test/tint/builtins/gen: Use returned value

It appears that FXC and DXC do some validation post dead-code-elimination.
These tests have been updated so that the return value is assigned to a storage buffer, ensuring that all validation is performed.

Many DXC tests are affected by https://github.com/microsoft/DirectXShaderCompiler/issues/5082, which have been SKIP'ed.

Fixed: tint:1859
Change-Id: I0001a9a9821846cd0855c3d8ce2bec79ab8e64ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122662
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
diff --git a/test/tint/builtins/gen/gen.wgsl.tmpl b/test/tint/builtins/gen/gen.wgsl.tmpl
index dd70b6c..4631079 100644
--- a/test/tint/builtins/gen/gen.wgsl.tmpl
+++ b/test/tint/builtins/gen/gen.wgsl.tmpl
@@ -145,8 +145,23 @@
 {{-     if $i -}}, {{end}}{{$args.Get $i -}}
 {{-   end -}}
   );
+{{- /* Ensure the call isn't dead-code eliminated */ -}}
+{{-   if and $overload.ReturnType (IsDeclarable $overload.ReturnType)}}
+{{-     if IsHostShareable $overload.ReturnType}}
+  prevent_dce = res;
+{{-     else}}
+  prevent_dce = select(0, 1, all(res == {{template "Type" $overload.ReturnType}}()));
+{{-     end}}
+{{-   end}}
 }
-{{/*new line*/ -}}
+
+{{-   if and $overload.ReturnType (IsDeclarable $overload.ReturnType)}}
+{{-     if IsHostShareable $overload.ReturnType}}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : {{template "Type" $overload.ReturnType}};
+{{-     else}}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+{{      end}}
+{{    end}}
 
 {{- if $overload.CanBeUsedInStage.Vertex }}
 @vertex
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl b/test/tint/builtins/gen/literal/abs/002533.wgsl
index de43c99..c0b8331 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<4, f32>) -> vec<4, f32>
 fn abs_002533() {
   var res: vec4<f32> = abs(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.dxc.hlsl
index 622f6b4..6e76a44 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_002533() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.fxc.hlsl
index 622f6b4..6e76a44 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_002533() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.glsl
index 95596b7..9a7dfdd 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void abs_002533() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void abs_002533() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void abs_002533() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.msl
index 149ee71..f9f2138 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_002533() {
+void abs_002533(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_002533();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  abs_002533(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_002533();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  abs_002533(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_002533();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  abs_002533(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.spvasm
index b4a5d21..748995b 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_002533 "abs_002533"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
- %abs_002533 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+ %abs_002533 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %abs_002533
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_002533
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %abs_002533
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %abs_002533
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %abs_002533
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %abs_002533
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.wgsl
index f459d54..acc37bc 100644
--- a/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/002533.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_002533() {
   var res : vec4<f32> = abs(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_002533();
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl b/test/tint/builtins/gen/literal/abs/005174.wgsl
index b80809e..321e7a2 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<3, f32>) -> vec<3, f32>
 fn abs_005174() {
   var res: vec3<f32> = abs(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.dxc.hlsl
index fb1822b..b5a2c6d0 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_005174() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.fxc.hlsl
index fb1822b..b5a2c6d0 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_005174() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.glsl
index f77f7d7..e3592d3 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void abs_005174() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void abs_005174() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void abs_005174() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.msl
index a5fdf30..9e6dc4c 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_005174() {
+void abs_005174(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_005174();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  abs_005174(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_005174();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  abs_005174(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_005174();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  abs_005174(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.spvasm
index 5b19784..d19412c 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_005174 "abs_005174"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
- %abs_005174 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+ %abs_005174 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %abs_005174
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_005174
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %abs_005174
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %abs_005174
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_005174
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %abs_005174
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.wgsl
index eab83d2..4542706 100644
--- a/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/005174.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_005174() {
   var res : vec3<f32> = abs(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_005174();
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl
index 09d89f8..3abaab5 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<4, u32>) -> vec<4, u32>
 fn abs_1ce782() {
   var res: vec4<u32> = abs(vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.dxc.hlsl
index 426d5a9..031389d 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_1ce782() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.fxc.hlsl
index 426d5a9..031389d 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_1ce782() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.glsl
index 44f37c7..00ec1ba 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void abs_1ce782() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void abs_1ce782() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void abs_1ce782() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.msl
index 2284b5e..64464ba 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_1ce782() {
+void abs_1ce782(device uint4* const tint_symbol_1) {
   uint4 res = uint4(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_1ce782();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  abs_1ce782(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_1ce782();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  abs_1ce782(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_1ce782();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  abs_1ce782(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.spvasm
index 1a58d40..12613e7 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_1ce782 "abs_1ce782"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_1ce782 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+ %abs_1ce782 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_1ce782
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_1ce782
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_1ce782
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %abs_1ce782
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_1ce782
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_1ce782
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.wgsl
index 54fc56a..062c265 100644
--- a/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/1ce782.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_1ce782() {
   var res : vec4<u32> = abs(vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_1ce782();
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl
index d2e6dbd..0a4a96b 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<2, f32>) -> vec<2, f32>
 fn abs_1e9d53() {
   var res: vec2<f32> = abs(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.dxc.hlsl
index e69b529..985b846 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_1e9d53() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.fxc.hlsl
index e69b529..985b846 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_1e9d53() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.glsl
index e3de90e..f9b2d20 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void abs_1e9d53() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void abs_1e9d53() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void abs_1e9d53() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.msl
index 2600a44..d70aca8 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_1e9d53() {
+void abs_1e9d53(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_1e9d53();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  abs_1e9d53(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_1e9d53();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  abs_1e9d53(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_1e9d53();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  abs_1e9d53(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.spvasm
index 5df0eaa..618607d 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_1e9d53 "abs_1e9d53"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
- %abs_1e9d53 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+ %abs_1e9d53 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %abs_1e9d53
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_1e9d53
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %abs_1e9d53
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %abs_1e9d53
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_1e9d53
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %abs_1e9d53
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.wgsl
index b197e4e..25d937e 100644
--- a/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/1e9d53.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_1e9d53() {
   var res : vec2<f32> = abs(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_1e9d53();
diff --git a/test/tint/builtins/gen/literal/abs/2f861b.wgsl b/test/tint/builtins/gen/literal/abs/2f861b.wgsl
index be8f698..321fe55 100644
--- a/test/tint/builtins/gen/literal/abs/2f861b.wgsl
+++ b/test/tint/builtins/gen/literal/abs/2f861b.wgsl
@@ -25,7 +25,6 @@
 fn abs_2f861b() {
   var res = abs(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_2f861b();
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl
index b2db3f7..d121b67 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl
@@ -26,7 +26,9 @@
 // fn abs(vec<3, f16>) -> vec<3, f16>
 fn abs_421ca3() {
   var res: vec3<f16> = abs(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.dxc.hlsl
index 11f21b9..bd2debc 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_421ca3() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.fxc.hlsl
index bfddf8a..fe59c1e 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_421ca3() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.glsl
index 7cf6126..b6076e0 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void abs_421ca3() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void abs_421ca3() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void abs_421ca3() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.msl
index 06dbe3c..1422c11 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_421ca3() {
+void abs_421ca3(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_421ca3();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  abs_421ca3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_421ca3();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  abs_421ca3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_421ca3();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  abs_421ca3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.spvasm
index dd58a96..3beba3b 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_421ca3 "abs_421ca3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_421ca3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %abs_421ca3 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_421ca3
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_421ca3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_421ca3
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_421ca3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_421ca3
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %abs_421ca3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.wgsl
index 35d4faa..d62039a 100644
--- a/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/421ca3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn abs_421ca3() {
   var res : vec3<f16> = abs(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_421ca3();
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl
index abddb6d..f17a4fb 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl
@@ -24,7 +24,9 @@
 // fn abs(u32) -> u32
 fn abs_467cd1() {
   var res: u32 = abs(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.dxc.hlsl
index 67452cd..2cc0c08 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_467cd1() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.fxc.hlsl
index 67452cd..2cc0c08 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_467cd1() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.glsl
index 6f63e08..c433b3a 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void abs_467cd1() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void abs_467cd1() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void abs_467cd1() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.msl
index c3b3c34..9b25e1f 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_467cd1() {
+void abs_467cd1(device uint* const tint_symbol_1) {
   uint res = 1u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_467cd1();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  abs_467cd1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_467cd1();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  abs_467cd1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_467cd1();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  abs_467cd1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.spvasm
index dc7ff3a..ab49bdb 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_467cd1 "abs_467cd1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_467cd1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %abs_467cd1 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_1
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %abs_467cd1
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %abs_467cd1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %abs_467cd1
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %abs_467cd1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_467cd1
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_467cd1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.wgsl
index a69414d..d963cb4 100644
--- a/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/467cd1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_467cd1() {
   var res : u32 = abs(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_467cd1();
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl
index 29bcc7c..5b4a396 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl
@@ -24,7 +24,9 @@
 // fn abs(i32) -> i32
 fn abs_4ad288() {
   var res: i32 = abs(1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.dxc.hlsl
index 59d9ee0..f272893 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_4ad288() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.fxc.hlsl
index 59d9ee0..f272893 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_4ad288() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.glsl
index 25c9285..a43f7cb 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void abs_4ad288() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void abs_4ad288() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void abs_4ad288() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.msl
index 7b013b1..a3cc868 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_4ad288() {
+void abs_4ad288(device int* const tint_symbol_1) {
   int res = 1;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_4ad288();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  abs_4ad288(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_4ad288();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  abs_4ad288(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_4ad288();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  abs_4ad288(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.spvasm
index ce5fb9a..1e76a99 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_4ad288 "abs_4ad288"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_4ad288 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+ %abs_4ad288 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %abs_4ad288
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %abs_4ad288
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %abs_4ad288
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %abs_4ad288
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_4ad288
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %abs_4ad288
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.wgsl
index 9c758fa..9a4a7b8 100644
--- a/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/4ad288.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_4ad288() {
   var res : i32 = abs(1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_4ad288();
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl b/test/tint/builtins/gen/literal/abs/538d29.wgsl
index 8e393c9..1bde75e 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl
@@ -26,7 +26,9 @@
 // fn abs(vec<4, f16>) -> vec<4, f16>
 fn abs_538d29() {
   var res: vec4<f16> = abs(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.dxc.hlsl
index dee1d6d..0204e0e 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_538d29() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.fxc.hlsl
index bc3fb67..0ceeaa7 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_538d29() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.glsl
index 5967742..9ce3899 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void abs_538d29() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void abs_538d29() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void abs_538d29() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.msl
index daab813..d6fc169 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_538d29() {
+void abs_538d29(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_538d29();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  abs_538d29(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_538d29();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  abs_538d29(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_538d29();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  abs_538d29(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.spvasm
index e897fcf..3b8d857 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_538d29 "abs_538d29"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_538d29 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %abs_538d29 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_538d29
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_538d29
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_538d29
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_538d29
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_538d29
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %abs_538d29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.wgsl
index 919eab8..8eeb6c9 100644
--- a/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/538d29.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn abs_538d29() {
   var res : vec4<f16> = abs(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_538d29();
diff --git a/test/tint/builtins/gen/literal/abs/577d6e.wgsl b/test/tint/builtins/gen/literal/abs/577d6e.wgsl
index 31f2110..282ce89 100644
--- a/test/tint/builtins/gen/literal/abs/577d6e.wgsl
+++ b/test/tint/builtins/gen/literal/abs/577d6e.wgsl
@@ -25,7 +25,6 @@
 fn abs_577d6e() {
   var res = abs(vec2(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_577d6e();
diff --git a/test/tint/builtins/gen/literal/abs/5a8af1.wgsl b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl
index 334c793..9285466 100644
--- a/test/tint/builtins/gen/literal/abs/5a8af1.wgsl
+++ b/test/tint/builtins/gen/literal/abs/5a8af1.wgsl
@@ -25,7 +25,6 @@
 fn abs_5a8af1() {
   var res = abs(1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_5a8af1();
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl
index e13e9c0..d4cae5e 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<3, i32>) -> vec<3, i32>
 fn abs_5ad50a() {
   var res: vec3<i32> = abs(vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.dxc.hlsl
index 11cc403..44f56bc 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_5ad50a() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.fxc.hlsl
index 11cc403..44f56bc 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_5ad50a() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.glsl
index d3f01d4..22eac15 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void abs_5ad50a() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void abs_5ad50a() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void abs_5ad50a() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.msl
index 413ad4e..4f53bb0 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_5ad50a() {
+void abs_5ad50a(device packed_int3* const tint_symbol_1) {
   int3 res = int3(1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_5ad50a();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  abs_5ad50a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_5ad50a();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  abs_5ad50a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_5ad50a();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  abs_5ad50a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.spvasm
index b0d2d92..66057aa 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_5ad50a "abs_5ad50a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_5ad50a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+ %abs_5ad50a = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_5ad50a
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_5ad50a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_5ad50a
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_5ad50a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_5ad50a
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %abs_5ad50a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.wgsl
index 842bd73..5eb09ea 100644
--- a/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/5ad50a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_5ad50a() {
   var res : vec3<i32> = abs(vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_5ad50a();
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl
index e94d993..a67b241 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl
@@ -26,7 +26,9 @@
 // fn abs(vec<2, f16>) -> vec<2, f16>
 fn abs_5ae4fe() {
   var res: vec2<f16> = abs(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.dxc.hlsl
index 218d736..f15686b 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_5ae4fe() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.fxc.hlsl
index 5e235dc..5d752b7 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_5ae4fe() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.glsl
index 0211497..46ae378 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void abs_5ae4fe() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void abs_5ae4fe() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void abs_5ae4fe() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.msl
index 7bd87a3..7fcd9f0 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_5ae4fe() {
+void abs_5ae4fe(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_5ae4fe();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  abs_5ae4fe(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_5ae4fe();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  abs_5ae4fe(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_5ae4fe();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  abs_5ae4fe(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.spvasm
index 49a91ec..5eb87d3 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_5ae4fe "abs_5ae4fe"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_5ae4fe = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %abs_5ae4fe = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_5ae4fe
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_5ae4fe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_5ae4fe
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_5ae4fe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_5ae4fe
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %abs_5ae4fe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.wgsl
index 89f05c6..0924fa4 100644
--- a/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/5ae4fe.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn abs_5ae4fe() {
   var res : vec2<f16> = abs(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_5ae4fe();
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl b/test/tint/builtins/gen/literal/abs/7326de.wgsl
index ca8574d..005aa2f 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<3, u32>) -> vec<3, u32>
 fn abs_7326de() {
   var res: vec3<u32> = abs(vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.dxc.hlsl
index 88e5fc4..eaf2aa1 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7326de() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.fxc.hlsl
index 88e5fc4..eaf2aa1 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7326de() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.glsl
index 412720d..5aca316 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void abs_7326de() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void abs_7326de() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void abs_7326de() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.msl
index 3f4309c..c90e65c 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_7326de() {
+void abs_7326de(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(1u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_7326de();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  abs_7326de(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_7326de();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  abs_7326de(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_7326de();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  abs_7326de(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.spvasm
index 09f9139..43123fc 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_7326de "abs_7326de"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_7326de = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+ %abs_7326de = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_7326de
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_7326de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_7326de
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %abs_7326de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_7326de
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_7326de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.wgsl
index 26962e2..b1291b8 100644
--- a/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/7326de.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_7326de() {
   var res : vec3<u32> = abs(vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_7326de();
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl
index 529759e..f6f6a33 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<2, u32>) -> vec<2, u32>
 fn abs_7f28e6() {
   var res: vec2<u32> = abs(vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.dxc.hlsl
index 72e7014..b8e038c 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7f28e6() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.fxc.hlsl
index 72e7014..b8e038c 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7f28e6() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.glsl
index fe70a48..a77817e 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void abs_7f28e6() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void abs_7f28e6() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void abs_7f28e6() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.msl
index 835fcb5..71b2522 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_7f28e6() {
+void abs_7f28e6(device uint2* const tint_symbol_1) {
   uint2 res = uint2(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_7f28e6();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  abs_7f28e6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_7f28e6();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  abs_7f28e6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_7f28e6();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  abs_7f28e6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.spvasm
index ddd3fa0..382ab49 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_7f28e6 "abs_7f28e6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_7f28e6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+ %abs_7f28e6 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_7f28e6
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %abs_7f28e6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_7f28e6
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %abs_7f28e6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_7f28e6
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_7f28e6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.wgsl
index f66e54e..47a38df 100644
--- a/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/7f28e6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_7f28e6() {
   var res : vec2<u32> = abs(vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_7f28e6();
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl
index c8bf4be..01699d4 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<2, i32>) -> vec<2, i32>
 fn abs_7faa9e() {
   var res: vec2<i32> = abs(vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.dxc.hlsl
index 0cd314a..d77553f 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7faa9e() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.fxc.hlsl
index 0cd314a..d77553f 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7faa9e() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.glsl
index 73aacee..b803309 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void abs_7faa9e() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void abs_7faa9e() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void abs_7faa9e() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.msl
index a14e992..f2e1747 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_7faa9e() {
+void abs_7faa9e(device int2* const tint_symbol_1) {
   int2 res = int2(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_7faa9e();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  abs_7faa9e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_7faa9e();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  abs_7faa9e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_7faa9e();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  abs_7faa9e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.spvasm
index 0fd80ff..a7f3760 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_7faa9e "abs_7faa9e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_7faa9e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+ %abs_7faa9e = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_7faa9e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_7faa9e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_7faa9e
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_7faa9e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_7faa9e
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %abs_7faa9e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.wgsl
index 8904134..e2baa16 100644
--- a/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/7faa9e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_7faa9e() {
   var res : vec2<i32> = abs(vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_7faa9e();
diff --git a/test/tint/builtins/gen/literal/abs/82ff9d.wgsl b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl
index 2605964..b73f39a 100644
--- a/test/tint/builtins/gen/literal/abs/82ff9d.wgsl
+++ b/test/tint/builtins/gen/literal/abs/82ff9d.wgsl
@@ -25,7 +25,6 @@
 fn abs_82ff9d() {
   var res = abs(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_82ff9d();
diff --git a/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl
index c74fefe..d84d4f6 100644
--- a/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl
+++ b/test/tint/builtins/gen/literal/abs/8ca9b1.wgsl
@@ -25,7 +25,6 @@
 fn abs_8ca9b1() {
   var res = abs(vec4(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_8ca9b1();
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl
index 1060a78..5a3a107 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl
@@ -24,7 +24,9 @@
 // fn abs(vec<4, i32>) -> vec<4, i32>
 fn abs_9c80a6() {
   var res: vec4<i32> = abs(vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.dxc.hlsl
index 8a74a1a..9572189 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_9c80a6() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.fxc.hlsl
index 8a74a1a..9572189 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_9c80a6() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.glsl
index 3f50690..9a2731b 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void abs_9c80a6() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void abs_9c80a6() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void abs_9c80a6() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.msl
index 6952fcb..7d97569 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_9c80a6() {
+void abs_9c80a6(device int4* const tint_symbol_1) {
   int4 res = int4(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_9c80a6();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  abs_9c80a6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_9c80a6();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  abs_9c80a6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_9c80a6();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  abs_9c80a6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.spvasm
index dd112f8..78743fb 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_9c80a6 "abs_9c80a6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_9c80a6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+ %abs_9c80a6 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_9c80a6
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_9c80a6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_9c80a6
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_9c80a6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_9c80a6
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %abs_9c80a6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.wgsl
index ed66152..0f122f1 100644
--- a/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/9c80a6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_9c80a6() {
   var res : vec4<i32> = abs(vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_9c80a6();
diff --git a/test/tint/builtins/gen/literal/abs/aedb6d.wgsl b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl
index 47d2310..a225410 100644
--- a/test/tint/builtins/gen/literal/abs/aedb6d.wgsl
+++ b/test/tint/builtins/gen/literal/abs/aedb6d.wgsl
@@ -25,7 +25,6 @@
 fn abs_aedb6d() {
   var res = abs(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_aedb6d();
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl b/test/tint/builtins/gen/literal/abs/b96037.wgsl
index 2ba0cdb..aca3ecc 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl
@@ -24,7 +24,9 @@
 // fn abs(f32) -> f32
 fn abs_b96037() {
   var res: f32 = abs(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.dxc.hlsl
index 51fa706..c947b8d 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_b96037() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.fxc.hlsl
index 51fa706..c947b8d 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_b96037() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.glsl
index c26be0b..0e9e932 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void abs_b96037() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void abs_b96037() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void abs_b96037() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.msl
index 00d7df9..deebe32 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_b96037() {
+void abs_b96037(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_b96037();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  abs_b96037(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_b96037();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  abs_b96037(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_b96037();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  abs_b96037(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.spvasm
index 3e45fe5..62f1dbd 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_b96037 "abs_b96037"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
- %abs_b96037 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+ %abs_b96037 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %abs_b96037
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %abs_b96037
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %abs_b96037
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_b96037
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %abs_b96037
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %abs_b96037
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.wgsl
index be38612..3ad76a0 100644
--- a/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/b96037.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn abs_b96037() {
   var res : f32 = abs(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_b96037();
diff --git a/test/tint/builtins/gen/literal/abs/c3321c.wgsl b/test/tint/builtins/gen/literal/abs/c3321c.wgsl
index 02f8b1e..34b1c20 100644
--- a/test/tint/builtins/gen/literal/abs/c3321c.wgsl
+++ b/test/tint/builtins/gen/literal/abs/c3321c.wgsl
@@ -25,7 +25,6 @@
 fn abs_c3321c() {
   var res = abs(vec3(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_c3321c();
diff --git a/test/tint/builtins/gen/literal/abs/e28785.wgsl b/test/tint/builtins/gen/literal/abs/e28785.wgsl
index fef7ec2..ed4b763 100644
--- a/test/tint/builtins/gen/literal/abs/e28785.wgsl
+++ b/test/tint/builtins/gen/literal/abs/e28785.wgsl
@@ -25,7 +25,6 @@
 fn abs_e28785() {
   var res = abs(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_e28785();
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl
index 622a040..682bf73 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl
@@ -26,7 +26,9 @@
 // fn abs(f16) -> f16
 fn abs_fd247f() {
   var res: f16 = abs(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.dxc.hlsl
index 21a9542..3c6ae8a 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_fd247f() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.fxc.hlsl
index 07dca56..630f544 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_fd247f() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.glsl
index 42d4ca1..12a8350 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void abs_fd247f() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void abs_fd247f() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void abs_fd247f() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.msl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.msl
index 5b56192..313627c 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_fd247f() {
+void abs_fd247f(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_fd247f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  abs_fd247f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_fd247f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  abs_fd247f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_fd247f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  abs_fd247f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.spvasm
index 433ec40..31ee7c5 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_fd247f "abs_fd247f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_fd247f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %abs_fd247f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %abs_fd247f
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %abs_fd247f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %abs_fd247f
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %abs_fd247f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_fd247f
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %abs_fd247f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.wgsl
index 2701dbd..e13e61e 100644
--- a/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/abs/fd247f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn abs_fd247f() {
   var res : f16 = abs(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_fd247f();
diff --git a/test/tint/builtins/gen/literal/acos/004aff.wgsl b/test/tint/builtins/gen/literal/acos/004aff.wgsl
index 6646047..8ced055 100644
--- a/test/tint/builtins/gen/literal/acos/004aff.wgsl
+++ b/test/tint/builtins/gen/literal/acos/004aff.wgsl
@@ -26,7 +26,9 @@
 // fn acos(vec<2, f16>) -> vec<2, f16>
 fn acos_004aff() {
   var res: vec2<f16> = acos(vec2<f16>(0.96891242171h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.dxc.hlsl
index 6bb1b9c..8d01506 100644
--- a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_004aff() {
   vector<float16_t, 2> res = (float16_t(0.25048828125h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.fxc.hlsl
index cfa42fb..203f8a6 100644
--- a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_004aff() {
-  vector<float16_t, 2> res = (float16_t(0.250488281h)).xx;
+  vector<float16_t, 2> res = (float16_t(0.25048828125h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.glsl
index e59e9c4..8808367 100644
--- a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acos_004aff() {
   f16vec2 res = f16vec2(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acos_004aff() {
   f16vec2 res = f16vec2(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acos_004aff() {
   f16vec2 res = f16vec2(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.msl b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.msl
index 7c2ca8f..66326ff 100644
--- a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_004aff() {
+void acos_004aff(device half2* const tint_symbol_1) {
   half2 res = half2(0.25048828125h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_004aff();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  acos_004aff(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_004aff();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  acos_004aff(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_004aff();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  acos_004aff(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.spvasm
index 34f105f..d5cc2ff 100644
--- a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_004aff "acos_004aff"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_008pn2 = OpConstant %half 0x1.008p-2
-         %16 = OpConstantComposite %v2half %half_0x1_008pn2 %half_0x1_008pn2
+         %19 = OpConstantComposite %v2half %half_0x1_008pn2 %half_0x1_008pn2
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_004aff = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%acos_004aff = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %acos_004aff
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %acos_004aff
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %acos_004aff
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %acos_004aff
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acos_004aff
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acos_004aff
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.wgsl
index dc52331..fbc54da 100644
--- a/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acos/004aff.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn acos_004aff() {
   var res : vec2<f16> = acos(vec2<f16>(0.96875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_004aff();
diff --git a/test/tint/builtins/gen/literal/acos/069188.wgsl b/test/tint/builtins/gen/literal/acos/069188.wgsl
index a3ab418..45b50b1 100644
--- a/test/tint/builtins/gen/literal/acos/069188.wgsl
+++ b/test/tint/builtins/gen/literal/acos/069188.wgsl
@@ -25,7 +25,6 @@
 fn acos_069188() {
   var res = acos(vec3(0.96891242171));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_069188();
diff --git a/test/tint/builtins/gen/literal/acos/15d35b.wgsl b/test/tint/builtins/gen/literal/acos/15d35b.wgsl
index 25e89dc..24f3024 100644
--- a/test/tint/builtins/gen/literal/acos/15d35b.wgsl
+++ b/test/tint/builtins/gen/literal/acos/15d35b.wgsl
@@ -25,7 +25,6 @@
 fn acos_15d35b() {
   var res = acos(vec2(0.96891242171));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_15d35b();
diff --git a/test/tint/builtins/gen/literal/acos/203628.wgsl b/test/tint/builtins/gen/literal/acos/203628.wgsl
index 886d04c..d1f8b77 100644
--- a/test/tint/builtins/gen/literal/acos/203628.wgsl
+++ b/test/tint/builtins/gen/literal/acos/203628.wgsl
@@ -26,7 +26,9 @@
 // fn acos(vec<4, f16>) -> vec<4, f16>
 fn acos_203628() {
   var res: vec4<f16> = acos(vec4<f16>(0.96891242171h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.dxc.hlsl
index dea8dd8..2962c11 100644
--- a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_203628() {
   vector<float16_t, 4> res = (float16_t(0.25048828125h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.fxc.hlsl
index a9cf00b..310a82b 100644
--- a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_203628() {
-  vector<float16_t, 4> res = (float16_t(0.250488281h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(0.25048828125h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.glsl
index 8acbd6f..cfc5204 100644
--- a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acos_203628() {
   f16vec4 res = f16vec4(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acos_203628() {
   f16vec4 res = f16vec4(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acos_203628() {
   f16vec4 res = f16vec4(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.msl b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.msl
index 11d632e..2307be5 100644
--- a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_203628() {
+void acos_203628(device half4* const tint_symbol_1) {
   half4 res = half4(0.25048828125h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_203628();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  acos_203628(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_203628();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  acos_203628(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_203628();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  acos_203628(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.spvasm
index f607fb5..154c7c2 100644
--- a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_203628 "acos_203628"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_008pn2 = OpConstant %half 0x1.008p-2
-         %16 = OpConstantComposite %v4half %half_0x1_008pn2 %half_0x1_008pn2 %half_0x1_008pn2 %half_0x1_008pn2
+         %19 = OpConstantComposite %v4half %half_0x1_008pn2 %half_0x1_008pn2 %half_0x1_008pn2 %half_0x1_008pn2
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_203628 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%acos_203628 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %acos_203628
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %acos_203628
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %acos_203628
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %acos_203628
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acos_203628
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acos_203628
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.wgsl
index 1764ae7..1d39a04 100644
--- a/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acos/203628.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn acos_203628() {
   var res : vec4<f16> = acos(vec4<f16>(0.96875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_203628();
diff --git a/test/tint/builtins/gen/literal/acos/303e3d.wgsl b/test/tint/builtins/gen/literal/acos/303e3d.wgsl
index f8fdc38..b74d782 100644
--- a/test/tint/builtins/gen/literal/acos/303e3d.wgsl
+++ b/test/tint/builtins/gen/literal/acos/303e3d.wgsl
@@ -26,7 +26,9 @@
 // fn acos(f16) -> f16
 fn acos_303e3d() {
   var res: f16 = acos(0.96891242171h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.dxc.hlsl
index ad7679f..6428580 100644
--- a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_303e3d() {
   float16_t res = float16_t(0.25048828125h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.fxc.hlsl
index 1b99f6e..fec3a8c 100644
--- a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_303e3d() {
-  float16_t res = float16_t(0.250488281h);
+  float16_t res = float16_t(0.25048828125h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.glsl
index 6b8fc12..09d1198 100644
--- a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acos_303e3d() {
   float16_t res = 0.25048828125hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acos_303e3d() {
   float16_t res = 0.25048828125hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acos_303e3d() {
   float16_t res = 0.25048828125hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.msl b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.msl
index ed81513..524a7ad 100644
--- a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_303e3d() {
+void acos_303e3d(device half* const tint_symbol_1) {
   half res = 0.25048828125h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_303e3d();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  acos_303e3d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_303e3d();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  acos_303e3d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_303e3d();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  acos_303e3d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.spvasm
index 6cccf82..de7e1d0 100644
--- a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_303e3d "acos_303e3d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_008pn2 = OpConstant %half 0x1.008p-2
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_303e3d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%acos_303e3d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_008pn2
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %acos_303e3d
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %acos_303e3d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %acos_303e3d
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %acos_303e3d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %acos_303e3d
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %acos_303e3d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.wgsl
index 6d509d4..6756bb1 100644
--- a/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acos/303e3d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn acos_303e3d() {
   var res : f16 = acos(0.96875h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_303e3d();
diff --git a/test/tint/builtins/gen/literal/acos/489247.wgsl b/test/tint/builtins/gen/literal/acos/489247.wgsl
index 7b5015d..2001887 100644
--- a/test/tint/builtins/gen/literal/acos/489247.wgsl
+++ b/test/tint/builtins/gen/literal/acos/489247.wgsl
@@ -24,7 +24,9 @@
 // fn acos(f32) -> f32
 fn acos_489247() {
   var res: f32 = acos(0.96891242171f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.dxc.hlsl
index 4ced8cf..ac57776 100644
--- a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_489247() {
   float res = 0.25f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.fxc.hlsl
index 4ced8cf..ac57776 100644
--- a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_489247() {
   float res = 0.25f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.glsl
index fa4dcfc..9070c7c 100644
--- a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acos_489247() {
   float res = 0.25f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acos_489247() {
   float res = 0.25f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acos_489247() {
   float res = 0.25f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.msl b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.msl
index f92153f..9896ec8 100644
--- a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_489247() {
+void acos_489247(device float* const tint_symbol_1) {
   float res = 0.25f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_489247();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  acos_489247(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_489247();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  acos_489247(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_489247();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  acos_489247(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.spvasm
index c7cb3bf..c259e11 100644
--- a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_489247 "acos_489247"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
  %float_0_25 = OpConstant %float 0.25
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_489247 = OpFunction %void None %9
-         %12 = OpLabel
+%acos_489247 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_25
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %acos_489247
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %acos_489247
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %acos_489247
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %acos_489247
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %acos_489247
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %acos_489247
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.wgsl
index b3aad15..bd77031 100644
--- a/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acos/489247.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn acos_489247() {
   var res : f32 = acos(0.96891242265701293945f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_489247();
diff --git a/test/tint/builtins/gen/literal/acos/4dac75.wgsl b/test/tint/builtins/gen/literal/acos/4dac75.wgsl
index c183e58..745a68e 100644
--- a/test/tint/builtins/gen/literal/acos/4dac75.wgsl
+++ b/test/tint/builtins/gen/literal/acos/4dac75.wgsl
@@ -25,7 +25,6 @@
 fn acos_4dac75() {
   var res = acos(vec4(0.96891242171));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_4dac75();
diff --git a/test/tint/builtins/gen/literal/acos/5e9ad2.wgsl b/test/tint/builtins/gen/literal/acos/5e9ad2.wgsl
index ec092bc..d6323b2 100644
--- a/test/tint/builtins/gen/literal/acos/5e9ad2.wgsl
+++ b/test/tint/builtins/gen/literal/acos/5e9ad2.wgsl
@@ -25,7 +25,6 @@
 fn acos_5e9ad2() {
   var res = acos(0.96891242171);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_5e9ad2();
diff --git a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl
index 7335cbd..33dc5b4 100644
--- a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl
+++ b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl
@@ -24,7 +24,9 @@
 // fn acos(vec<4, f32>) -> vec<4, f32>
 fn acos_8e2acf() {
   var res: vec4<f32> = acos(vec4<f32>(0.96891242171f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.dxc.hlsl
index 05199f4..c3a5937 100644
--- a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_8e2acf() {
   float4 res = (0.25f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.fxc.hlsl
index 05199f4..c3a5937 100644
--- a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_8e2acf() {
   float4 res = (0.25f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.glsl
index 4de1dea..b0978b3 100644
--- a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acos_8e2acf() {
   vec4 res = vec4(0.25f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acos_8e2acf() {
   vec4 res = vec4(0.25f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acos_8e2acf() {
   vec4 res = vec4(0.25f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.msl b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.msl
index 31530a2..21b2279 100644
--- a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_8e2acf() {
+void acos_8e2acf(device float4* const tint_symbol_1) {
   float4 res = float4(0.25f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_8e2acf();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  acos_8e2acf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_8e2acf();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  acos_8e2acf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_8e2acf();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  acos_8e2acf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.spvasm
index a566351..d525def 100644
--- a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_8e2acf "acos_8e2acf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
  %float_0_25 = OpConstant %float 0.25
-         %14 = OpConstantComposite %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25
+         %17 = OpConstantComposite %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_8e2acf = OpFunction %void None %9
-         %12 = OpLabel
+%acos_8e2acf = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %acos_8e2acf
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %acos_8e2acf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %acos_8e2acf
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %acos_8e2acf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %acos_8e2acf
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %acos_8e2acf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.wgsl
index 8de5539..4ff0bdb 100644
--- a/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acos/8e2acf.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn acos_8e2acf() {
   var res : vec4<f32> = acos(vec4<f32>(0.96891242265701293945f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_8e2acf();
diff --git a/test/tint/builtins/gen/literal/acos/a610c4.wgsl b/test/tint/builtins/gen/literal/acos/a610c4.wgsl
index a104b63..d67ad2a 100644
--- a/test/tint/builtins/gen/literal/acos/a610c4.wgsl
+++ b/test/tint/builtins/gen/literal/acos/a610c4.wgsl
@@ -24,7 +24,9 @@
 // fn acos(vec<3, f32>) -> vec<3, f32>
 fn acos_a610c4() {
   var res: vec3<f32> = acos(vec3<f32>(0.96891242171f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.dxc.hlsl
index c30a238..6a59564 100644
--- a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_a610c4() {
   float3 res = (0.25f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.fxc.hlsl
index c30a238..6a59564 100644
--- a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_a610c4() {
   float3 res = (0.25f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.glsl
index d5387ab..ab8e004 100644
--- a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acos_a610c4() {
   vec3 res = vec3(0.25f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acos_a610c4() {
   vec3 res = vec3(0.25f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acos_a610c4() {
   vec3 res = vec3(0.25f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.msl b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.msl
index f68925e..7775a13 100644
--- a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_a610c4() {
+void acos_a610c4(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.25f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_a610c4();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  acos_a610c4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_a610c4();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  acos_a610c4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_a610c4();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  acos_a610c4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.spvasm
index c1da502..813f2dd 100644
--- a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_a610c4 "acos_a610c4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
  %float_0_25 = OpConstant %float 0.25
-         %15 = OpConstantComposite %v3float %float_0_25 %float_0_25 %float_0_25
+         %18 = OpConstantComposite %v3float %float_0_25 %float_0_25 %float_0_25
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_a610c4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%acos_a610c4 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %acos_a610c4
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %acos_a610c4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %acos_a610c4
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %acos_a610c4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %acos_a610c4
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %acos_a610c4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.wgsl
index bca3a51..cf979cb 100644
--- a/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acos/a610c4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn acos_a610c4() {
   var res : vec3<f32> = acos(vec3<f32>(0.96891242265701293945f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_a610c4();
diff --git a/test/tint/builtins/gen/literal/acos/dfc915.wgsl b/test/tint/builtins/gen/literal/acos/dfc915.wgsl
index 88486ef..a37ee32 100644
--- a/test/tint/builtins/gen/literal/acos/dfc915.wgsl
+++ b/test/tint/builtins/gen/literal/acos/dfc915.wgsl
@@ -24,7 +24,9 @@
 // fn acos(vec<2, f32>) -> vec<2, f32>
 fn acos_dfc915() {
   var res: vec2<f32> = acos(vec2<f32>(0.96891242171f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.dxc.hlsl
index 8d93b86..4a0df62 100644
--- a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_dfc915() {
   float2 res = (0.25f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.fxc.hlsl
index 8d93b86..4a0df62 100644
--- a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_dfc915() {
   float2 res = (0.25f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.glsl
index 32a343d..a323e28 100644
--- a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acos_dfc915() {
   vec2 res = vec2(0.25f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acos_dfc915() {
   vec2 res = vec2(0.25f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acos_dfc915() {
   vec2 res = vec2(0.25f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.msl b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.msl
index ba4e8c7..e7606e8 100644
--- a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_dfc915() {
+void acos_dfc915(device float2* const tint_symbol_1) {
   float2 res = float2(0.25f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_dfc915();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  acos_dfc915(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_dfc915();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  acos_dfc915(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_dfc915();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  acos_dfc915(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.spvasm
index cbb6105..2ff004c 100644
--- a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_dfc915 "acos_dfc915"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
  %float_0_25 = OpConstant %float 0.25
-         %15 = OpConstantComposite %v2float %float_0_25 %float_0_25
+         %18 = OpConstantComposite %v2float %float_0_25 %float_0_25
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_dfc915 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%acos_dfc915 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %acos_dfc915
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %acos_dfc915
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %acos_dfc915
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %acos_dfc915
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %acos_dfc915
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %acos_dfc915
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.wgsl
index cac426d..1909c85 100644
--- a/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acos/dfc915.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn acos_dfc915() {
   var res : vec2<f32> = acos(vec2<f32>(0.96891242265701293945f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_dfc915();
diff --git a/test/tint/builtins/gen/literal/acos/f47057.wgsl b/test/tint/builtins/gen/literal/acos/f47057.wgsl
index 16b5967..4caea17 100644
--- a/test/tint/builtins/gen/literal/acos/f47057.wgsl
+++ b/test/tint/builtins/gen/literal/acos/f47057.wgsl
@@ -26,7 +26,9 @@
 // fn acos(vec<3, f16>) -> vec<3, f16>
 fn acos_f47057() {
   var res: vec3<f16> = acos(vec3<f16>(0.96891242171h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.dxc.hlsl
index 40d4b10..873299d 100644
--- a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_f47057() {
   vector<float16_t, 3> res = (float16_t(0.25048828125h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.fxc.hlsl
index 7623d60..e9fe85c 100644
--- a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_f47057() {
-  vector<float16_t, 3> res = (float16_t(0.250488281h)).xxx;
+  vector<float16_t, 3> res = (float16_t(0.25048828125h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.glsl
index 12eb244..6c2b08e 100644
--- a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acos_f47057() {
   f16vec3 res = f16vec3(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acos_f47057() {
   f16vec3 res = f16vec3(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acos_f47057() {
   f16vec3 res = f16vec3(0.25048828125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.msl b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.msl
index c8b8e72..3f10dd8 100644
--- a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_f47057() {
+void acos_f47057(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.25048828125h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_f47057();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  acos_f47057(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_f47057();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  acos_f47057(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_f47057();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  acos_f47057(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.spvasm
index 38f068a..b02edac 100644
--- a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_f47057 "acos_f47057"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_008pn2 = OpConstant %half 0x1.008p-2
-         %16 = OpConstantComposite %v3half %half_0x1_008pn2 %half_0x1_008pn2 %half_0x1_008pn2
+         %19 = OpConstantComposite %v3half %half_0x1_008pn2 %half_0x1_008pn2 %half_0x1_008pn2
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_f47057 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%acos_f47057 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %acos_f47057
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %acos_f47057
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %acos_f47057
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %acos_f47057
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acos_f47057
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acos_f47057
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.wgsl
index d718a2f..60b0d17 100644
--- a/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acos/f47057.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn acos_f47057() {
   var res : vec3<f16> = acos(vec3<f16>(0.96875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_f47057();
diff --git a/test/tint/builtins/gen/literal/acosh/17260e.wgsl b/test/tint/builtins/gen/literal/acosh/17260e.wgsl
index 8726acc..b2b833a 100644
--- a/test/tint/builtins/gen/literal/acosh/17260e.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/17260e.wgsl
@@ -25,7 +25,6 @@
 fn acosh_17260e() {
   var res = acosh(vec2(1.5430806348));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_17260e();
diff --git a/test/tint/builtins/gen/literal/acosh/3433e8.wgsl b/test/tint/builtins/gen/literal/acosh/3433e8.wgsl
index 22bab11..a8a3270 100644
--- a/test/tint/builtins/gen/literal/acosh/3433e8.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/3433e8.wgsl
@@ -25,7 +25,6 @@
 fn acosh_3433e8() {
   var res = acosh(1.5430806348);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_3433e8();
diff --git a/test/tint/builtins/gen/literal/acosh/490aae.wgsl b/test/tint/builtins/gen/literal/acosh/490aae.wgsl
index 75b63f9..84d2e37 100644
--- a/test/tint/builtins/gen/literal/acosh/490aae.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/490aae.wgsl
@@ -25,7 +25,6 @@
 fn acosh_490aae() {
   var res = acosh(vec4(1.5430806348));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_490aae();
diff --git a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl
index 4679b37..3323606 100644
--- a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl
@@ -26,7 +26,9 @@
 // fn acosh(vec<2, f16>) -> vec<2, f16>
 fn acosh_5f49d8() {
   var res: vec2<f16> = acosh(vec2<f16>(1.5430806348h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.dxc.hlsl
index 9dc5706..4cc7aca 100644
--- a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_5f49d8() {
   vector<float16_t, 2> res = (float16_t(0.99951171875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.fxc.hlsl
index eea2e74..9f12e13 100644
--- a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_5f49d8() {
-  vector<float16_t, 2> res = (float16_t(1.31640625h)).xx;
+  vector<float16_t, 2> res = (float16_t(0.99951171875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.glsl
index 559172b..8816a86 100644
--- a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acosh_5f49d8() {
   f16vec2 res = f16vec2(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acosh_5f49d8() {
   f16vec2 res = f16vec2(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acosh_5f49d8() {
   f16vec2 res = f16vec2(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.msl
index df27967..08be64f 100644
--- a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acosh_5f49d8() {
+void acosh_5f49d8(device half2* const tint_symbol_1) {
   half2 res = half2(0.99951171875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_5f49d8();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  acosh_5f49d8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_5f49d8();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  acosh_5f49d8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_5f49d8();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  acosh_5f49d8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.spvasm
index 5a493f9..5345d92 100644
--- a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acosh_5f49d8 "acosh_5f49d8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn1 = OpConstant %half 0x1.ffcp-1
-         %16 = OpConstantComposite %v2half %half_0x1_ffcpn1 %half_0x1_ffcpn1
+         %19 = OpConstantComposite %v2half %half_0x1_ffcpn1 %half_0x1_ffcpn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acosh_5f49d8 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%acosh_5f49d8 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %acosh_5f49d8
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %acosh_5f49d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %acosh_5f49d8
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %acosh_5f49d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acosh_5f49d8
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acosh_5f49d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.wgsl
index 1886b02..8d465f4 100644
--- a/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/5f49d8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn acosh_5f49d8() {
   var res : vec2<f16> = acosh(vec2<f16>(1.54296875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_5f49d8();
diff --git a/test/tint/builtins/gen/literal/acosh/640883.wgsl b/test/tint/builtins/gen/literal/acosh/640883.wgsl
index 6b962ff..8a9d4f9 100644
--- a/test/tint/builtins/gen/literal/acosh/640883.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/640883.wgsl
@@ -24,7 +24,9 @@
 // fn acosh(vec<2, f32>) -> vec<2, f32>
 fn acosh_640883() {
   var res: vec2<f32> = acosh(vec2<f32>(1.5430806348f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.dxc.hlsl
index 216fb4c..49b3c99 100644
--- a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_640883() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.fxc.hlsl
index 216fb4c..49b3c99 100644
--- a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_640883() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.glsl
index 0c16b6f..6586a50 100644
--- a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acosh_640883() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acosh_640883() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acosh_640883() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.msl b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.msl
index 09896fe..3dd53b2 100644
--- a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acosh_640883() {
+void acosh_640883(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_640883();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  acosh_640883(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_640883();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  acosh_640883(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_640883();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  acosh_640883(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.spvasm
index ea6700f..bd28826 100644
--- a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acosh_640883 "acosh_640883"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%acosh_640883 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%acosh_640883 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %acosh_640883
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %acosh_640883
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %acosh_640883
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %acosh_640883
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %acosh_640883
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %acosh_640883
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.wgsl
index 00d4e01..bb77500 100644
--- a/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/640883.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn acosh_640883() {
   var res : vec2<f32> = acosh(vec2<f32>(1.54308068752288818359f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_640883();
diff --git a/test/tint/builtins/gen/literal/acosh/9f213e.wgsl b/test/tint/builtins/gen/literal/acosh/9f213e.wgsl
index 0fea651..fccdbd4 100644
--- a/test/tint/builtins/gen/literal/acosh/9f213e.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/9f213e.wgsl
@@ -25,7 +25,6 @@
 fn acosh_9f213e() {
   var res = acosh(vec3(1.5430806348));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_9f213e();
diff --git a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl
index e5bf068..edf44cd 100644
--- a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl
@@ -26,7 +26,9 @@
 // fn acosh(f16) -> f16
 fn acosh_a37dfe() {
   var res: f16 = acosh(1.5430806348h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.dxc.hlsl
index 8bcc87e..35c9e0d 100644
--- a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_a37dfe() {
   float16_t res = float16_t(0.99951171875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.fxc.hlsl
index 7fccc88..d72fef1 100644
--- a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_a37dfe() {
-  float16_t res = float16_t(1.31640625h);
+  float16_t res = float16_t(0.99951171875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.glsl
index 5675660..47d6ec2 100644
--- a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acosh_a37dfe() {
   float16_t res = 0.99951171875hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acosh_a37dfe() {
   float16_t res = 0.99951171875hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acosh_a37dfe() {
   float16_t res = 0.99951171875hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.msl b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.msl
index aa56648..f434aab 100644
--- a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acosh_a37dfe() {
+void acosh_a37dfe(device half* const tint_symbol_1) {
   half res = 0.99951171875h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_a37dfe();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  acosh_a37dfe(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_a37dfe();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  acosh_a37dfe(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_a37dfe();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  acosh_a37dfe(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.spvasm
index 0024847..5eba167 100644
--- a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acosh_a37dfe "acosh_a37dfe"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_ffcpn1 = OpConstant %half 0x1.ffcp-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acosh_a37dfe = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%acosh_a37dfe = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_ffcpn1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %acosh_a37dfe
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %acosh_a37dfe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %acosh_a37dfe
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %acosh_a37dfe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %acosh_a37dfe
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %acosh_a37dfe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.wgsl
index 6f55e4e..c4f6497 100644
--- a/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/a37dfe.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn acosh_a37dfe() {
   var res : f16 = acosh(1.54296875h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_a37dfe();
diff --git a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl
index 4f494cc..ccf5435 100644
--- a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl
@@ -24,7 +24,9 @@
 // fn acosh(vec<4, f32>) -> vec<4, f32>
 fn acosh_d51ccb() {
   var res: vec4<f32> = acosh(vec4<f32>(1.5430806348f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.dxc.hlsl
index bc54cfc..b55a72f 100644
--- a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_d51ccb() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.fxc.hlsl
index bc54cfc..b55a72f 100644
--- a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_d51ccb() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.glsl
index c40473a..9a7d0550 100644
--- a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acosh_d51ccb() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acosh_d51ccb() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acosh_d51ccb() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.msl b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.msl
index 04c0cfa..72888cb 100644
--- a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acosh_d51ccb() {
+void acosh_d51ccb(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_d51ccb();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  acosh_d51ccb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_d51ccb();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  acosh_d51ccb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_d51ccb();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  acosh_d51ccb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.spvasm
index 0af3742..1b4626d 100644
--- a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acosh_d51ccb "acosh_d51ccb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%acosh_d51ccb = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%acosh_d51ccb = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %acosh_d51ccb
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %acosh_d51ccb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %acosh_d51ccb
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %acosh_d51ccb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %acosh_d51ccb
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %acosh_d51ccb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.wgsl
index 6f12d48..c753494 100644
--- a/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/d51ccb.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn acosh_d51ccb() {
   var res : vec4<f32> = acosh(vec4<f32>(1.54308068752288818359f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_d51ccb();
diff --git a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl
index acd9343..1eea32c 100644
--- a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl
@@ -26,7 +26,9 @@
 // fn acosh(vec<4, f16>) -> vec<4, f16>
 fn acosh_de60d8() {
   var res: vec4<f16> = acosh(vec4<f16>(1.5430806348h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.dxc.hlsl
index 4df2787..766375b 100644
--- a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_de60d8() {
   vector<float16_t, 4> res = (float16_t(0.99951171875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.fxc.hlsl
index ac3aaa0..b45d0ca 100644
--- a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_de60d8() {
-  vector<float16_t, 4> res = (float16_t(1.31640625h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(0.99951171875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.glsl
index 7d52db7..078427c 100644
--- a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acosh_de60d8() {
   f16vec4 res = f16vec4(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acosh_de60d8() {
   f16vec4 res = f16vec4(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acosh_de60d8() {
   f16vec4 res = f16vec4(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.msl
index 3ba201e..2b1877c 100644
--- a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acosh_de60d8() {
+void acosh_de60d8(device half4* const tint_symbol_1) {
   half4 res = half4(0.99951171875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_de60d8();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  acosh_de60d8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_de60d8();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  acosh_de60d8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_de60d8();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  acosh_de60d8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.spvasm
index 5337702..eb8f39d 100644
--- a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acosh_de60d8 "acosh_de60d8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn1 = OpConstant %half 0x1.ffcp-1
-         %16 = OpConstantComposite %v4half %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1
+         %19 = OpConstantComposite %v4half %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acosh_de60d8 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%acosh_de60d8 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %acosh_de60d8
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %acosh_de60d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %acosh_de60d8
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %acosh_de60d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acosh_de60d8
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acosh_de60d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.wgsl
index f834d7d..77ac310 100644
--- a/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/de60d8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn acosh_de60d8() {
   var res : vec4<f16> = acosh(vec4<f16>(1.54296875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_de60d8();
diff --git a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl
index a4fed29..fadb3aaa 100644
--- a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl
@@ -24,7 +24,9 @@
 // fn acosh(vec<3, f32>) -> vec<3, f32>
 fn acosh_e38f5c() {
   var res: vec3<f32> = acosh(vec3<f32>(1.5430806348f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.dxc.hlsl
index ffcf2d9..1c8f759 100644
--- a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_e38f5c() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.fxc.hlsl
index ffcf2d9..1c8f759 100644
--- a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_e38f5c() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.glsl
index 5ace5b6..cd44c22 100644
--- a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acosh_e38f5c() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acosh_e38f5c() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acosh_e38f5c() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.msl b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.msl
index 7d01e57..ff52822 100644
--- a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acosh_e38f5c() {
+void acosh_e38f5c(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_e38f5c();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  acosh_e38f5c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_e38f5c();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  acosh_e38f5c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_e38f5c();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  acosh_e38f5c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.spvasm
index d85709e..f0eac9a 100644
--- a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acosh_e38f5c "acosh_e38f5c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%acosh_e38f5c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%acosh_e38f5c = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %acosh_e38f5c
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %acosh_e38f5c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %acosh_e38f5c
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %acosh_e38f5c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %acosh_e38f5c
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %acosh_e38f5c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.wgsl
index f8473c9..987b34a 100644
--- a/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/e38f5c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn acosh_e38f5c() {
   var res : vec3<f32> = acosh(vec3<f32>(1.54308068752288818359f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_e38f5c();
diff --git a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl
index 9de3379..01bed35 100644
--- a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl
@@ -24,7 +24,9 @@
 // fn acosh(f32) -> f32
 fn acosh_ecf2d1() {
   var res: f32 = acosh(1.5430806348f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.dxc.hlsl
index 93def9e..db7727b 100644
--- a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_ecf2d1() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.fxc.hlsl
index 93def9e..db7727b 100644
--- a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_ecf2d1() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.glsl
index a4311af..0aa567d 100644
--- a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acosh_ecf2d1() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acosh_ecf2d1() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acosh_ecf2d1() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.msl b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.msl
index 1cd6264..a5702ee 100644
--- a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acosh_ecf2d1() {
+void acosh_ecf2d1(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_ecf2d1();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  acosh_ecf2d1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_ecf2d1();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  acosh_ecf2d1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_ecf2d1();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  acosh_ecf2d1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.spvasm
index 3c51a05..fa2822a 100644
--- a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acosh_ecf2d1 "acosh_ecf2d1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%acosh_ecf2d1 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%acosh_ecf2d1 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %acosh_ecf2d1
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %acosh_ecf2d1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %acosh_ecf2d1
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %acosh_ecf2d1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %acosh_ecf2d1
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %acosh_ecf2d1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.wgsl
index f07750c..fd6242f 100644
--- a/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/ecf2d1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn acosh_ecf2d1() {
   var res : f32 = acosh(1.54308068752288818359f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_ecf2d1();
diff --git a/test/tint/builtins/gen/literal/acosh/f56574.wgsl b/test/tint/builtins/gen/literal/acosh/f56574.wgsl
index 8d9a464..1afe5b0 100644
--- a/test/tint/builtins/gen/literal/acosh/f56574.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/f56574.wgsl
@@ -26,7 +26,9 @@
 // fn acosh(vec<3, f16>) -> vec<3, f16>
 fn acosh_f56574() {
   var res: vec3<f16> = acosh(vec3<f16>(1.5430806348h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.dxc.hlsl
index ee217e6..c0fac29 100644
--- a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_f56574() {
   vector<float16_t, 3> res = (float16_t(0.99951171875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.fxc.hlsl
index 8b5976f..e144fd3 100644
--- a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_f56574() {
-  vector<float16_t, 3> res = (float16_t(1.31640625h)).xxx;
+  vector<float16_t, 3> res = (float16_t(0.99951171875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.glsl b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.glsl
index a3a707e..2342a78 100644
--- a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acosh_f56574() {
   f16vec3 res = f16vec3(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acosh_f56574() {
   f16vec3 res = f16vec3(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acosh_f56574() {
   f16vec3 res = f16vec3(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.msl b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.msl
index 2a90824..f821d98 100644
--- a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acosh_f56574() {
+void acosh_f56574(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.99951171875h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_f56574();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  acosh_f56574(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_f56574();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  acosh_f56574(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_f56574();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  acosh_f56574(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.spvasm
index 8605345..e40035f 100644
--- a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acosh_f56574 "acosh_f56574"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn1 = OpConstant %half 0x1.ffcp-1
-         %16 = OpConstantComposite %v3half %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1
+         %19 = OpConstantComposite %v3half %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acosh_f56574 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%acosh_f56574 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %acosh_f56574
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %acosh_f56574
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %acosh_f56574
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %acosh_f56574
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acosh_f56574
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acosh_f56574
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.wgsl
index 463b9e2..6475ee5 100644
--- a/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/acosh/f56574.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn acosh_f56574() {
   var res : vec3<f16> = acosh(vec3<f16>(1.54296875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_f56574();
diff --git a/test/tint/builtins/gen/literal/all/353d6a.wgsl b/test/tint/builtins/gen/literal/all/353d6a.wgsl
index 410d63d..1d30d03 100644
--- a/test/tint/builtins/gen/literal/all/353d6a.wgsl
+++ b/test/tint/builtins/gen/literal/all/353d6a.wgsl
@@ -24,7 +24,10 @@
 // fn all(bool) -> bool
 fn all_353d6a() {
   var res: bool = all(true);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.dxc.hlsl
index 8aa391f..62b0e2f 100644
--- a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_353d6a() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.fxc.hlsl
index 8aa391f..62b0e2f 100644
--- a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_353d6a() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.glsl
index 7281723..680c371 100644
--- a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_353d6a() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_353d6a() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_353d6a() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.msl b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.msl
index 78fd78c..f01a858 100644
--- a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void all_353d6a() {
+void all_353d6a(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  all_353d6a();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  all_353d6a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  all_353d6a();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  all_353d6a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  all_353d6a();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  all_353d6a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.spvasm
index 4f2129b..50a955c 100644
--- a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %all_353d6a "all_353d6a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %all_353d6a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %all_353d6a = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %all_353d6a
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %all_353d6a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %all_353d6a
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %all_353d6a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %all_353d6a
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %all_353d6a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.wgsl
index b3632e2..4a5ec1a 100644
--- a/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/all/353d6a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn all_353d6a() {
   var res : bool = all(true);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   all_353d6a();
diff --git a/test/tint/builtins/gen/literal/all/986c7b.wgsl b/test/tint/builtins/gen/literal/all/986c7b.wgsl
index ba12253..05d5456 100644
--- a/test/tint/builtins/gen/literal/all/986c7b.wgsl
+++ b/test/tint/builtins/gen/literal/all/986c7b.wgsl
@@ -24,7 +24,10 @@
 // fn all(vec<4, bool>) -> bool
 fn all_986c7b() {
   var res: bool = all(vec4<bool>(true));
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.dxc.hlsl
index eeb115e..d5a5e7c 100644
--- a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_986c7b() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.fxc.hlsl
index eeb115e..d5a5e7c 100644
--- a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_986c7b() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.glsl
index 21a76c4..3f01458 100644
--- a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_986c7b() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_986c7b() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_986c7b() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.msl b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.msl
index 93c5215..0271393 100644
--- a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void all_986c7b() {
+void all_986c7b(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  all_986c7b();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  all_986c7b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  all_986c7b();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  all_986c7b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  all_986c7b();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  all_986c7b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.spvasm
index f335207..bfd650b 100644
--- a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %all_986c7b "all_986c7b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %all_986c7b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %all_986c7b = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %all_986c7b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %all_986c7b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %all_986c7b
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %all_986c7b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %all_986c7b
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %all_986c7b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.wgsl
index f9b0cbe..069c801 100644
--- a/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/all/986c7b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn all_986c7b() {
   var res : bool = all(vec4<bool>(true));
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   all_986c7b();
diff --git a/test/tint/builtins/gen/literal/all/bd2dba.wgsl b/test/tint/builtins/gen/literal/all/bd2dba.wgsl
index bcd6e05..b7ac69c 100644
--- a/test/tint/builtins/gen/literal/all/bd2dba.wgsl
+++ b/test/tint/builtins/gen/literal/all/bd2dba.wgsl
@@ -24,7 +24,10 @@
 // fn all(vec<3, bool>) -> bool
 fn all_bd2dba() {
   var res: bool = all(vec3<bool>(true));
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.dxc.hlsl
index 2ea2bab..37843b6 100644
--- a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_bd2dba() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.fxc.hlsl
index 2ea2bab..37843b6 100644
--- a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_bd2dba() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.glsl b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.glsl
index 69d19de..8d236a9 100644
--- a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_bd2dba() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_bd2dba() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_bd2dba() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.msl b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.msl
index bb3cd3d..534a93c 100644
--- a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void all_bd2dba() {
+void all_bd2dba(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  all_bd2dba();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  all_bd2dba(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  all_bd2dba();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  all_bd2dba(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  all_bd2dba();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  all_bd2dba(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.spvasm
index dcc7342..fc354ec 100644
--- a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %all_bd2dba "all_bd2dba"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %all_bd2dba = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %all_bd2dba = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %all_bd2dba
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %all_bd2dba
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %all_bd2dba
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %all_bd2dba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %all_bd2dba
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %all_bd2dba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.wgsl
index 8a12e51..824d879 100644
--- a/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/all/bd2dba.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn all_bd2dba() {
   var res : bool = all(vec3<bool>(true));
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   all_bd2dba();
diff --git a/test/tint/builtins/gen/literal/all/f46790.wgsl b/test/tint/builtins/gen/literal/all/f46790.wgsl
index 0dbdd3c..78af9bc 100644
--- a/test/tint/builtins/gen/literal/all/f46790.wgsl
+++ b/test/tint/builtins/gen/literal/all/f46790.wgsl
@@ -24,7 +24,10 @@
 // fn all(vec<2, bool>) -> bool
 fn all_f46790() {
   var res: bool = all(vec2<bool>(true));
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.dxc.hlsl
index 5def940..02bb1a7 100644
--- a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_f46790() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.fxc.hlsl
index 5def940..02bb1a7 100644
--- a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_f46790() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.glsl b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.glsl
index d515e55..1ebe333 100644
--- a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_f46790() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_f46790() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_f46790() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.msl b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.msl
index 449bdae..3dfd63b 100644
--- a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void all_f46790() {
+void all_f46790(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  all_f46790();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  all_f46790(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  all_f46790();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  all_f46790(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  all_f46790();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  all_f46790(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.spvasm
index 4201ee7..159a990 100644
--- a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %all_f46790 "all_f46790"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %all_f46790 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %all_f46790 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %all_f46790
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %all_f46790
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %all_f46790
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %all_f46790
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %all_f46790
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %all_f46790
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.wgsl
index 71a4a0b..73a94ab 100644
--- a/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/all/f46790.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn all_f46790() {
   var res : bool = all(vec2<bool>(true));
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   all_f46790();
diff --git a/test/tint/builtins/gen/literal/any/083428.wgsl b/test/tint/builtins/gen/literal/any/083428.wgsl
index bd2a46d..0f3d65b 100644
--- a/test/tint/builtins/gen/literal/any/083428.wgsl
+++ b/test/tint/builtins/gen/literal/any/083428.wgsl
@@ -24,7 +24,10 @@
 // fn any(vec<4, bool>) -> bool
 fn any_083428() {
   var res: bool = any(vec4<bool>(true));
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.dxc.hlsl
index 3e56fae..b2d4dd4 100644
--- a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_083428() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.fxc.hlsl
index 3e56fae..b2d4dd4 100644
--- a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_083428() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.glsl b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.glsl
index 6f1175c..3712b14 100644
--- a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_083428() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_083428() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_083428() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.msl b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.msl
index 3840abb..5cb2c17 100644
--- a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void any_083428() {
+void any_083428(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  any_083428();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  any_083428(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  any_083428();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  any_083428(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  any_083428();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  any_083428(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.spvasm
index dbddf7e..0061fb3 100644
--- a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %any_083428 "any_083428"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %any_083428 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %any_083428 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %any_083428
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %any_083428
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %any_083428
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %any_083428
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %any_083428
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %any_083428
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.wgsl
index c569341..8d54380 100644
--- a/test/tint/builtins/gen/literal/any/083428.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/any/083428.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn any_083428() {
   var res : bool = any(vec4<bool>(true));
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   any_083428();
diff --git a/test/tint/builtins/gen/literal/any/0e3e58.wgsl b/test/tint/builtins/gen/literal/any/0e3e58.wgsl
index 056bd21..8e84b75 100644
--- a/test/tint/builtins/gen/literal/any/0e3e58.wgsl
+++ b/test/tint/builtins/gen/literal/any/0e3e58.wgsl
@@ -24,7 +24,10 @@
 // fn any(vec<2, bool>) -> bool
 fn any_0e3e58() {
   var res: bool = any(vec2<bool>(true));
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.dxc.hlsl
index 2519e53..9c97020 100644
--- a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_0e3e58() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.fxc.hlsl
index 2519e53..9c97020 100644
--- a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_0e3e58() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.glsl b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.glsl
index 4655519..b2fd24f 100644
--- a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_0e3e58() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_0e3e58() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_0e3e58() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.msl b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.msl
index 10166c8..cd1a720 100644
--- a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void any_0e3e58() {
+void any_0e3e58(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  any_0e3e58();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  any_0e3e58(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  any_0e3e58();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  any_0e3e58(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  any_0e3e58();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  any_0e3e58(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.spvasm
index 9d66c5d..6606fe5 100644
--- a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %any_0e3e58 "any_0e3e58"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %any_0e3e58 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %any_0e3e58 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %any_0e3e58
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %any_0e3e58
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %any_0e3e58
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %any_0e3e58
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %any_0e3e58
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %any_0e3e58
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.wgsl
index 79a3155..174f336 100644
--- a/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/any/0e3e58.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn any_0e3e58() {
   var res : bool = any(vec2<bool>(true));
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   any_0e3e58();
diff --git a/test/tint/builtins/gen/literal/any/2ab91a.wgsl b/test/tint/builtins/gen/literal/any/2ab91a.wgsl
index 52d82a9..15d1b5a 100644
--- a/test/tint/builtins/gen/literal/any/2ab91a.wgsl
+++ b/test/tint/builtins/gen/literal/any/2ab91a.wgsl
@@ -24,7 +24,10 @@
 // fn any(bool) -> bool
 fn any_2ab91a() {
   var res: bool = any(true);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.dxc.hlsl
index 79ea6ff..6bb322a 100644
--- a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_2ab91a() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.fxc.hlsl
index 79ea6ff..6bb322a 100644
--- a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_2ab91a() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.glsl
index cdd5b69..892835f 100644
--- a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_2ab91a() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_2ab91a() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_2ab91a() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.msl b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.msl
index af01d5f..dd68bc3 100644
--- a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void any_2ab91a() {
+void any_2ab91a(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  any_2ab91a();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  any_2ab91a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  any_2ab91a();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  any_2ab91a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  any_2ab91a();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  any_2ab91a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.spvasm
index b4952e6..9fd20c4 100644
--- a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %any_2ab91a "any_2ab91a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %any_2ab91a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %any_2ab91a = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %any_2ab91a
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %any_2ab91a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %any_2ab91a
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %any_2ab91a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %any_2ab91a
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %any_2ab91a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.wgsl
index 9b27b89..e2469bb 100644
--- a/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/any/2ab91a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn any_2ab91a() {
   var res : bool = any(true);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   any_2ab91a();
diff --git a/test/tint/builtins/gen/literal/any/e755c1.wgsl b/test/tint/builtins/gen/literal/any/e755c1.wgsl
index 189ee8b..6af7d82 100644
--- a/test/tint/builtins/gen/literal/any/e755c1.wgsl
+++ b/test/tint/builtins/gen/literal/any/e755c1.wgsl
@@ -24,7 +24,10 @@
 // fn any(vec<3, bool>) -> bool
 fn any_e755c1() {
   var res: bool = any(vec3<bool>(true));
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.dxc.hlsl
index e727dd0..3b48d66 100644
--- a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_e755c1() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.fxc.hlsl
index e727dd0..3b48d66 100644
--- a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_e755c1() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.glsl
index 7c1083d..10f9a93 100644
--- a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_e755c1() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_e755c1() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_e755c1() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.msl b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.msl
index a4c1c5e..42f94df 100644
--- a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void any_e755c1() {
+void any_e755c1(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  any_e755c1();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  any_e755c1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  any_e755c1();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  any_e755c1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  any_e755c1();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  any_e755c1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.spvasm
index 7f8d23f..2e35bf5 100644
--- a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %any_e755c1 "any_e755c1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %any_e755c1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %any_e755c1 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %any_e755c1
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %any_e755c1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %any_e755c1
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %any_e755c1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %any_e755c1
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %any_e755c1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.wgsl
index 228cc32..85b3a6c 100644
--- a/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/any/e755c1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn any_e755c1() {
   var res : bool = any(vec3<bool>(true));
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   any_e755c1();
diff --git a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl
index 66f7357..d40e6ae 100644
--- a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<i32>, read>) -> u32
 fn arrayLength_1588cd() {
   var res: u32 = arrayLength(&sb_ro.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.dxc.hlsl
index fabbad5..002fffb 100644
--- a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_1588cd() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.fxc.hlsl
index fabbad5..002fffb 100644
--- a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_1588cd() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.glsl
index 4f59c4b..b2d79ac 100644
--- a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   int arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_1588cd() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   int arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_1588cd() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   int arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_1588cd() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.msl b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.msl
index 8f9b209..b42f4ee 100644
--- a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<int, 1> arg_0;
 };
 
-void arrayLength_1588cd(const constant tint_symbol_1* const tint_symbol_3) {
-  uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+void arrayLength_1588cd(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
+  uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_1588cd(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_1588cd(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_1588cd(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  arrayLength_1588cd(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_1588cd(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
+  arrayLength_1588cd(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.spvasm
index 40b7f6e..0e3d963 100644
--- a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RO "SB_RO"
                OpMemberName %SB_RO 0 "arg_0"
                OpName %sb_ro "sb_ro"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_1588cd "arrayLength_1588cd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
                OpDecorate %sb_ro NonWritable
                OpDecorate %sb_ro DescriptorSet 0
                OpDecorate %sb_ro Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,39 +49,47 @@
       %SB_RO = OpTypeStruct %_runtimearr_int
 %_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
       %sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
-       %void = OpTypeVoid
-         %14 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_1588cd = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpArrayLength %uint %sb_ro 0
-               OpStore %res %18
+%arrayLength_1588cd = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpArrayLength %uint %sb_ro 0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %arrayLength_1588cd
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %arrayLength_1588cd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %18
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %arrayLength_1588cd
+%fragment_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %arrayLength_1588cd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %arrayLength_1588cd
+%compute_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %arrayLength_1588cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.wgsl
index 8b3b166..a20cf14 100644
--- a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_1588cd() {
   var res : u32 = arrayLength(&(sb_ro.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_1588cd();
diff --git a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl
index 1c2902a..4d8e890 100644
--- a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<i32>, read_write>) -> u32
 fn arrayLength_61b1c7() {
   var res: u32 = arrayLength(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.dxc.hlsl
index ba47339..b416e47 100644
--- a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_61b1c7() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.fxc.hlsl
index ba47339..b416e47 100644
--- a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_61b1c7() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.glsl
index d22edc1..8d77b8a 100644
--- a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   int arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_61b1c7() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   int arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_61b1c7() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   int arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_61b1c7() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.msl b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.msl
index a0b7187..21ebe2c 100644
--- a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<int, 1> arg_0;
 };
 
-void arrayLength_61b1c7(const constant tint_symbol_1* const tint_symbol_3) {
+void arrayLength_61b1c7(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
   uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_61b1c7(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_61b1c7(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_61b1c7(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
+  arrayLength_61b1c7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_61b1c7(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
+  arrayLength_61b1c7(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.spvasm
index 482bb98..21d2f4e 100644
--- a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_61b1c7 "arrayLength_61b1c7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
                OpDecorate %_runtimearr_int ArrayStride 4
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,39 +48,47 @@
       %SB_RW = OpTypeStruct %_runtimearr_int
 %_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
       %sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
-       %void = OpTypeVoid
-         %14 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_61b1c7 = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpArrayLength %uint %sb_rw 0
-               OpStore %res %18
+%arrayLength_61b1c7 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpArrayLength %uint %sb_rw 0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %arrayLength_61b1c7
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %arrayLength_61b1c7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %18
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %arrayLength_61b1c7
+%fragment_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %arrayLength_61b1c7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %arrayLength_61b1c7
+%compute_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %arrayLength_61b1c7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.wgsl
index b9b63ee..8719832 100644
--- a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_61b1c7() {
   var res : u32 = arrayLength(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_61b1c7();
diff --git a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl
index 0a04948..38a2bdb 100644
--- a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl
@@ -30,7 +30,9 @@
 // fn arrayLength(ptr<storage, array<f16>, read>) -> u32
 fn arrayLength_8421b9() {
   var res: u32 = arrayLength(&sb_ro.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.dxc.hlsl
index 2694283..1b2b867 100644
--- a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_8421b9() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.fxc.hlsl
index 2694283..1b2b867 100644
--- a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_8421b9() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.glsl
index 9375052..5bc4297 100644
--- a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.glsl
@@ -5,8 +5,13 @@
   float16_t arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_8421b9() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,8 +35,13 @@
   float16_t arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_8421b9() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -49,8 +59,13 @@
   float16_t arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_8421b9() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.msl b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.msl
index 3661b22..b59b772 100644
--- a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<half, 1> arg_0;
 };
 
-void arrayLength_8421b9(const constant tint_symbol_1* const tint_symbol_3) {
-  uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 2u);
+void arrayLength_8421b9(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
+  uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 2u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_8421b9(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_8421b9(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_8421b9(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  arrayLength_8421b9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_8421b9(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
+  arrayLength_8421b9(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.spvasm
index 485ba20..c71ea89 100644
--- a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -19,6 +19,9 @@
                OpName %SB_RO "SB_RO"
                OpMemberName %SB_RO 0 "arg_0"
                OpName %sb_ro "sb_ro"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_8421b9 "arrayLength_8421b9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -33,6 +36,10 @@
                OpDecorate %sb_ro NonWritable
                OpDecorate %sb_ro DescriptorSet 0
                OpDecorate %sb_ro Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -46,39 +53,47 @@
       %SB_RO = OpTypeStruct %_runtimearr_half
 %_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
       %sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
-       %void = OpTypeVoid
-         %14 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_8421b9 = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpArrayLength %uint %sb_ro 0
-               OpStore %res %18
+%arrayLength_8421b9 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpArrayLength %uint %sb_ro 0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %arrayLength_8421b9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %arrayLength_8421b9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %18
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %arrayLength_8421b9
+%fragment_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %arrayLength_8421b9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %arrayLength_8421b9
+%compute_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %arrayLength_8421b9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.wgsl
index 2d6dca3..6083de9 100644
--- a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
 
 fn arrayLength_8421b9() {
   var res : u32 = arrayLength(&(sb_ro.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_8421b9();
diff --git a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl
index e6d4863..2df882a 100644
--- a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<f32>, read>) -> u32
 fn arrayLength_a0f5ca() {
   var res: u32 = arrayLength(&sb_ro.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.dxc.hlsl
index cee7ff2..a826bd9 100644
--- a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_a0f5ca() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.fxc.hlsl
index cee7ff2..a826bd9 100644
--- a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_a0f5ca() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.glsl b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.glsl
index d7e4539..25343cb 100644
--- a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   float arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_a0f5ca() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   float arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_a0f5ca() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   float arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_a0f5ca() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.msl b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.msl
index b0aba71..a4dab46 100644
--- a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<float, 1> arg_0;
 };
 
-void arrayLength_a0f5ca(const constant tint_symbol_1* const tint_symbol_3) {
-  uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+void arrayLength_a0f5ca(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
+  uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_a0f5ca(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_a0f5ca(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_a0f5ca(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  arrayLength_a0f5ca(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_a0f5ca(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
+  arrayLength_a0f5ca(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.spvasm
index 0af5f92..a21ffca 100644
--- a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RO "SB_RO"
                OpMemberName %SB_RO 0 "arg_0"
                OpName %sb_ro "sb_ro"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_a0f5ca "arrayLength_a0f5ca"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
                OpDecorate %sb_ro NonWritable
                OpDecorate %sb_ro DescriptorSet 0
                OpDecorate %sb_ro Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,39 +48,47 @@
       %SB_RO = OpTypeStruct %_runtimearr_float
 %_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
       %sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_a0f5ca = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %17 = OpArrayLength %uint %sb_ro 0
-               OpStore %res %17
+%arrayLength_a0f5ca = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpArrayLength %uint %sb_ro 0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %arrayLength_a0f5ca
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %arrayLength_a0f5ca
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %17
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %arrayLength_a0f5ca
+%fragment_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %arrayLength_a0f5ca
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %arrayLength_a0f5ca
+%compute_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %arrayLength_a0f5ca
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.wgsl
index fa60a15..8feea09 100644
--- a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_a0f5ca() {
   var res : u32 = arrayLength(&(sb_ro.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_a0f5ca();
diff --git a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl
index e457a8a..9727618 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl
@@ -30,7 +30,9 @@
 // fn arrayLength(ptr<storage, array<f16>, read_write>) -> u32
 fn arrayLength_cbd6b5() {
   var res: u32 = arrayLength(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.dxc.hlsl
index c62bc23..56d16ac 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cbd6b5() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.fxc.hlsl
index c62bc23..56d16ac 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cbd6b5() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.glsl
index aeaf5a3..c155e09 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.glsl
@@ -5,8 +5,13 @@
   float16_t arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cbd6b5() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,8 +35,13 @@
   float16_t arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cbd6b5() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -49,8 +59,13 @@
   float16_t arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cbd6b5() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.msl b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.msl
index 86034e4..1d5314b 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<half, 1> arg_0;
 };
 
-void arrayLength_cbd6b5(const constant tint_symbol_1* const tint_symbol_3) {
+void arrayLength_cbd6b5(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
   uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 2u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_cbd6b5(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_cbd6b5(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_cbd6b5(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
+  arrayLength_cbd6b5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_cbd6b5(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
+  arrayLength_cbd6b5(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.spvasm
index 15031de..f07f373 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -19,6 +19,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_cbd6b5 "arrayLength_cbd6b5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -32,6 +35,10 @@
                OpDecorate %_runtimearr_half ArrayStride 2
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -45,39 +52,47 @@
       %SB_RW = OpTypeStruct %_runtimearr_half
 %_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
       %sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
-       %void = OpTypeVoid
-         %14 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_cbd6b5 = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpArrayLength %uint %sb_rw 0
-               OpStore %res %18
+%arrayLength_cbd6b5 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpArrayLength %uint %sb_rw 0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %arrayLength_cbd6b5
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %arrayLength_cbd6b5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %18
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %arrayLength_cbd6b5
+%fragment_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %arrayLength_cbd6b5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %arrayLength_cbd6b5
+%compute_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %arrayLength_cbd6b5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.wgsl
index c025591..5320fc5 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
 
 fn arrayLength_cbd6b5() {
   var res : u32 = arrayLength(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_cbd6b5();
diff --git a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl
index c524ff6..01336ea 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<f32>, read_write>) -> u32
 fn arrayLength_cdd123() {
   var res: u32 = arrayLength(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.dxc.hlsl
index 2156844..fcc66f6 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cdd123() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.fxc.hlsl
index 2156844..fcc66f6 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cdd123() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.glsl b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.glsl
index 5d417ac..b8890f5 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   float arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cdd123() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   float arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cdd123() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   float arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cdd123() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.msl b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.msl
index b7fe50b..72bd980 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<float, 1> arg_0;
 };
 
-void arrayLength_cdd123(const constant tint_symbol_1* const tint_symbol_3) {
+void arrayLength_cdd123(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
   uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_cdd123(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_cdd123(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_cdd123(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
+  arrayLength_cdd123(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_cdd123(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
+  arrayLength_cdd123(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.spvasm
index 4644796..22f08f8 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_cdd123 "arrayLength_cdd123"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
                OpDecorate %_runtimearr_float ArrayStride 4
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,39 +47,47 @@
       %SB_RW = OpTypeStruct %_runtimearr_float
 %_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
       %sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_cdd123 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %17 = OpArrayLength %uint %sb_rw 0
-               OpStore %res %17
+%arrayLength_cdd123 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpArrayLength %uint %sb_rw 0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %arrayLength_cdd123
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %arrayLength_cdd123
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %17
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %arrayLength_cdd123
+%fragment_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %arrayLength_cdd123
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %arrayLength_cdd123
+%compute_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %arrayLength_cdd123
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.wgsl
index d792619..c949bb7 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_cdd123() {
   var res : u32 = arrayLength(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_cdd123();
diff --git a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl
index 9581e2e..a02d679 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<u32>, read>) -> u32
 fn arrayLength_cfca0a() {
   var res: u32 = arrayLength(&sb_ro.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.dxc.hlsl
index a6cf72c..ef42082 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cfca0a() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.fxc.hlsl
index a6cf72c..ef42082 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cfca0a() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.glsl
index a605e06..57ed7ff 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   uint arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cfca0a() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   uint arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cfca0a() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   uint arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cfca0a() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.msl b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.msl
index f62106e..039995a 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<uint, 1> arg_0;
 };
 
-void arrayLength_cfca0a(const constant tint_symbol_1* const tint_symbol_3) {
-  uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+void arrayLength_cfca0a(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
+  uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_cfca0a(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_cfca0a(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_cfca0a(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  arrayLength_cfca0a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_cfca0a(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
+  arrayLength_cfca0a(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.spvasm
index db230e9..bf72cad 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RO "SB_RO"
                OpMemberName %SB_RO 0 "arg_0"
                OpName %sb_ro "sb_ro"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_cfca0a "arrayLength_cfca0a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
                OpDecorate %sb_ro NonWritable
                OpDecorate %sb_ro DescriptorSet 0
                OpDecorate %sb_ro Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,38 +49,46 @@
       %SB_RO = OpTypeStruct %_runtimearr_uint
 %_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
       %sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %14 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_cfca0a = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpArrayLength %uint %sb_ro 0
-               OpStore %res %18
+%arrayLength_cfca0a = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpArrayLength %uint %sb_ro 0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %arrayLength_cfca0a
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %arrayLength_cfca0a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %17
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %arrayLength_cfca0a
+%fragment_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %arrayLength_cfca0a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %arrayLength_cfca0a
+%compute_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %arrayLength_cfca0a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.wgsl
index d741ef0..f1fa0e3 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_cfca0a() {
   var res : u32 = arrayLength(&(sb_ro.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_cfca0a();
diff --git a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl
index 5c2eca0..00cdbd5 100644
--- a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<u32>, read_write>) -> u32
 fn arrayLength_eb510f() {
   var res: u32 = arrayLength(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.dxc.hlsl
index 4b05a0f..6bc3dae 100644
--- a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_eb510f() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.fxc.hlsl
index 4b05a0f..6bc3dae 100644
--- a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_eb510f() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.glsl
index 51f60de..d6c4cda 100644
--- a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   uint arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_eb510f() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   uint arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_eb510f() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   uint arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_eb510f() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.msl b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.msl
index 05c3bc9..6838fcb 100644
--- a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<uint, 1> arg_0;
 };
 
-void arrayLength_eb510f(const constant tint_symbol_1* const tint_symbol_3) {
+void arrayLength_eb510f(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
   uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_eb510f(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_eb510f(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_eb510f(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
+  arrayLength_eb510f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_eb510f(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
+  arrayLength_eb510f(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.spvasm
index b165c3f..9acedf2 100644
--- a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_eb510f "arrayLength_eb510f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
                OpDecorate %_runtimearr_uint ArrayStride 4
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,38 +48,46 @@
       %SB_RW = OpTypeStruct %_runtimearr_uint
 %_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
       %sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %14 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_eb510f = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpArrayLength %uint %sb_rw 0
-               OpStore %res %18
+%arrayLength_eb510f = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpArrayLength %uint %sb_rw 0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %arrayLength_eb510f
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %arrayLength_eb510f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %17
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %arrayLength_eb510f
+%fragment_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %arrayLength_eb510f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %arrayLength_eb510f
+%compute_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %arrayLength_eb510f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.wgsl
index a048944..0f20ea4 100644
--- a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_eb510f() {
   var res : u32 = arrayLength(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_eb510f();
diff --git a/test/tint/builtins/gen/literal/asin/064953.wgsl b/test/tint/builtins/gen/literal/asin/064953.wgsl
index cf8e240..5c13172 100644
--- a/test/tint/builtins/gen/literal/asin/064953.wgsl
+++ b/test/tint/builtins/gen/literal/asin/064953.wgsl
@@ -24,7 +24,9 @@
 // fn asin(vec<4, f32>) -> vec<4, f32>
 fn asin_064953() {
   var res: vec4<f32> = asin(vec4<f32>(0.479425538604f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.dxc.hlsl
index 4ae1669..0ed2d59 100644
--- a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_064953() {
   float4 res = (0.5f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.fxc.hlsl
index 4ae1669..0ed2d59 100644
--- a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_064953() {
   float4 res = (0.5f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.glsl
index d1f38ac..5763cf0 100644
--- a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asin_064953() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asin_064953() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asin_064953() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.msl b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.msl
index b395eeb..6f7b8f9 100644
--- a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_064953() {
+void asin_064953(device float4* const tint_symbol_1) {
   float4 res = float4(0.5f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_064953();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  asin_064953(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_064953();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  asin_064953(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_064953();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  asin_064953(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.spvasm
index 764a9df..33a1e93 100644
--- a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_064953 "asin_064953"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %14 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+         %17 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_064953 = OpFunction %void None %9
-         %12 = OpLabel
+%asin_064953 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %asin_064953
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %asin_064953
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %asin_064953
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %asin_064953
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asin_064953
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asin_064953
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.wgsl
index 8f104ac..add1150 100644
--- a/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asin/064953.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn asin_064953() {
   var res : vec4<f32> = asin(vec4<f32>(0.47942554950714111328f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_064953();
diff --git a/test/tint/builtins/gen/literal/asin/0bac07.wgsl b/test/tint/builtins/gen/literal/asin/0bac07.wgsl
index 49508db..7774737 100644
--- a/test/tint/builtins/gen/literal/asin/0bac07.wgsl
+++ b/test/tint/builtins/gen/literal/asin/0bac07.wgsl
@@ -25,7 +25,6 @@
 fn asin_0bac07() {
   var res = asin(vec3(0.479425538604));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_0bac07();
diff --git a/test/tint/builtins/gen/literal/asin/11dfda.wgsl b/test/tint/builtins/gen/literal/asin/11dfda.wgsl
index a7cea13..6ba3d08 100644
--- a/test/tint/builtins/gen/literal/asin/11dfda.wgsl
+++ b/test/tint/builtins/gen/literal/asin/11dfda.wgsl
@@ -26,7 +26,9 @@
 // fn asin(f16) -> f16
 fn asin_11dfda() {
   var res: f16 = asin(0.479425538604h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.dxc.hlsl
index a3ec9d2..d15d514 100644
--- a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_11dfda() {
   float16_t res = float16_t(0.499755859375h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.fxc.hlsl
index 1de9dcf..2e96ff9 100644
--- a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_11dfda() {
-  float16_t res = float16_t(0.499755859h);
+  float16_t res = float16_t(0.499755859375h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.glsl
index 7867385..33f0975 100644
--- a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asin_11dfda() {
   float16_t res = 0.499755859375hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asin_11dfda() {
   float16_t res = 0.499755859375hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asin_11dfda() {
   float16_t res = 0.499755859375hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.msl b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.msl
index e5b8c70..d6c11ea 100644
--- a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_11dfda() {
+void asin_11dfda(device half* const tint_symbol_1) {
   half res = 0.499755859375h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_11dfda();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  asin_11dfda(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_11dfda();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  asin_11dfda(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_11dfda();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  asin_11dfda(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.spvasm
index 5d30cab..9b2590f 100644
--- a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_11dfda "asin_11dfda"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_ffcpn2 = OpConstant %half 0x1.ffcp-2
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_11dfda = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%asin_11dfda = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_ffcpn2
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %asin_11dfda
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %asin_11dfda
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %asin_11dfda
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %asin_11dfda
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %asin_11dfda
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %asin_11dfda
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.wgsl
index 97d74ca..af8ed21 100644
--- a/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asin/11dfda.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn asin_11dfda() {
   var res : f16 = asin(0.479248046875h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_11dfda();
diff --git a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl
index 9291474..581f85e 100644
--- a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl
+++ b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl
@@ -26,7 +26,9 @@
 // fn asin(vec<3, f16>) -> vec<3, f16>
 fn asin_2d8e29() {
   var res: vec3<f16> = asin(vec3<f16>(0.479425538604h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.dxc.hlsl
index b4a1c25..b04d8c9 100644
--- a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_2d8e29() {
   vector<float16_t, 3> res = (float16_t(0.499755859375h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.fxc.hlsl
index 8d42ff1..3284b71 100644
--- a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_2d8e29() {
-  vector<float16_t, 3> res = (float16_t(0.499755859h)).xxx;
+  vector<float16_t, 3> res = (float16_t(0.499755859375h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.glsl
index 62addca..c6b463f 100644
--- a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asin_2d8e29() {
   f16vec3 res = f16vec3(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asin_2d8e29() {
   f16vec3 res = f16vec3(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asin_2d8e29() {
   f16vec3 res = f16vec3(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.msl b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.msl
index da728bf..2aafe94 100644
--- a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_2d8e29() {
+void asin_2d8e29(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.499755859375h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_2d8e29();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  asin_2d8e29(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_2d8e29();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  asin_2d8e29(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_2d8e29();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  asin_2d8e29(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.spvasm
index 2768bf7..3df02a7 100644
--- a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_2d8e29 "asin_2d8e29"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn2 = OpConstant %half 0x1.ffcp-2
-         %16 = OpConstantComposite %v3half %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2
+         %19 = OpConstantComposite %v3half %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_2d8e29 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%asin_2d8e29 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %asin_2d8e29
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %asin_2d8e29
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asin_2d8e29
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asin_2d8e29
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asin_2d8e29
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asin_2d8e29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.wgsl
index d911ca4..fd5effa 100644
--- a/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asin/2d8e29.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn asin_2d8e29() {
   var res : vec3<f16> = asin(vec3<f16>(0.479248046875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_2d8e29();
diff --git a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl
index 6e46f91..c6f55ff 100644
--- a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl
+++ b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl
@@ -26,7 +26,9 @@
 // fn asin(vec<4, f16>) -> vec<4, f16>
 fn asin_3cfbd4() {
   var res: vec4<f16> = asin(vec4<f16>(0.479425538604h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.dxc.hlsl
index 2f61c02..7f2d074 100644
--- a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_3cfbd4() {
   vector<float16_t, 4> res = (float16_t(0.499755859375h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.fxc.hlsl
index ea28078..511f17d 100644
--- a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_3cfbd4() {
-  vector<float16_t, 4> res = (float16_t(0.499755859h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(0.499755859375h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.glsl
index 9af8626..5bc1dfb 100644
--- a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asin_3cfbd4() {
   f16vec4 res = f16vec4(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asin_3cfbd4() {
   f16vec4 res = f16vec4(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asin_3cfbd4() {
   f16vec4 res = f16vec4(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.msl b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.msl
index ecbe8f5..2b76424 100644
--- a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_3cfbd4() {
+void asin_3cfbd4(device half4* const tint_symbol_1) {
   half4 res = half4(0.499755859375h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_3cfbd4();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  asin_3cfbd4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_3cfbd4();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  asin_3cfbd4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_3cfbd4();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  asin_3cfbd4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.spvasm
index f110573..bd9cbbd 100644
--- a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_3cfbd4 "asin_3cfbd4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn2 = OpConstant %half 0x1.ffcp-2
-         %16 = OpConstantComposite %v4half %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2
+         %19 = OpConstantComposite %v4half %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_3cfbd4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%asin_3cfbd4 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %asin_3cfbd4
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %asin_3cfbd4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asin_3cfbd4
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asin_3cfbd4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asin_3cfbd4
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asin_3cfbd4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.wgsl
index f2ee7c3..807d511 100644
--- a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn asin_3cfbd4() {
   var res : vec4<f16> = asin(vec4<f16>(0.479248046875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_3cfbd4();
diff --git a/test/tint/builtins/gen/literal/asin/64bb1f.wgsl b/test/tint/builtins/gen/literal/asin/64bb1f.wgsl
index 650172c..4f29683 100644
--- a/test/tint/builtins/gen/literal/asin/64bb1f.wgsl
+++ b/test/tint/builtins/gen/literal/asin/64bb1f.wgsl
@@ -25,7 +25,6 @@
 fn asin_64bb1f() {
   var res = asin(vec4(0.479425538604));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_64bb1f();
diff --git a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl
index 83a9590..c40b94e 100644
--- a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl
+++ b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl
@@ -24,7 +24,9 @@
 // fn asin(vec<2, f32>) -> vec<2, f32>
 fn asin_7b6a44() {
   var res: vec2<f32> = asin(vec2<f32>(0.479425538604f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.dxc.hlsl
index 53e20d3..39ff72f 100644
--- a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_7b6a44() {
   float2 res = (0.5f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.fxc.hlsl
index 53e20d3..39ff72f 100644
--- a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_7b6a44() {
   float2 res = (0.5f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.glsl
index 2a7d93d..1f48551 100644
--- a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asin_7b6a44() {
   vec2 res = vec2(0.5f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asin_7b6a44() {
   vec2 res = vec2(0.5f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asin_7b6a44() {
   vec2 res = vec2(0.5f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.msl b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.msl
index bd3f146..da9146e 100644
--- a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_7b6a44() {
+void asin_7b6a44(device float2* const tint_symbol_1) {
   float2 res = float2(0.5f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_7b6a44();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  asin_7b6a44(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_7b6a44();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  asin_7b6a44(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_7b6a44();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  asin_7b6a44(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.spvasm
index 9d65d1e..77185b0 100644
--- a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_7b6a44 "asin_7b6a44"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %15 = OpConstantComposite %v2float %float_0_5 %float_0_5
+         %18 = OpConstantComposite %v2float %float_0_5 %float_0_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_7b6a44 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%asin_7b6a44 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %asin_7b6a44
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %asin_7b6a44
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %asin_7b6a44
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %asin_7b6a44
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asin_7b6a44
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asin_7b6a44
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.wgsl
index b5a89eb..86a44e4 100644
--- a/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asin/7b6a44.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn asin_7b6a44() {
   var res : vec2<f32> = asin(vec2<f32>(0.47942554950714111328f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_7b6a44();
diff --git a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl
index 4e43588..b823649 100644
--- a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl
+++ b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl
@@ -24,7 +24,9 @@
 // fn asin(vec<3, f32>) -> vec<3, f32>
 fn asin_8cd9c9() {
   var res: vec3<f32> = asin(vec3<f32>(0.479425538604f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.dxc.hlsl
index 3d16011..ca6db14 100644
--- a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_8cd9c9() {
   float3 res = (0.5f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.fxc.hlsl
index 3d16011..ca6db14 100644
--- a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_8cd9c9() {
   float3 res = (0.5f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.glsl
index 605d90c..05ec2d1 100644
--- a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asin_8cd9c9() {
   vec3 res = vec3(0.5f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asin_8cd9c9() {
   vec3 res = vec3(0.5f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asin_8cd9c9() {
   vec3 res = vec3(0.5f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.msl b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.msl
index c9bf2ec..3d3fef9 100644
--- a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_8cd9c9() {
+void asin_8cd9c9(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.5f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_8cd9c9();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  asin_8cd9c9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_8cd9c9();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  asin_8cd9c9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_8cd9c9();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  asin_8cd9c9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.spvasm
index ae00642..b8bcad0 100644
--- a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_8cd9c9 "asin_8cd9c9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %15 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+         %18 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_8cd9c9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%asin_8cd9c9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %asin_8cd9c9
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %asin_8cd9c9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %asin_8cd9c9
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %asin_8cd9c9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asin_8cd9c9
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asin_8cd9c9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.wgsl
index fab18a2..4cde99e 100644
--- a/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asin/8cd9c9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn asin_8cd9c9() {
   var res : vec3<f32> = asin(vec3<f32>(0.47942554950714111328f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_8cd9c9();
diff --git a/test/tint/builtins/gen/literal/asin/a5dd88.wgsl b/test/tint/builtins/gen/literal/asin/a5dd88.wgsl
index be8c51f..7c7efb4 100644
--- a/test/tint/builtins/gen/literal/asin/a5dd88.wgsl
+++ b/test/tint/builtins/gen/literal/asin/a5dd88.wgsl
@@ -25,7 +25,6 @@
 fn asin_a5dd88() {
   var res = asin(vec2(0.479425538604));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_a5dd88();
diff --git a/test/tint/builtins/gen/literal/asin/a6d73a.wgsl b/test/tint/builtins/gen/literal/asin/a6d73a.wgsl
index 2f61303..7af2979 100644
--- a/test/tint/builtins/gen/literal/asin/a6d73a.wgsl
+++ b/test/tint/builtins/gen/literal/asin/a6d73a.wgsl
@@ -25,7 +25,6 @@
 fn asin_a6d73a() {
   var res = asin(0.479425538604);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_a6d73a();
diff --git a/test/tint/builtins/gen/literal/asin/b4aced.wgsl b/test/tint/builtins/gen/literal/asin/b4aced.wgsl
index 792e6f6..5ec9065 100644
--- a/test/tint/builtins/gen/literal/asin/b4aced.wgsl
+++ b/test/tint/builtins/gen/literal/asin/b4aced.wgsl
@@ -26,7 +26,9 @@
 // fn asin(vec<2, f16>) -> vec<2, f16>
 fn asin_b4aced() {
   var res: vec2<f16> = asin(vec2<f16>(0.479425538604h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.dxc.hlsl
index 7f4a247..7bc0cdd 100644
--- a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_b4aced() {
   vector<float16_t, 2> res = (float16_t(0.499755859375h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.fxc.hlsl
index 13d540e..c4067cf 100644
--- a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_b4aced() {
-  vector<float16_t, 2> res = (float16_t(0.499755859h)).xx;
+  vector<float16_t, 2> res = (float16_t(0.499755859375h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.glsl
index 1e8ba02..db5bebe 100644
--- a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asin_b4aced() {
   f16vec2 res = f16vec2(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asin_b4aced() {
   f16vec2 res = f16vec2(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asin_b4aced() {
   f16vec2 res = f16vec2(0.499755859375hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.msl b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.msl
index 32e1af9..76da55d 100644
--- a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_b4aced() {
+void asin_b4aced(device half2* const tint_symbol_1) {
   half2 res = half2(0.499755859375h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_b4aced();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  asin_b4aced(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_b4aced();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  asin_b4aced(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_b4aced();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  asin_b4aced(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.spvasm
index d61e336..f24c25e 100644
--- a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_b4aced "asin_b4aced"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn2 = OpConstant %half 0x1.ffcp-2
-         %16 = OpConstantComposite %v2half %half_0x1_ffcpn2 %half_0x1_ffcpn2
+         %19 = OpConstantComposite %v2half %half_0x1_ffcpn2 %half_0x1_ffcpn2
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_b4aced = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%asin_b4aced = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %asin_b4aced
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %asin_b4aced
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asin_b4aced
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asin_b4aced
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asin_b4aced
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asin_b4aced
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.wgsl
index da77c20..0e9045a 100644
--- a/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asin/b4aced.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn asin_b4aced() {
   var res : vec2<f16> = asin(vec2<f16>(0.479248046875h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_b4aced();
diff --git a/test/tint/builtins/gen/literal/asin/c0c272.wgsl b/test/tint/builtins/gen/literal/asin/c0c272.wgsl
index 5739918..d3e76fa 100644
--- a/test/tint/builtins/gen/literal/asin/c0c272.wgsl
+++ b/test/tint/builtins/gen/literal/asin/c0c272.wgsl
@@ -24,7 +24,9 @@
 // fn asin(f32) -> f32
 fn asin_c0c272() {
   var res: f32 = asin(0.479425538604f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.dxc.hlsl
index 6020151..fe970d3 100644
--- a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_c0c272() {
   float res = 0.5f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.fxc.hlsl
index 6020151..fe970d3 100644
--- a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_c0c272() {
   float res = 0.5f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.glsl
index 34eb102..6971bfb 100644
--- a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asin_c0c272() {
   float res = 0.5f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asin_c0c272() {
   float res = 0.5f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asin_c0c272() {
   float res = 0.5f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.msl b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.msl
index 58374be..f7270bd 100644
--- a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_c0c272() {
+void asin_c0c272(device float* const tint_symbol_1) {
   float res = 0.5f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_c0c272();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  asin_c0c272(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_c0c272();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  asin_c0c272(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_c0c272();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  asin_c0c272(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.spvasm
index 37dd873..4b2ff26 100644
--- a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_c0c272 "asin_c0c272"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_c0c272 = OpFunction %void None %9
-         %12 = OpLabel
+%asin_c0c272 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_5
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %asin_c0c272
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %asin_c0c272
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %asin_c0c272
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %asin_c0c272
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %asin_c0c272
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %asin_c0c272
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.wgsl
index ad35e32..ac40bcc 100644
--- a/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asin/c0c272.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn asin_c0c272() {
   var res : f32 = asin(0.47942554950714111328f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_c0c272();
diff --git a/test/tint/builtins/gen/literal/asinh/157447.wgsl b/test/tint/builtins/gen/literal/asinh/157447.wgsl
index c184295..34d4309 100644
--- a/test/tint/builtins/gen/literal/asinh/157447.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/157447.wgsl
@@ -24,7 +24,9 @@
 // fn asinh(f32) -> f32
 fn asinh_157447() {
   var res: f32 = asinh(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.dxc.hlsl
index e3052ef..e35b24a 100644
--- a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_157447() {
   float res = 0.88137358427047729492f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.fxc.hlsl
index e3052ef..e35b24a 100644
--- a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_157447() {
   float res = 0.88137358427047729492f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.glsl
index d407617..b45922f 100644
--- a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asinh_157447() {
   float res = 0.88137358427047729492f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asinh_157447() {
   float res = 0.88137358427047729492f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asinh_157447() {
   float res = 0.88137358427047729492f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.msl b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.msl
index f3f3433..0f04e05 100644
--- a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_157447() {
+void asinh_157447(device float* const tint_symbol_1) {
   float res = 0.88137358427047729492f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_157447();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  asinh_157447(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_157447();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  asinh_157447(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_157447();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  asinh_157447(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.spvasm
index baaaa22..f063ec1 100644
--- a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_157447 "asinh_157447"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_881373584 = OpConstant %float 0.881373584
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_157447 = OpFunction %void None %9
-         %12 = OpLabel
+%asinh_157447 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_881373584
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %asinh_157447
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %asinh_157447
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %asinh_157447
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %asinh_157447
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %asinh_157447
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %asinh_157447
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.wgsl
index eef4f77..12b9189 100644
--- a/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/157447.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn asinh_157447() {
   var res : f32 = asinh(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_157447();
diff --git a/test/tint/builtins/gen/literal/asinh/16b543.wgsl b/test/tint/builtins/gen/literal/asinh/16b543.wgsl
index e6bb7c9..6ab3917 100644
--- a/test/tint/builtins/gen/literal/asinh/16b543.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/16b543.wgsl
@@ -25,7 +25,6 @@
 fn asinh_16b543() {
   var res = asinh(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_16b543();
diff --git a/test/tint/builtins/gen/literal/asinh/180015.wgsl b/test/tint/builtins/gen/literal/asinh/180015.wgsl
index 13a71e5..b2b0e12 100644
--- a/test/tint/builtins/gen/literal/asinh/180015.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/180015.wgsl
@@ -25,7 +25,6 @@
 fn asinh_180015() {
   var res = asinh(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_180015();
diff --git a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl
index ccf03d3..d049bd9 100644
--- a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl
@@ -24,7 +24,9 @@
 // fn asinh(vec<3, f32>) -> vec<3, f32>
 fn asinh_2265ee() {
   var res: vec3<f32> = asinh(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.dxc.hlsl
index a1b603f8..9859458 100644
--- a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_2265ee() {
   float3 res = (0.88137358427047729492f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.fxc.hlsl
index a1b603f8..9859458 100644
--- a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_2265ee() {
   float3 res = (0.88137358427047729492f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.glsl
index 1f46b85..798c156 100644
--- a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asinh_2265ee() {
   vec3 res = vec3(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asinh_2265ee() {
   vec3 res = vec3(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asinh_2265ee() {
   vec3 res = vec3(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.msl b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.msl
index 425e59f..2a85a8a 100644
--- a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_2265ee() {
+void asinh_2265ee(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.88137358427047729492f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_2265ee();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  asinh_2265ee(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_2265ee();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  asinh_2265ee(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_2265ee();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  asinh_2265ee(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.spvasm
index c29bb75..5c885e2 100644
--- a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_2265ee "asinh_2265ee"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_881373584 = OpConstant %float 0.881373584
-         %15 = OpConstantComposite %v3float %float_0_881373584 %float_0_881373584 %float_0_881373584
+         %18 = OpConstantComposite %v3float %float_0_881373584 %float_0_881373584 %float_0_881373584
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_2265ee = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%asinh_2265ee = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %asinh_2265ee
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %asinh_2265ee
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %asinh_2265ee
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %asinh_2265ee
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asinh_2265ee
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asinh_2265ee
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.wgsl
index a0961af..69f0db7 100644
--- a/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/2265ee.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn asinh_2265ee() {
   var res : vec3<f32> = asinh(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_2265ee();
diff --git a/test/tint/builtins/gen/literal/asinh/468a48.wgsl b/test/tint/builtins/gen/literal/asinh/468a48.wgsl
index 661f08e..e0617a4 100644
--- a/test/tint/builtins/gen/literal/asinh/468a48.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/468a48.wgsl
@@ -26,7 +26,9 @@
 // fn asinh(f16) -> f16
 fn asinh_468a48() {
   var res: f16 = asinh(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.dxc.hlsl
index d4f5bb7..818cb4a 100644
--- a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_468a48() {
   float16_t res = float16_t(0.88134765625h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.fxc.hlsl
index 3e1020e..2ec3e2e 100644
--- a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_468a48() {
-  float16_t res = float16_t(0.881347656h);
+  float16_t res = float16_t(0.88134765625h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.glsl
index 4b0554c..2917021 100644
--- a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asinh_468a48() {
   float16_t res = 0.88134765625hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asinh_468a48() {
   float16_t res = 0.88134765625hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asinh_468a48() {
   float16_t res = 0.88134765625hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.msl b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.msl
index 3d04c5f..84bc7ca 100644
--- a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_468a48() {
+void asinh_468a48(device half* const tint_symbol_1) {
   half res = 0.88134765625h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_468a48();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  asinh_468a48(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_468a48();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  asinh_468a48(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_468a48();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  asinh_468a48(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.spvasm
index 9e2b885..b7f4b55 100644
--- a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_468a48 "asinh_468a48"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_c34pn1 = OpConstant %half 0x1.c34p-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_468a48 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%asinh_468a48 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_c34pn1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %asinh_468a48
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %asinh_468a48
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %asinh_468a48
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %asinh_468a48
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %asinh_468a48
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %asinh_468a48
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.wgsl
index fc555c0..15a9906 100644
--- a/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/468a48.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn asinh_468a48() {
   var res : f16 = asinh(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_468a48();
diff --git a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl
index 8ac4653..02c451a 100644
--- a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl
@@ -24,7 +24,9 @@
 // fn asinh(vec<2, f32>) -> vec<2, f32>
 fn asinh_4a2226() {
   var res: vec2<f32> = asinh(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.dxc.hlsl
index d6f9077..5790c2f 100644
--- a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_4a2226() {
   float2 res = (0.88137358427047729492f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.fxc.hlsl
index d6f9077..5790c2f 100644
--- a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_4a2226() {
   float2 res = (0.88137358427047729492f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.glsl
index 2f38d77..11117d9 100644
--- a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asinh_4a2226() {
   vec2 res = vec2(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asinh_4a2226() {
   vec2 res = vec2(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asinh_4a2226() {
   vec2 res = vec2(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.msl b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.msl
index 10eca91..d437ff5 100644
--- a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_4a2226() {
+void asinh_4a2226(device float2* const tint_symbol_1) {
   float2 res = float2(0.88137358427047729492f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_4a2226();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  asinh_4a2226(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_4a2226();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  asinh_4a2226(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_4a2226();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  asinh_4a2226(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.spvasm
index d6686cd..0694b54 100644
--- a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_4a2226 "asinh_4a2226"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_881373584 = OpConstant %float 0.881373584
-         %15 = OpConstantComposite %v2float %float_0_881373584 %float_0_881373584
+         %18 = OpConstantComposite %v2float %float_0_881373584 %float_0_881373584
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_4a2226 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%asinh_4a2226 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %asinh_4a2226
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %asinh_4a2226
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %asinh_4a2226
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %asinh_4a2226
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asinh_4a2226
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asinh_4a2226
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.wgsl
index d4a07c1..eb59c32 100644
--- a/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/4a2226.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn asinh_4a2226() {
   var res : vec2<f32> = asinh(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_4a2226();
diff --git a/test/tint/builtins/gen/literal/asinh/51079e.wgsl b/test/tint/builtins/gen/literal/asinh/51079e.wgsl
index ffa2088..51ce237 100644
--- a/test/tint/builtins/gen/literal/asinh/51079e.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/51079e.wgsl
@@ -25,7 +25,6 @@
 fn asinh_51079e() {
   var res = asinh(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_51079e();
diff --git a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl
index 6efc56a..463dfa1 100644
--- a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl
@@ -24,7 +24,9 @@
 // fn asinh(vec<4, f32>) -> vec<4, f32>
 fn asinh_8d2e51() {
   var res: vec4<f32> = asinh(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.dxc.hlsl
index 28cf9bf..8cbc18e 100644
--- a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_8d2e51() {
   float4 res = (0.88137358427047729492f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.fxc.hlsl
index 28cf9bf..8cbc18e 100644
--- a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_8d2e51() {
   float4 res = (0.88137358427047729492f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.glsl
index 9fb9a3b..7cdfa17 100644
--- a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asinh_8d2e51() {
   vec4 res = vec4(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asinh_8d2e51() {
   vec4 res = vec4(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asinh_8d2e51() {
   vec4 res = vec4(0.88137358427047729492f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.msl b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.msl
index e6ddde2..8fe9146 100644
--- a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_8d2e51() {
+void asinh_8d2e51(device float4* const tint_symbol_1) {
   float4 res = float4(0.88137358427047729492f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_8d2e51();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  asinh_8d2e51(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_8d2e51();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  asinh_8d2e51(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_8d2e51();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  asinh_8d2e51(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.spvasm
index 2ef5c15..81163f5 100644
--- a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_8d2e51 "asinh_8d2e51"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_881373584 = OpConstant %float 0.881373584
-         %14 = OpConstantComposite %v4float %float_0_881373584 %float_0_881373584 %float_0_881373584 %float_0_881373584
+         %17 = OpConstantComposite %v4float %float_0_881373584 %float_0_881373584 %float_0_881373584 %float_0_881373584
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_8d2e51 = OpFunction %void None %9
-         %12 = OpLabel
+%asinh_8d2e51 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %asinh_8d2e51
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %asinh_8d2e51
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %asinh_8d2e51
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %asinh_8d2e51
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asinh_8d2e51
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asinh_8d2e51
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.wgsl
index feeb8f5..d7620e7 100644
--- a/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/8d2e51.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn asinh_8d2e51() {
   var res : vec4<f32> = asinh(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_8d2e51();
diff --git a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl
index d3df0c6..4894e26 100644
--- a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl
@@ -26,7 +26,9 @@
 // fn asinh(vec<4, f16>) -> vec<4, f16>
 fn asinh_95ab2b() {
   var res: vec4<f16> = asinh(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.dxc.hlsl
index de48e04..6da10c2 100644
--- a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_95ab2b() {
   vector<float16_t, 4> res = (float16_t(0.88134765625h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.fxc.hlsl
index 6db7771..34fb4b9 100644
--- a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_95ab2b() {
-  vector<float16_t, 4> res = (float16_t(0.881347656h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(0.88134765625h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.glsl
index 35c3916..5a6bad9 100644
--- a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asinh_95ab2b() {
   f16vec4 res = f16vec4(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asinh_95ab2b() {
   f16vec4 res = f16vec4(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asinh_95ab2b() {
   f16vec4 res = f16vec4(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.msl b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.msl
index d191758..a4b64b9 100644
--- a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_95ab2b() {
+void asinh_95ab2b(device half4* const tint_symbol_1) {
   half4 res = half4(0.88134765625h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_95ab2b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  asinh_95ab2b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_95ab2b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  asinh_95ab2b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_95ab2b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  asinh_95ab2b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.spvasm
index 8a5fa6a..f2588f0 100644
--- a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_95ab2b "asinh_95ab2b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_c34pn1 = OpConstant %half 0x1.c34p-1
-         %16 = OpConstantComposite %v4half %half_0x1_c34pn1 %half_0x1_c34pn1 %half_0x1_c34pn1 %half_0x1_c34pn1
+         %19 = OpConstantComposite %v4half %half_0x1_c34pn1 %half_0x1_c34pn1 %half_0x1_c34pn1 %half_0x1_c34pn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_95ab2b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%asinh_95ab2b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %asinh_95ab2b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %asinh_95ab2b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asinh_95ab2b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asinh_95ab2b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asinh_95ab2b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asinh_95ab2b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.wgsl
index e22c6a8..ac6916a 100644
--- a/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/95ab2b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn asinh_95ab2b() {
   var res : vec4<f16> = asinh(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_95ab2b();
diff --git a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl
index 3b284fa..6c2b5be 100644
--- a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl
@@ -26,7 +26,9 @@
 // fn asinh(vec<2, f16>) -> vec<2, f16>
 fn asinh_ad8f8b() {
   var res: vec2<f16> = asinh(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.dxc.hlsl
index 802429f..0e67c72 100644
--- a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_ad8f8b() {
   vector<float16_t, 2> res = (float16_t(0.88134765625h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.fxc.hlsl
index 402282f..b85e875 100644
--- a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_ad8f8b() {
-  vector<float16_t, 2> res = (float16_t(0.881347656h)).xx;
+  vector<float16_t, 2> res = (float16_t(0.88134765625h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.glsl
index 1be54f0..d65c2e4 100644
--- a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asinh_ad8f8b() {
   f16vec2 res = f16vec2(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asinh_ad8f8b() {
   f16vec2 res = f16vec2(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asinh_ad8f8b() {
   f16vec2 res = f16vec2(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.msl b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.msl
index 4a89f51..d49889d 100644
--- a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_ad8f8b() {
+void asinh_ad8f8b(device half2* const tint_symbol_1) {
   half2 res = half2(0.88134765625h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_ad8f8b();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  asinh_ad8f8b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_ad8f8b();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  asinh_ad8f8b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_ad8f8b();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  asinh_ad8f8b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.spvasm
index 027fbe2..5ee4a08 100644
--- a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_ad8f8b "asinh_ad8f8b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_c34pn1 = OpConstant %half 0x1.c34p-1
-         %16 = OpConstantComposite %v2half %half_0x1_c34pn1 %half_0x1_c34pn1
+         %19 = OpConstantComposite %v2half %half_0x1_c34pn1 %half_0x1_c34pn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_ad8f8b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%asinh_ad8f8b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %asinh_ad8f8b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %asinh_ad8f8b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asinh_ad8f8b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asinh_ad8f8b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asinh_ad8f8b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asinh_ad8f8b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.wgsl
index 150062d..f81cc80 100644
--- a/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/ad8f8b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn asinh_ad8f8b() {
   var res : vec2<f16> = asinh(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_ad8f8b();
diff --git a/test/tint/builtins/gen/literal/asinh/cf8603.wgsl b/test/tint/builtins/gen/literal/asinh/cf8603.wgsl
index e97e89c..19c85cb 100644
--- a/test/tint/builtins/gen/literal/asinh/cf8603.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/cf8603.wgsl
@@ -25,7 +25,6 @@
 fn asinh_cf8603() {
   var res = asinh(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_cf8603();
diff --git a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl
index 8f84a91..5ff0ac9 100644
--- a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl
@@ -26,7 +26,9 @@
 // fn asinh(vec<3, f16>) -> vec<3, f16>
 fn asinh_fb5e8c() {
   var res: vec3<f16> = asinh(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.dxc.hlsl
index bb18443..d2514ed 100644
--- a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_fb5e8c() {
   vector<float16_t, 3> res = (float16_t(0.88134765625h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.fxc.hlsl
index a86115e..4f79cdc 100644
--- a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_fb5e8c() {
-  vector<float16_t, 3> res = (float16_t(0.881347656h)).xxx;
+  vector<float16_t, 3> res = (float16_t(0.88134765625h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.glsl
index 46c51ce..a4da8bf 100644
--- a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asinh_fb5e8c() {
   f16vec3 res = f16vec3(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asinh_fb5e8c() {
   f16vec3 res = f16vec3(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asinh_fb5e8c() {
   f16vec3 res = f16vec3(0.88134765625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.msl b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.msl
index 7753043..df57f4a 100644
--- a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_fb5e8c() {
+void asinh_fb5e8c(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.88134765625h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_fb5e8c();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  asinh_fb5e8c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_fb5e8c();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  asinh_fb5e8c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_fb5e8c();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  asinh_fb5e8c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.spvasm
index 50f3700..c2b3318 100644
--- a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_fb5e8c "asinh_fb5e8c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_c34pn1 = OpConstant %half 0x1.c34p-1
-         %16 = OpConstantComposite %v3half %half_0x1_c34pn1 %half_0x1_c34pn1 %half_0x1_c34pn1
+         %19 = OpConstantComposite %v3half %half_0x1_c34pn1 %half_0x1_c34pn1 %half_0x1_c34pn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_fb5e8c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%asinh_fb5e8c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %asinh_fb5e8c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %asinh_fb5e8c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asinh_fb5e8c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asinh_fb5e8c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asinh_fb5e8c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asinh_fb5e8c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.wgsl
index 9187eb3..8678370 100644
--- a/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/asinh/fb5e8c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn asinh_fb5e8c() {
   var res : vec3<f16> = asinh(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_fb5e8c();
diff --git a/test/tint/builtins/gen/literal/atan/02979a.wgsl b/test/tint/builtins/gen/literal/atan/02979a.wgsl
index b0d5c0f..77309e7 100644
--- a/test/tint/builtins/gen/literal/atan/02979a.wgsl
+++ b/test/tint/builtins/gen/literal/atan/02979a.wgsl
@@ -24,7 +24,9 @@
 // fn atan(f32) -> f32
 fn atan_02979a() {
   var res: f32 = atan(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.dxc.hlsl
index 1f58ff0..1d2d3b8 100644
--- a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_02979a() {
   float res = 0.78539818525314331055f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.fxc.hlsl
index 1f58ff0..1d2d3b8 100644
--- a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_02979a() {
   float res = 0.78539818525314331055f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.glsl
index 85d99bb..9789346 100644
--- a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan_02979a() {
   float res = 0.78539818525314331055f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan_02979a() {
   float res = 0.78539818525314331055f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan_02979a() {
   float res = 0.78539818525314331055f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.msl
index 0112cf1..773decf 100644
--- a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_02979a() {
+void atan_02979a(device float* const tint_symbol_1) {
   float res = 0.78539818525314331055f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_02979a();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  atan_02979a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_02979a();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  atan_02979a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_02979a();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  atan_02979a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.spvasm
index e1d8202..68e79bb 100644
--- a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_02979a "atan_02979a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_785398185 = OpConstant %float 0.785398185
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_02979a = OpFunction %void None %9
-         %12 = OpLabel
+%atan_02979a = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_785398185
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %atan_02979a
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atan_02979a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atan_02979a
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atan_02979a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan_02979a
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan_02979a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.wgsl
index b96a3da..ab5e873 100644
--- a/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan/02979a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atan_02979a() {
   var res : f32 = atan(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_02979a();
diff --git a/test/tint/builtins/gen/literal/atan/19faea.wgsl b/test/tint/builtins/gen/literal/atan/19faea.wgsl
index 66ea29f..4d1fb8c 100644
--- a/test/tint/builtins/gen/literal/atan/19faea.wgsl
+++ b/test/tint/builtins/gen/literal/atan/19faea.wgsl
@@ -26,7 +26,9 @@
 // fn atan(vec<4, f16>) -> vec<4, f16>
 fn atan_19faea() {
   var res: vec4<f16> = atan(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.dxc.hlsl
index 216328d..063cb733 100644
--- a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_19faea() {
   vector<float16_t, 4> res = (float16_t(0.78515625h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.fxc.hlsl
index a4b9530..21f7f00 100644
--- a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_19faea() {
   vector<float16_t, 4> res = (float16_t(0.78515625h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.glsl
index 7130595..2bb8015 100644
--- a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan_19faea() {
   f16vec4 res = f16vec4(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan_19faea() {
   f16vec4 res = f16vec4(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan_19faea() {
   f16vec4 res = f16vec4(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.msl
index 0b34640..c1ffb2c 100644
--- a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_19faea() {
+void atan_19faea(device half4* const tint_symbol_1) {
   half4 res = half4(0.78515625h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_19faea();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  atan_19faea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_19faea();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  atan_19faea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_19faea();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  atan_19faea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.spvasm
index 30a969f..90bbf8c 100644
--- a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_19faea "atan_19faea"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92pn1 = OpConstant %half 0x1.92p-1
-         %16 = OpConstantComposite %v4half %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1
+         %19 = OpConstantComposite %v4half %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_19faea = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%atan_19faea = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atan_19faea
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atan_19faea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan_19faea
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan_19faea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atan_19faea
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atan_19faea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.wgsl
index b0ac4df..1560f02 100644
--- a/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan/19faea.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atan_19faea() {
   var res : vec4<f16> = atan(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_19faea();
diff --git a/test/tint/builtins/gen/literal/atan/1e1764.wgsl b/test/tint/builtins/gen/literal/atan/1e1764.wgsl
index 78b48d4..5b7f76f 100644
--- a/test/tint/builtins/gen/literal/atan/1e1764.wgsl
+++ b/test/tint/builtins/gen/literal/atan/1e1764.wgsl
@@ -26,7 +26,9 @@
 // fn atan(vec<2, f16>) -> vec<2, f16>
 fn atan_1e1764() {
   var res: vec2<f16> = atan(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.dxc.hlsl
index 05f6914..3506a79 100644
--- a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_1e1764() {
   vector<float16_t, 2> res = (float16_t(0.78515625h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.fxc.hlsl
index 4162546..547e6b7 100644
--- a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_1e1764() {
   vector<float16_t, 2> res = (float16_t(0.78515625h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.glsl
index 5b0496c..516baaa 100644
--- a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan_1e1764() {
   f16vec2 res = f16vec2(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan_1e1764() {
   f16vec2 res = f16vec2(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan_1e1764() {
   f16vec2 res = f16vec2(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.msl
index b488b7e..8be411b 100644
--- a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_1e1764() {
+void atan_1e1764(device half2* const tint_symbol_1) {
   half2 res = half2(0.78515625h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_1e1764();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  atan_1e1764(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_1e1764();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  atan_1e1764(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_1e1764();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  atan_1e1764(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.spvasm
index b557b01..db8ba17 100644
--- a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_1e1764 "atan_1e1764"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92pn1 = OpConstant %half 0x1.92p-1
-         %16 = OpConstantComposite %v2half %half_0x1_92pn1 %half_0x1_92pn1
+         %19 = OpConstantComposite %v2half %half_0x1_92pn1 %half_0x1_92pn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_1e1764 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%atan_1e1764 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atan_1e1764
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atan_1e1764
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan_1e1764
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan_1e1764
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atan_1e1764
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atan_1e1764
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.wgsl
index bf65b92..262eca8 100644
--- a/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan/1e1764.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atan_1e1764() {
   var res : vec2<f16> = atan(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_1e1764();
diff --git a/test/tint/builtins/gen/literal/atan/331e6d.wgsl b/test/tint/builtins/gen/literal/atan/331e6d.wgsl
index 1d3b8a3..153dbce 100644
--- a/test/tint/builtins/gen/literal/atan/331e6d.wgsl
+++ b/test/tint/builtins/gen/literal/atan/331e6d.wgsl
@@ -24,7 +24,9 @@
 // fn atan(vec<3, f32>) -> vec<3, f32>
 fn atan_331e6d() {
   var res: vec3<f32> = atan(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.dxc.hlsl
index 2ddd1f2..1edc4e1 100644
--- a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_331e6d() {
   float3 res = (0.78539818525314331055f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.fxc.hlsl
index 2ddd1f2..1edc4e1 100644
--- a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_331e6d() {
   float3 res = (0.78539818525314331055f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.glsl
index c3d1dbb..db4df36 100644
--- a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan_331e6d() {
   vec3 res = vec3(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan_331e6d() {
   vec3 res = vec3(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan_331e6d() {
   vec3 res = vec3(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.msl
index a505ed9..b55f57b 100644
--- a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_331e6d() {
+void atan_331e6d(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.78539818525314331055f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_331e6d();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  atan_331e6d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_331e6d();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  atan_331e6d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_331e6d();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  atan_331e6d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.spvasm
index 085901d..2b3c1679 100644
--- a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_331e6d "atan_331e6d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_785398185 = OpConstant %float 0.785398185
-         %15 = OpConstantComposite %v3float %float_0_785398185 %float_0_785398185 %float_0_785398185
+         %18 = OpConstantComposite %v3float %float_0_785398185 %float_0_785398185 %float_0_785398185
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_331e6d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%atan_331e6d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %atan_331e6d
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atan_331e6d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan_331e6d
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan_331e6d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan_331e6d
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan_331e6d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.wgsl
index ed2fba1..33e8442 100644
--- a/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan/331e6d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atan_331e6d() {
   var res : vec3<f32> = atan(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_331e6d();
diff --git a/test/tint/builtins/gen/literal/atan/5ca7b8.wgsl b/test/tint/builtins/gen/literal/atan/5ca7b8.wgsl
index 5368be1..46975d3 100644
--- a/test/tint/builtins/gen/literal/atan/5ca7b8.wgsl
+++ b/test/tint/builtins/gen/literal/atan/5ca7b8.wgsl
@@ -25,7 +25,6 @@
 fn atan_5ca7b8() {
   var res = atan(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_5ca7b8();
diff --git a/test/tint/builtins/gen/literal/atan/749e1b.wgsl b/test/tint/builtins/gen/literal/atan/749e1b.wgsl
index 63e018f..c4618da 100644
--- a/test/tint/builtins/gen/literal/atan/749e1b.wgsl
+++ b/test/tint/builtins/gen/literal/atan/749e1b.wgsl
@@ -25,7 +25,6 @@
 fn atan_749e1b() {
   var res = atan(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_749e1b();
diff --git a/test/tint/builtins/gen/literal/atan/7a2a75.wgsl b/test/tint/builtins/gen/literal/atan/7a2a75.wgsl
index f00b09c..bd1357b 100644
--- a/test/tint/builtins/gen/literal/atan/7a2a75.wgsl
+++ b/test/tint/builtins/gen/literal/atan/7a2a75.wgsl
@@ -25,7 +25,6 @@
 fn atan_7a2a75() {
   var res = atan(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_7a2a75();
diff --git a/test/tint/builtins/gen/literal/atan/a5f421.wgsl b/test/tint/builtins/gen/literal/atan/a5f421.wgsl
index 32968c9..dd8a1e0 100644
--- a/test/tint/builtins/gen/literal/atan/a5f421.wgsl
+++ b/test/tint/builtins/gen/literal/atan/a5f421.wgsl
@@ -26,7 +26,9 @@
 // fn atan(vec<3, f16>) -> vec<3, f16>
 fn atan_a5f421() {
   var res: vec3<f16> = atan(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.dxc.hlsl
index effc7b5..74deaa8 100644
--- a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a5f421() {
   vector<float16_t, 3> res = (float16_t(0.78515625h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.fxc.hlsl
index 4affda1..072a52f 100644
--- a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a5f421() {
   vector<float16_t, 3> res = (float16_t(0.78515625h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.glsl
index 85d1d52..f6ad987 100644
--- a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan_a5f421() {
   f16vec3 res = f16vec3(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan_a5f421() {
   f16vec3 res = f16vec3(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan_a5f421() {
   f16vec3 res = f16vec3(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.msl
index e28095e..de2d163 100644
--- a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_a5f421() {
+void atan_a5f421(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.78515625h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_a5f421();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  atan_a5f421(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_a5f421();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  atan_a5f421(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_a5f421();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  atan_a5f421(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.spvasm
index e7b6e05..6e5f507 100644
--- a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_a5f421 "atan_a5f421"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92pn1 = OpConstant %half 0x1.92p-1
-         %16 = OpConstantComposite %v3half %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1
+         %19 = OpConstantComposite %v3half %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_a5f421 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%atan_a5f421 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atan_a5f421
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atan_a5f421
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan_a5f421
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan_a5f421
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atan_a5f421
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atan_a5f421
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.wgsl
index 3fdca85..6536361 100644
--- a/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan/a5f421.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atan_a5f421() {
   var res : vec3<f16> = atan(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_a5f421();
diff --git a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl
index 4fe638f..850c7f7 100644
--- a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl
+++ b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl
@@ -26,7 +26,9 @@
 // fn atan(f16) -> f16
 fn atan_a7ba61() {
   var res: f16 = atan(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.dxc.hlsl
index 7917730..b7625ac 100644
--- a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a7ba61() {
   float16_t res = float16_t(0.78515625h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.fxc.hlsl
index ec6a3e9..9df345b 100644
--- a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a7ba61() {
   float16_t res = float16_t(0.78515625h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.glsl
index b1a4614..417494d7 100644
--- a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan_a7ba61() {
   float16_t res = 0.78515625hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan_a7ba61() {
   float16_t res = 0.78515625hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan_a7ba61() {
   float16_t res = 0.78515625hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.msl
index fa27251..8602298 100644
--- a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_a7ba61() {
+void atan_a7ba61(device half* const tint_symbol_1) {
   half res = 0.78515625h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_a7ba61();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  atan_a7ba61(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_a7ba61();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  atan_a7ba61(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_a7ba61();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  atan_a7ba61(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.spvasm
index 8e2d6b5..055dacd 100644
--- a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_a7ba61 "atan_a7ba61"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_92pn1 = OpConstant %half 0x1.92p-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_a7ba61 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%atan_a7ba61 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_92pn1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atan_a7ba61
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atan_a7ba61
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atan_a7ba61
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %atan_a7ba61
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %atan_a7ba61
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %atan_a7ba61
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.wgsl
index f589885..e93c4a1 100644
--- a/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan/a7ba61.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atan_a7ba61() {
   var res : f16 = atan(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_a7ba61();
diff --git a/test/tint/builtins/gen/literal/atan/a8b696.wgsl b/test/tint/builtins/gen/literal/atan/a8b696.wgsl
index 0a910aa..32dfe54 100644
--- a/test/tint/builtins/gen/literal/atan/a8b696.wgsl
+++ b/test/tint/builtins/gen/literal/atan/a8b696.wgsl
@@ -24,7 +24,9 @@
 // fn atan(vec<4, f32>) -> vec<4, f32>
 fn atan_a8b696() {
   var res: vec4<f32> = atan(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.dxc.hlsl
index 1b444ab..130342a 100644
--- a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a8b696() {
   float4 res = (0.78539818525314331055f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.fxc.hlsl
index 1b444ab..130342a 100644
--- a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a8b696() {
   float4 res = (0.78539818525314331055f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.glsl
index 21a67f4..d2a51e6 100644
--- a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan_a8b696() {
   vec4 res = vec4(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan_a8b696() {
   vec4 res = vec4(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan_a8b696() {
   vec4 res = vec4(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.msl
index e3636b0..7d62047 100644
--- a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_a8b696() {
+void atan_a8b696(device float4* const tint_symbol_1) {
   float4 res = float4(0.78539818525314331055f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_a8b696();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  atan_a8b696(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_a8b696();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  atan_a8b696(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_a8b696();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  atan_a8b696(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.spvasm
index 967379c..a1e154d 100644
--- a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_a8b696 "atan_a8b696"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_785398185 = OpConstant %float 0.785398185
-         %14 = OpConstantComposite %v4float %float_0_785398185 %float_0_785398185 %float_0_785398185 %float_0_785398185
+         %17 = OpConstantComposite %v4float %float_0_785398185 %float_0_785398185 %float_0_785398185 %float_0_785398185
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_a8b696 = OpFunction %void None %9
-         %12 = OpLabel
+%atan_a8b696 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %atan_a8b696
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %atan_a8b696
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %atan_a8b696
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %atan_a8b696
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan_a8b696
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan_a8b696
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.wgsl
index 63e2ff4..8fa1d9b 100644
--- a/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan/a8b696.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atan_a8b696() {
   var res : vec4<f32> = atan(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_a8b696();
diff --git a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl
index 821c5cb..952257d 100644
--- a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl
+++ b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl
@@ -24,7 +24,9 @@
 // fn atan(vec<2, f32>) -> vec<2, f32>
 fn atan_ad96e4() {
   var res: vec2<f32> = atan(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.dxc.hlsl
index fc396b4..3965113 100644
--- a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_ad96e4() {
   float2 res = (0.78539818525314331055f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.fxc.hlsl
index fc396b4..3965113 100644
--- a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_ad96e4() {
   float2 res = (0.78539818525314331055f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.glsl
index bac3b19..4ad9cae 100644
--- a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan_ad96e4() {
   vec2 res = vec2(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan_ad96e4() {
   vec2 res = vec2(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan_ad96e4() {
   vec2 res = vec2(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.msl
index adbe323..53187e1 100644
--- a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_ad96e4() {
+void atan_ad96e4(device float2* const tint_symbol_1) {
   float2 res = float2(0.78539818525314331055f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_ad96e4();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  atan_ad96e4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_ad96e4();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  atan_ad96e4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_ad96e4();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  atan_ad96e4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.spvasm
index b012aba..4ab5edc 100644
--- a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_ad96e4 "atan_ad96e4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_785398185 = OpConstant %float 0.785398185
-         %15 = OpConstantComposite %v2float %float_0_785398185 %float_0_785398185
+         %18 = OpConstantComposite %v2float %float_0_785398185 %float_0_785398185
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_ad96e4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%atan_ad96e4 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %atan_ad96e4
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atan_ad96e4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan_ad96e4
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan_ad96e4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan_ad96e4
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan_ad96e4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.wgsl
index 68ad03a..9727d63 100644
--- a/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan/ad96e4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atan_ad96e4() {
   var res : vec2<f32> = atan(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_ad96e4();
diff --git a/test/tint/builtins/gen/literal/atan/d17fb2.wgsl b/test/tint/builtins/gen/literal/atan/d17fb2.wgsl
index 0f2841b..5393a0b 100644
--- a/test/tint/builtins/gen/literal/atan/d17fb2.wgsl
+++ b/test/tint/builtins/gen/literal/atan/d17fb2.wgsl
@@ -25,7 +25,6 @@
 fn atan_d17fb2() {
   var res = atan(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_d17fb2();
diff --git a/test/tint/builtins/gen/literal/atan2/034ace.wgsl b/test/tint/builtins/gen/literal/atan2/034ace.wgsl
index 400f9ca..c7c4284 100644
--- a/test/tint/builtins/gen/literal/atan2/034ace.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/034ace.wgsl
@@ -25,7 +25,6 @@
 fn atan2_034ace() {
   var res = atan2(1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_034ace();
diff --git a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl
index bd3fda3..54d960f 100644
--- a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl
@@ -26,7 +26,9 @@
 // fn atan2(vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn atan2_21dfea() {
   var res: vec3<f16> = atan2(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.dxc.hlsl
index e43a600..49d886f 100644
--- a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_21dfea() {
   vector<float16_t, 3> res = (float16_t(0.78515625h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.fxc.hlsl
index 9b9446e..4079fd9 100644
--- a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_21dfea() {
   vector<float16_t, 3> res = (float16_t(0.78515625h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.glsl
index 51b0410..07006c6 100644
--- a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan2_21dfea() {
   f16vec3 res = f16vec3(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan2_21dfea() {
   f16vec3 res = f16vec3(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan2_21dfea() {
   f16vec3 res = f16vec3(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.msl
index bea4a82..bed14b5 100644
--- a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_21dfea() {
+void atan2_21dfea(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.78515625h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_21dfea();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  atan2_21dfea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_21dfea();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  atan2_21dfea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_21dfea();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  atan2_21dfea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.spvasm
index 57a1b0d..41445b9 100644
--- a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_21dfea "atan2_21dfea"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92pn1 = OpConstant %half 0x1.92p-1
-         %16 = OpConstantComposite %v3half %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1
+         %19 = OpConstantComposite %v3half %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_21dfea = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%atan2_21dfea = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atan2_21dfea
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atan2_21dfea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan2_21dfea
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan2_21dfea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atan2_21dfea
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atan2_21dfea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.wgsl
index 9e00206..6b82575 100644
--- a/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/21dfea.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atan2_21dfea() {
   var res : vec3<f16> = atan2(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_21dfea();
diff --git a/test/tint/builtins/gen/literal/atan2/3c2865.wgsl b/test/tint/builtins/gen/literal/atan2/3c2865.wgsl
index 8563293..cf30ad0 100644
--- a/test/tint/builtins/gen/literal/atan2/3c2865.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/3c2865.wgsl
@@ -25,7 +25,6 @@
 fn atan2_3c2865() {
   var res = atan2(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_3c2865();
diff --git a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl
index 2c96e0f..0fea228 100644
--- a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl
@@ -24,7 +24,9 @@
 // fn atan2(vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn atan2_57fb13() {
   var res: vec2<f32> = atan2(vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.dxc.hlsl
index 4c5a28f..86460b6 100644
--- a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_57fb13() {
   float2 res = (0.78539818525314331055f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.fxc.hlsl
index 4c5a28f..86460b6 100644
--- a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_57fb13() {
   float2 res = (0.78539818525314331055f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.glsl
index a774c1c..30c221a 100644
--- a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan2_57fb13() {
   vec2 res = vec2(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan2_57fb13() {
   vec2 res = vec2(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan2_57fb13() {
   vec2 res = vec2(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.msl
index df50917..183c8ba 100644
--- a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_57fb13() {
+void atan2_57fb13(device float2* const tint_symbol_1) {
   float2 res = float2(0.78539818525314331055f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_57fb13();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  atan2_57fb13(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_57fb13();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  atan2_57fb13(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_57fb13();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  atan2_57fb13(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.spvasm
index 8aed645..b70696a 100644
--- a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_57fb13 "atan2_57fb13"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_785398185 = OpConstant %float 0.785398185
-         %15 = OpConstantComposite %v2float %float_0_785398185 %float_0_785398185
+         %18 = OpConstantComposite %v2float %float_0_785398185 %float_0_785398185
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_57fb13 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%atan2_57fb13 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %atan2_57fb13
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atan2_57fb13
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan2_57fb13
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan2_57fb13
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan2_57fb13
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan2_57fb13
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.wgsl
index 027f578..d6e1279 100644
--- a/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/57fb13.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atan2_57fb13() {
   var res : vec2<f32> = atan2(vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_57fb13();
diff --git a/test/tint/builtins/gen/literal/atan2/93febc.wgsl b/test/tint/builtins/gen/literal/atan2/93febc.wgsl
index 26219a8..bd72b60 100644
--- a/test/tint/builtins/gen/literal/atan2/93febc.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/93febc.wgsl
@@ -26,7 +26,9 @@
 // fn atan2(vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn atan2_93febc() {
   var res: vec2<f16> = atan2(vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.dxc.hlsl
index 8c872a0..0967fbb 100644
--- a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_93febc() {
   vector<float16_t, 2> res = (float16_t(0.78515625h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.fxc.hlsl
index 7b66cdf..36ef2c7 100644
--- a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_93febc() {
   vector<float16_t, 2> res = (float16_t(0.78515625h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.glsl
index a3692f6..d5907f6 100644
--- a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan2_93febc() {
   f16vec2 res = f16vec2(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan2_93febc() {
   f16vec2 res = f16vec2(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan2_93febc() {
   f16vec2 res = f16vec2(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.msl
index 1c73f44..046354d 100644
--- a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_93febc() {
+void atan2_93febc(device half2* const tint_symbol_1) {
   half2 res = half2(0.78515625h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_93febc();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  atan2_93febc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_93febc();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  atan2_93febc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_93febc();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  atan2_93febc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.spvasm
index 40fbed8..133fe3e 100644
--- a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_93febc "atan2_93febc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92pn1 = OpConstant %half 0x1.92p-1
-         %16 = OpConstantComposite %v2half %half_0x1_92pn1 %half_0x1_92pn1
+         %19 = OpConstantComposite %v2half %half_0x1_92pn1 %half_0x1_92pn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_93febc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%atan2_93febc = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atan2_93febc
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atan2_93febc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan2_93febc
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan2_93febc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atan2_93febc
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atan2_93febc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.wgsl
index bc501ed..a8768fe 100644
--- a/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/93febc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atan2_93febc() {
   var res : vec2<f16> = atan2(vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_93febc();
diff --git a/test/tint/builtins/gen/literal/atan2/96057c.wgsl b/test/tint/builtins/gen/literal/atan2/96057c.wgsl
index 462ff08..20d0f2b 100644
--- a/test/tint/builtins/gen/literal/atan2/96057c.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/96057c.wgsl
@@ -24,7 +24,9 @@
 // fn atan2(f32, f32) -> f32
 fn atan2_96057c() {
   var res: f32 = atan2(1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.dxc.hlsl
index 3f5ad15..4cff46c 100644
--- a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_96057c() {
   float res = 0.78539818525314331055f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.fxc.hlsl
index 3f5ad15..4cff46c 100644
--- a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_96057c() {
   float res = 0.78539818525314331055f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.glsl
index a55d862..1b913bc 100644
--- a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan2_96057c() {
   float res = 0.78539818525314331055f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan2_96057c() {
   float res = 0.78539818525314331055f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan2_96057c() {
   float res = 0.78539818525314331055f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.msl
index 4f5806a..3045e9d 100644
--- a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_96057c() {
+void atan2_96057c(device float* const tint_symbol_1) {
   float res = 0.78539818525314331055f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_96057c();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  atan2_96057c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_96057c();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  atan2_96057c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_96057c();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  atan2_96057c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.spvasm
index 6314939..f5ed52f 100644
--- a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_96057c "atan2_96057c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_785398185 = OpConstant %float 0.785398185
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_96057c = OpFunction %void None %9
-         %12 = OpLabel
+%atan2_96057c = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_785398185
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %atan2_96057c
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atan2_96057c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atan2_96057c
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atan2_96057c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan2_96057c
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan2_96057c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.wgsl
index ab7825e..7d9be1a 100644
--- a/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/96057c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atan2_96057c() {
   var res : f32 = atan2(1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_96057c();
diff --git a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl
index 7d3418f..1176e49 100644
--- a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl
@@ -24,7 +24,9 @@
 // fn atan2(vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn atan2_a70d0d() {
   var res: vec3<f32> = atan2(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.dxc.hlsl
index 603b203..3c575d4 100644
--- a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_a70d0d() {
   float3 res = (0.78539818525314331055f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.fxc.hlsl
index 603b203..3c575d4 100644
--- a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_a70d0d() {
   float3 res = (0.78539818525314331055f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.glsl
index 27a20ac..43d438d 100644
--- a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan2_a70d0d() {
   vec3 res = vec3(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan2_a70d0d() {
   vec3 res = vec3(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan2_a70d0d() {
   vec3 res = vec3(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.msl
index b2d9b60..571bc6a 100644
--- a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_a70d0d() {
+void atan2_a70d0d(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.78539818525314331055f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_a70d0d();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  atan2_a70d0d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_a70d0d();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  atan2_a70d0d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_a70d0d();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  atan2_a70d0d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.spvasm
index e5d3081..258a994 100644
--- a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_a70d0d "atan2_a70d0d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_785398185 = OpConstant %float 0.785398185
-         %15 = OpConstantComposite %v3float %float_0_785398185 %float_0_785398185 %float_0_785398185
+         %18 = OpConstantComposite %v3float %float_0_785398185 %float_0_785398185 %float_0_785398185
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_a70d0d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%atan2_a70d0d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %atan2_a70d0d
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atan2_a70d0d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan2_a70d0d
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan2_a70d0d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan2_a70d0d
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan2_a70d0d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.wgsl
index 2195128..4354922 100644
--- a/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/a70d0d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atan2_a70d0d() {
   var res : vec3<f32> = atan2(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_a70d0d();
diff --git a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl
index 6dce175..c642e66 100644
--- a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl
@@ -24,7 +24,9 @@
 // fn atan2(vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn atan2_ae713e() {
   var res: vec4<f32> = atan2(vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.dxc.hlsl
index 0b86fe8..0faff85 100644
--- a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_ae713e() {
   float4 res = (0.78539818525314331055f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.fxc.hlsl
index 0b86fe8..0faff85 100644
--- a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_ae713e() {
   float4 res = (0.78539818525314331055f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.glsl
index d511e37..7f71b65 100644
--- a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan2_ae713e() {
   vec4 res = vec4(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan2_ae713e() {
   vec4 res = vec4(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan2_ae713e() {
   vec4 res = vec4(0.78539818525314331055f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.msl
index 3ec89eb..593428c 100644
--- a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_ae713e() {
+void atan2_ae713e(device float4* const tint_symbol_1) {
   float4 res = float4(0.78539818525314331055f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_ae713e();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  atan2_ae713e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_ae713e();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  atan2_ae713e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_ae713e();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  atan2_ae713e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.spvasm
index cb43b9d..fe69893 100644
--- a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_ae713e "atan2_ae713e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_785398185 = OpConstant %float 0.785398185
-         %14 = OpConstantComposite %v4float %float_0_785398185 %float_0_785398185 %float_0_785398185 %float_0_785398185
+         %17 = OpConstantComposite %v4float %float_0_785398185 %float_0_785398185 %float_0_785398185 %float_0_785398185
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_ae713e = OpFunction %void None %9
-         %12 = OpLabel
+%atan2_ae713e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %atan2_ae713e
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %atan2_ae713e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %atan2_ae713e
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %atan2_ae713e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan2_ae713e
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan2_ae713e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.wgsl
index 9565523..7f6fcc1 100644
--- a/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/ae713e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atan2_ae713e() {
   var res : vec4<f32> = atan2(vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_ae713e();
diff --git a/test/tint/builtins/gen/literal/atan2/c19683.wgsl b/test/tint/builtins/gen/literal/atan2/c19683.wgsl
index efca3ab..6464b1c 100644
--- a/test/tint/builtins/gen/literal/atan2/c19683.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/c19683.wgsl
@@ -25,7 +25,6 @@
 fn atan2_c19683() {
   var res = atan2(vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_c19683();
diff --git a/test/tint/builtins/gen/literal/atan2/c4be45.wgsl b/test/tint/builtins/gen/literal/atan2/c4be45.wgsl
index 9afdfaa..7fbca70 100644
--- a/test/tint/builtins/gen/literal/atan2/c4be45.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/c4be45.wgsl
@@ -25,7 +25,6 @@
 fn atan2_c4be45() {
   var res = atan2(vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_c4be45();
diff --git a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl
index 06f7c6b..217ceb1 100644
--- a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl
@@ -26,7 +26,9 @@
 // fn atan2(f16, f16) -> f16
 fn atan2_ca698e() {
   var res: f16 = atan2(1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.dxc.hlsl
index f6e9588..67c30d0 100644
--- a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_ca698e() {
   float16_t res = float16_t(0.78515625h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.fxc.hlsl
index 5a48a71..cddfc87 100644
--- a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_ca698e() {
   float16_t res = float16_t(0.78515625h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.glsl
index 244e8eb..0239769 100644
--- a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan2_ca698e() {
   float16_t res = 0.78515625hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan2_ca698e() {
   float16_t res = 0.78515625hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan2_ca698e() {
   float16_t res = 0.78515625hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.msl
index a875213..e5d706a 100644
--- a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_ca698e() {
+void atan2_ca698e(device half* const tint_symbol_1) {
   half res = 0.78515625h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_ca698e();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  atan2_ca698e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_ca698e();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  atan2_ca698e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_ca698e();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  atan2_ca698e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.spvasm
index dee8585..48454f8 100644
--- a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_ca698e "atan2_ca698e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_92pn1 = OpConstant %half 0x1.92p-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_ca698e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%atan2_ca698e = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_92pn1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atan2_ca698e
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atan2_ca698e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atan2_ca698e
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %atan2_ca698e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %atan2_ca698e
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %atan2_ca698e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.wgsl
index 26f362d..dbd49af 100644
--- a/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/ca698e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atan2_ca698e() {
   var res : f16 = atan2(1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_ca698e();
diff --git a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl
index c4f18a7..cdd799f 100644
--- a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl
@@ -26,7 +26,9 @@
 // fn atan2(vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn atan2_d983ab() {
   var res: vec4<f16> = atan2(vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.dxc.hlsl
index 12db579..645da70 100644
--- a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_d983ab() {
   vector<float16_t, 4> res = (float16_t(0.78515625h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.fxc.hlsl
index 45ba1c9..7000a07 100644
--- a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_d983ab() {
   vector<float16_t, 4> res = (float16_t(0.78515625h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.glsl
index 0c70c90..8d2a75d 100644
--- a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan2_d983ab() {
   f16vec4 res = f16vec4(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan2_d983ab() {
   f16vec4 res = f16vec4(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan2_d983ab() {
   f16vec4 res = f16vec4(0.78515625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.msl
index dbd659f..f59d80e 100644
--- a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_d983ab() {
+void atan2_d983ab(device half4* const tint_symbol_1) {
   half4 res = half4(0.78515625h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_d983ab();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  atan2_d983ab(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_d983ab();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  atan2_d983ab(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_d983ab();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  atan2_d983ab(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.spvasm
index d0060ea..09c16f6 100644
--- a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_d983ab "atan2_d983ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92pn1 = OpConstant %half 0x1.92p-1
-         %16 = OpConstantComposite %v4half %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1
+         %19 = OpConstantComposite %v4half %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1 %half_0x1_92pn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_d983ab = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%atan2_d983ab = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atan2_d983ab
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atan2_d983ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan2_d983ab
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan2_d983ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atan2_d983ab
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atan2_d983ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.wgsl
index 29a290c..408eead 100644
--- a/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atan2/d983ab.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atan2_d983ab() {
   var res : vec4<f16> = atan2(vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_d983ab();
diff --git a/test/tint/builtins/gen/literal/atanh/440cca.wgsl b/test/tint/builtins/gen/literal/atanh/440cca.wgsl
index 2ed2e89..225bfc6 100644
--- a/test/tint/builtins/gen/literal/atanh/440cca.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/440cca.wgsl
@@ -24,7 +24,9 @@
 // fn atanh(vec<3, f32>) -> vec<3, f32>
 fn atanh_440cca() {
   var res: vec3<f32> = atanh(vec3<f32>(0.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.dxc.hlsl
index 9886e9a..21fe1e9 100644
--- a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_440cca() {
   float3 res = (0.54930615425109863281f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.fxc.hlsl
index 9886e9a..21fe1e9 100644
--- a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_440cca() {
   float3 res = (0.54930615425109863281f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.glsl
index 113da45..9b2b355 100644
--- a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atanh_440cca() {
   vec3 res = vec3(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atanh_440cca() {
   vec3 res = vec3(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atanh_440cca() {
   vec3 res = vec3(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.msl b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.msl
index 079c92e..ca233c6 100644
--- a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atanh_440cca() {
+void atanh_440cca(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.54930615425109863281f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_440cca();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  atanh_440cca(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_440cca();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  atanh_440cca(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_440cca();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  atanh_440cca(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.spvasm
index 540ebee..358a03b 100644
--- a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atanh_440cca "atanh_440cca"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_549306154 = OpConstant %float 0.549306154
-         %15 = OpConstantComposite %v3float %float_0_549306154 %float_0_549306154 %float_0_549306154
+         %18 = OpConstantComposite %v3float %float_0_549306154 %float_0_549306154 %float_0_549306154
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atanh_440cca = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%atanh_440cca = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %atanh_440cca
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atanh_440cca
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atanh_440cca
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atanh_440cca
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atanh_440cca
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atanh_440cca
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.wgsl
index f340950..f4c1bc7 100644
--- a/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/440cca.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atanh_440cca() {
   var res : vec3<f32> = atanh(vec3<f32>(0.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_440cca();
diff --git a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl
index 7dd84b6..36bdd4c 100644
--- a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl
@@ -26,7 +26,9 @@
 // fn atanh(vec<2, f16>) -> vec<2, f16>
 fn atanh_5bf88d() {
   var res: vec2<f16> = atanh(vec2<f16>(0.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.dxc.hlsl
index f50d739..42aec88 100644
--- a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_5bf88d() {
   vector<float16_t, 2> res = (float16_t(0.548828125h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.fxc.hlsl
index 21ae74d..25d3344 100644
--- a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_5bf88d() {
   vector<float16_t, 2> res = (float16_t(0.548828125h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.glsl
index 2b14c65e..4790ecf 100644
--- a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atanh_5bf88d() {
   f16vec2 res = f16vec2(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atanh_5bf88d() {
   f16vec2 res = f16vec2(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atanh_5bf88d() {
   f16vec2 res = f16vec2(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.msl b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.msl
index 142f58e..0e926aa 100644
--- a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atanh_5bf88d() {
+void atanh_5bf88d(device half2* const tint_symbol_1) {
   half2 res = half2(0.548828125h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_5bf88d();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  atanh_5bf88d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_5bf88d();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  atanh_5bf88d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_5bf88d();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  atanh_5bf88d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.spvasm
index 3bc631f..1f2a704 100644
--- a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atanh_5bf88d "atanh_5bf88d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_19pn1 = OpConstant %half 0x1.19p-1
-         %16 = OpConstantComposite %v2half %half_0x1_19pn1 %half_0x1_19pn1
+         %19 = OpConstantComposite %v2half %half_0x1_19pn1 %half_0x1_19pn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atanh_5bf88d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%atanh_5bf88d = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atanh_5bf88d
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atanh_5bf88d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atanh_5bf88d
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atanh_5bf88d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atanh_5bf88d
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atanh_5bf88d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.wgsl
index a4f24f6..5a5ff3a 100644
--- a/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/5bf88d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atanh_5bf88d() {
   var res : vec2<f16> = atanh(vec2<f16>(0.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_5bf88d();
diff --git a/test/tint/builtins/gen/literal/atanh/70d5bd.wgsl b/test/tint/builtins/gen/literal/atanh/70d5bd.wgsl
index 16d99bf..d4afd81 100644
--- a/test/tint/builtins/gen/literal/atanh/70d5bd.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/70d5bd.wgsl
@@ -25,7 +25,6 @@
 fn atanh_70d5bd() {
   var res = atanh(vec2(0.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_70d5bd();
diff --git a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl
index a2c969a..bc56f13 100644
--- a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl
@@ -24,7 +24,9 @@
 // fn atanh(f32) -> f32
 fn atanh_7997d8() {
   var res: f32 = atanh(0.5f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.dxc.hlsl
index eda280b..0e08b5e 100644
--- a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_7997d8() {
   float res = 0.54930615425109863281f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.fxc.hlsl
index eda280b..0e08b5e 100644
--- a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_7997d8() {
   float res = 0.54930615425109863281f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.glsl
index c084125..f1e0815 100644
--- a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atanh_7997d8() {
   float res = 0.54930615425109863281f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atanh_7997d8() {
   float res = 0.54930615425109863281f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atanh_7997d8() {
   float res = 0.54930615425109863281f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.msl
index 0caba9a..f072c5e 100644
--- a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atanh_7997d8() {
+void atanh_7997d8(device float* const tint_symbol_1) {
   float res = 0.54930615425109863281f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_7997d8();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  atanh_7997d8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_7997d8();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  atanh_7997d8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_7997d8();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  atanh_7997d8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.spvasm
index 7bde138..6fc289f 100644
--- a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atanh_7997d8 "atanh_7997d8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_549306154 = OpConstant %float 0.549306154
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atanh_7997d8 = OpFunction %void None %9
-         %12 = OpLabel
+%atanh_7997d8 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_549306154
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %atanh_7997d8
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atanh_7997d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atanh_7997d8
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atanh_7997d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atanh_7997d8
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atanh_7997d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.wgsl
index c395d17..7c50e36 100644
--- a/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/7997d8.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atanh_7997d8() {
   var res : f32 = atanh(0.5f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_7997d8();
diff --git a/test/tint/builtins/gen/literal/atanh/7f2874.wgsl b/test/tint/builtins/gen/literal/atanh/7f2874.wgsl
index bdf04750..90f78b0 100644
--- a/test/tint/builtins/gen/literal/atanh/7f2874.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/7f2874.wgsl
@@ -25,7 +25,6 @@
 fn atanh_7f2874() {
   var res = atanh(vec3(0.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_7f2874();
diff --git a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl
index 26654e7..6e4a462 100644
--- a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl
@@ -24,7 +24,9 @@
 // fn atanh(vec<2, f32>) -> vec<2, f32>
 fn atanh_c0e634() {
   var res: vec2<f32> = atanh(vec2<f32>(0.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.dxc.hlsl
index 0db252c..67d4b6c 100644
--- a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_c0e634() {
   float2 res = (0.54930615425109863281f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.fxc.hlsl
index 0db252c..67d4b6c 100644
--- a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_c0e634() {
   float2 res = (0.54930615425109863281f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.glsl
index ffa9cf4..3d1870d 100644
--- a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atanh_c0e634() {
   vec2 res = vec2(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atanh_c0e634() {
   vec2 res = vec2(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atanh_c0e634() {
   vec2 res = vec2(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.msl b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.msl
index 59f2617..4d6dd5b 100644
--- a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atanh_c0e634() {
+void atanh_c0e634(device float2* const tint_symbol_1) {
   float2 res = float2(0.54930615425109863281f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_c0e634();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  atanh_c0e634(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_c0e634();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  atanh_c0e634(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_c0e634();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  atanh_c0e634(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.spvasm
index 28434f1..af9282c 100644
--- a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atanh_c0e634 "atanh_c0e634"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_549306154 = OpConstant %float 0.549306154
-         %15 = OpConstantComposite %v2float %float_0_549306154 %float_0_549306154
+         %18 = OpConstantComposite %v2float %float_0_549306154 %float_0_549306154
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atanh_c0e634 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%atanh_c0e634 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %atanh_c0e634
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atanh_c0e634
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atanh_c0e634
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atanh_c0e634
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atanh_c0e634
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atanh_c0e634
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.wgsl
index d8285dc..c333c3d 100644
--- a/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/c0e634.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atanh_c0e634() {
   var res : vec2<f32> = atanh(vec2<f32>(0.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_c0e634();
diff --git a/test/tint/builtins/gen/literal/atanh/c5dc32.wgsl b/test/tint/builtins/gen/literal/atanh/c5dc32.wgsl
index 0905a40..cf626f2 100644
--- a/test/tint/builtins/gen/literal/atanh/c5dc32.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/c5dc32.wgsl
@@ -25,7 +25,6 @@
 fn atanh_c5dc32() {
   var res = atanh(0.5);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_c5dc32();
diff --git a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl
index f3d7acd..8079a9b 100644
--- a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl
@@ -26,7 +26,9 @@
 // fn atanh(f16) -> f16
 fn atanh_d2d8cd() {
   var res: f16 = atanh(0.5h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.dxc.hlsl
index a915f4e..05c1f71 100644
--- a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_d2d8cd() {
   float16_t res = float16_t(0.548828125h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.fxc.hlsl
index 4837df2..a114fdc 100644
--- a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_d2d8cd() {
   float16_t res = float16_t(0.548828125h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.glsl
index 7d40b3a..cb0922e 100644
--- a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atanh_d2d8cd() {
   float16_t res = 0.548828125hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atanh_d2d8cd() {
   float16_t res = 0.548828125hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atanh_d2d8cd() {
   float16_t res = 0.548828125hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.msl b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.msl
index fecb05d..896430e 100644
--- a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atanh_d2d8cd() {
+void atanh_d2d8cd(device half* const tint_symbol_1) {
   half res = 0.548828125h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_d2d8cd();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  atanh_d2d8cd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_d2d8cd();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  atanh_d2d8cd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_d2d8cd();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  atanh_d2d8cd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.spvasm
index 3cf767b..89d21e4 100644
--- a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atanh_d2d8cd "atanh_d2d8cd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_19pn1 = OpConstant %half 0x1.19p-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atanh_d2d8cd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%atanh_d2d8cd = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_19pn1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atanh_d2d8cd
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atanh_d2d8cd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atanh_d2d8cd
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %atanh_d2d8cd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %atanh_d2d8cd
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %atanh_d2d8cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.wgsl
index a71dd50..6609fab 100644
--- a/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/d2d8cd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atanh_d2d8cd() {
   var res : f16 = atanh(0.5h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_d2d8cd();
diff --git a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl
index 5cdfb19..fde2871 100644
--- a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl
@@ -26,7 +26,9 @@
 // fn atanh(vec<4, f16>) -> vec<4, f16>
 fn atanh_e3b450() {
   var res: vec4<f16> = atanh(vec4<f16>(0.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.dxc.hlsl
index ddfc0ce..cf88ff7 100644
--- a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_e3b450() {
   vector<float16_t, 4> res = (float16_t(0.548828125h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.fxc.hlsl
index 14e2310..798352a 100644
--- a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_e3b450() {
   vector<float16_t, 4> res = (float16_t(0.548828125h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.glsl
index 6f61acd..f733650 100644
--- a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atanh_e3b450() {
   f16vec4 res = f16vec4(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atanh_e3b450() {
   f16vec4 res = f16vec4(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atanh_e3b450() {
   f16vec4 res = f16vec4(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.msl b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.msl
index 585ed1c..3336a24 100644
--- a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atanh_e3b450() {
+void atanh_e3b450(device half4* const tint_symbol_1) {
   half4 res = half4(0.548828125h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_e3b450();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  atanh_e3b450(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_e3b450();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  atanh_e3b450(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_e3b450();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  atanh_e3b450(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.spvasm
index 38694bb..0f6b7d1 100644
--- a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atanh_e3b450 "atanh_e3b450"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_19pn1 = OpConstant %half 0x1.19p-1
-         %16 = OpConstantComposite %v4half %half_0x1_19pn1 %half_0x1_19pn1 %half_0x1_19pn1 %half_0x1_19pn1
+         %19 = OpConstantComposite %v4half %half_0x1_19pn1 %half_0x1_19pn1 %half_0x1_19pn1 %half_0x1_19pn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atanh_e3b450 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%atanh_e3b450 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atanh_e3b450
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atanh_e3b450
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atanh_e3b450
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atanh_e3b450
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atanh_e3b450
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atanh_e3b450
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.wgsl
index a2b2337..e89cd51 100644
--- a/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/e3b450.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atanh_e3b450() {
   var res : vec4<f16> = atanh(vec4<f16>(0.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_e3b450();
diff --git a/test/tint/builtins/gen/literal/atanh/e431bb.wgsl b/test/tint/builtins/gen/literal/atanh/e431bb.wgsl
index fc29d4e..33d072e 100644
--- a/test/tint/builtins/gen/literal/atanh/e431bb.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/e431bb.wgsl
@@ -25,7 +25,6 @@
 fn atanh_e431bb() {
   var res = atanh(vec4(0.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_e431bb();
diff --git a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl
index 3995aab..a9c927b 100644
--- a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl
@@ -26,7 +26,9 @@
 // fn atanh(vec<3, f16>) -> vec<3, f16>
 fn atanh_ec4b06() {
   var res: vec3<f16> = atanh(vec3<f16>(0.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.dxc.hlsl
index a7a9231..4dd8f89 100644
--- a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_ec4b06() {
   vector<float16_t, 3> res = (float16_t(0.548828125h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.fxc.hlsl
index fca7c3e..f34da43 100644
--- a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_ec4b06() {
   vector<float16_t, 3> res = (float16_t(0.548828125h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.glsl
index a9cbf80..9099819 100644
--- a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atanh_ec4b06() {
   f16vec3 res = f16vec3(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atanh_ec4b06() {
   f16vec3 res = f16vec3(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atanh_ec4b06() {
   f16vec3 res = f16vec3(0.548828125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.msl b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.msl
index 5154b8c..1ed0864 100644
--- a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atanh_ec4b06() {
+void atanh_ec4b06(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.548828125h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_ec4b06();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  atanh_ec4b06(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_ec4b06();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  atanh_ec4b06(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_ec4b06();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  atanh_ec4b06(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.spvasm
index 9842aa3..2bded27 100644
--- a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atanh_ec4b06 "atanh_ec4b06"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_19pn1 = OpConstant %half 0x1.19p-1
-         %16 = OpConstantComposite %v3half %half_0x1_19pn1 %half_0x1_19pn1 %half_0x1_19pn1
+         %19 = OpConstantComposite %v3half %half_0x1_19pn1 %half_0x1_19pn1 %half_0x1_19pn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atanh_ec4b06 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%atanh_ec4b06 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atanh_ec4b06
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atanh_ec4b06
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atanh_ec4b06
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atanh_ec4b06
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atanh_ec4b06
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atanh_ec4b06
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.wgsl
index 26a5c3b..d66e83a 100644
--- a/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/ec4b06.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atanh_ec4b06() {
   var res : vec3<f16> = atanh(vec3<f16>(0.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_ec4b06();
diff --git a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl
index f9b0d0c..895713b 100644
--- a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl
@@ -24,7 +24,9 @@
 // fn atanh(vec<4, f32>) -> vec<4, f32>
 fn atanh_f3e01b() {
   var res: vec4<f32> = atanh(vec4<f32>(0.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.dxc.hlsl
index 8a89d13..62f78b3 100644
--- a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_f3e01b() {
   float4 res = (0.54930615425109863281f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.fxc.hlsl
index 8a89d13..62f78b3 100644
--- a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_f3e01b() {
   float4 res = (0.54930615425109863281f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.glsl
index 0b3dcbe..66bcd82 100644
--- a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atanh_f3e01b() {
   vec4 res = vec4(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atanh_f3e01b() {
   vec4 res = vec4(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atanh_f3e01b() {
   vec4 res = vec4(0.54930615425109863281f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.msl b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.msl
index a86f707..e24db01 100644
--- a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atanh_f3e01b() {
+void atanh_f3e01b(device float4* const tint_symbol_1) {
   float4 res = float4(0.54930615425109863281f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_f3e01b();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  atanh_f3e01b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_f3e01b();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  atanh_f3e01b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_f3e01b();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  atanh_f3e01b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.spvasm
index 2335ace..d58d91d 100644
--- a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atanh_f3e01b "atanh_f3e01b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_549306154 = OpConstant %float 0.549306154
-         %14 = OpConstantComposite %v4float %float_0_549306154 %float_0_549306154 %float_0_549306154 %float_0_549306154
+         %17 = OpConstantComposite %v4float %float_0_549306154 %float_0_549306154 %float_0_549306154 %float_0_549306154
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atanh_f3e01b = OpFunction %void None %9
-         %12 = OpLabel
+%atanh_f3e01b = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %atanh_f3e01b
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %atanh_f3e01b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %atanh_f3e01b
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %atanh_f3e01b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atanh_f3e01b
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atanh_f3e01b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.wgsl
index 23096b4..3259549 100644
--- a/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atanh/f3e01b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn atanh_f3e01b() {
   var res : vec4<f32> = atanh(vec4<f32>(0.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_f3e01b();
diff --git a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl
index c0fe308..85c045a 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl
@@ -25,7 +25,9 @@
 // fn atomicAdd(ptr<workgroup, atomic<i32>, read_write>, i32) -> i32
 fn atomicAdd_794055() {
   var res: i32 = atomicAdd(&arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.dxc.hlsl
index 1663280..7a6c109 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAdd_794055() {
   int atomic_result = 0;
   InterlockedAdd(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.fxc.hlsl
index 1663280..7a6c109 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAdd_794055() {
   int atomic_result = 0;
   InterlockedAdd(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.glsl
index 9aa5fd0..3e14d5d 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAdd_794055() {
   int res = atomicAdd(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.msl
index dca123c..c1a7b83 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicAdd_794055(threadgroup atomic_int* const tint_symbol) {
+void atomicAdd_794055(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_add_explicit(tint_symbol, 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicAdd_794055(tint_symbol_1);
+  atomicAdd_794055(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.spvasm
index d8903dc..530bc99 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,45 +9,59 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAdd_794055 "atomicAdd_794055"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %18 = OpConstantNull %int
-         %19 = OpTypeFunction %void %uint
+         %21 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicAdd_794055 = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %18
-         %11 = OpAtomicIAdd %int %arg_0 %uint_2 %uint_0 %int_1
-               OpStore %res %11
+%atomicAdd_794055 = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %21
+         %14 = OpAtomicIAdd %int %arg_0 %uint_2 %uint_0 %int_1
+               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %19
+%compute_main_inner = OpFunction %void None %25
 %local_invocation_index = OpFunctionParameter %uint
-         %22 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %18
+         %28 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %21
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %atomicAdd_794055
+         %33 = OpFunctionCall %void %atomicAdd_794055
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %10
+         %35 = OpLabel
+         %37 = OpLoad %uint %local_invocation_index_1
+         %36 = OpFunctionCall %void %compute_main_inner %37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.wgsl
index 92fbdcb..40e35df 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicAdd_794055() {
   var res : i32 = atomicAdd(&(arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicAdd_794055();
diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl
index dbf0d32..20d94c4 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl
@@ -28,7 +28,9 @@
 // fn atomicAdd(ptr<storage, atomic<u32>, read_write>, u32) -> u32
 fn atomicAdd_8a199a() {
   var res: u32 = atomicAdd(&sb_rw.arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.dxc.hlsl
index 21cb963..48bb847 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAdd_8a199a() {
   uint res = sb_rwatomicAdd(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.fxc.hlsl
index 21cb963..48bb847 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAdd_8a199a() {
   uint res = sb_rwatomicAdd(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.glsl
index 2eb8995..d2e3068 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAdd_8a199a() {
   uint res = atomicAdd(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAdd_8a199a() {
   uint res = atomicAdd(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.msl
index 4e58d98..ee04e07 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicAdd_8a199a(device SB_RW* const tint_symbol) {
+void atomicAdd_8a199a(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_add_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicAdd_8a199a(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicAdd_8a199a(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicAdd_8a199a(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicAdd_8a199a(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.spvasm
index 76f0c18..6a1b586 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAdd_8a199a "atomicAdd_8a199a"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicAdd_8a199a = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicIAdd %uint %15 %uint_1 %uint_0 %uint_1
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicAdd_8a199a = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicIAdd %uint %18 %uint_1 %uint_0 %uint_1
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicAdd_8a199a
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicAdd_8a199a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicAdd_8a199a
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicAdd_8a199a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.wgsl
index 973ffe2..c45499d 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicAdd_8a199a() {
   var res : u32 = atomicAdd(&(sb_rw.arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicAdd_8a199a();
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl
index 040364f..5b106d3 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl
@@ -28,7 +28,9 @@
 // fn atomicAdd(ptr<storage, atomic<i32>, read_write>, i32) -> i32
 fn atomicAdd_d32fe4() {
   var res: i32 = atomicAdd(&sb_rw.arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl
index 9ce9c65..dd7a726 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAdd_d32fe4() {
   int res = sb_rwatomicAdd(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl
index 9ce9c65..dd7a726 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAdd_d32fe4() {
   int res = sb_rwatomicAdd(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.glsl
index e2bf8cb..74e49c9 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAdd_d32fe4() {
   int res = atomicAdd(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAdd_d32fe4() {
   int res = atomicAdd(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.msl
index e6c84ae..c46cc7b 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicAdd_d32fe4(device SB_RW* const tint_symbol) {
+void atomicAdd_d32fe4(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_add_explicit(&((*(tint_symbol)).arg_0), 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicAdd_d32fe4(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicAdd_d32fe4(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicAdd_d32fe4(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicAdd_d32fe4(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.spvasm
index 05c1059..7f29f8c 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAdd_d32fe4 "atomicAdd_d32fe4"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,35 +26,46 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-%atomicAdd_d32fe4 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %20
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicIAdd %int %16 %uint_1 %uint_0 %int_1
-               OpStore %res %10
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicAdd_d32fe4 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %23
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicIAdd %int %19 %uint_1 %uint_0 %int_1
+               OpStore %res %13
+         %25 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicAdd_d32fe4
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicAdd_d32fe4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicAdd_d32fe4
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicAdd_d32fe4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.wgsl
index 7e8d047..d63440b 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicAdd_d32fe4() {
   var res : i32 = atomicAdd(&(sb_rw.arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicAdd_d32fe4();
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl
index 93a8c26..07c33aa 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl
@@ -25,7 +25,9 @@
 // fn atomicAdd(ptr<workgroup, atomic<u32>, read_write>, u32) -> u32
 fn atomicAdd_d5db1d() {
   var res: u32 = atomicAdd(&arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.dxc.hlsl
index 9429101..8128c3c 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAdd_d5db1d() {
   uint atomic_result = 0u;
   InterlockedAdd(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.fxc.hlsl
index 9429101..8128c3c 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAdd_d5db1d() {
   uint atomic_result = 0u;
   InterlockedAdd(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.glsl
index 58c0191..68fbe8b 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAdd_d5db1d() {
   uint res = atomicAdd(arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.msl
index 3d80f24..7f3e70d 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicAdd_d5db1d(threadgroup atomic_uint* const tint_symbol) {
+void atomicAdd_d5db1d(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_add_explicit(tint_symbol, 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicAdd_d5db1d(tint_symbol_1);
+  atomicAdd_d5db1d(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.spvasm
index 110fb42..f9ffeba 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAdd_d5db1d "atomicAdd_d5db1d"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicAdd_d5db1d = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
-         %10 = OpAtomicIAdd %uint %arg_0 %uint_2 %uint_0 %uint_1
-               OpStore %res %10
+%atomicAdd_d5db1d = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
+         %13 = OpAtomicIAdd %uint %arg_0 %uint_2 %uint_0 %uint_1
+               OpStore %res %13
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicAdd_d5db1d
+         %32 = OpFunctionCall %void %atomicAdd_d5db1d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %9
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.wgsl
index 22b1fbb..cd0b457 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicAdd_d5db1d() {
   var res : u32 = atomicAdd(&(arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicAdd_d5db1d();
diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl
index 4db2cd6..f192d7b 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl
@@ -28,7 +28,9 @@
 // fn atomicAnd(ptr<storage, atomic<i32>, read_write>, i32) -> i32
 fn atomicAnd_152966() {
   var res: i32 = atomicAnd(&sb_rw.arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.dxc.hlsl
index c56fa04..aef5e34 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAnd_152966() {
   int res = sb_rwatomicAnd(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.fxc.hlsl
index c56fa04..aef5e34 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAnd_152966() {
   int res = sb_rwatomicAnd(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.glsl
index 9a0182c..62d9313 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAnd_152966() {
   int res = atomicAnd(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAnd_152966() {
   int res = atomicAnd(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.msl
index 0205287..ec79e64 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicAnd_152966(device SB_RW* const tint_symbol) {
+void atomicAnd_152966(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_and_explicit(&((*(tint_symbol)).arg_0), 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicAnd_152966(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicAnd_152966(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicAnd_152966(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicAnd_152966(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.spvasm
index 7c9d531..31799a4 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAnd_152966 "atomicAnd_152966"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,35 +26,46 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-%atomicAnd_152966 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %20
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicAnd %int %16 %uint_1 %uint_0 %int_1
-               OpStore %res %10
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicAnd_152966 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %23
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicAnd %int %19 %uint_1 %uint_0 %int_1
+               OpStore %res %13
+         %25 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicAnd_152966
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicAnd_152966
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicAnd_152966
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicAnd_152966
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.wgsl
index 1a2882c..f78e5e9 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicAnd_152966() {
   var res : i32 = atomicAnd(&(sb_rw.arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicAnd_152966();
diff --git a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl
index 68d9027..abb273c 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl
@@ -25,7 +25,9 @@
 // fn atomicAnd(ptr<workgroup, atomic<u32>, read_write>, u32) -> u32
 fn atomicAnd_34edd3() {
   var res: u32 = atomicAnd(&arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.dxc.hlsl
index 1a459d0..b36d866 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAnd_34edd3() {
   uint atomic_result = 0u;
   InterlockedAnd(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.fxc.hlsl
index 1a459d0..b36d866 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAnd_34edd3() {
   uint atomic_result = 0u;
   InterlockedAnd(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.glsl
index 3052d85..7c8cb77 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAnd_34edd3() {
   uint res = atomicAnd(arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.msl
index adc4916..f6c0d78 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicAnd_34edd3(threadgroup atomic_uint* const tint_symbol) {
+void atomicAnd_34edd3(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_and_explicit(tint_symbol, 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicAnd_34edd3(tint_symbol_1);
+  atomicAnd_34edd3(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.spvasm
index 3d205d2..a624a59 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAnd_34edd3 "atomicAnd_34edd3"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicAnd_34edd3 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
-         %10 = OpAtomicAnd %uint %arg_0 %uint_2 %uint_0 %uint_1
-               OpStore %res %10
+%atomicAnd_34edd3 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
+         %13 = OpAtomicAnd %uint %arg_0 %uint_2 %uint_0 %uint_1
+               OpStore %res %13
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicAnd_34edd3
+         %32 = OpFunctionCall %void %atomicAnd_34edd3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %9
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.wgsl
index 7cae2d8..2263954 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicAnd_34edd3() {
   var res : u32 = atomicAnd(&(arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicAnd_34edd3();
diff --git a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl
index 6cb189c..d261630 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl
@@ -25,7 +25,9 @@
 // fn atomicAnd(ptr<workgroup, atomic<i32>, read_write>, i32) -> i32
 fn atomicAnd_45a819() {
   var res: i32 = atomicAnd(&arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.dxc.hlsl
index 43929b8..0e6d5ac 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAnd_45a819() {
   int atomic_result = 0;
   InterlockedAnd(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.fxc.hlsl
index 43929b8..0e6d5ac 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAnd_45a819() {
   int atomic_result = 0;
   InterlockedAnd(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.glsl
index 1d8d880..27124e0 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAnd_45a819() {
   int res = atomicAnd(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.msl
index 4fff671..5f99eb4 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicAnd_45a819(threadgroup atomic_int* const tint_symbol) {
+void atomicAnd_45a819(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_and_explicit(tint_symbol, 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicAnd_45a819(tint_symbol_1);
+  atomicAnd_45a819(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.spvasm
index 696d2a3..9872a08 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,45 +9,59 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAnd_45a819 "atomicAnd_45a819"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %18 = OpConstantNull %int
-         %19 = OpTypeFunction %void %uint
+         %21 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicAnd_45a819 = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %18
-         %11 = OpAtomicAnd %int %arg_0 %uint_2 %uint_0 %int_1
-               OpStore %res %11
+%atomicAnd_45a819 = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %21
+         %14 = OpAtomicAnd %int %arg_0 %uint_2 %uint_0 %int_1
+               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %19
+%compute_main_inner = OpFunction %void None %25
 %local_invocation_index = OpFunctionParameter %uint
-         %22 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %18
+         %28 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %21
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %atomicAnd_45a819
+         %33 = OpFunctionCall %void %atomicAnd_45a819
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %10
+         %35 = OpLabel
+         %37 = OpLoad %uint %local_invocation_index_1
+         %36 = OpFunctionCall %void %compute_main_inner %37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.wgsl
index 2dc54ed..3a951c2 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicAnd_45a819() {
   var res : i32 = atomicAnd(&(arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicAnd_45a819();
diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl
index 9016047..9ecc28b 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl
@@ -28,7 +28,9 @@
 // fn atomicAnd(ptr<storage, atomic<u32>, read_write>, u32) -> u32
 fn atomicAnd_85a8d9() {
   var res: u32 = atomicAnd(&sb_rw.arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl
index b1e36ec..0daa1ae 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAnd_85a8d9() {
   uint res = sb_rwatomicAnd(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl
index b1e36ec..0daa1ae 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAnd_85a8d9() {
   uint res = sb_rwatomicAnd(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.glsl
index 44a7103..8f0a28d 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAnd_85a8d9() {
   uint res = atomicAnd(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAnd_85a8d9() {
   uint res = atomicAnd(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.msl
index 62890e0..c4eeb2c 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicAnd_85a8d9(device SB_RW* const tint_symbol) {
+void atomicAnd_85a8d9(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_and_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicAnd_85a8d9(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicAnd_85a8d9(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicAnd_85a8d9(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicAnd_85a8d9(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.spvasm
index a53fd94..5bdec1f 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAnd_85a8d9 "atomicAnd_85a8d9"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicAnd_85a8d9 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicAnd %uint %15 %uint_1 %uint_0 %uint_1
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicAnd_85a8d9 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicAnd %uint %18 %uint_1 %uint_0 %uint_1
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicAnd_85a8d9
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicAnd_85a8d9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicAnd_85a8d9
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicAnd_85a8d9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.wgsl
index f570c70..419c2fd 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicAnd_85a8d9() {
   var res : u32 = atomicAnd(&(sb_rw.arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicAnd_85a8d9();
diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl
index 859fc31..70eb4cc 100644
--- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl
+++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl
@@ -29,7 +29,6 @@
 fn atomicCompareExchangeWeak_1bd40a() {
   var res = atomicCompareExchangeWeak(&sb_rw.arg_0, 1i, 1i);
 }
-
 @fragment
 fn fragment_main() {
   atomicCompareExchangeWeak_1bd40a();
diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl
index 02ddbc3..8d80ff7 100644
--- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl
+++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl
@@ -29,7 +29,6 @@
 fn atomicCompareExchangeWeak_63d8e6() {
   var res = atomicCompareExchangeWeak(&sb_rw.arg_0, 1u, 1u);
 }
-
 @fragment
 fn fragment_main() {
   atomicCompareExchangeWeak_63d8e6();
diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/83580d.wgsl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/83580d.wgsl
index 0863571..a9cc16d 100644
--- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/83580d.wgsl
+++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/83580d.wgsl
@@ -26,7 +26,6 @@
 fn atomicCompareExchangeWeak_83580d() {
   var res = atomicCompareExchangeWeak(&arg_0, 1u, 1u);
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicCompareExchangeWeak_83580d();
diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/e88938.wgsl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/e88938.wgsl
index 3d2b067..155163d 100644
--- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/e88938.wgsl
+++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/e88938.wgsl
@@ -26,7 +26,6 @@
 fn atomicCompareExchangeWeak_e88938() {
   var res = atomicCompareExchangeWeak(&arg_0, 1i, 1i);
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicCompareExchangeWeak_e88938();
diff --git a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl
index ba54de6..8d31b6d 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl
@@ -25,7 +25,9 @@
 // fn atomicExchange(ptr<workgroup, atomic<u32>, read_write>, u32) -> u32
 fn atomicExchange_0a5dca() {
   var res: u32 = atomicExchange(&arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.dxc.hlsl
index 86bcffa..c35da3b 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicExchange_0a5dca() {
   uint atomic_result = 0u;
   InterlockedExchange(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.fxc.hlsl
index 86bcffa..c35da3b 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicExchange_0a5dca() {
   uint atomic_result = 0u;
   InterlockedExchange(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.glsl
index 9bbbe05..d2d47e8 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicExchange_0a5dca() {
   uint res = atomicExchange(arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.msl
index 392a929..7abdc28 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicExchange_0a5dca(threadgroup atomic_uint* const tint_symbol) {
+void atomicExchange_0a5dca(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_exchange_explicit(tint_symbol, 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicExchange_0a5dca(tint_symbol_1);
+  atomicExchange_0a5dca(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.spvasm
index 23dbf02..2a3fad4 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicExchange_0a5dca "atomicExchange_0a5dca"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicExchange_0a5dca = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
-         %10 = OpAtomicExchange %uint %arg_0 %uint_2 %uint_0 %uint_1
-               OpStore %res %10
+%atomicExchange_0a5dca = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
+         %13 = OpAtomicExchange %uint %arg_0 %uint_2 %uint_0 %uint_1
+               OpStore %res %13
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicExchange_0a5dca
+         %32 = OpFunctionCall %void %atomicExchange_0a5dca
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %9
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.wgsl
index cf1786b..76ea938 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicExchange_0a5dca() {
   var res : u32 = atomicExchange(&(arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicExchange_0a5dca();
diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl
index de7a468..e97a7c4 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl
@@ -28,7 +28,9 @@
 // fn atomicExchange(ptr<storage, atomic<u32>, read_write>, u32) -> u32
 fn atomicExchange_d59712() {
   var res: u32 = atomicExchange(&sb_rw.arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.dxc.hlsl
index 59e08f0..2abb7c6 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicExchange_d59712() {
   uint res = sb_rwatomicExchange(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.fxc.hlsl
index 59e08f0..2abb7c6 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicExchange_d59712() {
   uint res = sb_rwatomicExchange(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.glsl
index 9e347a9..d20dcf8 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicExchange_d59712() {
   uint res = atomicExchange(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicExchange_d59712() {
   uint res = atomicExchange(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.msl
index 26886a5..fe167e9 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicExchange_d59712(device SB_RW* const tint_symbol) {
+void atomicExchange_d59712(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_exchange_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicExchange_d59712(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicExchange_d59712(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicExchange_d59712(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicExchange_d59712(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.spvasm
index 02192b5..b24edd9 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicExchange_d59712 "atomicExchange_d59712"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicExchange_d59712 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicExchange %uint %15 %uint_1 %uint_0 %uint_1
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicExchange_d59712 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicExchange %uint %18 %uint_1 %uint_0 %uint_1
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicExchange_d59712
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicExchange_d59712
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicExchange_d59712
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicExchange_d59712
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.wgsl
index 1fda804..bd51a4b 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicExchange_d59712() {
   var res : u32 = atomicExchange(&(sb_rw.arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicExchange_d59712();
diff --git a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl
index 919bdd6..f6a9f83 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl
@@ -25,7 +25,9 @@
 // fn atomicExchange(ptr<workgroup, atomic<i32>, read_write>, i32) -> i32
 fn atomicExchange_e114ba() {
   var res: i32 = atomicExchange(&arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.dxc.hlsl
index 3efb492..8ec19ff 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicExchange_e114ba() {
   int atomic_result = 0;
   InterlockedExchange(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.fxc.hlsl
index 3efb492..8ec19ff 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicExchange_e114ba() {
   int atomic_result = 0;
   InterlockedExchange(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.glsl
index 29b214e..17f47e8 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicExchange_e114ba() {
   int res = atomicExchange(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.msl
index d213dff..4b784f0 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicExchange_e114ba(threadgroup atomic_int* const tint_symbol) {
+void atomicExchange_e114ba(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_exchange_explicit(tint_symbol, 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicExchange_e114ba(tint_symbol_1);
+  atomicExchange_e114ba(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.spvasm
index b541d6b..0afe055 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,45 +9,59 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicExchange_e114ba "atomicExchange_e114ba"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %18 = OpConstantNull %int
-         %19 = OpTypeFunction %void %uint
+         %21 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicExchange_e114ba = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %18
-         %11 = OpAtomicExchange %int %arg_0 %uint_2 %uint_0 %int_1
-               OpStore %res %11
+%atomicExchange_e114ba = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %21
+         %14 = OpAtomicExchange %int %arg_0 %uint_2 %uint_0 %int_1
+               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %19
+%compute_main_inner = OpFunction %void None %25
 %local_invocation_index = OpFunctionParameter %uint
-         %22 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %18
+         %28 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %21
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %atomicExchange_e114ba
+         %33 = OpFunctionCall %void %atomicExchange_e114ba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %10
+         %35 = OpLabel
+         %37 = OpLoad %uint %local_invocation_index_1
+         %36 = OpFunctionCall %void %compute_main_inner %37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.wgsl
index 381857a..1dc3c8b 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicExchange_e114ba() {
   var res : i32 = atomicExchange(&(arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicExchange_e114ba();
diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl
index 3dfef46..d17210e 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl
@@ -28,7 +28,9 @@
 // fn atomicExchange(ptr<storage, atomic<i32>, read_write>, i32) -> i32
 fn atomicExchange_f2e22f() {
   var res: i32 = atomicExchange(&sb_rw.arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl
index f2492f0..14361fe 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicExchange_f2e22f() {
   int res = sb_rwatomicExchange(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl
index f2492f0..14361fe 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicExchange_f2e22f() {
   int res = sb_rwatomicExchange(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.glsl
index f9f85db..bc428ef 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicExchange_f2e22f() {
   int res = atomicExchange(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicExchange_f2e22f() {
   int res = atomicExchange(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.msl
index 736a844..a645eb9 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicExchange_f2e22f(device SB_RW* const tint_symbol) {
+void atomicExchange_f2e22f(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_exchange_explicit(&((*(tint_symbol)).arg_0), 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicExchange_f2e22f(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicExchange_f2e22f(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicExchange_f2e22f(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicExchange_f2e22f(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.spvasm
index 5ab9322..36fb78e 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicExchange_f2e22f "atomicExchange_f2e22f"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,35 +26,46 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-%atomicExchange_f2e22f = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %20
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicExchange %int %16 %uint_1 %uint_0 %int_1
-               OpStore %res %10
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicExchange_f2e22f = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %23
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicExchange %int %19 %uint_1 %uint_0 %int_1
+               OpStore %res %13
+         %25 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicExchange_f2e22f
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicExchange_f2e22f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicExchange_f2e22f
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicExchange_f2e22f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.wgsl
index 654a73d..d4e8119 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicExchange_f2e22f() {
   var res : i32 = atomicExchange(&(sb_rw.arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicExchange_f2e22f();
diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl
index 488d664..50aa58f 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl
@@ -28,7 +28,9 @@
 // fn atomicLoad(ptr<storage, atomic<i32>, read_write>) -> i32
 fn atomicLoad_0806ad() {
   var res: i32 = atomicLoad(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.dxc.hlsl
index 413dcf0..f91a4a9 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicLoad_0806ad() {
   int res = sb_rwatomicLoad(0u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.fxc.hlsl
index 413dcf0..f91a4a9 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicLoad_0806ad() {
   int res = sb_rwatomicLoad(0u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.glsl
index f9f7949..d38ae3c 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicLoad_0806ad() {
   int res = atomicOr(sb_rw.inner.arg_0, 0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicLoad_0806ad() {
   int res = atomicOr(sb_rw.inner.arg_0, 0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.msl
index 2335d0d..5b81064 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicLoad_0806ad(device SB_RW* const tint_symbol) {
+void atomicLoad_0806ad(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_load_explicit(&((*(tint_symbol)).arg_0), memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicLoad_0806ad(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicLoad_0806ad(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicLoad_0806ad(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicLoad_0806ad(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.spvasm
index 0a09d9d..82695e7 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicLoad_0806ad "atomicLoad_0806ad"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,34 +26,45 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
 %_ptr_Function_int = OpTypePointer Function %int
-         %19 = OpConstantNull %int
-%atomicLoad_0806ad = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %19
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicLoad %int %16 %uint_1 %uint_0
-               OpStore %res %10
+         %22 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicLoad_0806ad = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %22
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicLoad %int %19 %uint_1 %uint_0
+               OpStore %res %13
+         %24 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %atomicLoad_0806ad
+%fragment_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %atomicLoad_0806ad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicLoad_0806ad
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicLoad_0806ad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.wgsl
index 06c2703..5fe3796 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicLoad_0806ad() {
   var res : i32 = atomicLoad(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicLoad_0806ad();
diff --git a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl
index 162c19f..29525b1 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl
@@ -25,7 +25,9 @@
 // fn atomicLoad(ptr<workgroup, atomic<u32>, read_write>) -> u32
 fn atomicLoad_361bf1() {
   var res: u32 = atomicLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.dxc.hlsl
index f0f031f..0be9808 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicLoad_361bf1() {
   uint atomic_result = 0u;
   InterlockedOr(arg_0, 0, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.fxc.hlsl
index f0f031f..0be9808 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicLoad_361bf1() {
   uint atomic_result = 0u;
   InterlockedOr(arg_0, 0, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.glsl
index f56f5a7..6c89f0e 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicLoad_361bf1() {
   uint res = atomicOr(arg_0, 0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.msl
index eedf946..6942bf4 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicLoad_361bf1(threadgroup atomic_uint* const tint_symbol) {
+void atomicLoad_361bf1(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_load_explicit(tint_symbol, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicLoad_361bf1(tint_symbol_1);
+  atomicLoad_361bf1(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.spvasm
index 20eeca7..c9e76eb 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,43 +9,57 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicLoad_361bf1 "atomicLoad_361bf1"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %16 = OpConstantNull %uint
-         %17 = OpTypeFunction %void %uint
+         %19 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %23 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicLoad_361bf1 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %16
-         %10 = OpAtomicLoad %uint %arg_0 %uint_2 %uint_0
-               OpStore %res %10
+%atomicLoad_361bf1 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %19
+         %13 = OpAtomicLoad %uint %arg_0 %uint_2 %uint_0
+               OpStore %res %13
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %22 = OpLoad %uint %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %17
+%compute_main_inner = OpFunction %void None %23
 %local_invocation_index = OpFunctionParameter %uint
-         %20 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
+         %26 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %19
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %25 = OpFunctionCall %void %atomicLoad_361bf1
+         %31 = OpFunctionCall %void %atomicLoad_361bf1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %29 = OpLoad %uint %local_invocation_index_1
-         %28 = OpFunctionCall %void %compute_main_inner %29
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %35 = OpLoad %uint %local_invocation_index_1
+         %34 = OpFunctionCall %void %compute_main_inner %35
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.wgsl
index 2fb4caa..31f0757 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicLoad_361bf1() {
   var res : u32 = atomicLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicLoad_361bf1();
diff --git a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl
index 5b2faf2..0dbf1fc 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl
@@ -25,7 +25,9 @@
 // fn atomicLoad(ptr<workgroup, atomic<i32>, read_write>) -> i32
 fn atomicLoad_afcc03() {
   var res: i32 = atomicLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.dxc.hlsl
index adf265f..222a7e4 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicLoad_afcc03() {
   int atomic_result = 0;
   InterlockedOr(arg_0, 0, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.fxc.hlsl
index adf265f..222a7e4 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicLoad_afcc03() {
   int atomic_result = 0;
   InterlockedOr(arg_0, 0, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.glsl
index a290c99..33d8755 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicLoad_afcc03() {
   int res = atomicOr(arg_0, 0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.msl
index 90d483d..43c4c68 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicLoad_afcc03(threadgroup atomic_int* const tint_symbol) {
+void atomicLoad_afcc03(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_load_explicit(tint_symbol, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicLoad_afcc03(tint_symbol_1);
+  atomicLoad_afcc03(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.spvasm
index b996359..88338ea 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicLoad_afcc03 "atomicLoad_afcc03"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicLoad_afcc03 = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
-         %11 = OpAtomicLoad %int %arg_0 %uint_2 %uint_0
-               OpStore %res %11
+%atomicLoad_afcc03 = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
+         %14 = OpAtomicLoad %int %arg_0 %uint_2 %uint_0
+               OpStore %res %14
+         %22 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %23 = OpLoad %int %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicLoad_afcc03
+         %32 = OpFunctionCall %void %atomicLoad_afcc03
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %10
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.wgsl
index 37509ca..4b97959 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicLoad_afcc03() {
   var res : i32 = atomicLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicLoad_afcc03();
diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl
index 47b80d7..f7d4ad5 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl
@@ -28,7 +28,9 @@
 // fn atomicLoad(ptr<storage, atomic<u32>, read_write>) -> u32
 fn atomicLoad_fe6cc3() {
   var res: u32 = atomicLoad(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl
index d8fda75..a819268 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicLoad_fe6cc3() {
   uint res = sb_rwatomicLoad(0u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl
index d8fda75..a819268 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicLoad_fe6cc3() {
   uint res = sb_rwatomicLoad(0u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.glsl
index eaede54..6f69cb8 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicLoad_fe6cc3() {
   uint res = atomicOr(sb_rw.inner.arg_0, 0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicLoad_fe6cc3() {
   uint res = atomicOr(sb_rw.inner.arg_0, 0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.msl
index e78624d..66e39fc 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicLoad_fe6cc3(device SB_RW* const tint_symbol) {
+void atomicLoad_fe6cc3(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_load_explicit(&((*(tint_symbol)).arg_0), memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicLoad_fe6cc3(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicLoad_fe6cc3(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicLoad_fe6cc3(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicLoad_fe6cc3(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.spvasm
index d1efbaa..b612cf4 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicLoad_fe6cc3 "atomicLoad_fe6cc3"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicLoad_fe6cc3 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicLoad %uint %15 %uint_1 %uint_0
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicLoad_fe6cc3 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicLoad %uint %18 %uint_1 %uint_0
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicLoad_fe6cc3
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicLoad_fe6cc3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicLoad_fe6cc3
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicLoad_fe6cc3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.wgsl
index 8691467..e9a1b54 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicLoad_fe6cc3() {
   var res : u32 = atomicLoad(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicLoad_fe6cc3();
diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl
index 343151e..d5f32ad 100644
--- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl
@@ -28,7 +28,9 @@
 // fn atomicMax(ptr<storage, atomic<u32>, read_write>, u32) -> u32
 fn atomicMax_51b9be() {
   var res: u32 = atomicMax(&sb_rw.arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.dxc.hlsl
index 0c39796..d39211f 100644
--- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMax_51b9be() {
   uint res = sb_rwatomicMax(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.fxc.hlsl
index 0c39796..d39211f 100644
--- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMax_51b9be() {
   uint res = sb_rwatomicMax(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.glsl
index ff65321..7361b76 100644
--- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMax_51b9be() {
   uint res = atomicMax(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMax_51b9be() {
   uint res = atomicMax(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.msl
index 78e9001..b1d298d 100644
--- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicMax_51b9be(device SB_RW* const tint_symbol) {
+void atomicMax_51b9be(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_max_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicMax_51b9be(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicMax_51b9be(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicMax_51b9be(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicMax_51b9be(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.spvasm
index f4de1ba..97dfacb 100644
--- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMax_51b9be "atomicMax_51b9be"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicMax_51b9be = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicUMax %uint %15 %uint_1 %uint_0 %uint_1
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicMax_51b9be = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicUMax %uint %18 %uint_1 %uint_0 %uint_1
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicMax_51b9be
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicMax_51b9be
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicMax_51b9be
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicMax_51b9be
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.wgsl
index f59ae6d..6894581 100644
--- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicMax_51b9be() {
   var res : u32 = atomicMax(&(sb_rw.arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicMax_51b9be();
diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl
index 602f72f..631eb27 100644
--- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl
@@ -28,7 +28,9 @@
 // fn atomicMax(ptr<storage, atomic<i32>, read_write>, i32) -> i32
 fn atomicMax_92aa72() {
   var res: i32 = atomicMax(&sb_rw.arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.dxc.hlsl
index 4f7dc69..976fe80 100644
--- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMax_92aa72() {
   int res = sb_rwatomicMax(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.fxc.hlsl
index 4f7dc69..976fe80 100644
--- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMax_92aa72() {
   int res = sb_rwatomicMax(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.glsl
index 1bc71bd..297c0d5 100644
--- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMax_92aa72() {
   int res = atomicMax(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMax_92aa72() {
   int res = atomicMax(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.msl
index aac6b99..86f51b2 100644
--- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicMax_92aa72(device SB_RW* const tint_symbol) {
+void atomicMax_92aa72(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_max_explicit(&((*(tint_symbol)).arg_0), 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicMax_92aa72(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicMax_92aa72(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicMax_92aa72(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicMax_92aa72(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.spvasm
index 5d953fa..014f6e0 100644
--- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMax_92aa72 "atomicMax_92aa72"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,35 +26,46 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-%atomicMax_92aa72 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %20
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicSMax %int %16 %uint_1 %uint_0 %int_1
-               OpStore %res %10
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicMax_92aa72 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %23
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicSMax %int %19 %uint_1 %uint_0 %int_1
+               OpStore %res %13
+         %25 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicMax_92aa72
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicMax_92aa72
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicMax_92aa72
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicMax_92aa72
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.wgsl
index f4264d3..ebb4b43 100644
--- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicMax_92aa72() {
   var res : i32 = atomicMax(&(sb_rw.arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicMax_92aa72();
diff --git a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl
index ff0ad24..ef5fbda4 100644
--- a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl
@@ -25,7 +25,9 @@
 // fn atomicMax(ptr<workgroup, atomic<i32>, read_write>, i32) -> i32
 fn atomicMax_a89cc3() {
   var res: i32 = atomicMax(&arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.dxc.hlsl
index c5602f1..f12f931 100644
--- a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMax_a89cc3() {
   int atomic_result = 0;
   InterlockedMax(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.fxc.hlsl
index c5602f1..f12f931 100644
--- a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMax_a89cc3() {
   int atomic_result = 0;
   InterlockedMax(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.glsl
index 51e9eac..92eda29 100644
--- a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMax_a89cc3() {
   int res = atomicMax(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.msl
index bf92158..fc17a33 100644
--- a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicMax_a89cc3(threadgroup atomic_int* const tint_symbol) {
+void atomicMax_a89cc3(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_max_explicit(tint_symbol, 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicMax_a89cc3(tint_symbol_1);
+  atomicMax_a89cc3(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.spvasm
index 62355e0..ad39f1c 100644
--- a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,45 +9,59 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMax_a89cc3 "atomicMax_a89cc3"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %18 = OpConstantNull %int
-         %19 = OpTypeFunction %void %uint
+         %21 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicMax_a89cc3 = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %18
-         %11 = OpAtomicSMax %int %arg_0 %uint_2 %uint_0 %int_1
-               OpStore %res %11
+%atomicMax_a89cc3 = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %21
+         %14 = OpAtomicSMax %int %arg_0 %uint_2 %uint_0 %int_1
+               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %19
+%compute_main_inner = OpFunction %void None %25
 %local_invocation_index = OpFunctionParameter %uint
-         %22 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %18
+         %28 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %21
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %atomicMax_a89cc3
+         %33 = OpFunctionCall %void %atomicMax_a89cc3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %10
+         %35 = OpLabel
+         %37 = OpLoad %uint %local_invocation_index_1
+         %36 = OpFunctionCall %void %compute_main_inner %37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.wgsl
index 1a4ea13..437a41f 100644
--- a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicMax_a89cc3() {
   var res : i32 = atomicMax(&(arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicMax_a89cc3();
diff --git a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl
index d259922..b41ac0b 100644
--- a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl
@@ -25,7 +25,9 @@
 // fn atomicMax(ptr<workgroup, atomic<u32>, read_write>, u32) -> u32
 fn atomicMax_beccfc() {
   var res: u32 = atomicMax(&arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.dxc.hlsl
index 0b3f279..7b2db9f 100644
--- a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMax_beccfc() {
   uint atomic_result = 0u;
   InterlockedMax(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.fxc.hlsl
index 0b3f279..7b2db9f 100644
--- a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMax_beccfc() {
   uint atomic_result = 0u;
   InterlockedMax(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.glsl
index c307f41..ad1d510 100644
--- a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMax_beccfc() {
   uint res = atomicMax(arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.msl
index a0d53b9..f5149e0 100644
--- a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicMax_beccfc(threadgroup atomic_uint* const tint_symbol) {
+void atomicMax_beccfc(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_max_explicit(tint_symbol, 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicMax_beccfc(tint_symbol_1);
+  atomicMax_beccfc(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.spvasm
index 2636c66..976f231 100644
--- a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMax_beccfc "atomicMax_beccfc"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicMax_beccfc = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
-         %10 = OpAtomicUMax %uint %arg_0 %uint_2 %uint_0 %uint_1
-               OpStore %res %10
+%atomicMax_beccfc = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
+         %13 = OpAtomicUMax %uint %arg_0 %uint_2 %uint_0 %uint_1
+               OpStore %res %13
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicMax_beccfc
+         %32 = OpFunctionCall %void %atomicMax_beccfc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %9
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.wgsl
index 7b1f90a..a028eed 100644
--- a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicMax_beccfc() {
   var res : u32 = atomicMax(&(arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicMax_beccfc();
diff --git a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl
index 504d4a3..40f01f3 100644
--- a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl
@@ -25,7 +25,9 @@
 // fn atomicMin(ptr<workgroup, atomic<i32>, read_write>, i32) -> i32
 fn atomicMin_278235() {
   var res: i32 = atomicMin(&arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.dxc.hlsl
index 7c71909..cf3281e 100644
--- a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMin_278235() {
   int atomic_result = 0;
   InterlockedMin(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.fxc.hlsl
index 7c71909..cf3281e 100644
--- a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMin_278235() {
   int atomic_result = 0;
   InterlockedMin(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.glsl
index e899058..7b690a8 100644
--- a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMin_278235() {
   int res = atomicMin(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.msl
index afc4fe0..bbf3d4e 100644
--- a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicMin_278235(threadgroup atomic_int* const tint_symbol) {
+void atomicMin_278235(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_min_explicit(tint_symbol, 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicMin_278235(tint_symbol_1);
+  atomicMin_278235(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.spvasm
index dfe5a35..5a5c7c5 100644
--- a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,45 +9,59 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMin_278235 "atomicMin_278235"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %18 = OpConstantNull %int
-         %19 = OpTypeFunction %void %uint
+         %21 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicMin_278235 = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %18
-         %11 = OpAtomicSMin %int %arg_0 %uint_2 %uint_0 %int_1
-               OpStore %res %11
+%atomicMin_278235 = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %21
+         %14 = OpAtomicSMin %int %arg_0 %uint_2 %uint_0 %int_1
+               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %19
+%compute_main_inner = OpFunction %void None %25
 %local_invocation_index = OpFunctionParameter %uint
-         %22 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %18
+         %28 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %21
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %atomicMin_278235
+         %33 = OpFunctionCall %void %atomicMin_278235
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %10
+         %35 = OpLabel
+         %37 = OpLoad %uint %local_invocation_index_1
+         %36 = OpFunctionCall %void %compute_main_inner %37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.wgsl
index 1cea2b9..bd9293d 100644
--- a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicMin_278235() {
   var res : i32 = atomicMin(&(arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicMin_278235();
diff --git a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl
index 7953d53..52beed7 100644
--- a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl
@@ -25,7 +25,9 @@
 // fn atomicMin(ptr<workgroup, atomic<u32>, read_write>, u32) -> u32
 fn atomicMin_69d383() {
   var res: u32 = atomicMin(&arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.dxc.hlsl
index 61d7265..9cb3996 100644
--- a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMin_69d383() {
   uint atomic_result = 0u;
   InterlockedMin(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.fxc.hlsl
index 61d7265..9cb3996 100644
--- a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMin_69d383() {
   uint atomic_result = 0u;
   InterlockedMin(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.glsl
index bdb3b62..b475111 100644
--- a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMin_69d383() {
   uint res = atomicMin(arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.msl
index 166a4c2..136aa18 100644
--- a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicMin_69d383(threadgroup atomic_uint* const tint_symbol) {
+void atomicMin_69d383(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_min_explicit(tint_symbol, 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicMin_69d383(tint_symbol_1);
+  atomicMin_69d383(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.spvasm
index de92bee..b295e9d 100644
--- a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMin_69d383 "atomicMin_69d383"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicMin_69d383 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
-         %10 = OpAtomicUMin %uint %arg_0 %uint_2 %uint_0 %uint_1
-               OpStore %res %10
+%atomicMin_69d383 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
+         %13 = OpAtomicUMin %uint %arg_0 %uint_2 %uint_0 %uint_1
+               OpStore %res %13
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicMin_69d383
+         %32 = OpFunctionCall %void %atomicMin_69d383
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %9
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.wgsl
index 1fba69f..313eebc 100644
--- a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicMin_69d383() {
   var res : u32 = atomicMin(&(arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicMin_69d383();
diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl
index e400aaf..2a16e05 100644
--- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl
@@ -28,7 +28,9 @@
 // fn atomicMin(ptr<storage, atomic<i32>, read_write>, i32) -> i32
 fn atomicMin_8e38dc() {
   var res: i32 = atomicMin(&sb_rw.arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.dxc.hlsl
index 6968993..34263e7 100644
--- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMin_8e38dc() {
   int res = sb_rwatomicMin(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.fxc.hlsl
index 6968993..34263e7 100644
--- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMin_8e38dc() {
   int res = sb_rwatomicMin(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.glsl
index e4f42fc..ea083b7 100644
--- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMin_8e38dc() {
   int res = atomicMin(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMin_8e38dc() {
   int res = atomicMin(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.msl
index f11f8cc..3bf9f25 100644
--- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicMin_8e38dc(device SB_RW* const tint_symbol) {
+void atomicMin_8e38dc(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_min_explicit(&((*(tint_symbol)).arg_0), 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicMin_8e38dc(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicMin_8e38dc(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicMin_8e38dc(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicMin_8e38dc(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.spvasm
index 390d1ad..a836bc8 100644
--- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMin_8e38dc "atomicMin_8e38dc"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,35 +26,46 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-%atomicMin_8e38dc = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %20
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicSMin %int %16 %uint_1 %uint_0 %int_1
-               OpStore %res %10
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicMin_8e38dc = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %23
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicSMin %int %19 %uint_1 %uint_0 %int_1
+               OpStore %res %13
+         %25 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicMin_8e38dc
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicMin_8e38dc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicMin_8e38dc
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicMin_8e38dc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.wgsl
index c65f712..f94ba77 100644
--- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicMin_8e38dc() {
   var res : i32 = atomicMin(&(sb_rw.arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicMin_8e38dc();
diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl
index 84d26bc..30fe984 100644
--- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl
@@ -28,7 +28,9 @@
 // fn atomicMin(ptr<storage, atomic<u32>, read_write>, u32) -> u32
 fn atomicMin_c67a74() {
   var res: u32 = atomicMin(&sb_rw.arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.dxc.hlsl
index 6f7cc8f..8c9116b 100644
--- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMin_c67a74() {
   uint res = sb_rwatomicMin(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.fxc.hlsl
index 6f7cc8f..8c9116b 100644
--- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMin_c67a74() {
   uint res = sb_rwatomicMin(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.glsl
index ebca966..09f1682 100644
--- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMin_c67a74() {
   uint res = atomicMin(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMin_c67a74() {
   uint res = atomicMin(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.msl
index 129f24e..98c9c22 100644
--- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicMin_c67a74(device SB_RW* const tint_symbol) {
+void atomicMin_c67a74(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_min_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicMin_c67a74(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicMin_c67a74(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicMin_c67a74(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicMin_c67a74(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.spvasm
index 9f8faee..1bfe920 100644
--- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMin_c67a74 "atomicMin_c67a74"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicMin_c67a74 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicUMin %uint %15 %uint_1 %uint_0 %uint_1
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicMin_c67a74 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicUMin %uint %18 %uint_1 %uint_0 %uint_1
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicMin_c67a74
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicMin_c67a74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicMin_c67a74
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicMin_c67a74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.wgsl
index cd9b000..5923b2e 100644
--- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicMin_c67a74() {
   var res : u32 = atomicMin(&(sb_rw.arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicMin_c67a74();
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl
index 4595126..a0fec1f 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl
@@ -25,7 +25,9 @@
 // fn atomicOr(ptr<workgroup, atomic<u32>, read_write>, u32) -> u32
 fn atomicOr_5e3d61() {
   var res: u32 = atomicOr(&arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.dxc.hlsl
index da41f0c..3559e47 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicOr_5e3d61() {
   uint atomic_result = 0u;
   InterlockedOr(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.fxc.hlsl
index da41f0c..3559e47 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicOr_5e3d61() {
   uint atomic_result = 0u;
   InterlockedOr(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.glsl
index aa4f061..1825bc5 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicOr_5e3d61() {
   uint res = atomicOr(arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.msl
index 9527616..8eb82fa 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicOr_5e3d61(threadgroup atomic_uint* const tint_symbol) {
+void atomicOr_5e3d61(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_or_explicit(tint_symbol, 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicOr_5e3d61(tint_symbol_1);
+  atomicOr_5e3d61(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.spvasm
index 1b9dc27..4b32f78 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicOr_5e3d61 "atomicOr_5e3d61"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicOr_5e3d61 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
-         %10 = OpAtomicOr %uint %arg_0 %uint_2 %uint_0 %uint_1
-               OpStore %res %10
+%atomicOr_5e3d61 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
+         %13 = OpAtomicOr %uint %arg_0 %uint_2 %uint_0 %uint_1
+               OpStore %res %13
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicOr_5e3d61
+         %32 = OpFunctionCall %void %atomicOr_5e3d61
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %9
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.wgsl
index 9de0d3f..249a7a0 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicOr_5e3d61() {
   var res : u32 = atomicOr(&(arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicOr_5e3d61();
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl
index cc7dcec..d548199 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl
@@ -28,7 +28,9 @@
 // fn atomicOr(ptr<storage, atomic<u32>, read_write>, u32) -> u32
 fn atomicOr_5e95d4() {
   var res: u32 = atomicOr(&sb_rw.arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.dxc.hlsl
index 457c4aa..cdd7e95 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicOr_5e95d4() {
   uint res = sb_rwatomicOr(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.fxc.hlsl
index 457c4aa..cdd7e95 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicOr_5e95d4() {
   uint res = sb_rwatomicOr(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.glsl
index e331065..4ebb342 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicOr_5e95d4() {
   uint res = atomicOr(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicOr_5e95d4() {
   uint res = atomicOr(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.msl
index 5ea3c50..b18619b 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicOr_5e95d4(device SB_RW* const tint_symbol) {
+void atomicOr_5e95d4(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_or_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicOr_5e95d4(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicOr_5e95d4(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicOr_5e95d4(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicOr_5e95d4(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.spvasm
index 8827ecb..2e2fe06 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicOr_5e95d4 "atomicOr_5e95d4"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicOr_5e95d4 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicOr %uint %15 %uint_1 %uint_0 %uint_1
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicOr_5e95d4 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicOr %uint %18 %uint_1 %uint_0 %uint_1
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicOr_5e95d4
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicOr_5e95d4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicOr_5e95d4
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicOr_5e95d4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.wgsl
index 839af64..c580931 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicOr_5e95d4() {
   var res : u32 = atomicOr(&(sb_rw.arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicOr_5e95d4();
diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl
index 8e510dd..7efa7b6 100644
--- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl
+++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl
@@ -28,7 +28,9 @@
 // fn atomicOr(ptr<storage, atomic<i32>, read_write>, i32) -> i32
 fn atomicOr_8d96a0() {
   var res: i32 = atomicOr(&sb_rw.arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.dxc.hlsl
index cdd96dc..c96d62d 100644
--- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicOr_8d96a0() {
   int res = sb_rwatomicOr(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.fxc.hlsl
index cdd96dc..c96d62d 100644
--- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicOr_8d96a0() {
   int res = sb_rwatomicOr(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.glsl
index 5e69601..4c14073 100644
--- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicOr_8d96a0() {
   int res = atomicOr(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicOr_8d96a0() {
   int res = atomicOr(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.msl
index d25b8b2..72da5f7 100644
--- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicOr_8d96a0(device SB_RW* const tint_symbol) {
+void atomicOr_8d96a0(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_or_explicit(&((*(tint_symbol)).arg_0), 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicOr_8d96a0(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicOr_8d96a0(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicOr_8d96a0(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicOr_8d96a0(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.spvasm
index 3d6d68f..45888ed 100644
--- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicOr_8d96a0 "atomicOr_8d96a0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,35 +26,46 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-%atomicOr_8d96a0 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %20
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicOr %int %16 %uint_1 %uint_0 %int_1
-               OpStore %res %10
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicOr_8d96a0 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %23
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicOr %int %19 %uint_1 %uint_0 %int_1
+               OpStore %res %13
+         %25 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicOr_8d96a0
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicOr_8d96a0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicOr_8d96a0
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicOr_8d96a0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.wgsl
index e883b7e..dfe8fc3 100644
--- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicOr_8d96a0() {
   var res : i32 = atomicOr(&(sb_rw.arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicOr_8d96a0();
diff --git a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl
index 20f5f21..b455b8f 100644
--- a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl
+++ b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl
@@ -25,7 +25,9 @@
 // fn atomicOr(ptr<workgroup, atomic<i32>, read_write>, i32) -> i32
 fn atomicOr_d09248() {
   var res: i32 = atomicOr(&arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.dxc.hlsl
index 2831e1b..5aa4a83 100644
--- a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicOr_d09248() {
   int atomic_result = 0;
   InterlockedOr(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.fxc.hlsl
index 2831e1b..5aa4a83 100644
--- a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicOr_d09248() {
   int atomic_result = 0;
   InterlockedOr(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.glsl
index bb03f7c..2b8cc2f 100644
--- a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicOr_d09248() {
   int res = atomicOr(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.msl
index 0d50df3..7a5385e 100644
--- a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicOr_d09248(threadgroup atomic_int* const tint_symbol) {
+void atomicOr_d09248(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_or_explicit(tint_symbol, 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicOr_d09248(tint_symbol_1);
+  atomicOr_d09248(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.spvasm
index cd14aa9..2be0895 100644
--- a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,45 +9,59 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicOr_d09248 "atomicOr_d09248"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %18 = OpConstantNull %int
-         %19 = OpTypeFunction %void %uint
+         %21 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicOr_d09248 = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %18
-         %11 = OpAtomicOr %int %arg_0 %uint_2 %uint_0 %int_1
-               OpStore %res %11
+%atomicOr_d09248 = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %21
+         %14 = OpAtomicOr %int %arg_0 %uint_2 %uint_0 %int_1
+               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %19
+%compute_main_inner = OpFunction %void None %25
 %local_invocation_index = OpFunctionParameter %uint
-         %22 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %18
+         %28 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %21
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %atomicOr_d09248
+         %33 = OpFunctionCall %void %atomicOr_d09248
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %10
+         %35 = OpLabel
+         %37 = OpLoad %uint %local_invocation_index_1
+         %36 = OpFunctionCall %void %compute_main_inner %37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.wgsl
index 51a6036..7bcfdbd 100644
--- a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicOr_d09248() {
   var res : i32 = atomicOr(&(arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicOr_d09248();
diff --git a/test/tint/builtins/gen/literal/atomicStore/726882.wgsl b/test/tint/builtins/gen/literal/atomicStore/726882.wgsl
index be7c8ea..1840404 100644
--- a/test/tint/builtins/gen/literal/atomicStore/726882.wgsl
+++ b/test/tint/builtins/gen/literal/atomicStore/726882.wgsl
@@ -26,7 +26,6 @@
 fn atomicStore_726882() {
   atomicStore(&arg_0, 1u);
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicStore_726882();
diff --git a/test/tint/builtins/gen/literal/atomicStore/8bea94.wgsl b/test/tint/builtins/gen/literal/atomicStore/8bea94.wgsl
index 8dcf7e9..c041878 100644
--- a/test/tint/builtins/gen/literal/atomicStore/8bea94.wgsl
+++ b/test/tint/builtins/gen/literal/atomicStore/8bea94.wgsl
@@ -26,7 +26,6 @@
 fn atomicStore_8bea94() {
   atomicStore(&arg_0, 1i);
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicStore_8bea94();
diff --git a/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl b/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl
index 734c66c..1f455f3 100644
--- a/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl
+++ b/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl
@@ -29,7 +29,6 @@
 fn atomicStore_cdc29e() {
   atomicStore(&sb_rw.arg_0, 1u);
 }
-
 @fragment
 fn fragment_main() {
   atomicStore_cdc29e();
diff --git a/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl b/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl
index aa2a7f3..96ca1b6 100644
--- a/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl
+++ b/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl
@@ -29,7 +29,6 @@
 fn atomicStore_d1e9a6() {
   atomicStore(&sb_rw.arg_0, 1i);
 }
-
 @fragment
 fn fragment_main() {
   atomicStore_d1e9a6();
diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl
index e52d52a..eef841c 100644
--- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl
+++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl
@@ -28,7 +28,9 @@
 // fn atomicSub(ptr<storage, atomic<i32>, read_write>, i32) -> i32
 fn atomicSub_051100() {
   var res: i32 = atomicSub(&sb_rw.arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.dxc.hlsl
index 88284ad..ffa7a8d 100644
--- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicSub_051100() {
   int res = sb_rwatomicSub(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.fxc.hlsl
index 88284ad..ffa7a8d 100644
--- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicSub_051100() {
   int res = sb_rwatomicSub(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.glsl
index 427252a..484938b 100644
--- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicSub_051100() {
   int res = atomicAdd(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicSub_051100() {
   int res = atomicAdd(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.msl
index ec11a66..13957ec 100644
--- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicSub_051100(device SB_RW* const tint_symbol) {
+void atomicSub_051100(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_sub_explicit(&((*(tint_symbol)).arg_0), 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicSub_051100(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicSub_051100(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicSub_051100(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicSub_051100(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.spvasm
index 3172c31..22edda9 100644
--- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicSub_051100 "atomicSub_051100"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,35 +26,46 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-%atomicSub_051100 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %20
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicISub %int %16 %uint_1 %uint_0 %int_1
-               OpStore %res %10
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicSub_051100 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %23
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicISub %int %19 %uint_1 %uint_0 %int_1
+               OpStore %res %13
+         %25 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicSub_051100
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicSub_051100
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicSub_051100
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicSub_051100
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.wgsl
index cf67226..73dd000 100644
--- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicSub_051100() {
   var res : i32 = atomicSub(&(sb_rw.arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicSub_051100();
diff --git a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl
index ba6fd50..7dfc608 100644
--- a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl
+++ b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl
@@ -25,7 +25,9 @@
 // fn atomicSub(ptr<workgroup, atomic<u32>, read_write>, u32) -> u32
 fn atomicSub_0d26c2() {
   var res: u32 = atomicSub(&arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.dxc.hlsl
index caddb67..e48e3b9 100644
--- a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicSub_0d26c2() {
   uint atomic_result = 0u;
   InterlockedAdd(arg_0, -1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.fxc.hlsl
index caddb67..e48e3b9 100644
--- a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicSub_0d26c2() {
   uint atomic_result = 0u;
   InterlockedAdd(arg_0, -1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.glsl
index b03de77..b558425 100644
--- a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicSub_0d26c2() {
   uint res = atomicAdd(arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.msl
index 9ea6c97..9dbf4e2 100644
--- a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicSub_0d26c2(threadgroup atomic_uint* const tint_symbol) {
+void atomicSub_0d26c2(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_sub_explicit(tint_symbol, 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicSub_0d26c2(tint_symbol_1);
+  atomicSub_0d26c2(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.spvasm
index 0412631..48b5767 100644
--- a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicSub_0d26c2 "atomicSub_0d26c2"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicSub_0d26c2 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
-         %10 = OpAtomicISub %uint %arg_0 %uint_2 %uint_0 %uint_1
-               OpStore %res %10
+%atomicSub_0d26c2 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
+         %13 = OpAtomicISub %uint %arg_0 %uint_2 %uint_0 %uint_1
+               OpStore %res %13
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicSub_0d26c2
+         %32 = OpFunctionCall %void %atomicSub_0d26c2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %9
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.wgsl
index fcbe53c..3345e11 100644
--- a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicSub_0d26c2() {
   var res : u32 = atomicSub(&(arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicSub_0d26c2();
diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl
index eb42db4..3f0e86c 100644
--- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl
+++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl
@@ -28,7 +28,9 @@
 // fn atomicSub(ptr<storage, atomic<u32>, read_write>, u32) -> u32
 fn atomicSub_15bfc9() {
   var res: u32 = atomicSub(&sb_rw.arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.dxc.hlsl
index e343eec..d47e057 100644
--- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicSub_15bfc9() {
   uint res = sb_rwatomicSub(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.fxc.hlsl
index e343eec..d47e057 100644
--- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicSub_15bfc9() {
   uint res = sb_rwatomicSub(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.glsl
index 2f798a8..77138f3 100644
--- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicSub_15bfc9() {
   uint res = atomicAdd(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicSub_15bfc9() {
   uint res = atomicAdd(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.msl
index 994a48e..d27dead 100644
--- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicSub_15bfc9(device SB_RW* const tint_symbol) {
+void atomicSub_15bfc9(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_sub_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicSub_15bfc9(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicSub_15bfc9(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicSub_15bfc9(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicSub_15bfc9(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.spvasm
index 2398ff0..a12f18e 100644
--- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicSub_15bfc9 "atomicSub_15bfc9"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicSub_15bfc9 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicISub %uint %15 %uint_1 %uint_0 %uint_1
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicSub_15bfc9 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicISub %uint %18 %uint_1 %uint_0 %uint_1
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicSub_15bfc9
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicSub_15bfc9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicSub_15bfc9
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicSub_15bfc9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.wgsl
index 8d1ad29..4ceb578 100644
--- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicSub_15bfc9() {
   var res : u32 = atomicSub(&(sb_rw.arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicSub_15bfc9();
diff --git a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl
index 3996ba1..c736cf0 100644
--- a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl
+++ b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl
@@ -25,7 +25,9 @@
 // fn atomicSub(ptr<workgroup, atomic<i32>, read_write>, i32) -> i32
 fn atomicSub_77883a() {
   var res: i32 = atomicSub(&arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.dxc.hlsl
index 7ba0481..e5db231 100644
--- a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicSub_77883a() {
   int atomic_result = 0;
   InterlockedAdd(arg_0, -1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.fxc.hlsl
index 7ba0481..e5db231 100644
--- a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicSub_77883a() {
   int atomic_result = 0;
   InterlockedAdd(arg_0, -1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.glsl
index 27910ac..df64663 100644
--- a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicSub_77883a() {
   int res = atomicAdd(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.msl
index af2c77b..d3fa81d 100644
--- a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicSub_77883a(threadgroup atomic_int* const tint_symbol) {
+void atomicSub_77883a(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_sub_explicit(tint_symbol, 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicSub_77883a(tint_symbol_1);
+  atomicSub_77883a(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.spvasm
index f0471be..f0fa5f1 100644
--- a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,45 +9,59 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicSub_77883a "atomicSub_77883a"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %18 = OpConstantNull %int
-         %19 = OpTypeFunction %void %uint
+         %21 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicSub_77883a = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %18
-         %11 = OpAtomicISub %int %arg_0 %uint_2 %uint_0 %int_1
-               OpStore %res %11
+%atomicSub_77883a = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %21
+         %14 = OpAtomicISub %int %arg_0 %uint_2 %uint_0 %int_1
+               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %19
+%compute_main_inner = OpFunction %void None %25
 %local_invocation_index = OpFunctionParameter %uint
-         %22 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %18
+         %28 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %21
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %atomicSub_77883a
+         %33 = OpFunctionCall %void %atomicSub_77883a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %10
+         %35 = OpLabel
+         %37 = OpLoad %uint %local_invocation_index_1
+         %36 = OpFunctionCall %void %compute_main_inner %37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.wgsl
index 6521e29..cb77a1e 100644
--- a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicSub_77883a() {
   var res : i32 = atomicSub(&(arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicSub_77883a();
diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl
index d94df35..6619aee 100644
--- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl
+++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl
@@ -28,7 +28,9 @@
 // fn atomicXor(ptr<storage, atomic<u32>, read_write>, u32) -> u32
 fn atomicXor_54510e() {
   var res: u32 = atomicXor(&sb_rw.arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.dxc.hlsl
index 3bf3e8d..832adfb 100644
--- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicXor_54510e() {
   uint res = sb_rwatomicXor(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.fxc.hlsl
index 3bf3e8d..832adfb 100644
--- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicXor_54510e() {
   uint res = sb_rwatomicXor(0u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.glsl
index ce9a83b..123af7f 100644
--- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicXor_54510e() {
   uint res = atomicXor(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicXor_54510e() {
   uint res = atomicXor(sb_rw.inner.arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.msl
index 5967deb..4e0d67d 100644
--- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicXor_54510e(device SB_RW* const tint_symbol) {
+void atomicXor_54510e(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_xor_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicXor_54510e(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicXor_54510e(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicXor_54510e(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicXor_54510e(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.spvasm
index 58743e5..7f67f05 100644
--- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicXor_54510e "atomicXor_54510e"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicXor_54510e = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicXor %uint %15 %uint_1 %uint_0 %uint_1
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicXor_54510e = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicXor %uint %18 %uint_1 %uint_0 %uint_1
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicXor_54510e
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicXor_54510e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicXor_54510e
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicXor_54510e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.wgsl
index b771102..112eb47 100644
--- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicXor_54510e() {
   var res : u32 = atomicXor(&(sb_rw.arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicXor_54510e();
diff --git a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl
index 0a64c77..9eb3011 100644
--- a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl
+++ b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl
@@ -25,7 +25,9 @@
 // fn atomicXor(ptr<workgroup, atomic<i32>, read_write>, i32) -> i32
 fn atomicXor_75dc95() {
   var res: i32 = atomicXor(&arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.dxc.hlsl
index f9cc3d2..a180dba 100644
--- a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicXor_75dc95() {
   int atomic_result = 0;
   InterlockedXor(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.fxc.hlsl
index f9cc3d2..a180dba 100644
--- a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicXor_75dc95() {
   int atomic_result = 0;
   InterlockedXor(arg_0, 1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.glsl
index 5c4e204..3bba293 100644
--- a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicXor_75dc95() {
   int res = atomicXor(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.msl
index 83e290b..5ae72e0 100644
--- a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicXor_75dc95(threadgroup atomic_int* const tint_symbol) {
+void atomicXor_75dc95(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_xor_explicit(tint_symbol, 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicXor_75dc95(tint_symbol_1);
+  atomicXor_75dc95(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.spvasm
index 4e729e2..a6e46b4 100644
--- a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,45 +9,59 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicXor_75dc95 "atomicXor_75dc95"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %18 = OpConstantNull %int
-         %19 = OpTypeFunction %void %uint
+         %21 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicXor_75dc95 = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %18
-         %11 = OpAtomicXor %int %arg_0 %uint_2 %uint_0 %int_1
-               OpStore %res %11
+%atomicXor_75dc95 = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %21
+         %14 = OpAtomicXor %int %arg_0 %uint_2 %uint_0 %int_1
+               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %19
+%compute_main_inner = OpFunction %void None %25
 %local_invocation_index = OpFunctionParameter %uint
-         %22 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %18
+         %28 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %21
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %atomicXor_75dc95
+         %33 = OpFunctionCall %void %atomicXor_75dc95
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %10
+         %35 = OpLabel
+         %37 = OpLoad %uint %local_invocation_index_1
+         %36 = OpFunctionCall %void %compute_main_inner %37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.wgsl
index 41f5b3f..ea3a2f4 100644
--- a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicXor_75dc95() {
   var res : i32 = atomicXor(&(arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicXor_75dc95();
diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl
index 2846a69..d5a69f4 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl
@@ -28,7 +28,9 @@
 // fn atomicXor(ptr<storage, atomic<i32>, read_write>, i32) -> i32
 fn atomicXor_c1b78c() {
   var res: i32 = atomicXor(&sb_rw.arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.dxc.hlsl
index 43929d7..b83200a 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicXor_c1b78c() {
   int res = sb_rwatomicXor(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.fxc.hlsl
index 43929d7..b83200a 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicXor_c1b78c() {
   int res = sb_rwatomicXor(0u, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.glsl
index 5e44127..8f515e5 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicXor_c1b78c() {
   int res = atomicXor(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicXor_c1b78c() {
   int res = atomicXor(sb_rw.inner.arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.msl
index 42040a3..c7f1822 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicXor_c1b78c(device SB_RW* const tint_symbol) {
+void atomicXor_c1b78c(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_fetch_xor_explicit(&((*(tint_symbol)).arg_0), 1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicXor_c1b78c(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicXor_c1b78c(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicXor_c1b78c(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicXor_c1b78c(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.spvasm
index 64443fd..d598126 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicXor_c1b78c "atomicXor_c1b78c"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,35 +26,46 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-%atomicXor_c1b78c = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %20
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicXor %int %16 %uint_1 %uint_0 %int_1
-               OpStore %res %10
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicXor_c1b78c = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %23
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicXor %int %19 %uint_1 %uint_0 %int_1
+               OpStore %res %13
+         %25 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicXor_c1b78c
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicXor_c1b78c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicXor_c1b78c
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicXor_c1b78c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.wgsl
index af9861c..77ed115 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicXor_c1b78c() {
   var res : i32 = atomicXor(&(sb_rw.arg_0), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicXor_c1b78c();
diff --git a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl
index 15fa813..5ff5124 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl
@@ -25,7 +25,9 @@
 // fn atomicXor(ptr<workgroup, atomic<u32>, read_write>, u32) -> u32
 fn atomicXor_c8e6be() {
   var res: u32 = atomicXor(&arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.dxc.hlsl
index 404268d..e275040 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicXor_c8e6be() {
   uint atomic_result = 0u;
   InterlockedXor(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.fxc.hlsl
index 404268d..e275040 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicXor_c8e6be() {
   uint atomic_result = 0u;
   InterlockedXor(arg_0, 1u, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.glsl b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.glsl
index dd44734..3bef5f1 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicXor_c8e6be() {
   uint res = atomicXor(arg_0, 1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.msl b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.msl
index 41b94a0..e5c4061 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicXor_c8e6be(threadgroup atomic_uint* const tint_symbol) {
+void atomicXor_c8e6be(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_fetch_xor_explicit(tint_symbol, 1u, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicXor_c8e6be(tint_symbol_1);
+  atomicXor_c8e6be(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.spvasm
index a683557..f5b997c 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicXor_c8e6be "atomicXor_c8e6be"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicXor_c8e6be = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
-         %10 = OpAtomicXor %uint %arg_0 %uint_2 %uint_0 %uint_1
-               OpStore %res %10
+%atomicXor_c8e6be = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
+         %13 = OpAtomicXor %uint %arg_0 %uint_2 %uint_0 %uint_1
+               OpStore %res %13
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicXor_c8e6be
+         %32 = OpFunctionCall %void %atomicXor_c8e6be
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %9
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.wgsl
index f6bb2b9..5598ebb 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicXor_c8e6be() {
   var res : u32 = atomicXor(&(arg_0), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicXor_c8e6be();
diff --git a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl
index d7838315..66f00c8 100644
--- a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl
@@ -26,7 +26,9 @@
 // fn ceil(vec<3, f16>) -> vec<3, f16>
 fn ceil_09bf52() {
   var res: vec3<f16> = ceil(vec3<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.dxc.hlsl
index 375efff..e7b5d23 100644
--- a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_09bf52() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.fxc.hlsl
index c468a7d..0c3b19f 100644
--- a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_09bf52() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.glsl
index ec5f3bc..7bea47b 100644
--- a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ceil_09bf52() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ceil_09bf52() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ceil_09bf52() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.msl b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.msl
index 46a5ec3..c708a4d 100644
--- a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_09bf52() {
+void ceil_09bf52(device packed_half3* const tint_symbol_1) {
   half3 res = half3(2.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_09bf52();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  ceil_09bf52(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_09bf52();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  ceil_09bf52(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_09bf52();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  ceil_09bf52(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.spvasm
index 049a6c8..cf9f747 100644
--- a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_09bf52 "ceil_09bf52"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_09bf52 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%ceil_09bf52 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ceil_09bf52
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ceil_09bf52
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ceil_09bf52
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ceil_09bf52
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ceil_09bf52
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ceil_09bf52
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.wgsl
index 7c6fe63..c661486 100644
--- a/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/09bf52.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ceil_09bf52() {
   var res : vec3<f16> = ceil(vec3<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_09bf52();
diff --git a/test/tint/builtins/gen/literal/ceil/11b1dc.wgsl b/test/tint/builtins/gen/literal/ceil/11b1dc.wgsl
index bea2b7e..d01ddcb 100644
--- a/test/tint/builtins/gen/literal/ceil/11b1dc.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/11b1dc.wgsl
@@ -25,7 +25,6 @@
 fn ceil_11b1dc() {
   var res = ceil(vec4(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_11b1dc();
diff --git a/test/tint/builtins/gen/literal/ceil/18c240.wgsl b/test/tint/builtins/gen/literal/ceil/18c240.wgsl
index 59ea5c4..cdf60b2 100644
--- a/test/tint/builtins/gen/literal/ceil/18c240.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/18c240.wgsl
@@ -26,7 +26,9 @@
 // fn ceil(vec<2, f16>) -> vec<2, f16>
 fn ceil_18c240() {
   var res: vec2<f16> = ceil(vec2<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.dxc.hlsl
index 4b5e394..064bd86 100644
--- a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_18c240() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.fxc.hlsl
index 260de92..91688c3 100644
--- a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_18c240() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.glsl
index fca89d9..1b59dcc 100644
--- a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ceil_18c240() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ceil_18c240() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ceil_18c240() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.msl b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.msl
index 8881bb7..aa06b2e 100644
--- a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_18c240() {
+void ceil_18c240(device half2* const tint_symbol_1) {
   half2 res = half2(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_18c240();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  ceil_18c240(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_18c240();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  ceil_18c240(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_18c240();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  ceil_18c240(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.spvasm
index 2207042..8470982 100644
--- a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_18c240 "ceil_18c240"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_18c240 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%ceil_18c240 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ceil_18c240
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ceil_18c240
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ceil_18c240
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ceil_18c240
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ceil_18c240
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ceil_18c240
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.wgsl
index 559f2e5..a8af0b9 100644
--- a/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/18c240.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ceil_18c240() {
   var res : vec2<f16> = ceil(vec2<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_18c240();
diff --git a/test/tint/builtins/gen/literal/ceil/32c946.wgsl b/test/tint/builtins/gen/literal/ceil/32c946.wgsl
index 28a3c26..039494b 100644
--- a/test/tint/builtins/gen/literal/ceil/32c946.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/32c946.wgsl
@@ -25,7 +25,6 @@
 fn ceil_32c946() {
   var res = ceil(vec3(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_32c946();
diff --git a/test/tint/builtins/gen/literal/ceil/34064b.wgsl b/test/tint/builtins/gen/literal/ceil/34064b.wgsl
index 553052f..24ff290 100644
--- a/test/tint/builtins/gen/literal/ceil/34064b.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/34064b.wgsl
@@ -24,7 +24,9 @@
 // fn ceil(vec<3, f32>) -> vec<3, f32>
 fn ceil_34064b() {
   var res: vec3<f32> = ceil(vec3<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.dxc.hlsl
index 9033b8d..d44c950 100644
--- a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_34064b() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.fxc.hlsl
index 9033b8d..d44c950 100644
--- a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_34064b() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.glsl
index ab05efa..b9ef97b 100644
--- a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ceil_34064b() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ceil_34064b() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ceil_34064b() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.msl b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.msl
index 2de699a..45ba512 100644
--- a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_34064b() {
+void ceil_34064b(device packed_float3* const tint_symbol_1) {
   float3 res = float3(2.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_34064b();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  ceil_34064b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_34064b();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  ceil_34064b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_34064b();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  ceil_34064b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.spvasm
index 5538037..bd3e7f8 100644
--- a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_34064b "ceil_34064b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+         %18 = OpConstantComposite %v3float %float_2 %float_2 %float_2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_34064b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%ceil_34064b = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %ceil_34064b
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %ceil_34064b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ceil_34064b
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ceil_34064b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %ceil_34064b
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %ceil_34064b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.wgsl
index c88e88e..900e4f6 100644
--- a/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/34064b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ceil_34064b() {
   var res : vec3<f32> = ceil(vec3<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_34064b();
diff --git a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl
index 6ee53d9..89c654d 100644
--- a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl
@@ -26,7 +26,9 @@
 // fn ceil(vec<4, f16>) -> vec<4, f16>
 fn ceil_4bca2a() {
   var res: vec4<f16> = ceil(vec4<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.dxc.hlsl
index f7c44b6..0f12c75 100644
--- a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_4bca2a() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.fxc.hlsl
index 7767b67..6faea0a 100644
--- a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_4bca2a() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.glsl
index 221237f..d739326 100644
--- a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ceil_4bca2a() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ceil_4bca2a() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ceil_4bca2a() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.msl b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.msl
index d870cea..bb84b36 100644
--- a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_4bca2a() {
+void ceil_4bca2a(device half4* const tint_symbol_1) {
   half4 res = half4(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_4bca2a();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  ceil_4bca2a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_4bca2a();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  ceil_4bca2a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_4bca2a();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  ceil_4bca2a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.spvasm
index cff6dd3..c5749f0 100644
--- a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_4bca2a "ceil_4bca2a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_4bca2a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%ceil_4bca2a = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ceil_4bca2a
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ceil_4bca2a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ceil_4bca2a
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ceil_4bca2a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ceil_4bca2a
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ceil_4bca2a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.wgsl
index 0146378..fbf3f15 100644
--- a/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/4bca2a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ceil_4bca2a() {
   var res : vec4<f16> = ceil(vec4<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_4bca2a();
diff --git a/test/tint/builtins/gen/literal/ceil/678655.wgsl b/test/tint/builtins/gen/literal/ceil/678655.wgsl
index 2f81f6d..db0238f 100644
--- a/test/tint/builtins/gen/literal/ceil/678655.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/678655.wgsl
@@ -24,7 +24,9 @@
 // fn ceil(f32) -> f32
 fn ceil_678655() {
   var res: f32 = ceil(1.5f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.dxc.hlsl
index 56a79d1..ad2d012 100644
--- a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_678655() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.fxc.hlsl
index 56a79d1..ad2d012 100644
--- a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_678655() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.glsl
index 9a15224..3ed89c3 100644
--- a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ceil_678655() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ceil_678655() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ceil_678655() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.msl b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.msl
index bc40d4f..3727490 100644
--- a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_678655() {
+void ceil_678655(device float* const tint_symbol_1) {
   float res = 2.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_678655();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  ceil_678655(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_678655();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  ceil_678655(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_678655();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  ceil_678655(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.spvasm
index 81a9a67..702408c 100644
--- a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_678655 "ceil_678655"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_678655 = OpFunction %void None %9
-         %12 = OpLabel
+%ceil_678655 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_2
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %ceil_678655
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %ceil_678655
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %ceil_678655
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %ceil_678655
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ceil_678655
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ceil_678655
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.wgsl
index 01d590d..aed38ab 100644
--- a/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/678655.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ceil_678655() {
   var res : f32 = ceil(1.5f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_678655();
diff --git a/test/tint/builtins/gen/literal/ceil/96f597.wgsl b/test/tint/builtins/gen/literal/ceil/96f597.wgsl
index db8fc64..38ce746 100644
--- a/test/tint/builtins/gen/literal/ceil/96f597.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/96f597.wgsl
@@ -24,7 +24,9 @@
 // fn ceil(vec<2, f32>) -> vec<2, f32>
 fn ceil_96f597() {
   var res: vec2<f32> = ceil(vec2<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.dxc.hlsl
index 2469cd1..b8d87dc 100644
--- a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_96f597() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.fxc.hlsl
index 2469cd1..b8d87dc 100644
--- a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_96f597() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.glsl
index 9b37453..6297796 100644
--- a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ceil_96f597() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ceil_96f597() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ceil_96f597() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.msl b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.msl
index 2cd2768..2cb7c38 100644
--- a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_96f597() {
+void ceil_96f597(device float2* const tint_symbol_1) {
   float2 res = float2(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_96f597();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  ceil_96f597(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_96f597();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  ceil_96f597(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_96f597();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  ceil_96f597(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.spvasm
index 67e52a3..fa8f5b1 100644
--- a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_96f597 "ceil_96f597"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v2float %float_2 %float_2
+         %18 = OpConstantComposite %v2float %float_2 %float_2
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_96f597 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%ceil_96f597 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %ceil_96f597
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %ceil_96f597
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ceil_96f597
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ceil_96f597
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %ceil_96f597
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %ceil_96f597
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.wgsl
index 6cd0ba5..fb8535f 100644
--- a/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/96f597.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ceil_96f597() {
   var res : vec2<f32> = ceil(vec2<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_96f597();
diff --git a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl
index c2d9472..b5abb9d 100644
--- a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl
@@ -24,7 +24,9 @@
 // fn ceil(vec<4, f32>) -> vec<4, f32>
 fn ceil_b74c16() {
   var res: vec4<f32> = ceil(vec4<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.dxc.hlsl
index 00beff8..53344dc 100644
--- a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_b74c16() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.fxc.hlsl
index 00beff8..53344dc 100644
--- a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_b74c16() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.glsl
index 54c3f79..ea2f1da 100644
--- a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ceil_b74c16() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ceil_b74c16() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ceil_b74c16() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.msl b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.msl
index c68a4d6..338c569 100644
--- a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_b74c16() {
+void ceil_b74c16(device float4* const tint_symbol_1) {
   float4 res = float4(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_b74c16();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  ceil_b74c16(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_b74c16();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  ceil_b74c16(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_b74c16();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  ceil_b74c16(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.spvasm
index 4a60c5b..cac2e89 100644
--- a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_b74c16 "ceil_b74c16"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %14 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+         %17 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_b74c16 = OpFunction %void None %9
-         %12 = OpLabel
+%ceil_b74c16 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %ceil_b74c16
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %ceil_b74c16
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %ceil_b74c16
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %ceil_b74c16
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ceil_b74c16
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ceil_b74c16
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.wgsl
index 73d40a5..90742fd 100644
--- a/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/b74c16.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ceil_b74c16() {
   var res : vec4<f32> = ceil(vec4<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_b74c16();
diff --git a/test/tint/builtins/gen/literal/ceil/bb2ca2.wgsl b/test/tint/builtins/gen/literal/ceil/bb2ca2.wgsl
index a6a02bb..0507241 100644
--- a/test/tint/builtins/gen/literal/ceil/bb2ca2.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/bb2ca2.wgsl
@@ -25,7 +25,6 @@
 fn ceil_bb2ca2() {
   var res = ceil(vec2(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_bb2ca2();
diff --git a/test/tint/builtins/gen/literal/ceil/e0b70a.wgsl b/test/tint/builtins/gen/literal/ceil/e0b70a.wgsl
index c8f8d36..37cc71f 100644
--- a/test/tint/builtins/gen/literal/ceil/e0b70a.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/e0b70a.wgsl
@@ -25,7 +25,6 @@
 fn ceil_e0b70a() {
   var res = ceil(1.5);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_e0b70a();
diff --git a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl
index c494500..97afa62 100644
--- a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl
@@ -26,7 +26,9 @@
 // fn ceil(f16) -> f16
 fn ceil_f3f889() {
   var res: f16 = ceil(1.5h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.dxc.hlsl
index 8ffd661..b8707ca 100644
--- a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_f3f889() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.fxc.hlsl
index 94b8315..9a7d89b 100644
--- a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_f3f889() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.glsl
index ae674d5..dc1b2dd 100644
--- a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ceil_f3f889() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ceil_f3f889() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ceil_f3f889() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.msl b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.msl
index 4f3948a..e483298 100644
--- a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_f3f889() {
+void ceil_f3f889(device half* const tint_symbol_1) {
   half res = 2.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_f3f889();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  ceil_f3f889(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_f3f889();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  ceil_f3f889(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_f3f889();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  ceil_f3f889(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.spvasm
index dda4872..dd7b47b 100644
--- a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_f3f889 "ceil_f3f889"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_f3f889 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%ceil_f3f889 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %ceil_f3f889
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %ceil_f3f889
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %ceil_f3f889
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %ceil_f3f889
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ceil_f3f889
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ceil_f3f889
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.wgsl
index 300bb86..3190735 100644
--- a/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ceil/f3f889.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ceil_f3f889() {
   var res : f16 = ceil(1.5h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_f3f889();
diff --git a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl
index 047e915..e256012 100644
--- a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn clamp_0acf8f() {
   var res: vec2<f32> = clamp(vec2<f32>(1.f), vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.dxc.hlsl
index b802155..9e893ed 100644
--- a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_0acf8f() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.fxc.hlsl
index b802155..9e893ed 100644
--- a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_0acf8f() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.glsl
index 0a8ea6f..ecc2887 100644
--- a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void clamp_0acf8f() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void clamp_0acf8f() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void clamp_0acf8f() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.msl
index 3479eea..35592bf 100644
--- a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_0acf8f() {
+void clamp_0acf8f(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_0acf8f();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  clamp_0acf8f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_0acf8f();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  clamp_0acf8f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_0acf8f();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  clamp_0acf8f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.spvasm
index 0b0dd31..145d7f5 100644
--- a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_0acf8f "clamp_0acf8f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%clamp_0acf8f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%clamp_0acf8f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %clamp_0acf8f
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %clamp_0acf8f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %clamp_0acf8f
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %clamp_0acf8f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %clamp_0acf8f
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %clamp_0acf8f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.wgsl
index a555d79..5858c13 100644
--- a/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/0acf8f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_0acf8f() {
   var res : vec2<f32> = clamp(vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_0acf8f();
diff --git a/test/tint/builtins/gen/literal/clamp/177548.wgsl b/test/tint/builtins/gen/literal/clamp/177548.wgsl
index a7a3f4b..bcac3d0 100644
--- a/test/tint/builtins/gen/literal/clamp/177548.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/177548.wgsl
@@ -25,7 +25,6 @@
 fn clamp_177548() {
   var res = clamp(vec2(1), vec2(1), vec2(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_177548();
diff --git a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl
index 7571db5..f20af2e 100644
--- a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<4, i32>, vec<4, i32>, vec<4, i32>) -> vec<4, i32>
 fn clamp_1a32e3() {
   var res: vec4<i32> = clamp(vec4<i32>(1i), vec4<i32>(1i), vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.dxc.hlsl
index 8acdd22..1eb1b2a 100644
--- a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_1a32e3() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.fxc.hlsl
index 8acdd22..1eb1b2a 100644
--- a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_1a32e3() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.glsl
index 764d647..8ebb08d 100644
--- a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void clamp_1a32e3() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void clamp_1a32e3() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void clamp_1a32e3() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.msl
index e82fbd0..1b07aec 100644
--- a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_1a32e3() {
+void clamp_1a32e3(device int4* const tint_symbol_1) {
   int4 res = int4(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_1a32e3();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  clamp_1a32e3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_1a32e3();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  clamp_1a32e3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_1a32e3();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  clamp_1a32e3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.spvasm
index 65ad15f..f260047 100644
--- a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_1a32e3 "clamp_1a32e3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_1a32e3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+%clamp_1a32e3 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_1a32e3
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %clamp_1a32e3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_1a32e3
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_1a32e3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_1a32e3
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %clamp_1a32e3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.wgsl
index ea0c8ea..23b4e74 100644
--- a/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/1a32e3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_1a32e3() {
   var res : vec4<i32> = clamp(vec4<i32>(1i), vec4<i32>(1i), vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_1a32e3();
diff --git a/test/tint/builtins/gen/literal/clamp/235b29.wgsl b/test/tint/builtins/gen/literal/clamp/235b29.wgsl
index 59e9629..e00553f 100644
--- a/test/tint/builtins/gen/literal/clamp/235b29.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/235b29.wgsl
@@ -26,7 +26,9 @@
 // fn clamp(vec<2, f16>, vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn clamp_235b29() {
   var res: vec2<f16> = clamp(vec2<f16>(1.h), vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.dxc.hlsl
index 689753d..cc9745b 100644
--- a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_235b29() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.fxc.hlsl
index 4c0b67f..5cdf0da 100644
--- a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_235b29() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.glsl
index 5ca5bcc..712e1f2 100644
--- a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void clamp_235b29() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void clamp_235b29() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void clamp_235b29() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.msl
index e16b9e7..4150d65 100644
--- a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_235b29() {
+void clamp_235b29(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_235b29();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  clamp_235b29(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_235b29();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  clamp_235b29(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_235b29();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  clamp_235b29(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.spvasm
index 6bc8564..5c113b6 100644
--- a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_235b29 "clamp_235b29"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_235b29 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%clamp_235b29 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_235b29
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %clamp_235b29
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_235b29
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_235b29
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_235b29
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %clamp_235b29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.wgsl
index 9f3cf42..919bae1 100644
--- a/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/235b29.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn clamp_235b29() {
   var res : vec2<f16> = clamp(vec2<f16>(1.0h), vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_235b29();
diff --git a/test/tint/builtins/gen/literal/clamp/23aa4f.wgsl b/test/tint/builtins/gen/literal/clamp/23aa4f.wgsl
index 2bbd266..24b80d9 100644
--- a/test/tint/builtins/gen/literal/clamp/23aa4f.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/23aa4f.wgsl
@@ -25,7 +25,6 @@
 fn clamp_23aa4f() {
   var res = clamp(1., 1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_23aa4f();
diff --git a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl
index 746fadf..707dad9 100644
--- a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(f32, f32, f32) -> f32
 fn clamp_2bd567() {
   var res: f32 = clamp(1.f, 1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.dxc.hlsl
index 8b0b0c6..4a89a64 100644
--- a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2bd567() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.fxc.hlsl
index 8b0b0c6..4a89a64 100644
--- a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2bd567() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.glsl
index 406dade..011729e 100644
--- a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void clamp_2bd567() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void clamp_2bd567() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void clamp_2bd567() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.msl
index 0fae76a..939168c 100644
--- a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_2bd567() {
+void clamp_2bd567(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_2bd567();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  clamp_2bd567(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_2bd567();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  clamp_2bd567(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_2bd567();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  clamp_2bd567(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.spvasm
index fe56eaa..be92dbb 100644
--- a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_2bd567 "clamp_2bd567"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%clamp_2bd567 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%clamp_2bd567 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %clamp_2bd567
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %clamp_2bd567
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %clamp_2bd567
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %clamp_2bd567
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %clamp_2bd567
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %clamp_2bd567
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.wgsl
index 146e458..37b7566 100644
--- a/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/2bd567.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_2bd567() {
   var res : f32 = clamp(1.0f, 1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_2bd567();
diff --git a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl
index 26fa1c2..7e067b1 100644
--- a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn clamp_2bde41() {
   var res: vec4<f32> = clamp(vec4<f32>(1.f), vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.dxc.hlsl
index 9379a36..0066a1c 100644
--- a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2bde41() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.fxc.hlsl
index 9379a36..0066a1c 100644
--- a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2bde41() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.glsl
index eb8354b..1541453 100644
--- a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void clamp_2bde41() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void clamp_2bde41() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void clamp_2bde41() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.msl
index adf4ea4..3d661ac 100644
--- a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_2bde41() {
+void clamp_2bde41(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_2bde41();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  clamp_2bde41(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_2bde41();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  clamp_2bde41(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_2bde41();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  clamp_2bde41(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.spvasm
index 0b1234a..285f1c6 100644
--- a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_2bde41 "clamp_2bde41"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%clamp_2bde41 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%clamp_2bde41 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %clamp_2bde41
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %clamp_2bde41
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %clamp_2bde41
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %clamp_2bde41
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %clamp_2bde41
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %clamp_2bde41
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.wgsl
index 370e66b..7361634 100644
--- a/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/2bde41.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_2bde41() {
   var res : vec4<f32> = clamp(vec4<f32>(1.0f), vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_2bde41();
diff --git a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl
index d46e307..14d256c 100644
--- a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl
@@ -26,7 +26,9 @@
 // fn clamp(vec<4, f16>, vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn clamp_2c251b() {
   var res: vec4<f16> = clamp(vec4<f16>(1.h), vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.dxc.hlsl
index e790a46..ca770c8 100644
--- a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2c251b() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.fxc.hlsl
index f33bd44..76665c4 100644
--- a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2c251b() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.glsl
index 3044fef..6a1bfe5 100644
--- a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void clamp_2c251b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void clamp_2c251b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void clamp_2c251b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.msl
index a3a99b3..4f43176 100644
--- a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_2c251b() {
+void clamp_2c251b(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_2c251b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  clamp_2c251b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_2c251b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  clamp_2c251b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_2c251b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  clamp_2c251b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.spvasm
index c179c90..4c121f2 100644
--- a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_2c251b "clamp_2c251b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_2c251b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%clamp_2c251b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_2c251b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %clamp_2c251b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_2c251b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_2c251b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_2c251b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %clamp_2c251b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.wgsl
index b7e50a0..9473dce 100644
--- a/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/2c251b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn clamp_2c251b() {
   var res : vec4<f16> = clamp(vec4<f16>(1.0h), vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_2c251b();
diff --git a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl
index 59d930e..f00c343 100644
--- a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<3, u32>, vec<3, u32>, vec<3, u32>) -> vec<3, u32>
 fn clamp_548fc7() {
   var res: vec3<u32> = clamp(vec3<u32>(1u), vec3<u32>(1u), vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.dxc.hlsl
index 158ed1c..0bfabc3 100644
--- a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_548fc7() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.fxc.hlsl
index 158ed1c..0bfabc3 100644
--- a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_548fc7() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.glsl
index 30f8c4a..076d9e2 100644
--- a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void clamp_548fc7() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void clamp_548fc7() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void clamp_548fc7() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.msl
index ccea18c..1d93242 100644
--- a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_548fc7() {
+void clamp_548fc7(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(1u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_548fc7();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  clamp_548fc7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_548fc7();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  clamp_548fc7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_548fc7();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  clamp_548fc7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.spvasm
index 2e160d3..ea412c9 100644
--- a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_548fc7 "clamp_548fc7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_548fc7 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+%clamp_548fc7 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_548fc7
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %clamp_548fc7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_548fc7
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %clamp_548fc7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_548fc7
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %clamp_548fc7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.wgsl
index 27abeca..8c08c9e 100644
--- a/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/548fc7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_548fc7() {
   var res : vec3<u32> = clamp(vec3<u32>(1u), vec3<u32>(1u), vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_548fc7();
diff --git a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl
index 62e2d98..597844e 100644
--- a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl
@@ -26,7 +26,9 @@
 // fn clamp(f16, f16, f16) -> f16
 fn clamp_553ffb() {
   var res: f16 = clamp(1.h, 1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.dxc.hlsl
index 13664d0..6ef0c3c 100644
--- a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_553ffb() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.fxc.hlsl
index 2e4703b..b2d325d 100644
--- a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_553ffb() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.glsl
index 58b0e15..069acfd 100644
--- a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void clamp_553ffb() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void clamp_553ffb() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void clamp_553ffb() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.msl
index 72b5e78..8356432 100644
--- a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_553ffb() {
+void clamp_553ffb(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_553ffb();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  clamp_553ffb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_553ffb();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  clamp_553ffb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_553ffb();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  clamp_553ffb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.spvasm
index e36bfdb..348746b 100644
--- a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_553ffb "clamp_553ffb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_553ffb = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%clamp_553ffb = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %clamp_553ffb
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %clamp_553ffb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %clamp_553ffb
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %clamp_553ffb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %clamp_553ffb
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %clamp_553ffb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.wgsl
index 51e5047..607fec9 100644
--- a/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/553ffb.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn clamp_553ffb() {
   var res : f16 = clamp(1.0h, 1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_553ffb();
diff --git a/test/tint/builtins/gen/literal/clamp/5cf700.wgsl b/test/tint/builtins/gen/literal/clamp/5cf700.wgsl
index 4e81cf3..ffe073f 100644
--- a/test/tint/builtins/gen/literal/clamp/5cf700.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/5cf700.wgsl
@@ -25,7 +25,6 @@
 fn clamp_5cf700() {
   var res = clamp(vec3(1.), vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_5cf700();
diff --git a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl
index 4a93eb9..dfa37d7 100644
--- a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<3, i32>, vec<3, i32>, vec<3, i32>) -> vec<3, i32>
 fn clamp_5f0819() {
   var res: vec3<i32> = clamp(vec3<i32>(1i), vec3<i32>(1i), vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.dxc.hlsl
index f1d83d5..b68a074 100644
--- a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_5f0819() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.fxc.hlsl
index f1d83d5..b68a074 100644
--- a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_5f0819() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.glsl
index 1f50edd..feecffc 100644
--- a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void clamp_5f0819() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void clamp_5f0819() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void clamp_5f0819() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.msl
index 724945f..52aef27 100644
--- a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_5f0819() {
+void clamp_5f0819(device packed_int3* const tint_symbol_1) {
   int3 res = int3(1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_5f0819();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  clamp_5f0819(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_5f0819();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  clamp_5f0819(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_5f0819();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  clamp_5f0819(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.spvasm
index e57ec12..01103b9 100644
--- a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_5f0819 "clamp_5f0819"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_5f0819 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+%clamp_5f0819 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_5f0819
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %clamp_5f0819
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_5f0819
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_5f0819
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_5f0819
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %clamp_5f0819
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.wgsl
index 71062f5..a45f6f4 100644
--- a/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/5f0819.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_5f0819() {
   var res : vec3<i32> = clamp(vec3<i32>(1i), vec3<i32>(1i), vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_5f0819();
diff --git a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl
index 15f8d67..750ad03 100644
--- a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<2, i32>, vec<2, i32>, vec<2, i32>) -> vec<2, i32>
 fn clamp_6c1749() {
   var res: vec2<i32> = clamp(vec2<i32>(1i), vec2<i32>(1i), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.dxc.hlsl
index 7178ef5..59583c0 100644
--- a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_6c1749() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.fxc.hlsl
index 7178ef5..59583c0 100644
--- a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_6c1749() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.glsl
index 3d0bb25..2aeb494 100644
--- a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void clamp_6c1749() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void clamp_6c1749() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void clamp_6c1749() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.msl
index 37c4764..fd30d433 100644
--- a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_6c1749() {
+void clamp_6c1749(device int2* const tint_symbol_1) {
   int2 res = int2(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_6c1749();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  clamp_6c1749(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_6c1749();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  clamp_6c1749(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_6c1749();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  clamp_6c1749(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.spvasm
index bbcb3c3..083dae1 100644
--- a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_6c1749 "clamp_6c1749"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_6c1749 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+%clamp_6c1749 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_6c1749
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %clamp_6c1749
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_6c1749
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_6c1749
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_6c1749
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %clamp_6c1749
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.wgsl
index fdbd4b8..ed87a13 100644
--- a/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/6c1749.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_6c1749() {
   var res : vec2<i32> = clamp(vec2<i32>(1i), vec2<i32>(1i), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_6c1749();
diff --git a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl
index ae8377df22..1cb8e03 100644
--- a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<2, u32>, vec<2, u32>, vec<2, u32>) -> vec<2, u32>
 fn clamp_7706d7() {
   var res: vec2<u32> = clamp(vec2<u32>(1u), vec2<u32>(1u), vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.dxc.hlsl
index 039fbea..45b6223 100644
--- a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_7706d7() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.fxc.hlsl
index 039fbea..45b6223 100644
--- a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_7706d7() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.glsl
index 170b7d0..f72ff5b 100644
--- a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void clamp_7706d7() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void clamp_7706d7() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void clamp_7706d7() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.msl
index 33e531e..a45bcd6 100644
--- a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_7706d7() {
+void clamp_7706d7(device uint2* const tint_symbol_1) {
   uint2 res = uint2(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_7706d7();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  clamp_7706d7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_7706d7();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  clamp_7706d7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_7706d7();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  clamp_7706d7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.spvasm
index 5d73e0a..0103e15 100644
--- a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_7706d7 "clamp_7706d7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_7706d7 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+%clamp_7706d7 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_7706d7
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %clamp_7706d7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_7706d7
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %clamp_7706d7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_7706d7
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %clamp_7706d7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.wgsl
index a614443..c1ad815 100644
--- a/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/7706d7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_7706d7() {
   var res : vec2<u32> = clamp(vec2<u32>(1u), vec2<u32>(1u), vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_7706d7();
diff --git a/test/tint/builtins/gen/literal/clamp/867397.wgsl b/test/tint/builtins/gen/literal/clamp/867397.wgsl
index bf27902..480943a 100644
--- a/test/tint/builtins/gen/literal/clamp/867397.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/867397.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn clamp_867397() {
   var res: vec3<f32> = clamp(vec3<f32>(1.f), vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.dxc.hlsl
index 80c2bd0..9070839 100644
--- a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_867397() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.fxc.hlsl
index 80c2bd0..9070839 100644
--- a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_867397() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.glsl
index 63fb7a8..11df59f 100644
--- a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void clamp_867397() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void clamp_867397() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void clamp_867397() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.msl
index a356772..2b8a634 100644
--- a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_867397() {
+void clamp_867397(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_867397();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  clamp_867397(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_867397();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  clamp_867397(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_867397();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  clamp_867397(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.spvasm
index cadd954..aaf6602 100644
--- a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_867397 "clamp_867397"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%clamp_867397 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%clamp_867397 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %clamp_867397
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %clamp_867397
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %clamp_867397
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %clamp_867397
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %clamp_867397
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %clamp_867397
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.wgsl
index e1dcadf..24084df 100644
--- a/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/867397.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_867397() {
   var res : vec3<f32> = clamp(vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_867397();
diff --git a/test/tint/builtins/gen/literal/clamp/87df46.wgsl b/test/tint/builtins/gen/literal/clamp/87df46.wgsl
index 6e3a04a..bacf7b1 100644
--- a/test/tint/builtins/gen/literal/clamp/87df46.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/87df46.wgsl
@@ -25,7 +25,6 @@
 fn clamp_87df46() {
   var res = clamp(vec4(1.), vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_87df46();
diff --git a/test/tint/builtins/gen/literal/clamp/8b1eaa.wgsl b/test/tint/builtins/gen/literal/clamp/8b1eaa.wgsl
index bfa3d60..e15379a 100644
--- a/test/tint/builtins/gen/literal/clamp/8b1eaa.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/8b1eaa.wgsl
@@ -25,7 +25,6 @@
 fn clamp_8b1eaa() {
   var res = clamp(vec3(1), vec3(1), vec3(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_8b1eaa();
diff --git a/test/tint/builtins/gen/literal/clamp/96e56a.wgsl b/test/tint/builtins/gen/literal/clamp/96e56a.wgsl
index 2cdba00..5942375 100644
--- a/test/tint/builtins/gen/literal/clamp/96e56a.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/96e56a.wgsl
@@ -25,7 +25,6 @@
 fn clamp_96e56a() {
   var res = clamp(1, 1, 1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_96e56a();
diff --git a/test/tint/builtins/gen/literal/clamp/9d731c.wgsl b/test/tint/builtins/gen/literal/clamp/9d731c.wgsl
index 0bc1cb2..5b577c7 100644
--- a/test/tint/builtins/gen/literal/clamp/9d731c.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/9d731c.wgsl
@@ -25,7 +25,6 @@
 fn clamp_9d731c() {
   var res = clamp(vec2(1.), vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_9d731c();
diff --git a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl
index ac3f67c..368136a 100644
--- a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(u32, u32, u32) -> u32
 fn clamp_a2de25() {
   var res: u32 = clamp(1u, 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.dxc.hlsl
index f28586f..abdf03a 100644
--- a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_a2de25() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.fxc.hlsl
index f28586f..abdf03a 100644
--- a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_a2de25() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.glsl
index bcd4b44..928a9c5 100644
--- a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void clamp_a2de25() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void clamp_a2de25() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void clamp_a2de25() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.msl
index 49c396a..27ebd8b 100644
--- a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_a2de25() {
+void clamp_a2de25(device uint* const tint_symbol_1) {
   uint res = 1u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_a2de25();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  clamp_a2de25(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_a2de25();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  clamp_a2de25(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_a2de25();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  clamp_a2de25(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.spvasm
index 3b4ab71..dafa4f2 100644
--- a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_a2de25 "clamp_a2de25"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_a2de25 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%clamp_a2de25 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_1
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %clamp_a2de25
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %clamp_a2de25
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %clamp_a2de25
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %clamp_a2de25
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %clamp_a2de25
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_a2de25
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.wgsl
index 5aee4d3..6c5f266 100644
--- a/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/a2de25.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_a2de25() {
   var res : u32 = clamp(1u, 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_a2de25();
diff --git a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl
index cc28c92..63f09ec 100644
--- a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(i32, i32, i32) -> i32
 fn clamp_b07c65() {
   var res: i32 = clamp(1i, 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.dxc.hlsl
index bcf0673..32eb190 100644
--- a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_b07c65() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.fxc.hlsl
index bcf0673..32eb190 100644
--- a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_b07c65() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.glsl
index a6dba03..45468cd 100644
--- a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void clamp_b07c65() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void clamp_b07c65() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void clamp_b07c65() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.msl
index ad20dc6..af9afb3 100644
--- a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_b07c65() {
+void clamp_b07c65(device int* const tint_symbol_1) {
   int res = 1;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_b07c65();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  clamp_b07c65(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_b07c65();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  clamp_b07c65(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_b07c65();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  clamp_b07c65(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.spvasm
index 6e55cb9..0a2eb09 100644
--- a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_b07c65 "clamp_b07c65"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_b07c65 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+%clamp_b07c65 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %clamp_b07c65
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %clamp_b07c65
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %clamp_b07c65
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %clamp_b07c65
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %clamp_b07c65
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %clamp_b07c65
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.wgsl
index 0251ae9..935800f 100644
--- a/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/b07c65.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_b07c65() {
   var res : i32 = clamp(1i, 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_b07c65();
diff --git a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl
index 10e7a35..4a12793 100644
--- a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl
@@ -26,7 +26,9 @@
 // fn clamp(vec<3, f16>, vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn clamp_b195eb() {
   var res: vec3<f16> = clamp(vec3<f16>(1.h), vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.dxc.hlsl
index 251c215..0419937 100644
--- a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_b195eb() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.fxc.hlsl
index 96a0f1b..a142ba9 100644
--- a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_b195eb() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.glsl
index 887817b..cf21127 100644
--- a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void clamp_b195eb() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void clamp_b195eb() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void clamp_b195eb() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.msl
index 0570ea1..4214fd3 100644
--- a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_b195eb() {
+void clamp_b195eb(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_b195eb();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  clamp_b195eb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_b195eb();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  clamp_b195eb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_b195eb();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  clamp_b195eb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.spvasm
index 066e6d4..15552ad 100644
--- a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_b195eb "clamp_b195eb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_b195eb = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%clamp_b195eb = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_b195eb
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %clamp_b195eb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_b195eb
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_b195eb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_b195eb
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %clamp_b195eb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.wgsl
index dc537e0..faf5f06 100644
--- a/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/b195eb.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn clamp_b195eb() {
   var res : vec3<f16> = clamp(vec3<f16>(1.0h), vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_b195eb();
diff --git a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl
index d4cbe89..d5c4262 100644
--- a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl
@@ -24,7 +24,9 @@
 // fn clamp(vec<4, u32>, vec<4, u32>, vec<4, u32>) -> vec<4, u32>
 fn clamp_bd43ce() {
   var res: vec4<u32> = clamp(vec4<u32>(1u), vec4<u32>(1u), vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.dxc.hlsl
index 948d108..3e1d712 100644
--- a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_bd43ce() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.fxc.hlsl
index 948d108..3e1d712 100644
--- a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_bd43ce() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.glsl
index 863d712..86f9cbe 100644
--- a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void clamp_bd43ce() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void clamp_bd43ce() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void clamp_bd43ce() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.msl
index de1f5a6..60bf4d7 100644
--- a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_bd43ce() {
+void clamp_bd43ce(device uint4* const tint_symbol_1) {
   uint4 res = uint4(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_bd43ce();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  clamp_bd43ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_bd43ce();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  clamp_bd43ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_bd43ce();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  clamp_bd43ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.spvasm
index f08dc7b..eab8880 100644
--- a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_bd43ce "clamp_bd43ce"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_bd43ce = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+%clamp_bd43ce = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %clamp_bd43ce
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %clamp_bd43ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_bd43ce
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %clamp_bd43ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_bd43ce
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %clamp_bd43ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.wgsl
index 2b4ad42..827e2b1 100644
--- a/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/bd43ce.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn clamp_bd43ce() {
   var res : vec4<u32> = clamp(vec4<u32>(1u), vec4<u32>(1u), vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_bd43ce();
diff --git a/test/tint/builtins/gen/literal/clamp/d396af.wgsl b/test/tint/builtins/gen/literal/clamp/d396af.wgsl
index 569fe01..4a1dc03 100644
--- a/test/tint/builtins/gen/literal/clamp/d396af.wgsl
+++ b/test/tint/builtins/gen/literal/clamp/d396af.wgsl
@@ -25,7 +25,6 @@
 fn clamp_d396af() {
   var res = clamp(vec4(1), vec4(1), vec4(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_d396af();
diff --git a/test/tint/builtins/gen/literal/cos/0835a8.wgsl b/test/tint/builtins/gen/literal/cos/0835a8.wgsl
index d1d62e3..ffdfde4 100644
--- a/test/tint/builtins/gen/literal/cos/0835a8.wgsl
+++ b/test/tint/builtins/gen/literal/cos/0835a8.wgsl
@@ -26,7 +26,9 @@
 // fn cos(vec<3, f16>) -> vec<3, f16>
 fn cos_0835a8() {
   var res: vec3<f16> = cos(vec3<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.dxc.hlsl
index d8034aa..5f1e189 100644
--- a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_0835a8() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.fxc.hlsl
index cf34ab4..ddc8085 100644
--- a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_0835a8() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.glsl
index 5dac11b..2769d74 100644
--- a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cos_0835a8() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cos_0835a8() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cos_0835a8() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.msl b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.msl
index 3c7c2be..866dfb4 100644
--- a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_0835a8() {
+void cos_0835a8(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_0835a8();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  cos_0835a8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_0835a8();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  cos_0835a8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_0835a8();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  cos_0835a8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.spvasm
index a7fdda5..e87d255 100644
--- a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_0835a8 "cos_0835a8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_0835a8 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %cos_0835a8 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %cos_0835a8
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %cos_0835a8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %cos_0835a8
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %cos_0835a8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %cos_0835a8
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %cos_0835a8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.wgsl
index 5ffc3a0..589d1fa 100644
--- a/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cos/0835a8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cos_0835a8() {
   var res : vec3<f16> = cos(vec3<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_0835a8();
diff --git a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl
index 391b81e3..da755ed 100644
--- a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl
+++ b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl
@@ -26,7 +26,9 @@
 // fn cos(vec<4, f16>) -> vec<4, f16>
 fn cos_0a89f7() {
   var res: vec4<f16> = cos(vec4<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.dxc.hlsl
index 5539b63..1414c57 100644
--- a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_0a89f7() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.fxc.hlsl
index 3ee553e..1d55912 100644
--- a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_0a89f7() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.glsl
index 6409128..b58e172 100644
--- a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cos_0a89f7() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cos_0a89f7() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cos_0a89f7() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.msl b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.msl
index 6498f29..f6baf2a 100644
--- a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_0a89f7() {
+void cos_0a89f7(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_0a89f7();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  cos_0a89f7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_0a89f7();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  cos_0a89f7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_0a89f7();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  cos_0a89f7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.spvasm
index d18e775..0c16241 100644
--- a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_0a89f7 "cos_0a89f7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_0a89f7 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %cos_0a89f7 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %cos_0a89f7
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %cos_0a89f7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %cos_0a89f7
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %cos_0a89f7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %cos_0a89f7
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %cos_0a89f7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.wgsl
index 79f9568..9575958 100644
--- a/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cos/0a89f7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cos_0a89f7() {
   var res : vec4<f16> = cos(vec4<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_0a89f7();
diff --git a/test/tint/builtins/gen/literal/cos/16dc15.wgsl b/test/tint/builtins/gen/literal/cos/16dc15.wgsl
index 020b64f..be8210e 100644
--- a/test/tint/builtins/gen/literal/cos/16dc15.wgsl
+++ b/test/tint/builtins/gen/literal/cos/16dc15.wgsl
@@ -24,7 +24,9 @@
 // fn cos(vec<3, f32>) -> vec<3, f32>
 fn cos_16dc15() {
   var res: vec3<f32> = cos(vec3<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.dxc.hlsl
index 939a4bd..86cc62f 100644
--- a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_16dc15() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.fxc.hlsl
index 939a4bd..86cc62f 100644
--- a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_16dc15() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.glsl
index c269742..a06b834 100644
--- a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cos_16dc15() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cos_16dc15() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cos_16dc15() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.msl b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.msl
index 9965150..ae182d7 100644
--- a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_16dc15() {
+void cos_16dc15(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_16dc15();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  cos_16dc15(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_16dc15();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  cos_16dc15(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_16dc15();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  cos_16dc15(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.spvasm
index 3e664f2..a3f2299 100644
--- a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_16dc15 "cos_16dc15"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
- %cos_16dc15 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+ %cos_16dc15 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %cos_16dc15
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %cos_16dc15
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cos_16dc15
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cos_16dc15
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cos_16dc15
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cos_16dc15
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.wgsl
index e3c1486..ccc6c5b 100644
--- a/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cos/16dc15.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cos_16dc15() {
   var res : vec3<f32> = cos(vec3<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_16dc15();
diff --git a/test/tint/builtins/gen/literal/cos/29d66d.wgsl b/test/tint/builtins/gen/literal/cos/29d66d.wgsl
index 4e87050..37de407 100644
--- a/test/tint/builtins/gen/literal/cos/29d66d.wgsl
+++ b/test/tint/builtins/gen/literal/cos/29d66d.wgsl
@@ -24,7 +24,9 @@
 // fn cos(vec<4, f32>) -> vec<4, f32>
 fn cos_29d66d() {
   var res: vec4<f32> = cos(vec4<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.dxc.hlsl
index a0efab1..f69fb77 100644
--- a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_29d66d() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.fxc.hlsl
index a0efab1..f69fb77 100644
--- a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_29d66d() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.glsl
index 32ebb3a..8717c5e 100644
--- a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cos_29d66d() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cos_29d66d() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cos_29d66d() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.msl b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.msl
index 0bcf095..fa64d66 100644
--- a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_29d66d() {
+void cos_29d66d(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_29d66d();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  cos_29d66d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_29d66d();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  cos_29d66d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_29d66d();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  cos_29d66d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.spvasm
index fdd927c..044a294 100644
--- a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_29d66d "cos_29d66d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
- %cos_29d66d = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+ %cos_29d66d = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %cos_29d66d
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %cos_29d66d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %cos_29d66d
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %cos_29d66d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %cos_29d66d
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %cos_29d66d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.wgsl
index f1e7ea0..7a3f494 100644
--- a/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cos/29d66d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cos_29d66d() {
   var res : vec4<f32> = cos(vec4<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_29d66d();
diff --git a/test/tint/builtins/gen/literal/cos/47d768.wgsl b/test/tint/builtins/gen/literal/cos/47d768.wgsl
index af54503..18e6ecf 100644
--- a/test/tint/builtins/gen/literal/cos/47d768.wgsl
+++ b/test/tint/builtins/gen/literal/cos/47d768.wgsl
@@ -25,7 +25,6 @@
 fn cos_47d768() {
   var res = cos(vec4(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_47d768();
diff --git a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl
index 36f9ccb..6e92e06 100644
--- a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl
+++ b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl
@@ -26,7 +26,9 @@
 // fn cos(vec<2, f16>) -> vec<2, f16>
 fn cos_5bc2c6() {
   var res: vec2<f16> = cos(vec2<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.dxc.hlsl
index 2003bbf..c4bbb86 100644
--- a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_5bc2c6() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.fxc.hlsl
index 1032178..38a711f 100644
--- a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_5bc2c6() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.glsl
index 3c24e56..893f3ec 100644
--- a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cos_5bc2c6() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cos_5bc2c6() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cos_5bc2c6() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.msl
index 469a84f..d9224e6 100644
--- a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_5bc2c6() {
+void cos_5bc2c6(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_5bc2c6();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  cos_5bc2c6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_5bc2c6();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  cos_5bc2c6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_5bc2c6();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  cos_5bc2c6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.spvasm
index 5935f70..396bfaa 100644
--- a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_5bc2c6 "cos_5bc2c6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_5bc2c6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %cos_5bc2c6 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %cos_5bc2c6
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %cos_5bc2c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %cos_5bc2c6
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %cos_5bc2c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %cos_5bc2c6
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %cos_5bc2c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.wgsl
index d8bcd66..7dd7f64 100644
--- a/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cos/5bc2c6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cos_5bc2c6() {
   var res : vec2<f16> = cos(vec2<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_5bc2c6();
diff --git a/test/tint/builtins/gen/literal/cos/6b1fdf.wgsl b/test/tint/builtins/gen/literal/cos/6b1fdf.wgsl
index 765254e..49613a1 100644
--- a/test/tint/builtins/gen/literal/cos/6b1fdf.wgsl
+++ b/test/tint/builtins/gen/literal/cos/6b1fdf.wgsl
@@ -25,7 +25,6 @@
 fn cos_6b1fdf() {
   var res = cos(vec3(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_6b1fdf();
diff --git a/test/tint/builtins/gen/literal/cos/a297d4.wgsl b/test/tint/builtins/gen/literal/cos/a297d4.wgsl
index b53ac0a..649b5be 100644
--- a/test/tint/builtins/gen/literal/cos/a297d4.wgsl
+++ b/test/tint/builtins/gen/literal/cos/a297d4.wgsl
@@ -25,7 +25,6 @@
 fn cos_a297d4() {
   var res = cos(0.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_a297d4();
diff --git a/test/tint/builtins/gen/literal/cos/af7447.wgsl b/test/tint/builtins/gen/literal/cos/af7447.wgsl
index c8213a05..f522147 100644
--- a/test/tint/builtins/gen/literal/cos/af7447.wgsl
+++ b/test/tint/builtins/gen/literal/cos/af7447.wgsl
@@ -25,7 +25,6 @@
 fn cos_af7447() {
   var res = cos(vec2(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_af7447();
diff --git a/test/tint/builtins/gen/literal/cos/c3b486.wgsl b/test/tint/builtins/gen/literal/cos/c3b486.wgsl
index 92de1ad..901fe50 100644
--- a/test/tint/builtins/gen/literal/cos/c3b486.wgsl
+++ b/test/tint/builtins/gen/literal/cos/c3b486.wgsl
@@ -24,7 +24,9 @@
 // fn cos(vec<2, f32>) -> vec<2, f32>
 fn cos_c3b486() {
   var res: vec2<f32> = cos(vec2<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.dxc.hlsl
index bb4ac58..c3846b1 100644
--- a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_c3b486() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.fxc.hlsl
index bb4ac58..c3846b1 100644
--- a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_c3b486() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.glsl
index c2b8ff3..487295e 100644
--- a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cos_c3b486() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cos_c3b486() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cos_c3b486() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.msl b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.msl
index 554b52f..fc3d5c9 100644
--- a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_c3b486() {
+void cos_c3b486(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_c3b486();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  cos_c3b486(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_c3b486();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  cos_c3b486(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_c3b486();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  cos_c3b486(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.spvasm
index 8807cef..a6e6cc8 100644
--- a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_c3b486 "cos_c3b486"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
- %cos_c3b486 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+ %cos_c3b486 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %cos_c3b486
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %cos_c3b486
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cos_c3b486
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cos_c3b486
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cos_c3b486
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cos_c3b486
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.wgsl
index 6f0ceae..83bc1ee 100644
--- a/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cos/c3b486.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cos_c3b486() {
   var res : vec2<f32> = cos(vec2<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_c3b486();
diff --git a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl
index 01d13a8..250413e 100644
--- a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl
+++ b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl
@@ -24,7 +24,9 @@
 // fn cos(f32) -> f32
 fn cos_c5c28e() {
   var res: f32 = cos(0.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.dxc.hlsl
index c4c6dd18..94953b8 100644
--- a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_c5c28e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.fxc.hlsl
index c4c6dd18..94953b8 100644
--- a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_c5c28e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.glsl
index ae88f39..b799e95 100644
--- a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cos_c5c28e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cos_c5c28e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cos_c5c28e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.msl b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.msl
index f4d033f..efbfd25 100644
--- a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_c5c28e() {
+void cos_c5c28e(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_c5c28e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  cos_c5c28e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_c5c28e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  cos_c5c28e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_c5c28e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  cos_c5c28e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.spvasm
index 6305ec3..fd0cfa6 100644
--- a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_c5c28e "cos_c5c28e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
- %cos_c5c28e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+ %cos_c5c28e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %cos_c5c28e
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %cos_c5c28e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %cos_c5c28e
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %cos_c5c28e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cos_c5c28e
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cos_c5c28e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.wgsl
index 6b5f9a1..2ce89a0 100644
--- a/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cos/c5c28e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cos_c5c28e() {
   var res : f32 = cos(0.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_c5c28e();
diff --git a/test/tint/builtins/gen/literal/cos/fc047d.wgsl b/test/tint/builtins/gen/literal/cos/fc047d.wgsl
index 2f4cc35..9792bef 100644
--- a/test/tint/builtins/gen/literal/cos/fc047d.wgsl
+++ b/test/tint/builtins/gen/literal/cos/fc047d.wgsl
@@ -26,7 +26,9 @@
 // fn cos(f16) -> f16
 fn cos_fc047d() {
   var res: f16 = cos(0.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.dxc.hlsl
index cd55028..505f777 100644
--- a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_fc047d() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.fxc.hlsl
index 5c5aa25..e15c623 100644
--- a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_fc047d() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.glsl
index 9e9407a..e05bafc 100644
--- a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cos_fc047d() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cos_fc047d() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cos_fc047d() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.msl b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.msl
index eb7ce56..ce59707 100644
--- a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_fc047d() {
+void cos_fc047d(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_fc047d();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  cos_fc047d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_fc047d();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  cos_fc047d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_fc047d();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  cos_fc047d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.spvasm
index 6df5d09..5268701 100644
--- a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_fc047d "cos_fc047d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_fc047d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %cos_fc047d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %cos_fc047d
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %cos_fc047d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cos_fc047d
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cos_fc047d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cos_fc047d
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cos_fc047d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.wgsl
index 49035a2..41e98cc 100644
--- a/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cos/fc047d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cos_fc047d() {
   var res : f16 = cos(0.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_fc047d();
diff --git a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl
index 99f24cf..11ebb47 100644
--- a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl
@@ -26,7 +26,9 @@
 // fn cosh(f16) -> f16
 fn cosh_2ed778() {
   var res: f16 = cosh(0.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.dxc.hlsl
index aa3e8ab..57815de 100644
--- a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_2ed778() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.fxc.hlsl
index f0a204c..6b21c54 100644
--- a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_2ed778() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.glsl
index 6401b27..d18890d 100644
--- a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cosh_2ed778() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cosh_2ed778() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cosh_2ed778() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.msl b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.msl
index 7b3f1f8..70f0a5e 100644
--- a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_2ed778() {
+void cosh_2ed778(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_2ed778();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  cosh_2ed778(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_2ed778();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  cosh_2ed778(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_2ed778();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  cosh_2ed778(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.spvasm
index ed1cf22..b8fa322 100644
--- a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_2ed778 "cosh_2ed778"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_2ed778 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%cosh_2ed778 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %cosh_2ed778
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %cosh_2ed778
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cosh_2ed778
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cosh_2ed778
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cosh_2ed778
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cosh_2ed778
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.wgsl
index 3da45546..fb1b450 100644
--- a/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/2ed778.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cosh_2ed778() {
   var res : f16 = cosh(0.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_2ed778();
diff --git a/test/tint/builtins/gen/literal/cosh/377652.wgsl b/test/tint/builtins/gen/literal/cosh/377652.wgsl
index e53b8e4f..e392770 100644
--- a/test/tint/builtins/gen/literal/cosh/377652.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/377652.wgsl
@@ -24,7 +24,9 @@
 // fn cosh(vec<3, f32>) -> vec<3, f32>
 fn cosh_377652() {
   var res: vec3<f32> = cosh(vec3<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.dxc.hlsl
index d5ecfdf..a1b246b 100644
--- a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_377652() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.fxc.hlsl
index d5ecfdf..a1b246b 100644
--- a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_377652() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.glsl
index 31b889c..01c238a 100644
--- a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cosh_377652() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cosh_377652() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cosh_377652() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.msl b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.msl
index 06053cc..101a83e 100644
--- a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_377652() {
+void cosh_377652(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_377652();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  cosh_377652(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_377652();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  cosh_377652(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_377652();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  cosh_377652(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.spvasm
index b5bd5e7..c16a7fb 100644
--- a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_377652 "cosh_377652"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%cosh_377652 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%cosh_377652 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %cosh_377652
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %cosh_377652
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cosh_377652
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cosh_377652
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cosh_377652
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cosh_377652
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.wgsl
index f2b0274..92fda25 100644
--- a/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/377652.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cosh_377652() {
   var res : vec3<f32> = cosh(vec3<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_377652();
diff --git a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl
index 93fe211..eb9ca4c 100644
--- a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl
@@ -26,7 +26,9 @@
 // fn cosh(vec<4, f16>) -> vec<4, f16>
 fn cosh_3b7bbf() {
   var res: vec4<f16> = cosh(vec4<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.dxc.hlsl
index 46fb351..f2caec7 100644
--- a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_3b7bbf() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.fxc.hlsl
index 4112216..48030f0 100644
--- a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_3b7bbf() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.glsl
index c4d1c07..046c0a0 100644
--- a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cosh_3b7bbf() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cosh_3b7bbf() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cosh_3b7bbf() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.msl b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.msl
index 485c537..2d45e03 100644
--- a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_3b7bbf() {
+void cosh_3b7bbf(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_3b7bbf();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  cosh_3b7bbf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_3b7bbf();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  cosh_3b7bbf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_3b7bbf();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  cosh_3b7bbf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.spvasm
index 41e08ab..6647a5b 100644
--- a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_3b7bbf "cosh_3b7bbf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_3b7bbf = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%cosh_3b7bbf = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %cosh_3b7bbf
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %cosh_3b7bbf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %cosh_3b7bbf
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %cosh_3b7bbf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %cosh_3b7bbf
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %cosh_3b7bbf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.wgsl
index acb612d..d737981 100644
--- a/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/3b7bbf.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cosh_3b7bbf() {
   var res : vec4<f16> = cosh(vec4<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_3b7bbf();
diff --git a/test/tint/builtins/gen/literal/cosh/432645.wgsl b/test/tint/builtins/gen/literal/cosh/432645.wgsl
index cff8090..303832c 100644
--- a/test/tint/builtins/gen/literal/cosh/432645.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/432645.wgsl
@@ -25,7 +25,6 @@
 fn cosh_432645() {
   var res = cosh(vec2(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_432645();
diff --git a/test/tint/builtins/gen/literal/cosh/43b672.wgsl b/test/tint/builtins/gen/literal/cosh/43b672.wgsl
index ddbe3b6..8235f3e 100644
--- a/test/tint/builtins/gen/literal/cosh/43b672.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/43b672.wgsl
@@ -26,7 +26,9 @@
 // fn cosh(vec<2, f16>) -> vec<2, f16>
 fn cosh_43b672() {
   var res: vec2<f16> = cosh(vec2<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.dxc.hlsl
index 55d0069..e170ba95 100644
--- a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_43b672() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.fxc.hlsl
index 503f646..33088aa 100644
--- a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_43b672() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.glsl
index 2bcb1b4..a3e6ddb 100644
--- a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cosh_43b672() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cosh_43b672() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cosh_43b672() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.msl b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.msl
index 4ec4a67..62d4e2b 100644
--- a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_43b672() {
+void cosh_43b672(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_43b672();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  cosh_43b672(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_43b672();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  cosh_43b672(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_43b672();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  cosh_43b672(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.spvasm
index 3fb47b2..0a2d6eb 100644
--- a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_43b672 "cosh_43b672"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_43b672 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%cosh_43b672 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %cosh_43b672
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %cosh_43b672
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %cosh_43b672
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %cosh_43b672
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %cosh_43b672
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %cosh_43b672
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.wgsl
index 866e760..b4f7621 100644
--- a/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/43b672.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cosh_43b672() {
   var res : vec2<f16> = cosh(vec2<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_43b672();
diff --git a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl
index 3a7967e..df06e48 100644
--- a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl
@@ -26,7 +26,9 @@
 // fn cosh(vec<3, f16>) -> vec<3, f16>
 fn cosh_b1b8a0() {
   var res: vec3<f16> = cosh(vec3<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.dxc.hlsl
index 1ff6dcb..37a141d 100644
--- a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_b1b8a0() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.fxc.hlsl
index fe85516..e59daa0 100644
--- a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_b1b8a0() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.glsl
index a2bf806..6fa9943 100644
--- a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cosh_b1b8a0() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cosh_b1b8a0() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cosh_b1b8a0() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.msl b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.msl
index 4b53094..d69644c 100644
--- a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_b1b8a0() {
+void cosh_b1b8a0(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_b1b8a0();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  cosh_b1b8a0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_b1b8a0();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  cosh_b1b8a0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_b1b8a0();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  cosh_b1b8a0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.spvasm
index a5ccfc3..02c1c89 100644
--- a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_b1b8a0 "cosh_b1b8a0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_b1b8a0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%cosh_b1b8a0 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %cosh_b1b8a0
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %cosh_b1b8a0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %cosh_b1b8a0
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %cosh_b1b8a0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %cosh_b1b8a0
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %cosh_b1b8a0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.wgsl
index f9a1b33..89b240f 100644
--- a/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/b1b8a0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cosh_b1b8a0() {
   var res : vec3<f16> = cosh(vec3<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_b1b8a0();
diff --git a/test/tint/builtins/gen/literal/cosh/c13756.wgsl b/test/tint/builtins/gen/literal/cosh/c13756.wgsl
index afd07b6..61d6eaf 100644
--- a/test/tint/builtins/gen/literal/cosh/c13756.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/c13756.wgsl
@@ -24,7 +24,9 @@
 // fn cosh(vec<2, f32>) -> vec<2, f32>
 fn cosh_c13756() {
   var res: vec2<f32> = cosh(vec2<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.dxc.hlsl
index e2887bf..cb937d6 100644
--- a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_c13756() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.fxc.hlsl
index e2887bf..cb937d6 100644
--- a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_c13756() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.glsl
index 531ab81..8e4b64b 100644
--- a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cosh_c13756() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cosh_c13756() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cosh_c13756() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.msl b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.msl
index 1e131e8..e37f194 100644
--- a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_c13756() {
+void cosh_c13756(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_c13756();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  cosh_c13756(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_c13756();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  cosh_c13756(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_c13756();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  cosh_c13756(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.spvasm
index 6a1214c..03cd7ef 100644
--- a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_c13756 "cosh_c13756"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%cosh_c13756 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%cosh_c13756 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %cosh_c13756
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %cosh_c13756
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cosh_c13756
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cosh_c13756
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cosh_c13756
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cosh_c13756
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.wgsl
index 3c1e237..98ba858 100644
--- a/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/c13756.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cosh_c13756() {
   var res : vec2<f32> = cosh(vec2<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_c13756();
diff --git a/test/tint/builtins/gen/literal/cosh/c892bb.wgsl b/test/tint/builtins/gen/literal/cosh/c892bb.wgsl
index ddd6cac..93b4202 100644
--- a/test/tint/builtins/gen/literal/cosh/c892bb.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/c892bb.wgsl
@@ -25,7 +25,6 @@
 fn cosh_c892bb() {
   var res = cosh(0.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_c892bb();
diff --git a/test/tint/builtins/gen/literal/cosh/d8dee7.wgsl b/test/tint/builtins/gen/literal/cosh/d8dee7.wgsl
index a4482f7..de13f18 100644
--- a/test/tint/builtins/gen/literal/cosh/d8dee7.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/d8dee7.wgsl
@@ -25,7 +25,6 @@
 fn cosh_d8dee7() {
   var res = cosh(vec4(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_d8dee7();
diff --git a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl
index cc06b03..08bb07f 100644
--- a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl
@@ -24,7 +24,9 @@
 // fn cosh(f32) -> f32
 fn cosh_da92dd() {
   var res: f32 = cosh(0.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.dxc.hlsl
index ed16a6f..34735c3 100644
--- a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_da92dd() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.fxc.hlsl
index ed16a6f..34735c3 100644
--- a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_da92dd() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.glsl
index ff31fba..cbf9496 100644
--- a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cosh_da92dd() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cosh_da92dd() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cosh_da92dd() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.msl b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.msl
index 3f34091..afc09d0 100644
--- a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_da92dd() {
+void cosh_da92dd(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_da92dd();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  cosh_da92dd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_da92dd();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  cosh_da92dd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_da92dd();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  cosh_da92dd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.spvasm
index 8892600..8980e77 100644
--- a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_da92dd "cosh_da92dd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%cosh_da92dd = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%cosh_da92dd = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %cosh_da92dd
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %cosh_da92dd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %cosh_da92dd
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %cosh_da92dd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cosh_da92dd
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cosh_da92dd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.wgsl
index becb8c7..63f3f2a 100644
--- a/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/da92dd.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cosh_da92dd() {
   var res : f32 = cosh(0.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_da92dd();
diff --git a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl
index 5baed12..3022499 100644
--- a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl
@@ -24,7 +24,9 @@
 // fn cosh(vec<4, f32>) -> vec<4, f32>
 fn cosh_e0c1de() {
   var res: vec4<f32> = cosh(vec4<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.dxc.hlsl
index 1cdac12..13f95a6 100644
--- a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_e0c1de() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.fxc.hlsl
index 1cdac12..13f95a6 100644
--- a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_e0c1de() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.glsl
index 27c6525..dd15e8d 100644
--- a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cosh_e0c1de() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cosh_e0c1de() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cosh_e0c1de() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.msl b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.msl
index a17b7ac..f208c72 100644
--- a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_e0c1de() {
+void cosh_e0c1de(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_e0c1de();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  cosh_e0c1de(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_e0c1de();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  cosh_e0c1de(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_e0c1de();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  cosh_e0c1de(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.spvasm
index 73f9ecd..292de19 100644
--- a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_e0c1de "cosh_e0c1de"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%cosh_e0c1de = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%cosh_e0c1de = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %cosh_e0c1de
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %cosh_e0c1de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %cosh_e0c1de
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %cosh_e0c1de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %cosh_e0c1de
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %cosh_e0c1de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.wgsl
index 630bb03..a2224fa 100644
--- a/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/e0c1de.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cosh_e0c1de() {
   var res : vec4<f32> = cosh(vec4<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_e0c1de();
diff --git a/test/tint/builtins/gen/literal/cosh/f67ff1.wgsl b/test/tint/builtins/gen/literal/cosh/f67ff1.wgsl
index 890700e..a567408 100644
--- a/test/tint/builtins/gen/literal/cosh/f67ff1.wgsl
+++ b/test/tint/builtins/gen/literal/cosh/f67ff1.wgsl
@@ -25,7 +25,6 @@
 fn cosh_f67ff1() {
   var res = cosh(vec3(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_f67ff1();
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl
index fd1e1a9..2b83218 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl
@@ -24,7 +24,9 @@
 // fn countLeadingZeros(u32) -> u32
 fn countLeadingZeros_208d46() {
   var res: u32 = countLeadingZeros(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.dxc.hlsl
index 96eac70..83309fa 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_208d46() {
   uint res = 31u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.fxc.hlsl
index 96eac70..83309fa 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_208d46() {
   uint res = 31u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.glsl
index feb6fa0..93c87fa 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countLeadingZeros_208d46() {
   uint res = 31u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countLeadingZeros_208d46() {
   uint res = 31u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countLeadingZeros_208d46() {
   uint res = 31u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.msl b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.msl
index 29fb7c7..c7ceedd 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_208d46() {
+void countLeadingZeros_208d46(device uint* const tint_symbol_1) {
   uint res = 31u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_208d46();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  countLeadingZeros_208d46(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_208d46();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_208d46(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_208d46();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_208d46(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.spvasm
index 6763e32..d4c2b4c 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countLeadingZeros_208d46 "countLeadingZeros_208d46"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %uint_31 = OpConstant %uint 31
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countLeadingZeros_208d46 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%countLeadingZeros_208d46 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_31
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countLeadingZeros_208d46
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %countLeadingZeros_208d46
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countLeadingZeros_208d46
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %countLeadingZeros_208d46
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countLeadingZeros_208d46
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countLeadingZeros_208d46
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.wgsl
index ccf686a..d647a50 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/208d46.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countLeadingZeros_208d46() {
   var res : u32 = countLeadingZeros(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_208d46();
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl
index af8a9e1..44ec48d 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl
@@ -24,7 +24,9 @@
 // fn countLeadingZeros(i32) -> i32
 fn countLeadingZeros_6d4656() {
   var res: i32 = countLeadingZeros(1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.dxc.hlsl
index 5bf5346..724dd41 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_6d4656() {
   int res = 31;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.fxc.hlsl
index 5bf5346..724dd41 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_6d4656() {
   int res = 31;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.glsl
index cb7bcb7..e4a19d9 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countLeadingZeros_6d4656() {
   int res = 31;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countLeadingZeros_6d4656() {
   int res = 31;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countLeadingZeros_6d4656() {
   int res = 31;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.msl b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.msl
index fdfcd6d..bb8d404 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_6d4656() {
+void countLeadingZeros_6d4656(device int* const tint_symbol_1) {
   int res = 31;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_6d4656();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  countLeadingZeros_6d4656(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_6d4656();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_6d4656(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_6d4656();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_6d4656(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.spvasm
index de27ef1..30bea0c 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countLeadingZeros_6d4656 "countLeadingZeros_6d4656"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %int_31 = OpConstant %int 31
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countLeadingZeros_6d4656 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+%countLeadingZeros_6d4656 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_31
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countLeadingZeros_6d4656
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %countLeadingZeros_6d4656
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countLeadingZeros_6d4656
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %countLeadingZeros_6d4656
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countLeadingZeros_6d4656
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %countLeadingZeros_6d4656
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.wgsl
index 8c2d7e6..c902715 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/6d4656.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countLeadingZeros_6d4656() {
   var res : i32 = countLeadingZeros(1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_6d4656();
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl
index 2c9868b..26f1f72 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl
@@ -24,7 +24,9 @@
 // fn countLeadingZeros(vec<2, u32>) -> vec<2, u32>
 fn countLeadingZeros_70783f() {
   var res: vec2<u32> = countLeadingZeros(vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.dxc.hlsl
index 81dd0ff..7c1ea73 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_70783f() {
   uint2 res = (31u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.fxc.hlsl
index 81dd0ff..7c1ea73 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_70783f() {
   uint2 res = (31u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.glsl
index 93bbc08..78de996 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_70783f() {
   uvec2 res = uvec2(31u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_70783f() {
   uvec2 res = uvec2(31u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_70783f() {
   uvec2 res = uvec2(31u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.msl b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.msl
index 959711d..3a09117 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_70783f() {
+void countLeadingZeros_70783f(device uint2* const tint_symbol_1) {
   uint2 res = uint2(31u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_70783f();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  countLeadingZeros_70783f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_70783f();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_70783f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_70783f();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_70783f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.spvasm
index 86252e8..1e9ee3a 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countLeadingZeros_70783f "countLeadingZeros_70783f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
     %uint_31 = OpConstant %uint 31
-         %16 = OpConstantComposite %v2uint %uint_31 %uint_31
+         %19 = OpConstantComposite %v2uint %uint_31 %uint_31
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countLeadingZeros_70783f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+%countLeadingZeros_70783f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countLeadingZeros_70783f
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %countLeadingZeros_70783f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countLeadingZeros_70783f
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %countLeadingZeros_70783f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countLeadingZeros_70783f
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countLeadingZeros_70783f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.wgsl
index 6d34dec..dd9e6ab 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/70783f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countLeadingZeros_70783f() {
   var res : vec2<u32> = countLeadingZeros(vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_70783f();
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl
index 3d3f5e6..f6af362 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl
@@ -24,7 +24,9 @@
 // fn countLeadingZeros(vec<3, i32>) -> vec<3, i32>
 fn countLeadingZeros_7c38a6() {
   var res: vec3<i32> = countLeadingZeros(vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.dxc.hlsl
index 44d17f8..347ec3f 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_7c38a6() {
   int3 res = (31).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.fxc.hlsl
index 44d17f8..347ec3f 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_7c38a6() {
   int3 res = (31).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.glsl
index e1ec7fa..aeadd8e 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_7c38a6() {
   ivec3 res = ivec3(31);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_7c38a6() {
   ivec3 res = ivec3(31);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_7c38a6() {
   ivec3 res = ivec3(31);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.msl b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.msl
index 78f1f03..be9f8fc 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_7c38a6() {
+void countLeadingZeros_7c38a6(device packed_int3* const tint_symbol_1) {
   int3 res = int3(31);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_7c38a6();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  countLeadingZeros_7c38a6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_7c38a6();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_7c38a6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_7c38a6();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_7c38a6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.spvasm
index 51e0fc1..0a30d3683 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countLeadingZeros_7c38a6 "countLeadingZeros_7c38a6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %int_31 = OpConstant %int 31
-         %16 = OpConstantComposite %v3int %int_31 %int_31 %int_31
+         %19 = OpConstantComposite %v3int %int_31 %int_31 %int_31
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countLeadingZeros_7c38a6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+%countLeadingZeros_7c38a6 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countLeadingZeros_7c38a6
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %countLeadingZeros_7c38a6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countLeadingZeros_7c38a6
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countLeadingZeros_7c38a6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countLeadingZeros_7c38a6
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countLeadingZeros_7c38a6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.wgsl
index 731b32c..5398aa2 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/7c38a6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countLeadingZeros_7c38a6() {
   var res : vec3<i32> = countLeadingZeros(vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_7c38a6();
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl
index c5bc990..1203f17 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl
@@ -24,7 +24,9 @@
 // fn countLeadingZeros(vec<2, i32>) -> vec<2, i32>
 fn countLeadingZeros_858d40() {
   var res: vec2<i32> = countLeadingZeros(vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.dxc.hlsl
index 25fe282..88e4718 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_858d40() {
   int2 res = (31).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.fxc.hlsl
index 25fe282..88e4718 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_858d40() {
   int2 res = (31).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.glsl
index edd459b..29458ed 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_858d40() {
   ivec2 res = ivec2(31);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_858d40() {
   ivec2 res = ivec2(31);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_858d40() {
   ivec2 res = ivec2(31);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.msl b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.msl
index d0dd71f..33cf518 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_858d40() {
+void countLeadingZeros_858d40(device int2* const tint_symbol_1) {
   int2 res = int2(31);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_858d40();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  countLeadingZeros_858d40(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_858d40();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_858d40(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_858d40();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_858d40(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.spvasm
index be3c41d..4fcb380 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countLeadingZeros_858d40 "countLeadingZeros_858d40"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %int_31 = OpConstant %int 31
-         %16 = OpConstantComposite %v2int %int_31 %int_31
+         %19 = OpConstantComposite %v2int %int_31 %int_31
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countLeadingZeros_858d40 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+%countLeadingZeros_858d40 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countLeadingZeros_858d40
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %countLeadingZeros_858d40
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countLeadingZeros_858d40
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countLeadingZeros_858d40
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countLeadingZeros_858d40
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countLeadingZeros_858d40
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.wgsl
index 3f84df2..41fffa4 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/858d40.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countLeadingZeros_858d40() {
   var res : vec2<i32> = countLeadingZeros(vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_858d40();
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl
index f48875c..4dc4cfe 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl
@@ -24,7 +24,9 @@
 // fn countLeadingZeros(vec<3, u32>) -> vec<3, u32>
 fn countLeadingZeros_ab6345() {
   var res: vec3<u32> = countLeadingZeros(vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.dxc.hlsl
index aca87cf..143fda3 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_ab6345() {
   uint3 res = (31u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.fxc.hlsl
index aca87cf..143fda3 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_ab6345() {
   uint3 res = (31u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.glsl
index cbf475f..4a06600 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_ab6345() {
   uvec3 res = uvec3(31u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_ab6345() {
   uvec3 res = uvec3(31u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_ab6345() {
   uvec3 res = uvec3(31u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.msl b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.msl
index c7cbaab..bae70b3 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_ab6345() {
+void countLeadingZeros_ab6345(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(31u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_ab6345();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  countLeadingZeros_ab6345(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_ab6345();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_ab6345(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_ab6345();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_ab6345(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.spvasm
index b648a7a..e8ee06a 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countLeadingZeros_ab6345 "countLeadingZeros_ab6345"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
     %uint_31 = OpConstant %uint 31
-         %16 = OpConstantComposite %v3uint %uint_31 %uint_31 %uint_31
+         %19 = OpConstantComposite %v3uint %uint_31 %uint_31 %uint_31
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countLeadingZeros_ab6345 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+%countLeadingZeros_ab6345 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countLeadingZeros_ab6345
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %countLeadingZeros_ab6345
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countLeadingZeros_ab6345
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %countLeadingZeros_ab6345
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countLeadingZeros_ab6345
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countLeadingZeros_ab6345
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.wgsl
index c7bc319..0949ce3 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/ab6345.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countLeadingZeros_ab6345() {
   var res : vec3<u32> = countLeadingZeros(vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_ab6345();
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl
index e95fe6c..226a857 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl
@@ -24,7 +24,9 @@
 // fn countLeadingZeros(vec<4, i32>) -> vec<4, i32>
 fn countLeadingZeros_eab32b() {
   var res: vec4<i32> = countLeadingZeros(vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.dxc.hlsl
index 20d59f5..3ffa510 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_eab32b() {
   int4 res = (31).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.fxc.hlsl
index 20d59f5..3ffa510 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_eab32b() {
   int4 res = (31).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.glsl
index d9cee38..7415dfa 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_eab32b() {
   ivec4 res = ivec4(31);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_eab32b() {
   ivec4 res = ivec4(31);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_eab32b() {
   ivec4 res = ivec4(31);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.msl b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.msl
index 4544e07..2c009b1 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_eab32b() {
+void countLeadingZeros_eab32b(device int4* const tint_symbol_1) {
   int4 res = int4(31);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_eab32b();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  countLeadingZeros_eab32b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_eab32b();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_eab32b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_eab32b();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_eab32b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.spvasm
index 0bae17d..53d10a7 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countLeadingZeros_eab32b "countLeadingZeros_eab32b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %int_31 = OpConstant %int 31
-         %16 = OpConstantComposite %v4int %int_31 %int_31 %int_31 %int_31
+         %19 = OpConstantComposite %v4int %int_31 %int_31 %int_31 %int_31
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countLeadingZeros_eab32b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+%countLeadingZeros_eab32b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countLeadingZeros_eab32b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %countLeadingZeros_eab32b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countLeadingZeros_eab32b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countLeadingZeros_eab32b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countLeadingZeros_eab32b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countLeadingZeros_eab32b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.wgsl
index 8b87b66..9424a01 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/eab32b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countLeadingZeros_eab32b() {
   var res : vec4<i32> = countLeadingZeros(vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_eab32b();
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl
index 5e006a2..e398a21 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl
@@ -24,7 +24,9 @@
 // fn countLeadingZeros(vec<4, u32>) -> vec<4, u32>
 fn countLeadingZeros_f70103() {
   var res: vec4<u32> = countLeadingZeros(vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.dxc.hlsl
index e8fe650..6e4f450 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_f70103() {
   uint4 res = (31u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.fxc.hlsl
index e8fe650..6e4f450 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_f70103() {
   uint4 res = (31u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.glsl
index 4b663e7..dd1f33c 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_f70103() {
   uvec4 res = uvec4(31u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_f70103() {
   uvec4 res = uvec4(31u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_f70103() {
   uvec4 res = uvec4(31u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.msl b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.msl
index 1bd357f..b16dfa4 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_f70103() {
+void countLeadingZeros_f70103(device uint4* const tint_symbol_1) {
   uint4 res = uint4(31u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_f70103();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  countLeadingZeros_f70103(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_f70103();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_f70103(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_f70103();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_f70103(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.spvasm
index 477f6a7..9b25f3c 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countLeadingZeros_f70103 "countLeadingZeros_f70103"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
     %uint_31 = OpConstant %uint 31
-         %16 = OpConstantComposite %v4uint %uint_31 %uint_31 %uint_31 %uint_31
+         %19 = OpConstantComposite %v4uint %uint_31 %uint_31 %uint_31 %uint_31
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countLeadingZeros_f70103 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+%countLeadingZeros_f70103 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countLeadingZeros_f70103
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %countLeadingZeros_f70103
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countLeadingZeros_f70103
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %countLeadingZeros_f70103
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countLeadingZeros_f70103
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countLeadingZeros_f70103
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.wgsl
index 2877eb6..db9da50 100644
--- a/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countLeadingZeros/f70103.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countLeadingZeros_f70103() {
   var res : vec4<u32> = countLeadingZeros(vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_f70103();
diff --git a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl
index 87a07fa..dad0a12 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl
@@ -24,7 +24,9 @@
 // fn countOneBits(vec<4, u32>) -> vec<4, u32>
 fn countOneBits_0d0e46() {
   var res: vec4<u32> = countOneBits(vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.dxc.hlsl
index ca49cf7..533c425 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_0d0e46() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.fxc.hlsl
index ca49cf7..533c425 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_0d0e46() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.glsl
index 0092329..a79b1d4 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countOneBits_0d0e46() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countOneBits_0d0e46() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countOneBits_0d0e46() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.msl b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.msl
index 5090ddc..e27d77c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_0d0e46() {
+void countOneBits_0d0e46(device uint4* const tint_symbol_1) {
   uint4 res = uint4(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_0d0e46();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  countOneBits_0d0e46(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_0d0e46();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_0d0e46(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_0d0e46();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_0d0e46(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.spvasm
index c61cc28..dfc002e 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_0d0e46 "countOneBits_0d0e46"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_0d0e46 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+%countOneBits_0d0e46 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countOneBits_0d0e46
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %countOneBits_0d0e46
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countOneBits_0d0e46
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %countOneBits_0d0e46
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_0d0e46
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countOneBits_0d0e46
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.wgsl
index ce4168b..3ba898f 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0d0e46.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countOneBits_0d0e46() {
   var res : vec4<u32> = countOneBits(vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_0d0e46();
diff --git a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl
index 58cd532..4719347 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl
@@ -24,7 +24,9 @@
 // fn countOneBits(vec<4, i32>) -> vec<4, i32>
 fn countOneBits_0f7980() {
   var res: vec4<i32> = countOneBits(vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.dxc.hlsl
index 73ce2e8..7a5ab95 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_0f7980() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.fxc.hlsl
index 73ce2e8..7a5ab95 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_0f7980() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.glsl
index c6a79c0..dc0c96f 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countOneBits_0f7980() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countOneBits_0f7980() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countOneBits_0f7980() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.msl b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.msl
index 14fefd6..008ac7a 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_0f7980() {
+void countOneBits_0f7980(device int4* const tint_symbol_1) {
   int4 res = int4(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_0f7980();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  countOneBits_0f7980(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_0f7980();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_0f7980(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_0f7980();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_0f7980(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.spvasm
index 2402892..bf78a08 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_0f7980 "countOneBits_0f7980"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_0f7980 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+%countOneBits_0f7980 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countOneBits_0f7980
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %countOneBits_0f7980
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countOneBits_0f7980
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countOneBits_0f7980
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_0f7980
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countOneBits_0f7980
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.wgsl
index 0343194..e383ef1 100644
--- a/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/0f7980.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countOneBits_0f7980() {
   var res : vec4<i32> = countOneBits(vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_0f7980();
diff --git a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl
index 8d55398..d5e5c1b 100644
--- a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl
@@ -24,7 +24,9 @@
 // fn countOneBits(vec<3, i32>) -> vec<3, i32>
 fn countOneBits_65d2ae() {
   var res: vec3<i32> = countOneBits(vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.dxc.hlsl
index ce3d74f..2a2ed973 100644
--- a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_65d2ae() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.fxc.hlsl
index ce3d74f..2a2ed973 100644
--- a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_65d2ae() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.glsl
index 6e1363c..adba54a 100644
--- a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countOneBits_65d2ae() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countOneBits_65d2ae() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countOneBits_65d2ae() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.msl b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.msl
index fd1928c..4287b3b 100644
--- a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_65d2ae() {
+void countOneBits_65d2ae(device packed_int3* const tint_symbol_1) {
   int3 res = int3(1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_65d2ae();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  countOneBits_65d2ae(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_65d2ae();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_65d2ae(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_65d2ae();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_65d2ae(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.spvasm
index c210167..cae6c01 100644
--- a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_65d2ae "countOneBits_65d2ae"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_65d2ae = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+%countOneBits_65d2ae = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countOneBits_65d2ae
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %countOneBits_65d2ae
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countOneBits_65d2ae
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countOneBits_65d2ae
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_65d2ae
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countOneBits_65d2ae
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.wgsl
index eacc7e7..d3d06ab 100644
--- a/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/65d2ae.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countOneBits_65d2ae() {
   var res : vec3<i32> = countOneBits(vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_65d2ae();
diff --git a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl
index 504e2d4..66cb338 100644
--- a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl
@@ -24,7 +24,9 @@
 // fn countOneBits(vec<3, u32>) -> vec<3, u32>
 fn countOneBits_690cfc() {
   var res: vec3<u32> = countOneBits(vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.dxc.hlsl
index b5c737d..598d30e 100644
--- a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_690cfc() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.fxc.hlsl
index b5c737d..598d30e 100644
--- a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_690cfc() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.glsl
index ab51c8864..abb2a36 100644
--- a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countOneBits_690cfc() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countOneBits_690cfc() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countOneBits_690cfc() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.msl b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.msl
index 29f59d8..4eeb920 100644
--- a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_690cfc() {
+void countOneBits_690cfc(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(1u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_690cfc();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  countOneBits_690cfc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_690cfc();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_690cfc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_690cfc();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_690cfc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.spvasm
index 514c316..26de172 100644
--- a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_690cfc "countOneBits_690cfc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_690cfc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+%countOneBits_690cfc = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countOneBits_690cfc
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %countOneBits_690cfc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countOneBits_690cfc
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %countOneBits_690cfc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_690cfc
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countOneBits_690cfc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.wgsl
index 79967b1..3810f9e 100644
--- a/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/690cfc.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countOneBits_690cfc() {
   var res : vec3<u32> = countOneBits(vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_690cfc();
diff --git a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl
index 1a341bb..f6d7f50 100644
--- a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl
@@ -24,7 +24,9 @@
 // fn countOneBits(vec<2, u32>) -> vec<2, u32>
 fn countOneBits_94fd81() {
   var res: vec2<u32> = countOneBits(vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.dxc.hlsl
index a92bb30..9ae4c7c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_94fd81() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.fxc.hlsl
index a92bb30..9ae4c7c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_94fd81() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.glsl
index c0e234f..35df52c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countOneBits_94fd81() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countOneBits_94fd81() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countOneBits_94fd81() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.msl b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.msl
index 68a63f8..db6d41c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_94fd81() {
+void countOneBits_94fd81(device uint2* const tint_symbol_1) {
   uint2 res = uint2(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_94fd81();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  countOneBits_94fd81(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_94fd81();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_94fd81(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_94fd81();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_94fd81(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.spvasm
index 17bea2d..18eb095 100644
--- a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_94fd81 "countOneBits_94fd81"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_94fd81 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+%countOneBits_94fd81 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countOneBits_94fd81
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %countOneBits_94fd81
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countOneBits_94fd81
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %countOneBits_94fd81
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_94fd81
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countOneBits_94fd81
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.wgsl
index d82e957..4e50bd8 100644
--- a/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/94fd81.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countOneBits_94fd81() {
   var res : vec2<u32> = countOneBits(vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_94fd81();
diff --git a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl
index fb89218..9e00163 100644
--- a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl
@@ -24,7 +24,9 @@
 // fn countOneBits(u32) -> u32
 fn countOneBits_ae44f9() {
   var res: u32 = countOneBits(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.dxc.hlsl
index 2162694..b9e3e85 100644
--- a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_ae44f9() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.fxc.hlsl
index 2162694..b9e3e85 100644
--- a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_ae44f9() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.glsl
index bb3693a..419253d 100644
--- a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countOneBits_ae44f9() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countOneBits_ae44f9() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countOneBits_ae44f9() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.msl b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.msl
index 2f89485..fd9d88c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_ae44f9() {
+void countOneBits_ae44f9(device uint* const tint_symbol_1) {
   uint res = 1u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_ae44f9();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  countOneBits_ae44f9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_ae44f9();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_ae44f9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_ae44f9();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_ae44f9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.spvasm
index fe8c485..74f707d 100644
--- a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_ae44f9 "countOneBits_ae44f9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_ae44f9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%countOneBits_ae44f9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_1
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countOneBits_ae44f9
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %countOneBits_ae44f9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countOneBits_ae44f9
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %countOneBits_ae44f9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countOneBits_ae44f9
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countOneBits_ae44f9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.wgsl
index 880bb56..9ca56ba 100644
--- a/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/ae44f9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countOneBits_ae44f9() {
   var res : u32 = countOneBits(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_ae44f9();
diff --git a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl
index 54e5705..b80b5af 100644
--- a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl
@@ -24,7 +24,9 @@
 // fn countOneBits(vec<2, i32>) -> vec<2, i32>
 fn countOneBits_af90e2() {
   var res: vec2<i32> = countOneBits(vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.dxc.hlsl
index 6a6a9b4..e30ef2d 100644
--- a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_af90e2() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.fxc.hlsl
index 6a6a9b4..e30ef2d 100644
--- a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_af90e2() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.glsl
index b8eceb6..624926c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countOneBits_af90e2() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countOneBits_af90e2() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countOneBits_af90e2() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.msl b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.msl
index b87444c..3f7dae4 100644
--- a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_af90e2() {
+void countOneBits_af90e2(device int2* const tint_symbol_1) {
   int2 res = int2(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_af90e2();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  countOneBits_af90e2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_af90e2();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_af90e2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_af90e2();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_af90e2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.spvasm
index 154f2f4..7fe6e6c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_af90e2 "countOneBits_af90e2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_af90e2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+%countOneBits_af90e2 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %countOneBits_af90e2
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %countOneBits_af90e2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countOneBits_af90e2
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countOneBits_af90e2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_af90e2
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countOneBits_af90e2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.wgsl
index 82b01c8..d46e3c8 100644
--- a/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/af90e2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countOneBits_af90e2() {
   var res : vec2<i32> = countOneBits(vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_af90e2();
diff --git a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl
index 65a80c6..bab0965 100644
--- a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl
@@ -24,7 +24,9 @@
 // fn countOneBits(i32) -> i32
 fn countOneBits_fd88b2() {
   var res: i32 = countOneBits(1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.dxc.hlsl
index 71e3fc0..8958769 100644
--- a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_fd88b2() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.fxc.hlsl
index 71e3fc0..8958769 100644
--- a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_fd88b2() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.glsl
index da7d29e..89ec6b9 100644
--- a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countOneBits_fd88b2() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countOneBits_fd88b2() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countOneBits_fd88b2() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.msl b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.msl
index a596c93..b8d795c 100644
--- a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_fd88b2() {
+void countOneBits_fd88b2(device int* const tint_symbol_1) {
   int res = 1;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_fd88b2();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  countOneBits_fd88b2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_fd88b2();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_fd88b2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_fd88b2();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_fd88b2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.spvasm
index d8377c5..a765d61 100644
--- a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_fd88b2 "countOneBits_fd88b2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_fd88b2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+%countOneBits_fd88b2 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countOneBits_fd88b2
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %countOneBits_fd88b2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countOneBits_fd88b2
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %countOneBits_fd88b2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countOneBits_fd88b2
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %countOneBits_fd88b2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.wgsl
index 0d6dc81..d2d614d 100644
--- a/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countOneBits/fd88b2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countOneBits_fd88b2() {
   var res : i32 = countOneBits(1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_fd88b2();
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl
index cafda4d..80ae7e9 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl
@@ -24,7 +24,9 @@
 // fn countTrailingZeros(vec<2, u32>) -> vec<2, u32>
 fn countTrailingZeros_1ad138() {
   var res: vec2<u32> = countTrailingZeros(vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.dxc.hlsl
index 53ca8f4..198fde3 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_1ad138() {
   uint2 res = (0u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.fxc.hlsl
index 53ca8f4..198fde3 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_1ad138() {
   uint2 res = (0u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.glsl
index 7587a61..8a96298 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_1ad138() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_1ad138() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_1ad138() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.msl b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.msl
index e0f33eb..885ee99 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_1ad138() {
+void countTrailingZeros_1ad138(device uint2* const tint_symbol_1) {
   uint2 res = uint2(0u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_1ad138();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  countTrailingZeros_1ad138(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_1ad138();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_1ad138(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_1ad138();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_1ad138(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.spvasm
index 9bb2548..ce3e876 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countTrailingZeros_1ad138 "countTrailingZeros_1ad138"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-         %15 = OpConstantNull %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countTrailingZeros_1ad138 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %15
-               OpStore %res %15
+%countTrailingZeros_1ad138 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %24 = OpLoad %v2uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countTrailingZeros_1ad138
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %countTrailingZeros_1ad138
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countTrailingZeros_1ad138
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %countTrailingZeros_1ad138
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countTrailingZeros_1ad138
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countTrailingZeros_1ad138
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.wgsl
index 0f6d2b9..c917e9a 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1ad138.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countTrailingZeros_1ad138() {
   var res : vec2<u32> = countTrailingZeros(vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_1ad138();
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl
index 98c65c7..7ac514d 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl
@@ -24,7 +24,9 @@
 // fn countTrailingZeros(vec<4, i32>) -> vec<4, i32>
 fn countTrailingZeros_1dc84a() {
   var res: vec4<i32> = countTrailingZeros(vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.dxc.hlsl
index 327fef3..2a3127e 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_1dc84a() {
   int4 res = (0).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.fxc.hlsl
index 327fef3..2a3127e 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_1dc84a() {
   int4 res = (0).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.glsl
index f29e7c4..fdcf43a 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_1dc84a() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_1dc84a() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_1dc84a() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.msl b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.msl
index dcf6b8a..1b59097 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_1dc84a() {
+void countTrailingZeros_1dc84a(device int4* const tint_symbol_1) {
   int4 res = int4(0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_1dc84a();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  countTrailingZeros_1dc84a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_1dc84a();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_1dc84a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_1dc84a();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_1dc84a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.spvasm
index f20dbd4..697c00e 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countTrailingZeros_1dc84a "countTrailingZeros_1dc84a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-         %15 = OpConstantNull %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countTrailingZeros_1dc84a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %15
-               OpStore %res %15
+%countTrailingZeros_1dc84a = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %25 = OpLoad %v4int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countTrailingZeros_1dc84a
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %countTrailingZeros_1dc84a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countTrailingZeros_1dc84a
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %countTrailingZeros_1dc84a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countTrailingZeros_1dc84a
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %countTrailingZeros_1dc84a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.wgsl
index 5de34cd..5ae9be3 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/1dc84a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countTrailingZeros_1dc84a() {
   var res : vec4<i32> = countTrailingZeros(vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_1dc84a();
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl
index dfd48ad..60d57af 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl
@@ -24,7 +24,9 @@
 // fn countTrailingZeros(u32) -> u32
 fn countTrailingZeros_21e394() {
   var res: u32 = countTrailingZeros(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.dxc.hlsl
index 2399db9..0b95a59 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_21e394() {
   uint res = 0u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.fxc.hlsl
index 2399db9..0b95a59 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_21e394() {
   uint res = 0u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.glsl
index 4d74fa0..47da3d5 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countTrailingZeros_21e394() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countTrailingZeros_21e394() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countTrailingZeros_21e394() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.msl b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.msl
index d3eb2a9..f8d2614 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_21e394() {
+void countTrailingZeros_21e394(device uint* const tint_symbol_1) {
   uint res = 0u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_21e394();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  countTrailingZeros_21e394(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_21e394();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_21e394(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_21e394();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_21e394(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.spvasm
index f3035a2..aa6daa9 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countTrailingZeros_21e394 "countTrailingZeros_21e394"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
-         %14 = OpConstantNull %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countTrailingZeros_21e394 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %14
-               OpStore %res %14
+%countTrailingZeros_21e394 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %17
+               OpStore %res %17
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %countTrailingZeros_21e394
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %countTrailingZeros_21e394
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %countTrailingZeros_21e394
+%fragment_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %countTrailingZeros_21e394
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countTrailingZeros_21e394
+%compute_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %countTrailingZeros_21e394
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.wgsl
index c04b853..68d5bb6 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/21e394.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countTrailingZeros_21e394() {
   var res : u32 = countTrailingZeros(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_21e394();
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl
index 54de9aa..411c348 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl
@@ -24,7 +24,9 @@
 // fn countTrailingZeros(vec<2, i32>) -> vec<2, i32>
 fn countTrailingZeros_327c37() {
   var res: vec2<i32> = countTrailingZeros(vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.dxc.hlsl
index c42b308..4c5b07b 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_327c37() {
   int2 res = (0).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.fxc.hlsl
index c42b308..4c5b07b 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_327c37() {
   int2 res = (0).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.glsl
index 0a5c509..981b816 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_327c37() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_327c37() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_327c37() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.msl b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.msl
index b4039fb..2318d29 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_327c37() {
+void countTrailingZeros_327c37(device int2* const tint_symbol_1) {
   int2 res = int2(0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_327c37();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  countTrailingZeros_327c37(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_327c37();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_327c37(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_327c37();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_327c37(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.spvasm
index 24a157c..d8547d2 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countTrailingZeros_327c37 "countTrailingZeros_327c37"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-         %15 = OpConstantNull %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2int
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countTrailingZeros_327c37 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %15
-               OpStore %res %15
+%countTrailingZeros_327c37 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %25 = OpLoad %v2int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countTrailingZeros_327c37
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %countTrailingZeros_327c37
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countTrailingZeros_327c37
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %countTrailingZeros_327c37
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countTrailingZeros_327c37
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %countTrailingZeros_327c37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.wgsl
index ccf51af..22eff9b 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/327c37.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countTrailingZeros_327c37() {
   var res : vec2<i32> = countTrailingZeros(vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_327c37();
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl
index a8780cf..be9a362 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl
@@ -24,7 +24,9 @@
 // fn countTrailingZeros(i32) -> i32
 fn countTrailingZeros_42fed6() {
   var res: i32 = countTrailingZeros(1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.dxc.hlsl
index 795a698..ee843fc 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_42fed6() {
   int res = 0;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.fxc.hlsl
index 795a698..ee843fc 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_42fed6() {
   int res = 0;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.glsl
index 38fc48c..a49a684 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countTrailingZeros_42fed6() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countTrailingZeros_42fed6() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countTrailingZeros_42fed6() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.msl b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.msl
index 662a1a4..7d41039 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_42fed6() {
+void countTrailingZeros_42fed6(device int* const tint_symbol_1) {
   int res = 0;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_42fed6();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  countTrailingZeros_42fed6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_42fed6();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_42fed6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_42fed6();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_42fed6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.spvasm
index 2096349..61e9313 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countTrailingZeros_42fed6 "countTrailingZeros_42fed6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
-         %14 = OpConstantNull %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %int
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countTrailingZeros_42fed6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %14
-               OpStore %res %14
+%countTrailingZeros_42fed6 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %countTrailingZeros_42fed6
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %countTrailingZeros_42fed6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %countTrailingZeros_42fed6
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %countTrailingZeros_42fed6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %countTrailingZeros_42fed6
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countTrailingZeros_42fed6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.wgsl
index 5649637..0257774 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/42fed6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countTrailingZeros_42fed6() {
   var res : i32 = countTrailingZeros(1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_42fed6();
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl
index d00f308..9407b54 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl
@@ -24,7 +24,9 @@
 // fn countTrailingZeros(vec<3, u32>) -> vec<3, u32>
 fn countTrailingZeros_8ed26f() {
   var res: vec3<u32> = countTrailingZeros(vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.dxc.hlsl
index 89e2360..444b31b 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_8ed26f() {
   uint3 res = (0u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.fxc.hlsl
index 89e2360..444b31b 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_8ed26f() {
   uint3 res = (0u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.glsl
index 9bb8dbb..980c8f8 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_8ed26f() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_8ed26f() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_8ed26f() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.msl b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.msl
index 78f48b6..ba3d019 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_8ed26f() {
+void countTrailingZeros_8ed26f(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(0u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_8ed26f();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  countTrailingZeros_8ed26f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_8ed26f();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_8ed26f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_8ed26f();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_8ed26f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.spvasm
index 4a78169..223c679 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countTrailingZeros_8ed26f "countTrailingZeros_8ed26f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-         %15 = OpConstantNull %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countTrailingZeros_8ed26f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %15
-               OpStore %res %15
+%countTrailingZeros_8ed26f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %24 = OpLoad %v3uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countTrailingZeros_8ed26f
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %countTrailingZeros_8ed26f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countTrailingZeros_8ed26f
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %countTrailingZeros_8ed26f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countTrailingZeros_8ed26f
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countTrailingZeros_8ed26f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.wgsl
index dbb40bb..73b7f63 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/8ed26f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countTrailingZeros_8ed26f() {
   var res : vec3<u32> = countTrailingZeros(vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_8ed26f();
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl
index 6ebcf30..104bd7f 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl
@@ -24,7 +24,9 @@
 // fn countTrailingZeros(vec<3, i32>) -> vec<3, i32>
 fn countTrailingZeros_acfacb() {
   var res: vec3<i32> = countTrailingZeros(vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.dxc.hlsl
index 9f0d446..0de30eb 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_acfacb() {
   int3 res = (0).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.fxc.hlsl
index 9f0d446..0de30eb 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_acfacb() {
   int3 res = (0).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.glsl
index 44fcde0..c567c97 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_acfacb() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_acfacb() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_acfacb() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.msl b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.msl
index b218911..c8ec980 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_acfacb() {
+void countTrailingZeros_acfacb(device packed_int3* const tint_symbol_1) {
   int3 res = int3(0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_acfacb();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  countTrailingZeros_acfacb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_acfacb();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_acfacb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_acfacb();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_acfacb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.spvasm
index 795e4e0..7b16e1e 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countTrailingZeros_acfacb "countTrailingZeros_acfacb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-         %15 = OpConstantNull %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3int
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countTrailingZeros_acfacb = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %15
-               OpStore %res %15
+%countTrailingZeros_acfacb = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %25 = OpLoad %v3int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countTrailingZeros_acfacb
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %countTrailingZeros_acfacb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countTrailingZeros_acfacb
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %countTrailingZeros_acfacb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countTrailingZeros_acfacb
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %countTrailingZeros_acfacb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.wgsl
index 59d13b8..961ff88 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/acfacb.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countTrailingZeros_acfacb() {
   var res : vec3<i32> = countTrailingZeros(vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_acfacb();
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl
index 42c66bc..c388436 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl
@@ -24,7 +24,9 @@
 // fn countTrailingZeros(vec<4, u32>) -> vec<4, u32>
 fn countTrailingZeros_d2b4a0() {
   var res: vec4<u32> = countTrailingZeros(vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.dxc.hlsl
index 4d36b60..943a1e9 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_d2b4a0() {
   uint4 res = (0u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.fxc.hlsl
index 4d36b60..943a1e9 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_d2b4a0() {
   uint4 res = (0u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.glsl
index 721e11e..6737a6d 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_d2b4a0() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_d2b4a0() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_d2b4a0() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.msl b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.msl
index ee9e6a8..f9ca547 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_d2b4a0() {
+void countTrailingZeros_d2b4a0(device uint4* const tint_symbol_1) {
   uint4 res = uint4(0u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_d2b4a0();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  countTrailingZeros_d2b4a0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_d2b4a0();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_d2b4a0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_d2b4a0();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_d2b4a0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.spvasm
index 20a5725..7d0560c 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countTrailingZeros_d2b4a0 "countTrailingZeros_d2b4a0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-         %15 = OpConstantNull %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countTrailingZeros_d2b4a0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %15
-               OpStore %res %15
+%countTrailingZeros_d2b4a0 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %24 = OpLoad %v4uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %countTrailingZeros_d2b4a0
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %countTrailingZeros_d2b4a0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %countTrailingZeros_d2b4a0
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %countTrailingZeros_d2b4a0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countTrailingZeros_d2b4a0
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countTrailingZeros_d2b4a0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.wgsl
index 7f6c8d0..ade37ab 100644
--- a/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/countTrailingZeros/d2b4a0.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn countTrailingZeros_d2b4a0() {
   var res : vec4<u32> = countTrailingZeros(vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_d2b4a0();
diff --git a/test/tint/builtins/gen/literal/cross/041cb0.wgsl b/test/tint/builtins/gen/literal/cross/041cb0.wgsl
index 7e13aab..a079db9 100644
--- a/test/tint/builtins/gen/literal/cross/041cb0.wgsl
+++ b/test/tint/builtins/gen/literal/cross/041cb0.wgsl
@@ -24,7 +24,9 @@
 // fn cross(vec3<f32>, vec3<f32>) -> vec3<f32>
 fn cross_041cb0() {
   var res: vec3<f32> = cross(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.dxc.hlsl
index 10b86ac..f00574f 100644
--- a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cross_041cb0() {
   float3 res = (0.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.fxc.hlsl
index 10b86ac..f00574f 100644
--- a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cross_041cb0() {
   float3 res = (0.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.glsl
index d3417a5..8671be4 100644
--- a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cross_041cb0() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cross_041cb0() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cross_041cb0() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.msl b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.msl
index 7330e7b..6ebc236 100644
--- a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cross_041cb0() {
+void cross_041cb0(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cross_041cb0();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  cross_041cb0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cross_041cb0();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  cross_041cb0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cross_041cb0();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  cross_041cb0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.spvasm
index a7cee98..26cf08f 100644
--- a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cross_041cb0 "cross_041cb0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
-         %14 = OpConstantNull %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v3float
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cross_041cb0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %14
-               OpStore %res %14
+%cross_041cb0 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %24 = OpLoad %v3float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %cross_041cb0
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %cross_041cb0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %cross_041cb0
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %cross_041cb0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %cross_041cb0
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %cross_041cb0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.wgsl
index 6928bca..7066338 100644
--- a/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cross/041cb0.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn cross_041cb0() {
   var res : vec3<f32> = cross(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cross_041cb0();
diff --git a/test/tint/builtins/gen/literal/cross/1d7933.wgsl b/test/tint/builtins/gen/literal/cross/1d7933.wgsl
index e99acca..0b3e197 100644
--- a/test/tint/builtins/gen/literal/cross/1d7933.wgsl
+++ b/test/tint/builtins/gen/literal/cross/1d7933.wgsl
@@ -25,7 +25,6 @@
 fn cross_1d7933() {
   var res = cross(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cross_1d7933();
diff --git a/test/tint/builtins/gen/literal/cross/9857cb.wgsl b/test/tint/builtins/gen/literal/cross/9857cb.wgsl
index fffed92..40e69ff 100644
--- a/test/tint/builtins/gen/literal/cross/9857cb.wgsl
+++ b/test/tint/builtins/gen/literal/cross/9857cb.wgsl
@@ -26,7 +26,9 @@
 // fn cross(vec3<f16>, vec3<f16>) -> vec3<f16>
 fn cross_9857cb() {
   var res: vec3<f16> = cross(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.dxc.hlsl
index 792f65b..04b4e39 100644
--- a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cross_9857cb() {
   vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.fxc.hlsl
index 802b5ee..2478291 100644
--- a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cross_9857cb() {
   vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.glsl
index e29f1de..072a570 100644
--- a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cross_9857cb() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cross_9857cb() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cross_9857cb() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.msl b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.msl
index a2e6048..f6e2d63 100644
--- a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cross_9857cb() {
+void cross_9857cb(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cross_9857cb();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  cross_9857cb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cross_9857cb();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  cross_9857cb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cross_9857cb();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  cross_9857cb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.spvasm
index 3b31668..2f3ce3f 100644
--- a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cross_9857cb "cross_9857cb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-         %15 = OpConstantNull %v3half
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3half
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cross_9857cb = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %15
-               OpStore %res %15
+%cross_9857cb = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %25 = OpLoad %v3half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %cross_9857cb
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %cross_9857cb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cross_9857cb
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cross_9857cb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cross_9857cb
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cross_9857cb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.wgsl
index 04296c9..58bb230 100644
--- a/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/cross/9857cb.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn cross_9857cb() {
   var res : vec3<f16> = cross(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cross_9857cb();
diff --git a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl
index e2fee81..96836e6 100644
--- a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl
@@ -24,7 +24,9 @@
 // fn degrees(vec<4, f32>) -> vec<4, f32>
 fn degrees_0d170c() {
   var res: vec4<f32> = degrees(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.dxc.hlsl
index 18eec3c..6bc2da9 100644
--- a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_0d170c() {
   float4 res = (57.2957763671875f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.fxc.hlsl
index 18eec3c..6bc2da9 100644
--- a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_0d170c() {
   float4 res = (57.2957763671875f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.glsl
index e14cbfc..ced8620 100644
--- a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void degrees_0d170c() {
   vec4 res = vec4(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void degrees_0d170c() {
   vec4 res = vec4(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void degrees_0d170c() {
   vec4 res = vec4(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.msl b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.msl
index 337b31f..d0d924f 100644
--- a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void degrees_0d170c() {
+void degrees_0d170c(device float4* const tint_symbol_1) {
   float4 res = float4(57.2957763671875f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_0d170c();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  degrees_0d170c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_0d170c();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  degrees_0d170c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_0d170c();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  degrees_0d170c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.spvasm
index ba056b9..0db3da8 100644
--- a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_0d170c "degrees_0d170c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_57_2957764 = OpConstant %float 57.2957764
-         %14 = OpConstantComposite %v4float %float_57_2957764 %float_57_2957764 %float_57_2957764 %float_57_2957764
+         %17 = OpConstantComposite %v4float %float_57_2957764 %float_57_2957764 %float_57_2957764 %float_57_2957764
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_0d170c = OpFunction %void None %9
-         %12 = OpLabel
+%degrees_0d170c = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %degrees_0d170c
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %degrees_0d170c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %degrees_0d170c
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %degrees_0d170c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %degrees_0d170c
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %degrees_0d170c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.wgsl
index c387999..c572e07 100644
--- a/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/0d170c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn degrees_0d170c() {
   var res : vec4<f32> = degrees(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_0d170c();
diff --git a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl
index 653b687..1adccce 100644
--- a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl
@@ -24,7 +24,9 @@
 // fn degrees(vec<2, f32>) -> vec<2, f32>
 fn degrees_1ad5df() {
   var res: vec2<f32> = degrees(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.dxc.hlsl
index f2668e1..368382e 100644
--- a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_1ad5df() {
   float2 res = (57.2957763671875f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.fxc.hlsl
index f2668e1..368382e 100644
--- a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_1ad5df() {
   float2 res = (57.2957763671875f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.glsl b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.glsl
index c985ccc..cec7740 100644
--- a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void degrees_1ad5df() {
   vec2 res = vec2(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void degrees_1ad5df() {
   vec2 res = vec2(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void degrees_1ad5df() {
   vec2 res = vec2(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.msl b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.msl
index e2c6907..b4f053a 100644
--- a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void degrees_1ad5df() {
+void degrees_1ad5df(device float2* const tint_symbol_1) {
   float2 res = float2(57.2957763671875f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_1ad5df();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  degrees_1ad5df(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_1ad5df();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  degrees_1ad5df(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_1ad5df();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  degrees_1ad5df(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.spvasm
index 9c5c485..dfaff80 100644
--- a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_1ad5df "degrees_1ad5df"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_57_2957764 = OpConstant %float 57.2957764
-         %15 = OpConstantComposite %v2float %float_57_2957764 %float_57_2957764
+         %18 = OpConstantComposite %v2float %float_57_2957764 %float_57_2957764
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_1ad5df = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%degrees_1ad5df = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %degrees_1ad5df
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %degrees_1ad5df
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %degrees_1ad5df
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %degrees_1ad5df
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %degrees_1ad5df
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %degrees_1ad5df
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.wgsl
index 518eca4..08ccd2f 100644
--- a/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/1ad5df.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn degrees_1ad5df() {
   var res : vec2<f32> = degrees(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_1ad5df();
diff --git a/test/tint/builtins/gen/literal/degrees/2af623.wgsl b/test/tint/builtins/gen/literal/degrees/2af623.wgsl
index a524ec7..bc1dfa5 100644
--- a/test/tint/builtins/gen/literal/degrees/2af623.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/2af623.wgsl
@@ -24,7 +24,9 @@
 // fn degrees(vec<3, f32>) -> vec<3, f32>
 fn degrees_2af623() {
   var res: vec3<f32> = degrees(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.dxc.hlsl
index a55fec7..615fda9 100644
--- a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_2af623() {
   float3 res = (57.2957763671875f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.fxc.hlsl
index a55fec7..615fda9 100644
--- a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_2af623() {
   float3 res = (57.2957763671875f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.glsl b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.glsl
index 1f14b71..8e13c86 100644
--- a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void degrees_2af623() {
   vec3 res = vec3(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void degrees_2af623() {
   vec3 res = vec3(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void degrees_2af623() {
   vec3 res = vec3(57.2957763671875f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.msl b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.msl
index 5ee520d..cc12463 100644
--- a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void degrees_2af623() {
+void degrees_2af623(device packed_float3* const tint_symbol_1) {
   float3 res = float3(57.2957763671875f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_2af623();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  degrees_2af623(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_2af623();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  degrees_2af623(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_2af623();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  degrees_2af623(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.spvasm
index b692ad7..012f556 100644
--- a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_2af623 "degrees_2af623"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_57_2957764 = OpConstant %float 57.2957764
-         %15 = OpConstantComposite %v3float %float_57_2957764 %float_57_2957764 %float_57_2957764
+         %18 = OpConstantComposite %v3float %float_57_2957764 %float_57_2957764 %float_57_2957764
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_2af623 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%degrees_2af623 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %degrees_2af623
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %degrees_2af623
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %degrees_2af623
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %degrees_2af623
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %degrees_2af623
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %degrees_2af623
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.wgsl
index b26cdbf..6c6ed73 100644
--- a/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/2af623.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn degrees_2af623() {
   var res : vec3<f32> = degrees(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_2af623();
diff --git a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl
index 1a55b08..edccd81 100644
--- a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl
@@ -26,7 +26,9 @@
 // fn degrees(vec<4, f16>) -> vec<4, f16>
 fn degrees_3055d3() {
   var res: vec4<f16> = degrees(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.dxc.hlsl
index 3ec4e92..5a57082 100644
--- a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_3055d3() {
   vector<float16_t, 4> res = (float16_t(57.3125h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.fxc.hlsl
index d52117b..09e3796 100644
--- a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_3055d3() {
   vector<float16_t, 4> res = (float16_t(57.3125h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.glsl
index 1820254..c2682bb 100644
--- a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void degrees_3055d3() {
   f16vec4 res = f16vec4(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void degrees_3055d3() {
   f16vec4 res = f16vec4(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void degrees_3055d3() {
   f16vec4 res = f16vec4(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.msl b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.msl
index dbbd520..a9e491f 100644
--- a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void degrees_3055d3() {
+void degrees_3055d3(device half4* const tint_symbol_1) {
   half4 res = half4(57.3125h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_3055d3();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  degrees_3055d3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_3055d3();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  degrees_3055d3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_3055d3();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  degrees_3055d3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.spvasm
index ba293b3..d13e9d2 100644
--- a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_3055d3 "degrees_3055d3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ca8p_5 = OpConstant %half 0x1.ca8p+5
-         %16 = OpConstantComposite %v4half %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5
+         %19 = OpConstantComposite %v4half %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_3055d3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%degrees_3055d3 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %degrees_3055d3
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %degrees_3055d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %degrees_3055d3
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %degrees_3055d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %degrees_3055d3
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %degrees_3055d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.wgsl
index e58a8a0..d8c520d 100644
--- a/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/3055d3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn degrees_3055d3() {
   var res : vec4<f16> = degrees(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_3055d3();
diff --git a/test/tint/builtins/gen/literal/degrees/51f705.wgsl b/test/tint/builtins/gen/literal/degrees/51f705.wgsl
index c853557..cb12450 100644
--- a/test/tint/builtins/gen/literal/degrees/51f705.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/51f705.wgsl
@@ -24,7 +24,9 @@
 // fn degrees(f32) -> f32
 fn degrees_51f705() {
   var res: f32 = degrees(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.dxc.hlsl
index c9c20ca..2316af3 100644
--- a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_51f705() {
   float res = 57.2957763671875f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.fxc.hlsl
index c9c20ca..2316af3 100644
--- a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_51f705() {
   float res = 57.2957763671875f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.glsl b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.glsl
index dbb8ac8..8be0371 100644
--- a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void degrees_51f705() {
   float res = 57.2957763671875f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void degrees_51f705() {
   float res = 57.2957763671875f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void degrees_51f705() {
   float res = 57.2957763671875f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.msl b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.msl
index 326c7b3..a501dad 100644
--- a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void degrees_51f705() {
+void degrees_51f705(device float* const tint_symbol_1) {
   float res = 57.2957763671875f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_51f705();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  degrees_51f705(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_51f705();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  degrees_51f705(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_51f705();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  degrees_51f705(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.spvasm
index 9c98fce..780a892 100644
--- a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_51f705 "degrees_51f705"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_57_2957764 = OpConstant %float 57.2957764
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_51f705 = OpFunction %void None %9
-         %12 = OpLabel
+%degrees_51f705 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_57_2957764
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %degrees_51f705
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %degrees_51f705
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %degrees_51f705
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %degrees_51f705
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %degrees_51f705
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %degrees_51f705
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.wgsl
index a1f9f7f..ef0ce38 100644
--- a/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/51f705.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn degrees_51f705() {
   var res : f32 = degrees(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_51f705();
diff --git a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl
index e1e9537..373c2f2 100644
--- a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl
@@ -26,7 +26,9 @@
 // fn degrees(f16) -> f16
 fn degrees_5e9805() {
   var res: f16 = degrees(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.dxc.hlsl
index eff605b..e12d177 100644
--- a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_5e9805() {
   float16_t res = float16_t(57.3125h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.fxc.hlsl
index 4c0dd2b..909d86f 100644
--- a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_5e9805() {
   float16_t res = float16_t(57.3125h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.glsl b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.glsl
index 1ef9dcf..46bd8db 100644
--- a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void degrees_5e9805() {
   float16_t res = 57.3125hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void degrees_5e9805() {
   float16_t res = 57.3125hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void degrees_5e9805() {
   float16_t res = 57.3125hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.msl b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.msl
index 8a94020..7c8baf9 100644
--- a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void degrees_5e9805() {
+void degrees_5e9805(device half* const tint_symbol_1) {
   half res = 57.3125h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_5e9805();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  degrees_5e9805(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_5e9805();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  degrees_5e9805(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_5e9805();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  degrees_5e9805(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.spvasm
index a942b16..bc4fa06 100644
--- a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_5e9805 "degrees_5e9805"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_ca8p_5 = OpConstant %half 0x1.ca8p+5
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_5e9805 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%degrees_5e9805 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_ca8p_5
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %degrees_5e9805
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %degrees_5e9805
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %degrees_5e9805
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %degrees_5e9805
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %degrees_5e9805
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %degrees_5e9805
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.wgsl
index 4056d0b..fb75354 100644
--- a/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/5e9805.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn degrees_5e9805() {
   var res : f16 = degrees(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_5e9805();
diff --git a/test/tint/builtins/gen/literal/degrees/810467.wgsl b/test/tint/builtins/gen/literal/degrees/810467.wgsl
index f3a288e..a450145f 100644
--- a/test/tint/builtins/gen/literal/degrees/810467.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/810467.wgsl
@@ -25,7 +25,6 @@
 fn degrees_810467() {
   var res = degrees(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_810467();
diff --git a/test/tint/builtins/gen/literal/degrees/c0880c.wgsl b/test/tint/builtins/gen/literal/degrees/c0880c.wgsl
index 168ddab..34d184d 100644
--- a/test/tint/builtins/gen/literal/degrees/c0880c.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/c0880c.wgsl
@@ -25,7 +25,6 @@
 fn degrees_c0880c() {
   var res = degrees(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_c0880c();
diff --git a/test/tint/builtins/gen/literal/degrees/d43a49.wgsl b/test/tint/builtins/gen/literal/degrees/d43a49.wgsl
index 591aa5e..30e5d72 100644
--- a/test/tint/builtins/gen/literal/degrees/d43a49.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/d43a49.wgsl
@@ -25,7 +25,6 @@
 fn degrees_d43a49() {
   var res = degrees(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_d43a49();
diff --git a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl
index 6ab63b2..460aa39 100644
--- a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl
@@ -26,7 +26,9 @@
 // fn degrees(vec<3, f16>) -> vec<3, f16>
 fn degrees_dfe8f4() {
   var res: vec3<f16> = degrees(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.dxc.hlsl
index e79a618..c050597 100644
--- a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_dfe8f4() {
   vector<float16_t, 3> res = (float16_t(57.3125h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.fxc.hlsl
index ed429e7..f09b6f2 100644
--- a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_dfe8f4() {
   vector<float16_t, 3> res = (float16_t(57.3125h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.glsl
index 44e7b2a..a47391e 100644
--- a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void degrees_dfe8f4() {
   f16vec3 res = f16vec3(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void degrees_dfe8f4() {
   f16vec3 res = f16vec3(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void degrees_dfe8f4() {
   f16vec3 res = f16vec3(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.msl b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.msl
index 581a6af..b86a5cb 100644
--- a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void degrees_dfe8f4() {
+void degrees_dfe8f4(device packed_half3* const tint_symbol_1) {
   half3 res = half3(57.3125h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_dfe8f4();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  degrees_dfe8f4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_dfe8f4();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  degrees_dfe8f4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_dfe8f4();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  degrees_dfe8f4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.spvasm
index 449a8ea..5c42252 100644
--- a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_dfe8f4 "degrees_dfe8f4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ca8p_5 = OpConstant %half 0x1.ca8p+5
-         %16 = OpConstantComposite %v3half %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5
+         %19 = OpConstantComposite %v3half %half_0x1_ca8p_5 %half_0x1_ca8p_5 %half_0x1_ca8p_5
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_dfe8f4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%degrees_dfe8f4 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %degrees_dfe8f4
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %degrees_dfe8f4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %degrees_dfe8f4
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %degrees_dfe8f4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %degrees_dfe8f4
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %degrees_dfe8f4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.wgsl
index 885b2b9..3f14c88 100644
--- a/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/dfe8f4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn degrees_dfe8f4() {
   var res : vec3<f16> = degrees(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_dfe8f4();
diff --git a/test/tint/builtins/gen/literal/degrees/f59715.wgsl b/test/tint/builtins/gen/literal/degrees/f59715.wgsl
index 4c5bb05..b3ddd1a 100644
--- a/test/tint/builtins/gen/literal/degrees/f59715.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/f59715.wgsl
@@ -26,7 +26,9 @@
 // fn degrees(vec<2, f16>) -> vec<2, f16>
 fn degrees_f59715() {
   var res: vec2<f16> = degrees(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.dxc.hlsl
index 336be91..45761b7 100644
--- a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_f59715() {
   vector<float16_t, 2> res = (float16_t(57.3125h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.fxc.hlsl
index d44884e..092a964 100644
--- a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_f59715() {
   vector<float16_t, 2> res = (float16_t(57.3125h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.glsl b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.glsl
index a3e8bf9..2efe4ca 100644
--- a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void degrees_f59715() {
   f16vec2 res = f16vec2(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void degrees_f59715() {
   f16vec2 res = f16vec2(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void degrees_f59715() {
   f16vec2 res = f16vec2(57.3125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.msl b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.msl
index 62fd426..be9d865 100644
--- a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void degrees_f59715() {
+void degrees_f59715(device half2* const tint_symbol_1) {
   half2 res = half2(57.3125h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_f59715();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  degrees_f59715(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_f59715();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  degrees_f59715(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_f59715();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  degrees_f59715(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.spvasm
index ba71ed3..2c2711e 100644
--- a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_f59715 "degrees_f59715"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ca8p_5 = OpConstant %half 0x1.ca8p+5
-         %16 = OpConstantComposite %v2half %half_0x1_ca8p_5 %half_0x1_ca8p_5
+         %19 = OpConstantComposite %v2half %half_0x1_ca8p_5 %half_0x1_ca8p_5
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_f59715 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%degrees_f59715 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %degrees_f59715
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %degrees_f59715
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %degrees_f59715
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %degrees_f59715
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %degrees_f59715
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %degrees_f59715
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.wgsl
index 0971312..3ac2766 100644
--- a/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/f59715.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn degrees_f59715() {
   var res : vec2<f16> = degrees(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_f59715();
diff --git a/test/tint/builtins/gen/literal/degrees/fafa7e.wgsl b/test/tint/builtins/gen/literal/degrees/fafa7e.wgsl
index f5135de..d9383c7 100644
--- a/test/tint/builtins/gen/literal/degrees/fafa7e.wgsl
+++ b/test/tint/builtins/gen/literal/degrees/fafa7e.wgsl
@@ -25,7 +25,6 @@
 fn degrees_fafa7e() {
   var res = degrees(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_fafa7e();
diff --git a/test/tint/builtins/gen/literal/determinant/1bf6e7.wgsl b/test/tint/builtins/gen/literal/determinant/1bf6e7.wgsl
index e005418..949fd3f 100644
--- a/test/tint/builtins/gen/literal/determinant/1bf6e7.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/1bf6e7.wgsl
@@ -25,7 +25,6 @@
 fn determinant_1bf6e7() {
   var res = determinant(mat2x2(1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_1bf6e7();
diff --git a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl
index aa2e813..2729c5f 100644
--- a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl
@@ -24,7 +24,9 @@
 // fn determinant(mat<3, 3, f32>) -> f32
 fn determinant_2b62ba() {
   var res: f32 = determinant(mat3x3<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.dxc.hlsl
index 30e80d3..b0f85c6 100644
--- a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_2b62ba() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.fxc.hlsl
index 30e80d3..b0f85c6 100644
--- a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_2b62ba() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.glsl b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.glsl
index 41fce04..9258ebe 100644
--- a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_2b62ba() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_2b62ba() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_2b62ba() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.msl b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.msl
index 56313b0..89eda90 100644
--- a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_2b62ba() {
+void determinant_2b62ba(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_2b62ba();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  determinant_2b62ba(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_2b62ba();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  determinant_2b62ba(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_2b62ba();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  determinant_2b62ba(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.spvasm
index c7425e8..61f89e4 100644
--- a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_2b62ba "determinant_2b62ba"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_2b62ba = OpFunction %void None %9
-         %12 = OpLabel
+%determinant_2b62ba = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %determinant_2b62ba
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %determinant_2b62ba
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %determinant_2b62ba
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %determinant_2b62ba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %determinant_2b62ba
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %determinant_2b62ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.wgsl
index fc1d5c6..b13242d 100644
--- a/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/2b62ba.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn determinant_2b62ba() {
   var res : f32 = determinant(mat3x3<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_2b62ba();
diff --git a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl
index 0add05e..1a5f5bf 100644
--- a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl
@@ -26,7 +26,9 @@
 // fn determinant(mat<4, 4, f16>) -> f16
 fn determinant_32bfde() {
   var res: f16 = determinant(mat4x4<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.dxc.hlsl
index e602aa2..eb9bd7a 100644
--- a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_32bfde() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.fxc.hlsl
index 06a3c85..a9663db 100644
--- a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_32bfde() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.glsl b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.glsl
index 2a0aa4f..dd7dba8 100644
--- a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_32bfde() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_32bfde() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_32bfde() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.msl b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.msl
index c50561d..0986760 100644
--- a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_32bfde() {
+void determinant_32bfde(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_32bfde();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  determinant_32bfde(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_32bfde();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  determinant_32bfde(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_32bfde();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  determinant_32bfde(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.spvasm
index d2fb249..1c89b38 100644
--- a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_32bfde "determinant_32bfde"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_32bfde = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%determinant_32bfde = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %determinant_32bfde
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %determinant_32bfde
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %determinant_32bfde
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %determinant_32bfde
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %determinant_32bfde
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %determinant_32bfde
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.wgsl
index 237cc23..14c13af 100644
--- a/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/32bfde.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn determinant_32bfde() {
   var res : f16 = determinant(mat4x4<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_32bfde();
diff --git a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl
index 089c341..a44e048 100644
--- a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl
@@ -24,7 +24,9 @@
 // fn determinant(mat<4, 4, f32>) -> f32
 fn determinant_a0a87c() {
   var res: f32 = determinant(mat4x4<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.dxc.hlsl
index 78a081c..694a93d 100644
--- a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_a0a87c() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.fxc.hlsl
index 78a081c..694a93d 100644
--- a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_a0a87c() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.glsl
index de14daf..52ebe40 100644
--- a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_a0a87c() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_a0a87c() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_a0a87c() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.msl b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.msl
index bd6b0a6..bcdae86 100644
--- a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_a0a87c() {
+void determinant_a0a87c(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_a0a87c();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  determinant_a0a87c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_a0a87c();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  determinant_a0a87c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_a0a87c();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  determinant_a0a87c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.spvasm
index 4d1af3a..18f159c 100644
--- a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_a0a87c "determinant_a0a87c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_a0a87c = OpFunction %void None %9
-         %12 = OpLabel
+%determinant_a0a87c = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %determinant_a0a87c
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %determinant_a0a87c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %determinant_a0a87c
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %determinant_a0a87c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %determinant_a0a87c
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %determinant_a0a87c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.wgsl
index ddd8ee9..5568803 100644
--- a/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/a0a87c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn determinant_a0a87c() {
   var res : f32 = determinant(mat4x4<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_a0a87c();
diff --git a/test/tint/builtins/gen/literal/determinant/c8251d.wgsl b/test/tint/builtins/gen/literal/determinant/c8251d.wgsl
index d38a575..df4979e 100644
--- a/test/tint/builtins/gen/literal/determinant/c8251d.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/c8251d.wgsl
@@ -25,7 +25,6 @@
 fn determinant_c8251d() {
   var res = determinant(mat3x3(1., 1., 1., 1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_c8251d();
diff --git a/test/tint/builtins/gen/literal/determinant/cefdf3.wgsl b/test/tint/builtins/gen/literal/determinant/cefdf3.wgsl
index 8563a81..85fc343 100644
--- a/test/tint/builtins/gen/literal/determinant/cefdf3.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/cefdf3.wgsl
@@ -25,7 +25,6 @@
 fn determinant_cefdf3() {
   var res = determinant(mat4x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_cefdf3();
diff --git a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl
index 5154ef7..dc0a187 100644
--- a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl
@@ -26,7 +26,9 @@
 // fn determinant(mat<3, 3, f16>) -> f16
 fn determinant_d7c86f() {
   var res: f16 = determinant(mat3x3<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.dxc.hlsl
index ecaeb94..605a339 100644
--- a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_d7c86f() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.fxc.hlsl
index 8cc1a36..c3f37ef 100644
--- a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_d7c86f() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.glsl
index 2c159929..ae2f16a 100644
--- a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_d7c86f() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_d7c86f() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_d7c86f() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.msl b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.msl
index 2855ff5..cf1da8a 100644
--- a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_d7c86f() {
+void determinant_d7c86f(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_d7c86f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  determinant_d7c86f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_d7c86f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  determinant_d7c86f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_d7c86f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  determinant_d7c86f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.spvasm
index 1324352..f3d269d 100644
--- a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_d7c86f "determinant_d7c86f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_d7c86f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%determinant_d7c86f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %determinant_d7c86f
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %determinant_d7c86f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %determinant_d7c86f
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %determinant_d7c86f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %determinant_d7c86f
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %determinant_d7c86f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.wgsl
index d578f32..939f448 100644
--- a/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/d7c86f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn determinant_d7c86f() {
   var res : f16 = determinant(mat3x3<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_d7c86f();
diff --git a/test/tint/builtins/gen/literal/determinant/e19305.wgsl b/test/tint/builtins/gen/literal/determinant/e19305.wgsl
index c025b31..07aad40 100644
--- a/test/tint/builtins/gen/literal/determinant/e19305.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/e19305.wgsl
@@ -24,7 +24,9 @@
 // fn determinant(mat<2, 2, f32>) -> f32
 fn determinant_e19305() {
   var res: f32 = determinant(mat2x2<f32>(1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.dxc.hlsl
index de9399c..8a5a0fe 100644
--- a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_e19305() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.fxc.hlsl
index de9399c..8a5a0fe 100644
--- a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_e19305() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.glsl b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.glsl
index 0a24701..6a36b0f 100644
--- a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_e19305() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_e19305() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_e19305() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.msl b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.msl
index c592c00..7b95e50 100644
--- a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_e19305() {
+void determinant_e19305(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_e19305();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  determinant_e19305(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_e19305();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  determinant_e19305(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_e19305();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  determinant_e19305(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.spvasm
index 4a86d63..0601759 100644
--- a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_e19305 "determinant_e19305"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_e19305 = OpFunction %void None %9
-         %12 = OpLabel
+%determinant_e19305 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %determinant_e19305
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %determinant_e19305
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %determinant_e19305
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %determinant_e19305
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %determinant_e19305
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %determinant_e19305
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.wgsl
index ae1eead..45c1b34 100644
--- a/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/e19305.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn determinant_e19305() {
   var res : f32 = determinant(mat2x2<f32>(1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_e19305();
diff --git a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl
index 2741b6d..c94168f 100644
--- a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl
@@ -26,7 +26,9 @@
 // fn determinant(mat<2, 2, f16>) -> f16
 fn determinant_fc12a5() {
   var res: f16 = determinant(mat2x2<f16>(1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.dxc.hlsl
index b2730ff..090cef6 100644
--- a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_fc12a5() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.fxc.hlsl
index 1d9fc00..9db0c8d 100644
--- a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_fc12a5() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.glsl
index eb4ac54..5137099 100644
--- a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_fc12a5() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_fc12a5() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_fc12a5() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.msl b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.msl
index 51ce8b3..0d33b12 100644
--- a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_fc12a5() {
+void determinant_fc12a5(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_fc12a5();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  determinant_fc12a5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_fc12a5();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  determinant_fc12a5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_fc12a5();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  determinant_fc12a5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.spvasm
index 9a8aa11..1ee0635 100644
--- a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_fc12a5 "determinant_fc12a5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_fc12a5 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%determinant_fc12a5 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %determinant_fc12a5
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %determinant_fc12a5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %determinant_fc12a5
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %determinant_fc12a5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %determinant_fc12a5
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %determinant_fc12a5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.wgsl
index 2a13c30..540bedd 100644
--- a/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/determinant/fc12a5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn determinant_fc12a5() {
   var res : f16 = determinant(mat2x2<f16>(1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_fc12a5();
diff --git a/test/tint/builtins/gen/literal/distance/0657d4.wgsl b/test/tint/builtins/gen/literal/distance/0657d4.wgsl
index 9279027..2406acb 100644
--- a/test/tint/builtins/gen/literal/distance/0657d4.wgsl
+++ b/test/tint/builtins/gen/literal/distance/0657d4.wgsl
@@ -24,7 +24,9 @@
 // fn distance(vec<3, f32>, vec<3, f32>) -> f32
 fn distance_0657d4() {
   var res: f32 = distance(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.dxc.hlsl
index f3cfc1c..955dca0 100644
--- a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_0657d4() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.fxc.hlsl
index f3cfc1c..955dca0 100644
--- a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_0657d4() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.glsl
index ed0378f..a9f2d2f 100644
--- a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_0657d4() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_0657d4() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_0657d4() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.msl b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.msl
index 2418aa3..51166bd 100644
--- a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_0657d4() {
+void distance_0657d4(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_0657d4();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  distance_0657d4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_0657d4();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  distance_0657d4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_0657d4();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  distance_0657d4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.spvasm
index 6968ef0..54a21ed 100644
--- a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_0657d4 "distance_0657d4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_0657d4 = OpFunction %void None %9
-         %12 = OpLabel
+%distance_0657d4 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %distance_0657d4
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %distance_0657d4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %distance_0657d4
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %distance_0657d4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %distance_0657d4
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %distance_0657d4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.wgsl
index 2cec350..6616e19 100644
--- a/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/distance/0657d4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn distance_0657d4() {
   var res : f32 = distance(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_0657d4();
diff --git a/test/tint/builtins/gen/literal/distance/3a175a.wgsl b/test/tint/builtins/gen/literal/distance/3a175a.wgsl
index b229dd1..d925324 100644
--- a/test/tint/builtins/gen/literal/distance/3a175a.wgsl
+++ b/test/tint/builtins/gen/literal/distance/3a175a.wgsl
@@ -25,7 +25,6 @@
 fn distance_3a175a() {
   var res = distance(vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_3a175a();
diff --git a/test/tint/builtins/gen/literal/distance/7272f3.wgsl b/test/tint/builtins/gen/literal/distance/7272f3.wgsl
index 78785ef..9d41bce 100644
--- a/test/tint/builtins/gen/literal/distance/7272f3.wgsl
+++ b/test/tint/builtins/gen/literal/distance/7272f3.wgsl
@@ -26,7 +26,9 @@
 // fn distance(vec<4, f16>, vec<4, f16>) -> f16
 fn distance_7272f3() {
   var res: f16 = distance(vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.dxc.hlsl
index 9975d15..649f694 100644
--- a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_7272f3() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.fxc.hlsl
index 67b8ca5..1d88dc1 100644
--- a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_7272f3() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.glsl
index 80ea586..543f49e 100644
--- a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7272f3() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7272f3() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7272f3() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.msl b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.msl
index 21b5578..6092ff0 100644
--- a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_7272f3() {
+void distance_7272f3(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_7272f3();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  distance_7272f3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_7272f3();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  distance_7272f3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_7272f3();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  distance_7272f3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.spvasm
index 4caa4ef..07bdb7d 100644
--- a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_7272f3 "distance_7272f3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_7272f3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%distance_7272f3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %distance_7272f3
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %distance_7272f3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %distance_7272f3
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %distance_7272f3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %distance_7272f3
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %distance_7272f3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.wgsl
index 22004c9..5a13064 100644
--- a/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/distance/7272f3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn distance_7272f3() {
   var res : f16 = distance(vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_7272f3();
diff --git a/test/tint/builtins/gen/literal/distance/7d201f.wgsl b/test/tint/builtins/gen/literal/distance/7d201f.wgsl
index 4a27b52..2007a52 100644
--- a/test/tint/builtins/gen/literal/distance/7d201f.wgsl
+++ b/test/tint/builtins/gen/literal/distance/7d201f.wgsl
@@ -26,7 +26,9 @@
 // fn distance(f16, f16) -> f16
 fn distance_7d201f() {
   var res: f16 = distance(1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.dxc.hlsl
index 5de1ed2..a324873 100644
--- a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_7d201f() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.fxc.hlsl
index 6452257..29bf0f3 100644
--- a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_7d201f() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.glsl
index b2cc1bd..9698103 100644
--- a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7d201f() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7d201f() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7d201f() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.msl b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.msl
index 0a0b634..9ace4a5 100644
--- a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_7d201f() {
+void distance_7d201f(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_7d201f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  distance_7d201f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_7d201f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  distance_7d201f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_7d201f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  distance_7d201f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.spvasm
index 90dbc0d..5d8f0e8 100644
--- a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_7d201f "distance_7d201f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_7d201f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%distance_7d201f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %distance_7d201f
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %distance_7d201f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %distance_7d201f
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %distance_7d201f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %distance_7d201f
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %distance_7d201f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.wgsl
index c664ae0..680302b 100644
--- a/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/distance/7d201f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn distance_7d201f() {
   var res : f16 = distance(1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_7d201f();
diff --git a/test/tint/builtins/gen/literal/distance/83911f.wgsl b/test/tint/builtins/gen/literal/distance/83911f.wgsl
index ab9bc91..c63571e 100644
--- a/test/tint/builtins/gen/literal/distance/83911f.wgsl
+++ b/test/tint/builtins/gen/literal/distance/83911f.wgsl
@@ -25,7 +25,6 @@
 fn distance_83911f() {
   var res = distance(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_83911f();
diff --git a/test/tint/builtins/gen/literal/distance/892a5d.wgsl b/test/tint/builtins/gen/literal/distance/892a5d.wgsl
index 502dfaa..dd2ebb1 100644
--- a/test/tint/builtins/gen/literal/distance/892a5d.wgsl
+++ b/test/tint/builtins/gen/literal/distance/892a5d.wgsl
@@ -26,7 +26,9 @@
 // fn distance(vec<2, f16>, vec<2, f16>) -> f16
 fn distance_892a5d() {
   var res: f16 = distance(vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.dxc.hlsl
index 2a6873b..869e8ce 100644
--- a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_892a5d() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.fxc.hlsl
index 8856221..5e74981 100644
--- a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_892a5d() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.glsl
index a2e35a9..0a03ec5 100644
--- a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_892a5d() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_892a5d() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_892a5d() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.msl b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.msl
index c1f2c4d..71a63c1 100644
--- a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_892a5d() {
+void distance_892a5d(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_892a5d();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  distance_892a5d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_892a5d();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  distance_892a5d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_892a5d();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  distance_892a5d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.spvasm
index 049c36b..55b77d6 100644
--- a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_892a5d "distance_892a5d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_892a5d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%distance_892a5d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %distance_892a5d
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %distance_892a5d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %distance_892a5d
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %distance_892a5d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %distance_892a5d
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %distance_892a5d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.wgsl
index 53390b3..4b42d42 100644
--- a/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/distance/892a5d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn distance_892a5d() {
   var res : f16 = distance(vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_892a5d();
diff --git a/test/tint/builtins/gen/literal/distance/928fa0.wgsl b/test/tint/builtins/gen/literal/distance/928fa0.wgsl
index 5d5a2d2..0bb71f9 100644
--- a/test/tint/builtins/gen/literal/distance/928fa0.wgsl
+++ b/test/tint/builtins/gen/literal/distance/928fa0.wgsl
@@ -26,7 +26,9 @@
 // fn distance(vec<3, f16>, vec<3, f16>) -> f16
 fn distance_928fa0() {
   var res: f16 = distance(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.dxc.hlsl
index aceea56..fbed002 100644
--- a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_928fa0() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.fxc.hlsl
index 3228116..5755005 100644
--- a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_928fa0() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.glsl
index 8e3bfd4..7e0945d 100644
--- a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_928fa0() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_928fa0() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_928fa0() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.msl b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.msl
index dffd473..52a3fb3 100644
--- a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_928fa0() {
+void distance_928fa0(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_928fa0();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  distance_928fa0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_928fa0();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  distance_928fa0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_928fa0();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  distance_928fa0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.spvasm
index c2c743a..6163e22 100644
--- a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_928fa0 "distance_928fa0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_928fa0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%distance_928fa0 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %distance_928fa0
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %distance_928fa0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %distance_928fa0
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %distance_928fa0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %distance_928fa0
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %distance_928fa0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.wgsl
index 3a283dd..2651e00 100644
--- a/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/distance/928fa0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn distance_928fa0() {
   var res : f16 = distance(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_928fa0();
diff --git a/test/tint/builtins/gen/literal/distance/9646ea.wgsl b/test/tint/builtins/gen/literal/distance/9646ea.wgsl
index 7eaaa6d..10236ab 100644
--- a/test/tint/builtins/gen/literal/distance/9646ea.wgsl
+++ b/test/tint/builtins/gen/literal/distance/9646ea.wgsl
@@ -24,7 +24,9 @@
 // fn distance(vec<4, f32>, vec<4, f32>) -> f32
 fn distance_9646ea() {
   var res: f32 = distance(vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.dxc.hlsl
index 7d382a6..402aaac 100644
--- a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_9646ea() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.fxc.hlsl
index 7d382a6..402aaac 100644
--- a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_9646ea() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.glsl
index 8f708a0..eca386b 100644
--- a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_9646ea() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_9646ea() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_9646ea() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.msl b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.msl
index 0fb4dd8..30737378 100644
--- a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_9646ea() {
+void distance_9646ea(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_9646ea();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  distance_9646ea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_9646ea();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  distance_9646ea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_9646ea();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  distance_9646ea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.spvasm
index 2a380dd..bd91eb3 100644
--- a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_9646ea "distance_9646ea"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_9646ea = OpFunction %void None %9
-         %12 = OpLabel
+%distance_9646ea = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %distance_9646ea
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %distance_9646ea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %distance_9646ea
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %distance_9646ea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %distance_9646ea
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %distance_9646ea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.wgsl
index 4a3d9da..8009350 100644
--- a/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/distance/9646ea.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn distance_9646ea() {
   var res : f32 = distance(vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_9646ea();
diff --git a/test/tint/builtins/gen/literal/distance/aa4055.wgsl b/test/tint/builtins/gen/literal/distance/aa4055.wgsl
index 16ab33b..5a694db 100644
--- a/test/tint/builtins/gen/literal/distance/aa4055.wgsl
+++ b/test/tint/builtins/gen/literal/distance/aa4055.wgsl
@@ -24,7 +24,9 @@
 // fn distance(vec<2, f32>, vec<2, f32>) -> f32
 fn distance_aa4055() {
   var res: f32 = distance(vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.dxc.hlsl
index 3bddd0f..00ff903 100644
--- a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_aa4055() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.fxc.hlsl
index 3bddd0f..00ff903 100644
--- a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_aa4055() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.glsl b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.glsl
index 71ebcff..663b8e7 100644
--- a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_aa4055() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_aa4055() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_aa4055() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.msl b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.msl
index 75d883c..807ab6e 100644
--- a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_aa4055() {
+void distance_aa4055(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_aa4055();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  distance_aa4055(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_aa4055();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  distance_aa4055(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_aa4055();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  distance_aa4055(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.spvasm
index 25f74d1..49b022d 100644
--- a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_aa4055 "distance_aa4055"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_aa4055 = OpFunction %void None %9
-         %12 = OpLabel
+%distance_aa4055 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %distance_aa4055
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %distance_aa4055
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %distance_aa4055
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %distance_aa4055
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %distance_aa4055
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %distance_aa4055
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.wgsl
index bfec354..1a777ea 100644
--- a/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/distance/aa4055.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn distance_aa4055() {
   var res : f32 = distance(vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_aa4055();
diff --git a/test/tint/builtins/gen/literal/distance/ac5535.wgsl b/test/tint/builtins/gen/literal/distance/ac5535.wgsl
index 5984840..4fd08bd 100644
--- a/test/tint/builtins/gen/literal/distance/ac5535.wgsl
+++ b/test/tint/builtins/gen/literal/distance/ac5535.wgsl
@@ -25,7 +25,6 @@
 fn distance_ac5535() {
   var res = distance(vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_ac5535();
diff --git a/test/tint/builtins/gen/literal/distance/cfed73.wgsl b/test/tint/builtins/gen/literal/distance/cfed73.wgsl
index 7455071..0b5cc6d 100644
--- a/test/tint/builtins/gen/literal/distance/cfed73.wgsl
+++ b/test/tint/builtins/gen/literal/distance/cfed73.wgsl
@@ -24,7 +24,9 @@
 // fn distance(f32, f32) -> f32
 fn distance_cfed73() {
   var res: f32 = distance(1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.dxc.hlsl
index 8e44709..b9d0458 100644
--- a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_cfed73() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.fxc.hlsl
index 8e44709..b9d0458 100644
--- a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_cfed73() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.glsl b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.glsl
index 7c0db51..d6d4170 100644
--- a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_cfed73() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_cfed73() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_cfed73() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.msl b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.msl
index e48b48f..734d8ba 100644
--- a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_cfed73() {
+void distance_cfed73(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_cfed73();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  distance_cfed73(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_cfed73();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  distance_cfed73(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_cfed73();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  distance_cfed73(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.spvasm
index 2a601c1..a1625f2 100644
--- a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_cfed73 "distance_cfed73"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_cfed73 = OpFunction %void None %9
-         %12 = OpLabel
+%distance_cfed73 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %distance_cfed73
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %distance_cfed73
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %distance_cfed73
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %distance_cfed73
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %distance_cfed73
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %distance_cfed73
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.wgsl
index 4cf21ef..f38ac4e 100644
--- a/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/distance/cfed73.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn distance_cfed73() {
   var res : f32 = distance(1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_cfed73();
diff --git a/test/tint/builtins/gen/literal/distance/f9c9ee.wgsl b/test/tint/builtins/gen/literal/distance/f9c9ee.wgsl
index 6a9fd64..f936fc3 100644
--- a/test/tint/builtins/gen/literal/distance/f9c9ee.wgsl
+++ b/test/tint/builtins/gen/literal/distance/f9c9ee.wgsl
@@ -25,7 +25,6 @@
 fn distance_f9c9ee() {
   var res = distance(1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_f9c9ee();
diff --git a/test/tint/builtins/gen/literal/dot/08eb56.wgsl b/test/tint/builtins/gen/literal/dot/08eb56.wgsl
index 1be3d72..81e9dab 100644
--- a/test/tint/builtins/gen/literal/dot/08eb56.wgsl
+++ b/test/tint/builtins/gen/literal/dot/08eb56.wgsl
@@ -25,7 +25,6 @@
 fn dot_08eb56() {
   var res = dot(vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_08eb56();
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl
index 68a6963..33788b3 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<4, f32>, vec<4, f32>) -> f32
 fn dot_0c577b() {
   var res: f32 = dot(vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.dxc.hlsl
index f8d8fff..03310a3 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_0c577b() {
   float res = 4.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.fxc.hlsl
index f8d8fff..03310a3 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_0c577b() {
   float res = 4.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.glsl
index df20f28..3be1d22 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_0c577b() {
   float res = 4.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_0c577b() {
   float res = 4.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_0c577b() {
   float res = 4.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.msl
index 041a650..40c79c4 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_0c577b() {
+void dot_0c577b(device float* const tint_symbol_1) {
   float res = 4.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_0c577b();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  dot_0c577b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_0c577b();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  dot_0c577b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_0c577b();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  dot_0c577b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.spvasm
index b814ca8..9c1b987 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_0c577b "dot_0c577b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_4 = OpConstant %float 4
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_0c577b = OpFunction %void None %9
-         %12 = OpLabel
+ %dot_0c577b = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_4
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %dot_0c577b
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %dot_0c577b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %dot_0c577b
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %dot_0c577b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %dot_0c577b
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %dot_0c577b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.wgsl
index f372932..2e3eabe 100644
--- a/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/0c577b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_0c577b() {
   var res : f32 = dot(vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_0c577b();
diff --git a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl
index 2673e84..ed77ab7 100644
--- a/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl
+++ b/test/tint/builtins/gen/literal/dot/0d2c2e.wgsl
@@ -25,7 +25,6 @@
 fn dot_0d2c2e() {
   var res = dot(vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_0d2c2e();
diff --git a/test/tint/builtins/gen/literal/dot/14bc63.wgsl b/test/tint/builtins/gen/literal/dot/14bc63.wgsl
index b59b695..8b8ae31 100644
--- a/test/tint/builtins/gen/literal/dot/14bc63.wgsl
+++ b/test/tint/builtins/gen/literal/dot/14bc63.wgsl
@@ -25,7 +25,6 @@
 fn dot_14bc63() {
   var res = dot(vec2(1), vec2(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_14bc63();
diff --git a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl
index 8720932..0f238ca 100644
--- a/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl
+++ b/test/tint/builtins/gen/literal/dot/5a4c8f.wgsl
@@ -25,7 +25,6 @@
 fn dot_5a4c8f() {
   var res = dot(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_5a4c8f();
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl
index c4137ac..8b66c0c 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<3, u32>, vec<3, u32>) -> u32
 fn dot_7548a0() {
   var res: u32 = dot(vec3<u32>(1u), vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.dxc.hlsl
index 734a719..ece84ec 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_7548a0() {
   uint res = 3u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.fxc.hlsl
index 734a719..ece84ec 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_7548a0() {
   uint res = 3u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.glsl
index 7011d7e..f94c5e4 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_7548a0() {
   uint res = 3u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_7548a0() {
   uint res = 3u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_7548a0() {
   uint res = 3u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.msl
index 3261b2e..eb208ac 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_7548a0() {
+void dot_7548a0(device uint* const tint_symbol_1) {
   uint res = 3u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_7548a0();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  dot_7548a0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_7548a0();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  dot_7548a0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_7548a0();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  dot_7548a0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.spvasm
index 27b387a..9decac6 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_7548a0 "dot_7548a0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_3 = OpConstant %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_7548a0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %dot_7548a0 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_3
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_7548a0
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %dot_7548a0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_7548a0
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %dot_7548a0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_7548a0
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %dot_7548a0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.wgsl
index 61d1496..9206dbb 100644
--- a/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/7548a0.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_7548a0() {
   var res : u32 = dot(vec3<u32>(1u), vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_7548a0();
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl
index 9e4fb03..2c84086 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<2, f32>, vec<2, f32>) -> f32
 fn dot_883f0e() {
   var res: f32 = dot(vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.dxc.hlsl
index 47e8b07..5a22498 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_883f0e() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.fxc.hlsl
index 47e8b07..5a22498 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_883f0e() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.glsl
index 226cf9a..99cc8eb 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_883f0e() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_883f0e() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_883f0e() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.msl
index 0f63f30..b552c9f 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_883f0e() {
+void dot_883f0e(device float* const tint_symbol_1) {
   float res = 2.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_883f0e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  dot_883f0e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_883f0e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  dot_883f0e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_883f0e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  dot_883f0e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.spvasm
index e178ced..acd5b52 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_883f0e "dot_883f0e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_883f0e = OpFunction %void None %9
-         %12 = OpLabel
+ %dot_883f0e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_2
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %dot_883f0e
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %dot_883f0e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %dot_883f0e
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %dot_883f0e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %dot_883f0e
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %dot_883f0e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.wgsl
index 4d6a4bd..d7aaf5f 100644
--- a/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/883f0e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_883f0e() {
   var res : f32 = dot(vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_883f0e();
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl
index 52cd299..09b9dac 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl
@@ -26,7 +26,9 @@
 // fn dot(vec<3, f16>, vec<3, f16>) -> f16
 fn dot_8e40f1() {
   var res: f16 = dot(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.dxc.hlsl
index ae4d815..43339b7 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_8e40f1() {
   float16_t res = float16_t(3.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.fxc.hlsl
index 3930dea..bbe4fea 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_8e40f1() {
   float16_t res = float16_t(3.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.glsl
index 8f5eca6..5a02db9 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_8e40f1() {
   float16_t res = 3.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_8e40f1() {
   float16_t res = 3.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_8e40f1() {
   float16_t res = 3.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.msl
index 4828851..54be2b8 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_8e40f1() {
+void dot_8e40f1(device half* const tint_symbol_1) {
   half res = 3.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_8e40f1();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  dot_8e40f1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_8e40f1();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  dot_8e40f1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_8e40f1();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  dot_8e40f1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.spvasm
index f1e3db83..bfb1b5f 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_8e40f1 "dot_8e40f1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_8p_1 = OpConstant %half 0x1.8p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_8e40f1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %dot_8e40f1 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_8p_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_8e40f1
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %dot_8e40f1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_8e40f1
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot_8e40f1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_8e40f1
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %dot_8e40f1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.wgsl
index 609ecd0..fbb4a34 100644
--- a/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/8e40f1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn dot_8e40f1() {
   var res : f16 = dot(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_8e40f1();
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl
index 8b72eec..5a83843 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<2, u32>, vec<2, u32>) -> u32
 fn dot_97c7ee() {
   var res: u32 = dot(vec2<u32>(1u), vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.dxc.hlsl
index 598ea1a..d197c0a 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_97c7ee() {
   uint res = 2u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.fxc.hlsl
index 598ea1a..d197c0a 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_97c7ee() {
   uint res = 2u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.glsl
index eca1297..6e96dc5 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_97c7ee() {
   uint res = 2u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_97c7ee() {
   uint res = 2u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_97c7ee() {
   uint res = 2u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.msl
index e329edd..9f5f708 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_97c7ee() {
+void dot_97c7ee(device uint* const tint_symbol_1) {
   uint res = 2u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_97c7ee();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  dot_97c7ee(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_97c7ee();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  dot_97c7ee(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_97c7ee();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  dot_97c7ee(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.spvasm
index 384a3d7..44af30b 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_97c7ee "dot_97c7ee"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_97c7ee = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %dot_97c7ee = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_2
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_97c7ee
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %dot_97c7ee
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_97c7ee
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %dot_97c7ee
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_97c7ee
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %dot_97c7ee
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.wgsl
index 9c2729b..636ddd5 100644
--- a/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/97c7ee.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_97c7ee() {
   var res : u32 = dot(vec2<u32>(1u), vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_97c7ee();
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl
index 55ebdb6..8fb1599 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<3, f32>, vec<3, f32>) -> f32
 fn dot_ba4246() {
   var res: f32 = dot(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.dxc.hlsl
index 08f1cdd..284e648 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_ba4246() {
   float res = 3.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.fxc.hlsl
index 08f1cdd..284e648 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_ba4246() {
   float res = 3.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.glsl
index 95e9397..4c58e68 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_ba4246() {
   float res = 3.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_ba4246() {
   float res = 3.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_ba4246() {
   float res = 3.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.msl
index e127cec..6734d53 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_ba4246() {
+void dot_ba4246(device float* const tint_symbol_1) {
   float res = 3.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_ba4246();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  dot_ba4246(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_ba4246();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  dot_ba4246(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_ba4246();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  dot_ba4246(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.spvasm
index 948070e..6d20548 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_ba4246 "dot_ba4246"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_3 = OpConstant %float 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_ba4246 = OpFunction %void None %9
-         %12 = OpLabel
+ %dot_ba4246 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_3
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %dot_ba4246
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %dot_ba4246
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %dot_ba4246
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %dot_ba4246
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %dot_ba4246
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %dot_ba4246
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.wgsl
index 8e8e00f..dd8907c 100644
--- a/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/ba4246.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_ba4246() {
   var res : f32 = dot(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_ba4246();
diff --git a/test/tint/builtins/gen/literal/dot/c11efe.wgsl b/test/tint/builtins/gen/literal/dot/c11efe.wgsl
index b2409c4..638e38a 100644
--- a/test/tint/builtins/gen/literal/dot/c11efe.wgsl
+++ b/test/tint/builtins/gen/literal/dot/c11efe.wgsl
@@ -25,7 +25,6 @@
 fn dot_c11efe() {
   var res = dot(vec3(1), vec3(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_c11efe();
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl
index 0846182..9aa7bc5 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl
@@ -26,7 +26,9 @@
 // fn dot(vec<2, f16>, vec<2, f16>) -> f16
 fn dot_cd5a04() {
   var res: f16 = dot(vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.dxc.hlsl
index 546135b..fb07793 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_cd5a04() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.fxc.hlsl
index f49b398..c1283eb 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_cd5a04() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.glsl
index a9e34ca..cd1520b 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_cd5a04() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_cd5a04() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_cd5a04() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.msl
index e213927..46f226f 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_cd5a04() {
+void dot_cd5a04(device half* const tint_symbol_1) {
   half res = 2.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_cd5a04();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  dot_cd5a04(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_cd5a04();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  dot_cd5a04(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_cd5a04();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  dot_cd5a04(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.spvasm
index 5baab99..74a201c 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_cd5a04 "dot_cd5a04"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_cd5a04 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %dot_cd5a04 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_cd5a04
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %dot_cd5a04
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_cd5a04
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot_cd5a04
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_cd5a04
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %dot_cd5a04
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.wgsl
index 3547523..ed946a7 100644
--- a/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/cd5a04.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn dot_cd5a04() {
   var res : f16 = dot(vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_cd5a04();
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl
index 2b47d38..ad9bf41 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl
@@ -26,7 +26,9 @@
 // fn dot(vec<4, f16>, vec<4, f16>) -> f16
 fn dot_d0d179() {
   var res: f16 = dot(vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.dxc.hlsl
index 9ab6fe7..83e8ac1 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_d0d179() {
   float16_t res = float16_t(4.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.fxc.hlsl
index 1c483ad..31b2836 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_d0d179() {
   float16_t res = float16_t(4.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.glsl
index 7654968..ab42692 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_d0d179() {
   float16_t res = 4.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_d0d179() {
   float16_t res = 4.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_d0d179() {
   float16_t res = 4.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.msl
index 82091e5..0eaa772 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_d0d179() {
+void dot_d0d179(device half* const tint_symbol_1) {
   half res = 4.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_d0d179();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  dot_d0d179(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_d0d179();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  dot_d0d179(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_d0d179();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  dot_d0d179(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.spvasm
index b6182eb..52a9cfd 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_d0d179 "dot_d0d179"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_2 = OpConstant %half 0x1p+2
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_d0d179 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %dot_d0d179 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_2
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_d0d179
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %dot_d0d179
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_d0d179
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot_d0d179
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_d0d179
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %dot_d0d179
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.wgsl
index 17c0bba..7dff27f 100644
--- a/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/d0d179.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn dot_d0d179() {
   var res : f16 = dot(vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_d0d179();
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl
index 05a4690..b86aead 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<4, u32>, vec<4, u32>) -> u32
 fn dot_e994c7() {
   var res: u32 = dot(vec4<u32>(1u), vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.dxc.hlsl
index d6f5c4b..17b4f93 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_e994c7() {
   uint res = 4u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.fxc.hlsl
index d6f5c4b..17b4f93 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_e994c7() {
   uint res = 4u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.glsl
index 7254b26..8d0a406 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_e994c7() {
   uint res = 4u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_e994c7() {
   uint res = 4u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_e994c7() {
   uint res = 4u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.msl
index f748a3c..dc3406a 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_e994c7() {
+void dot_e994c7(device uint* const tint_symbol_1) {
   uint res = 4u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_e994c7();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  dot_e994c7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_e994c7();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  dot_e994c7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_e994c7();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  dot_e994c7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.spvasm
index 1c5c497..89c1b0f 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_e994c7 "dot_e994c7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_4 = OpConstant %uint 4
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_e994c7 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %dot_e994c7 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_4
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_e994c7
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %dot_e994c7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_e994c7
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %dot_e994c7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_e994c7
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %dot_e994c7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.wgsl
index f1a91b6..6f55e18 100644
--- a/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/e994c7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_e994c7() {
   var res : u32 = dot(vec4<u32>(1u), vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_e994c7();
diff --git a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl
index 527f7fc..43607ce 100644
--- a/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl
+++ b/test/tint/builtins/gen/literal/dot/eb9fbf.wgsl
@@ -25,7 +25,6 @@
 fn dot_eb9fbf() {
   var res = dot(vec4(1), vec4(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_eb9fbf();
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl
index eb364f7..5ef8a8c 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<4, i32>, vec<4, i32>) -> i32
 fn dot_ef6b1d() {
   var res: i32 = dot(vec4<i32>(1i), vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.dxc.hlsl
index dfaf584..9f5fa7c 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_ef6b1d() {
   int res = 4;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.fxc.hlsl
index dfaf584..9f5fa7c 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_ef6b1d() {
   int res = 4;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.glsl
index c3359d5..7f3eb12 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_ef6b1d() {
   int res = 4;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_ef6b1d() {
   int res = 4;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_ef6b1d() {
   int res = 4;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.msl
index ee2bc3c..f7e34be 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_ef6b1d() {
+void dot_ef6b1d(device int* const tint_symbol_1) {
   int res = 4;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_ef6b1d();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  dot_ef6b1d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_ef6b1d();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  dot_ef6b1d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_ef6b1d();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  dot_ef6b1d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.spvasm
index afe822c..04e8aa4 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_ef6b1d "dot_ef6b1d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_4 = OpConstant %int 4
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_ef6b1d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+ %dot_ef6b1d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_4
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_ef6b1d
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %dot_ef6b1d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_ef6b1d
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot_ef6b1d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_ef6b1d
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %dot_ef6b1d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.wgsl
index e29bd2b..6429034 100644
--- a/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/ef6b1d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_ef6b1d() {
   var res : i32 = dot(vec4<i32>(1i), vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_ef6b1d();
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl
index 40db685..a75aab3 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<3, i32>, vec<3, i32>) -> i32
 fn dot_f1312c() {
   var res: i32 = dot(vec3<i32>(1i), vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.dxc.hlsl
index 7454ee2..187ddb0 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_f1312c() {
   int res = 3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.fxc.hlsl
index 7454ee2..187ddb0 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_f1312c() {
   int res = 3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.glsl
index e076417..8c9a79a 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_f1312c() {
   int res = 3;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_f1312c() {
   int res = 3;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_f1312c() {
   int res = 3;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.msl
index b5181d5..bbbc4e4 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_f1312c() {
+void dot_f1312c(device int* const tint_symbol_1) {
   int res = 3;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_f1312c();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  dot_f1312c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_f1312c();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  dot_f1312c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_f1312c();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  dot_f1312c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.spvasm
index 1cd4a1c..47805bf 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_f1312c "dot_f1312c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_3 = OpConstant %int 3
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_f1312c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+ %dot_f1312c = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_3
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_f1312c
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %dot_f1312c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_f1312c
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot_f1312c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_f1312c
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %dot_f1312c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.wgsl
index 8183602..625768b 100644
--- a/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/f1312c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_f1312c() {
   var res : i32 = dot(vec3<i32>(1i), vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_f1312c();
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl
index e10986e..7fe2bd4 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl
@@ -24,7 +24,9 @@
 // fn dot(vec<2, i32>, vec<2, i32>) -> i32
 fn dot_fc5f7c() {
   var res: i32 = dot(vec2<i32>(1i), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.dxc.hlsl
index ab81427..9511843 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_fc5f7c() {
   int res = 2;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.fxc.hlsl
index ab81427..9511843 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_fc5f7c() {
   int res = 2;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.glsl
index d570992..468e35d 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_fc5f7c() {
   int res = 2;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_fc5f7c() {
   int res = 2;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_fc5f7c() {
   int res = 2;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.msl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.msl
index 4531473..b0af8c7 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_fc5f7c() {
+void dot_fc5f7c(device int* const tint_symbol_1) {
   int res = 2;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_fc5f7c();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  dot_fc5f7c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_fc5f7c();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  dot_fc5f7c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_fc5f7c();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  dot_fc5f7c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.spvasm
index f62845f..47dcf66 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_fc5f7c "dot_fc5f7c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_2 = OpConstant %int 2
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_fc5f7c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+ %dot_fc5f7c = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_2
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %dot_fc5f7c
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %dot_fc5f7c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_fc5f7c
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot_fc5f7c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %dot_fc5f7c
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %dot_fc5f7c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.wgsl
index e301ec5..6dbc69a 100644
--- a/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot/fc5f7c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dot_fc5f7c() {
   var res : i32 = dot(vec2<i32>(1i), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_fc5f7c();
diff --git a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl
index dafb8b6..2ad18b3 100644
--- a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl
+++ b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl
@@ -26,7 +26,9 @@
 // fn dot4I8Packed(u32, u32) -> i32
 fn dot4I8Packed_881e62() {
   var res: i32 = dot4I8Packed(1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.dxc.hlsl
index 3ba4985..07db08f 100644
--- a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.dxc.hlsl
@@ -1,10 +1,15 @@
+SKIP: FAILED
+
 int tint_dot4I8Packed(uint param_0, uint param_1) {
   int accumulator = 0;
   return dot4add_i8packed(param_0, param_1, accumulator);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot4I8Packed_881e62() {
   int res = tint_dot4I8Packed(1u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +38,31 @@
   dot4I8Packed_881e62();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddI8Packed not valid in shader model vs_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 163, i32 0, i32 1, i32 1)' in block '#0' of function 'vertex_main'.
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddI8Packed not valid in shader model ps_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 163, i32 0, i32 1, i32 1)' in block '#0' of function 'fragment_main'.
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddI8Packed not valid in shader model cs_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 163, i32 0, i32 1, i32 1)' in block '#0' of function 'compute_main'.
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.fxc.hlsl
index 5692ea0..6d5819e 100644
--- a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.fxc.hlsl
@@ -5,8 +5,11 @@
   return dot4add_i8packed(param_0, param_1, accumulator);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot4I8Packed_881e62() {
   int res = tint_dot4I8Packed(1u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.spvasm
index d71f31e..324972a 100644
--- a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpCapability DotProduct
@@ -15,6 +15,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot4I8Packed_881e62 "dot4I8Packed_881e62"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,41 +38,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %19 = OpConstantNull %int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%dot4I8Packed_881e62 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %19
-         %13 = OpSDot %int %uint_1 %uint_1 PackedVectorFormat4x8Bit
-               OpStore %res %13
+%dot4I8Packed_881e62 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %22
+         %17 = OpSDot %int %uint_1 %uint_1 PackedVectorFormat4x8Bit
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %dot4I8Packed_881e62
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %dot4I8Packed_881e62
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %dot4I8Packed_881e62
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %dot4I8Packed_881e62
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %dot4I8Packed_881e62
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %dot4I8Packed_881e62
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.wgsl
index 8057884..03dd070 100644
--- a/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot4I8Packed/881e62.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn dot4I8Packed_881e62() {
   var res : i32 = dot4I8Packed(1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot4I8Packed_881e62();
diff --git a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl
index da99ad2..f4c7a2e 100644
--- a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl
+++ b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl
@@ -26,7 +26,9 @@
 // fn dot4U8Packed(u32, u32) -> u32
 fn dot4U8Packed_fbed7b() {
   var res: u32 = dot4U8Packed(1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.dxc.hlsl
index ffd9878..c451ecf 100644
--- a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.dxc.hlsl
@@ -1,10 +1,15 @@
+SKIP: FAILED
+
 uint tint_dot4U8Packed(uint param_0, uint param_1) {
   uint accumulator = 0u;
   return dot4add_u8packed(param_0, param_1, accumulator);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot4U8Packed_fbed7b() {
   uint res = tint_dot4U8Packed(1u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +38,31 @@
   dot4U8Packed_fbed7b();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddU8Packed not valid in shader model vs_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 164, i32 0, i32 1, i32 1)' in block '#0' of function 'vertex_main'.
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddU8Packed not valid in shader model ps_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 164, i32 0, i32 1, i32 1)' in block '#0' of function 'fragment_main'.
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddU8Packed not valid in shader model cs_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 164, i32 0, i32 1, i32 1)' in block '#0' of function 'compute_main'.
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.fxc.hlsl
index c371939..0bce1dd 100644
--- a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.fxc.hlsl
@@ -5,8 +5,11 @@
   return dot4add_u8packed(param_0, param_1, accumulator);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot4U8Packed_fbed7b() {
   uint res = tint_dot4U8Packed(1u, 1u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.spvasm
index 855730c..02e6fb3 100644
--- a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability DotProduct
@@ -15,6 +15,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot4U8Packed_fbed7b "dot4U8Packed_fbed7b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,40 +38,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%dot4U8Packed_fbed7b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %13 = OpUDot %uint %uint_1 %uint_1 PackedVectorFormat4x8Bit
-               OpStore %res %13
+%dot4U8Packed_fbed7b = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %17 = OpUDot %uint %uint_1 %uint_1 PackedVectorFormat4x8Bit
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %dot4U8Packed_fbed7b
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %dot4U8Packed_fbed7b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %dot4U8Packed_fbed7b
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot4U8Packed_fbed7b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %dot4U8Packed_fbed7b
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %dot4U8Packed_fbed7b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.wgsl
index f261301..495c448 100644
--- a/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dot4U8Packed/fbed7b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn dot4U8Packed_fbed7b() {
   var res : u32 = dot4U8Packed(1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot4U8Packed_fbed7b();
diff --git a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl
index be35d4c..2f0db30 100644
--- a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl
+++ b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl
@@ -24,7 +24,9 @@
 // fn dpdx(vec<3, f32>) -> vec<3, f32>
 fn dpdx_0763f7() {
   var res: vec3<f32> = dpdx(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.dxc.hlsl
index 006f0ad..b1334b4 100644
--- a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_0763f7() {
   float3 res = ddx((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.fxc.hlsl
index 006f0ad..b1334b4 100644
--- a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_0763f7() {
   float3 res = ddx((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.glsl
index 13b51c3..ac54486 100644
--- a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdx_0763f7() {
   vec3 res = dFdx(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.msl
index bb7c03a..a94023f 100644
--- a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdx_0763f7() {
+void dpdx_0763f7(device packed_float3* const tint_symbol) {
   float3 res = dfdx(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdx_0763f7();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdx_0763f7(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.spvasm
index 4aa28b4..513c668 100644
--- a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdx_0763f7 "dpdx_0763f7"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%dpdx_0763f7 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpDPdx %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdx_0763f7 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpDPdx %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdx_0763f7
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdx_0763f7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.wgsl
index 01ce49f..a2da2f7 100644
--- a/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdx/0763f7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdx_0763f7() {
   var res : vec3<f32> = dpdx(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdx_0763f7();
diff --git a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl
index 987877d..9e1e2da 100644
--- a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl
+++ b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl
@@ -24,7 +24,9 @@
 // fn dpdx(vec<2, f32>) -> vec<2, f32>
 fn dpdx_99edb1() {
   var res: vec2<f32> = dpdx(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.dxc.hlsl
index 329f5be..07a70e8 100644
--- a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_99edb1() {
   float2 res = ddx((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.fxc.hlsl
index 329f5be..07a70e8 100644
--- a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_99edb1() {
   float2 res = ddx((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.glsl
index 54f5625..2c6f4d3 100644
--- a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdx_99edb1() {
   vec2 res = dFdx(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.msl
index a7fe265..5cd6843 100644
--- a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdx_99edb1() {
+void dpdx_99edb1(device float2* const tint_symbol) {
   float2 res = dfdx(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdx_99edb1();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdx_99edb1(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.spvasm
index 0925757..0b16a6d 100644
--- a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdx_99edb1 "dpdx_99edb1"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%dpdx_99edb1 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpDPdx %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdx_99edb1 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpDPdx %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdx_99edb1
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdx_99edb1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.wgsl
index c04b9d5..c2c031b 100644
--- a/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdx/99edb1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdx_99edb1() {
   var res : vec2<f32> = dpdx(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdx_99edb1();
diff --git a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl
index fa5212e..68fa0a7 100644
--- a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl
+++ b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl
@@ -24,7 +24,9 @@
 // fn dpdx(vec<4, f32>) -> vec<4, f32>
 fn dpdx_c487fa() {
   var res: vec4<f32> = dpdx(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.dxc.hlsl
index 5fe5a49..ca0658b 100644
--- a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_c487fa() {
   float4 res = ddx((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.fxc.hlsl
index 5fe5a49..ca0658b 100644
--- a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_c487fa() {
   float4 res = ddx((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.glsl
index 2f90462..75b2dbe 100644
--- a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdx_c487fa() {
   vec4 res = dFdx(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.msl
index 3b79c39..d991e0a 100644
--- a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdx_c487fa() {
+void dpdx_c487fa(device float4* const tint_symbol) {
   float4 res = dfdx(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdx_c487fa();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdx_c487fa(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.spvasm
index e13bd9e..bf3211b 100644
--- a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdx_c487fa "dpdx_c487fa"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%dpdx_c487fa = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpDPdx %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdx_c487fa = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpDPdx %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdx_c487fa
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdx_c487fa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.wgsl
index 535c9f9..e5cf270 100644
--- a/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdx/c487fa.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdx_c487fa() {
   var res : vec4<f32> = dpdx(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdx_c487fa();
diff --git a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl
index d38f6c7..53de90f 100644
--- a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl
+++ b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl
@@ -24,7 +24,9 @@
 // fn dpdx(f32) -> f32
 fn dpdx_e263de() {
   var res: f32 = dpdx(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.dxc.hlsl
index e9ef3f4..9253f85 100644
--- a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_e263de() {
   float res = ddx(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.fxc.hlsl
index e9ef3f4..9253f85 100644
--- a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_e263de() {
   float res = ddx(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.glsl
index 7909a07..acde968 100644
--- a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdx_e263de() {
   float res = dFdx(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.msl
index 69792e1..d8eba11 100644
--- a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdx_e263de() {
+void dpdx_e263de(device float* const tint_symbol) {
   float res = dfdx(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdx_e263de();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdx_e263de(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.spvasm
index 362c4c1..52d68b1 100644
--- a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.spvasm
@@ -1,30 +1,46 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdx_e263de "dpdx_e263de"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%dpdx_e263de = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpDPdx %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdx_e263de = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpDPdx %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %dpdx_e263de
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %dpdx_e263de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.wgsl
index 50afb2d..9541e67 100644
--- a/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdx/e263de.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdx_e263de() {
   var res : f32 = dpdx(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdx_e263de();
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl
index eeb5490..3e9e58f 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl
@@ -24,7 +24,9 @@
 // fn dpdxCoarse(f32) -> f32
 fn dpdxCoarse_029152() {
   var res: f32 = dpdxCoarse(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.dxc.hlsl
index 940572b..beb4f52 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_029152() {
   float res = ddx_coarse(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.fxc.hlsl
index 940572b..beb4f52 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_029152() {
   float res = ddx_coarse(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.glsl
index 1a6f532..2151155 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdxCoarse_029152() {
   float res = dFdx(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.msl
index b566d55..a2482fe 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxCoarse_029152() {
+void dpdxCoarse_029152(device float* const tint_symbol) {
   float res = dfdx(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxCoarse_029152();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdxCoarse_029152(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.spvasm
index a000ab1..0fe9135 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.spvasm
@@ -1,31 +1,47 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxCoarse_029152 "dpdxCoarse_029152"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%dpdxCoarse_029152 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpDPdxCoarse %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdxCoarse_029152 = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpDPdxCoarse %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %dpdxCoarse_029152
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %dpdxCoarse_029152
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.wgsl
index b9c3d00..71f9e5c 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/029152.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdxCoarse_029152() {
   var res : f32 = dpdxCoarse(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdxCoarse_029152();
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl
index 7c28974..a262050 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl
@@ -24,7 +24,9 @@
 // fn dpdxCoarse(vec<2, f32>) -> vec<2, f32>
 fn dpdxCoarse_9581cf() {
   var res: vec2<f32> = dpdxCoarse(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.dxc.hlsl
index 90068fd..83e71aa 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_9581cf() {
   float2 res = ddx_coarse((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.fxc.hlsl
index 90068fd..83e71aa 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_9581cf() {
   float2 res = ddx_coarse((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.glsl
index 3edfdc4..ec8a7fa 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdxCoarse_9581cf() {
   vec2 res = dFdx(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.msl
index ee68af8..71e3cc3 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxCoarse_9581cf() {
+void dpdxCoarse_9581cf(device float2* const tint_symbol) {
   float2 res = dfdx(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxCoarse_9581cf();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdxCoarse_9581cf(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.spvasm
index e04bfea..51f4380 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxCoarse_9581cf "dpdxCoarse_9581cf"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%dpdxCoarse_9581cf = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpDPdxCoarse %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdxCoarse_9581cf = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpDPdxCoarse %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdxCoarse_9581cf
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdxCoarse_9581cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.wgsl
index ab423ce..c28b280 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/9581cf.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdxCoarse_9581cf() {
   var res : vec2<f32> = dpdxCoarse(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxCoarse_9581cf();
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl
index 25de663..7622d4f 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl
@@ -24,7 +24,9 @@
 // fn dpdxCoarse(vec<4, f32>) -> vec<4, f32>
 fn dpdxCoarse_c28641() {
   var res: vec4<f32> = dpdxCoarse(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.dxc.hlsl
index b58e750..0f817f3 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_c28641() {
   float4 res = ddx_coarse((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.fxc.hlsl
index b58e750..0f817f3 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_c28641() {
   float4 res = ddx_coarse((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.glsl
index d872d9c..9b890f0 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdxCoarse_c28641() {
   vec4 res = dFdx(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.msl
index 06a6825..a414cba 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxCoarse_c28641() {
+void dpdxCoarse_c28641(device float4* const tint_symbol) {
   float4 res = dfdx(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxCoarse_c28641();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdxCoarse_c28641(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.spvasm
index 9881a33..24844e3 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxCoarse_c28641 "dpdxCoarse_c28641"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%dpdxCoarse_c28641 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpDPdxCoarse %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdxCoarse_c28641 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpDPdxCoarse %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdxCoarse_c28641
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdxCoarse_c28641
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.wgsl
index 73c918e..1434d82 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/c28641.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdxCoarse_c28641() {
   var res : vec4<f32> = dpdxCoarse(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxCoarse_c28641();
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl
index 6d19694..c9dddb2 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl
@@ -24,7 +24,9 @@
 // fn dpdxCoarse(vec<3, f32>) -> vec<3, f32>
 fn dpdxCoarse_f64d7b() {
   var res: vec3<f32> = dpdxCoarse(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.dxc.hlsl
index ac7bdfa..325caab 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_f64d7b() {
   float3 res = ddx_coarse((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.fxc.hlsl
index ac7bdfa..325caab 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_f64d7b() {
   float3 res = ddx_coarse((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.glsl
index 7226ff3..e0148aa 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdxCoarse_f64d7b() {
   vec3 res = dFdx(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.msl
index 873a04f..9978fe7 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxCoarse_f64d7b() {
+void dpdxCoarse_f64d7b(device packed_float3* const tint_symbol) {
   float3 res = dfdx(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdxCoarse_f64d7b();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdxCoarse_f64d7b(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.spvasm
index 9929a2d..e78c750 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxCoarse_f64d7b "dpdxCoarse_f64d7b"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%dpdxCoarse_f64d7b = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpDPdxCoarse %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdxCoarse_f64d7b = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpDPdxCoarse %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdxCoarse_f64d7b
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdxCoarse_f64d7b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.wgsl
index dd55954..1a45c44 100644
--- a/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxCoarse/f64d7b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdxCoarse_f64d7b() {
   var res : vec3<f32> = dpdxCoarse(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxCoarse_f64d7b();
diff --git a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl
index 882541d..cdf54f8 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl
@@ -24,7 +24,9 @@
 // fn dpdxFine(vec<4, f32>) -> vec<4, f32>
 fn dpdxFine_8c5069() {
   var res: vec4<f32> = dpdxFine(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.dxc.hlsl
index 0fd9cbd..454605a 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_8c5069() {
   float4 res = ddx_fine((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.fxc.hlsl
index 0fd9cbd..454605a 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_8c5069() {
   float4 res = ddx_fine((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.glsl
index 642c5c9..37ebe64 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdxFine_8c5069() {
   vec4 res = dFdx(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.msl
index 8976e5a..fbcfb4e 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxFine_8c5069() {
+void dpdxFine_8c5069(device float4* const tint_symbol) {
   float4 res = dfdx(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxFine_8c5069();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdxFine_8c5069(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.spvasm
index 0539ee9..60fc328 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxFine_8c5069 "dpdxFine_8c5069"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%dpdxFine_8c5069 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpDPdxFine %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdxFine_8c5069 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpDPdxFine %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdxFine_8c5069
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdxFine_8c5069
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.wgsl
index 68ac49b..2f313f9 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/8c5069.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdxFine_8c5069() {
   var res : vec4<f32> = dpdxFine(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxFine_8c5069();
diff --git a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl
index a658a70..65ecbc2 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl
@@ -24,7 +24,9 @@
 // fn dpdxFine(vec<2, f32>) -> vec<2, f32>
 fn dpdxFine_9631de() {
   var res: vec2<f32> = dpdxFine(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.dxc.hlsl
index 0cbd83c..3d571cf 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_9631de() {
   float2 res = ddx_fine((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.fxc.hlsl
index 0cbd83c..3d571cf 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_9631de() {
   float2 res = ddx_fine((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.glsl
index 6e00045..a5472bb 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdxFine_9631de() {
   vec2 res = dFdx(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.msl
index c2c63db..3b5c6f4 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxFine_9631de() {
+void dpdxFine_9631de(device float2* const tint_symbol) {
   float2 res = dfdx(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxFine_9631de();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdxFine_9631de(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.spvasm
index fe6f1cd..1db1864 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxFine_9631de "dpdxFine_9631de"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%dpdxFine_9631de = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpDPdxFine %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdxFine_9631de = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpDPdxFine %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdxFine_9631de
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdxFine_9631de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.wgsl
index cafb382..7beb7f9 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/9631de.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdxFine_9631de() {
   var res : vec2<f32> = dpdxFine(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxFine_9631de();
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl
index 638fee0..6c2912a 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl
@@ -24,7 +24,9 @@
 // fn dpdxFine(f32) -> f32
 fn dpdxFine_f401a2() {
   var res: f32 = dpdxFine(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.dxc.hlsl
index bf4ada4..ab0528c 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_f401a2() {
   float res = ddx_fine(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.fxc.hlsl
index bf4ada4..ab0528c 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_f401a2() {
   float res = ddx_fine(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.glsl
index 16b9ab1..c1b2f34 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdxFine_f401a2() {
   float res = dFdx(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.msl
index 26f6c10..1394e29 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxFine_f401a2() {
+void dpdxFine_f401a2(device float* const tint_symbol) {
   float res = dfdx(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxFine_f401a2();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdxFine_f401a2(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.spvasm
index 24fd696..39e85c1 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.spvasm
@@ -1,31 +1,47 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxFine_f401a2 "dpdxFine_f401a2"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%dpdxFine_f401a2 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpDPdxFine %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdxFine_f401a2 = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpDPdxFine %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %dpdxFine_f401a2
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %dpdxFine_f401a2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.wgsl
index 03e57e9..85630162 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f401a2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdxFine_f401a2() {
   var res : f32 = dpdxFine(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdxFine_f401a2();
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl
index 57488d2..ee92987 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl
@@ -24,7 +24,9 @@
 // fn dpdxFine(vec<3, f32>) -> vec<3, f32>
 fn dpdxFine_f92fb6() {
   var res: vec3<f32> = dpdxFine(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.dxc.hlsl
index 8629bb2..9ad89b6 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_f92fb6() {
   float3 res = ddx_fine((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.fxc.hlsl
index 8629bb2..9ad89b6 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_f92fb6() {
   float3 res = ddx_fine((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.glsl
index a378379..35c1eaa 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdxFine_f92fb6() {
   vec3 res = dFdx(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.msl
index c5c1844..57bf90d 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxFine_f92fb6() {
+void dpdxFine_f92fb6(device packed_float3* const tint_symbol) {
   float3 res = dfdx(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdxFine_f92fb6();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdxFine_f92fb6(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.spvasm
index d9b670f..21393cb 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxFine_f92fb6 "dpdxFine_f92fb6"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%dpdxFine_f92fb6 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpDPdxFine %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdxFine_f92fb6 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpDPdxFine %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdxFine_f92fb6
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdxFine_f92fb6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.wgsl
index aebeb3d..d5a3595 100644
--- a/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdxFine/f92fb6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdxFine_f92fb6() {
   var res : vec3<f32> = dpdxFine(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxFine_f92fb6();
diff --git a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl
index 36be877..040832f 100644
--- a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl
+++ b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl
@@ -24,7 +24,9 @@
 // fn dpdy(vec<4, f32>) -> vec<4, f32>
 fn dpdy_699a05() {
   var res: vec4<f32> = dpdy(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.dxc.hlsl
index 178cd50..a76c86a 100644
--- a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_699a05() {
   float4 res = ddy((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.fxc.hlsl
index 178cd50..a76c86a 100644
--- a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_699a05() {
   float4 res = ddy((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.glsl
index 9baa62c..37d867d 100644
--- a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdy_699a05() {
   vec4 res = dFdy(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.msl
index d912666..e708d91 100644
--- a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdy_699a05() {
+void dpdy_699a05(device float4* const tint_symbol) {
   float4 res = dfdy(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdy_699a05();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdy_699a05(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.spvasm
index 82a555a..73525fd 100644
--- a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdy_699a05 "dpdy_699a05"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%dpdy_699a05 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpDPdy %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdy_699a05 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpDPdy %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdy_699a05
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdy_699a05
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.wgsl
index ec7c3a8..3566cf2 100644
--- a/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdy/699a05.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdy_699a05() {
   var res : vec4<f32> = dpdy(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdy_699a05();
diff --git a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl
index a567c95..e5fcf18 100644
--- a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl
+++ b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl
@@ -24,7 +24,9 @@
 // fn dpdy(f32) -> f32
 fn dpdy_7f8d84() {
   var res: f32 = dpdy(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.dxc.hlsl
index 8b93006..b32cdcd 100644
--- a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_7f8d84() {
   float res = ddy(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.fxc.hlsl
index 8b93006..b32cdcd 100644
--- a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_7f8d84() {
   float res = ddy(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.glsl
index cc8d4b7..0a78c1d 100644
--- a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdy_7f8d84() {
   float res = dFdy(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.msl
index d4f274e..d2987ae 100644
--- a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdy_7f8d84() {
+void dpdy_7f8d84(device float* const tint_symbol) {
   float res = dfdy(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdy_7f8d84();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdy_7f8d84(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.spvasm
index 9283881..2b2031d 100644
--- a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.spvasm
@@ -1,30 +1,46 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdy_7f8d84 "dpdy_7f8d84"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%dpdy_7f8d84 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpDPdy %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdy_7f8d84 = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpDPdy %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %dpdy_7f8d84
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %dpdy_7f8d84
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.wgsl
index 6106dc9..43aa735 100644
--- a/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdy/7f8d84.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdy_7f8d84() {
   var res : f32 = dpdy(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdy_7f8d84();
diff --git a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl
index df3d138..94b4d57 100644
--- a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl
+++ b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl
@@ -24,7 +24,9 @@
 // fn dpdy(vec<2, f32>) -> vec<2, f32>
 fn dpdy_a8b56e() {
   var res: vec2<f32> = dpdy(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.dxc.hlsl
index 917ee27..85689d2 100644
--- a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_a8b56e() {
   float2 res = ddy((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.fxc.hlsl
index 917ee27..85689d2 100644
--- a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_a8b56e() {
   float2 res = ddy((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.glsl
index 3c34a29..f95dc52 100644
--- a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdy_a8b56e() {
   vec2 res = dFdy(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.msl
index 410597a..d47daef 100644
--- a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdy_a8b56e() {
+void dpdy_a8b56e(device float2* const tint_symbol) {
   float2 res = dfdy(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdy_a8b56e();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdy_a8b56e(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.spvasm
index 5b618af..fb511f7 100644
--- a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdy_a8b56e "dpdy_a8b56e"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%dpdy_a8b56e = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpDPdy %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdy_a8b56e = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpDPdy %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdy_a8b56e
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdy_a8b56e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.wgsl
index 704c407..0aa82bd 100644
--- a/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdy/a8b56e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdy_a8b56e() {
   var res : vec2<f32> = dpdy(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdy_a8b56e();
diff --git a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl
index 8448462..1ba1b6f 100644
--- a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl
+++ b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl
@@ -24,7 +24,9 @@
 // fn dpdy(vec<3, f32>) -> vec<3, f32>
 fn dpdy_feb40f() {
   var res: vec3<f32> = dpdy(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.dxc.hlsl
index a468cee..bdd8ef9 100644
--- a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_feb40f() {
   float3 res = ddy((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.fxc.hlsl
index a468cee..bdd8ef9 100644
--- a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_feb40f() {
   float3 res = ddy((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.glsl
index 9a429dc4..04c59ea 100644
--- a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdy_feb40f() {
   vec3 res = dFdy(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.msl
index c3249a9..bd3a4ad 100644
--- a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdy_feb40f() {
+void dpdy_feb40f(device packed_float3* const tint_symbol) {
   float3 res = dfdy(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdy_feb40f();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdy_feb40f(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.spvasm
index 4fc2920..90172bf 100644
--- a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdy_feb40f "dpdy_feb40f"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%dpdy_feb40f = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpDPdy %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdy_feb40f = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpDPdy %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdy_feb40f
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdy_feb40f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.wgsl
index 26ca0a7..34eec19 100644
--- a/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdy/feb40f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdy_feb40f() {
   var res : vec3<f32> = dpdy(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdy_feb40f();
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl
index 9348ea8..df35065 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl
@@ -24,7 +24,9 @@
 // fn dpdyCoarse(vec<2, f32>) -> vec<2, f32>
 fn dpdyCoarse_3e1ab4() {
   var res: vec2<f32> = dpdyCoarse(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.dxc.hlsl
index 5702876..bfd1005 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_3e1ab4() {
   float2 res = ddy_coarse((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.fxc.hlsl
index 5702876..bfd1005 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_3e1ab4() {
   float2 res = ddy_coarse((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.glsl
index 2838f06..a7ca3b2 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdyCoarse_3e1ab4() {
   vec2 res = dFdy(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.msl
index 95dfcc8..67faa8a 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyCoarse_3e1ab4() {
+void dpdyCoarse_3e1ab4(device float2* const tint_symbol) {
   float2 res = dfdy(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyCoarse_3e1ab4();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdyCoarse_3e1ab4(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.spvasm
index 9202588..a8cda33 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyCoarse_3e1ab4 "dpdyCoarse_3e1ab4"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%dpdyCoarse_3e1ab4 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpDPdyCoarse %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdyCoarse_3e1ab4 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpDPdyCoarse %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdyCoarse_3e1ab4
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdyCoarse_3e1ab4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.wgsl
index 5312afc..83b1e0d 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/3e1ab4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdyCoarse_3e1ab4() {
   var res : vec2<f32> = dpdyCoarse(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyCoarse_3e1ab4();
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl
index 6ccb919..703deac 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl
@@ -24,7 +24,9 @@
 // fn dpdyCoarse(vec<4, f32>) -> vec<4, f32>
 fn dpdyCoarse_445d24() {
   var res: vec4<f32> = dpdyCoarse(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.dxc.hlsl
index 032fe5b..4fdea06 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_445d24() {
   float4 res = ddy_coarse((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.fxc.hlsl
index 032fe5b..4fdea06 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_445d24() {
   float4 res = ddy_coarse((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.glsl
index 7975166..412ede1 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdyCoarse_445d24() {
   vec4 res = dFdy(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.msl
index 8625cff..9d7a0c2 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyCoarse_445d24() {
+void dpdyCoarse_445d24(device float4* const tint_symbol) {
   float4 res = dfdy(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyCoarse_445d24();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdyCoarse_445d24(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.spvasm
index 7a552f1..1acb7b0 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyCoarse_445d24 "dpdyCoarse_445d24"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%dpdyCoarse_445d24 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpDPdyCoarse %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdyCoarse_445d24 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpDPdyCoarse %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdyCoarse_445d24
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdyCoarse_445d24
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.wgsl
index f96c8ab..41463a6 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/445d24.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdyCoarse_445d24() {
   var res : vec4<f32> = dpdyCoarse(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyCoarse_445d24();
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl
index 6834d5d..8f4f895 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl
@@ -24,7 +24,9 @@
 // fn dpdyCoarse(f32) -> f32
 fn dpdyCoarse_870a7e() {
   var res: f32 = dpdyCoarse(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.dxc.hlsl
index 4308124..ac2a86f 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_870a7e() {
   float res = ddy_coarse(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.fxc.hlsl
index 4308124..ac2a86f 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_870a7e() {
   float res = ddy_coarse(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.glsl
index 4d10ef2..28debfa 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdyCoarse_870a7e() {
   float res = dFdy(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.msl
index f77b122..65aba59 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyCoarse_870a7e() {
+void dpdyCoarse_870a7e(device float* const tint_symbol) {
   float res = dfdy(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyCoarse_870a7e();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdyCoarse_870a7e(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.spvasm
index 81b17f0..ebff538 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.spvasm
@@ -1,31 +1,47 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyCoarse_870a7e "dpdyCoarse_870a7e"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%dpdyCoarse_870a7e = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpDPdyCoarse %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdyCoarse_870a7e = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpDPdyCoarse %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %dpdyCoarse_870a7e
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %dpdyCoarse_870a7e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.wgsl
index cb6ebd4..d4e9725 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/870a7e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdyCoarse_870a7e() {
   var res : f32 = dpdyCoarse(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdyCoarse_870a7e();
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl
index 75d07fe..b950025 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl
@@ -24,7 +24,9 @@
 // fn dpdyCoarse(vec<3, f32>) -> vec<3, f32>
 fn dpdyCoarse_ae1873() {
   var res: vec3<f32> = dpdyCoarse(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.dxc.hlsl
index c41f57f..e96e7c0 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_ae1873() {
   float3 res = ddy_coarse((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.fxc.hlsl
index c41f57f..e96e7c0 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_ae1873() {
   float3 res = ddy_coarse((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.glsl
index 71426cd..cdb4a70 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdyCoarse_ae1873() {
   vec3 res = dFdy(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.msl
index 2cb000f..613172d 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyCoarse_ae1873() {
+void dpdyCoarse_ae1873(device packed_float3* const tint_symbol) {
   float3 res = dfdy(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdyCoarse_ae1873();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdyCoarse_ae1873(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.spvasm
index 518e4e2..095a395 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyCoarse_ae1873 "dpdyCoarse_ae1873"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%dpdyCoarse_ae1873 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpDPdyCoarse %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdyCoarse_ae1873 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpDPdyCoarse %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdyCoarse_ae1873
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdyCoarse_ae1873
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.wgsl
index a27742c..cefbcb3 100644
--- a/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyCoarse/ae1873.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdyCoarse_ae1873() {
   var res : vec3<f32> = dpdyCoarse(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyCoarse_ae1873();
diff --git a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl
index 08bb289..5f88b87 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl
@@ -24,7 +24,9 @@
 // fn dpdyFine(vec<3, f32>) -> vec<3, f32>
 fn dpdyFine_1fb7ab() {
   var res: vec3<f32> = dpdyFine(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.dxc.hlsl
index 4bf3c52..47b6991 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_1fb7ab() {
   float3 res = ddy_fine((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.fxc.hlsl
index 4bf3c52..47b6991 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_1fb7ab() {
   float3 res = ddy_fine((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.glsl
index 5e56f78..6d6e1fa 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdyFine_1fb7ab() {
   vec3 res = dFdy(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.msl
index 6152568..5893f50 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyFine_1fb7ab() {
+void dpdyFine_1fb7ab(device packed_float3* const tint_symbol) {
   float3 res = dfdy(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdyFine_1fb7ab();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdyFine_1fb7ab(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.spvasm
index e417bb6..cffbf93 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyFine_1fb7ab "dpdyFine_1fb7ab"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%dpdyFine_1fb7ab = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpDPdyFine %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdyFine_1fb7ab = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpDPdyFine %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdyFine_1fb7ab
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdyFine_1fb7ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.wgsl
index a807255..5e7507a 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/1fb7ab.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdyFine_1fb7ab() {
   var res : vec3<f32> = dpdyFine(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyFine_1fb7ab();
diff --git a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl
index 5441354..759c910 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl
@@ -24,7 +24,9 @@
 // fn dpdyFine(f32) -> f32
 fn dpdyFine_6eb673() {
   var res: f32 = dpdyFine(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.dxc.hlsl
index 6b16f5d..6e8a215 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_6eb673() {
   float res = ddy_fine(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.fxc.hlsl
index 6b16f5d..6e8a215 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_6eb673() {
   float res = ddy_fine(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.glsl
index 1f1b7a8..7664160 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdyFine_6eb673() {
   float res = dFdy(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.msl
index 38d8c93..1e3fd94 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyFine_6eb673() {
+void dpdyFine_6eb673(device float* const tint_symbol) {
   float res = dfdy(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyFine_6eb673();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdyFine_6eb673(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.spvasm
index 1656762..41d995e 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.spvasm
@@ -1,31 +1,47 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyFine_6eb673 "dpdyFine_6eb673"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%dpdyFine_6eb673 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpDPdyFine %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdyFine_6eb673 = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpDPdyFine %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %dpdyFine_6eb673
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %dpdyFine_6eb673
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.wgsl
index 4580d6a..71eacca 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/6eb673.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdyFine_6eb673() {
   var res : f32 = dpdyFine(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdyFine_6eb673();
diff --git a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl
index ba1bd55..1b9c30d 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl
@@ -24,7 +24,9 @@
 // fn dpdyFine(vec<4, f32>) -> vec<4, f32>
 fn dpdyFine_d0a648() {
   var res: vec4<f32> = dpdyFine(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.dxc.hlsl
index b1ec8cd..d234be2 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_d0a648() {
   float4 res = ddy_fine((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.fxc.hlsl
index b1ec8cd..d234be2 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_d0a648() {
   float4 res = ddy_fine((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.glsl
index f074753..14450e4 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdyFine_d0a648() {
   vec4 res = dFdy(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.msl
index ac69007..4ef4fbc 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyFine_d0a648() {
+void dpdyFine_d0a648(device float4* const tint_symbol) {
   float4 res = dfdy(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyFine_d0a648();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdyFine_d0a648(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.spvasm
index 44751d0..40b2f65 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyFine_d0a648 "dpdyFine_d0a648"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%dpdyFine_d0a648 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpDPdyFine %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdyFine_d0a648 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpDPdyFine %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdyFine_d0a648
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdyFine_d0a648
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.wgsl
index 4c8796f..b9718ba 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/d0a648.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdyFine_d0a648() {
   var res : vec4<f32> = dpdyFine(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyFine_d0a648();
diff --git a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl
index fdf2d98..fdb49c5 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl
@@ -24,7 +24,9 @@
 // fn dpdyFine(vec<2, f32>) -> vec<2, f32>
 fn dpdyFine_df33aa() {
   var res: vec2<f32> = dpdyFine(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.dxc.hlsl
index 7ad2997..33b69ce 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_df33aa() {
   float2 res = ddy_fine((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.fxc.hlsl
index 7ad2997..33b69ce 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_df33aa() {
   float2 res = ddy_fine((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.glsl
index 502d6aa..9a424fc 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdyFine_df33aa() {
   vec2 res = dFdy(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.msl b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.msl
index 2685b93..94f4367 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyFine_df33aa() {
+void dpdyFine_df33aa(device float2* const tint_symbol) {
   float2 res = dfdy(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyFine_df33aa();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdyFine_df33aa(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.spvasm
index ad9cdf7..d7c4d3e 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyFine_df33aa "dpdyFine_df33aa"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%dpdyFine_df33aa = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpDPdyFine %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdyFine_df33aa = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpDPdyFine %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdyFine_df33aa
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdyFine_df33aa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.wgsl
index 77d8aaa..b40ddbc 100644
--- a/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/dpdyFine/df33aa.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn dpdyFine_df33aa() {
   var res : vec2<f32> = dpdyFine(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyFine_df33aa();
diff --git a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl
index 7eea3bd..df97b47 100644
--- a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl
+++ b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl
@@ -24,7 +24,9 @@
 // fn exp(vec<4, f32>) -> vec<4, f32>
 fn exp_0f70eb() {
   var res: vec4<f32> = exp(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.dxc.hlsl
index 2c3fb1b..7ce085a 100644
--- a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_0f70eb() {
   float4 res = (2.71828174591064453125f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.fxc.hlsl
index 2c3fb1b..7ce085a 100644
--- a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_0f70eb() {
   float4 res = (2.71828174591064453125f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.glsl
index 7dd5b56..b870421 100644
--- a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp_0f70eb() {
   vec4 res = vec4(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp_0f70eb() {
   vec4 res = vec4(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp_0f70eb() {
   vec4 res = vec4(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.msl
index 8fa9364..a6c62dc 100644
--- a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_0f70eb() {
+void exp_0f70eb(device float4* const tint_symbol_1) {
   float4 res = float4(2.71828174591064453125f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_0f70eb();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  exp_0f70eb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_0f70eb();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  exp_0f70eb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_0f70eb();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  exp_0f70eb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.spvasm
index 731ff6c..cae5667 100644
--- a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_0f70eb "exp_0f70eb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_2_71828175 = OpConstant %float 2.71828175
-         %14 = OpConstantComposite %v4float %float_2_71828175 %float_2_71828175 %float_2_71828175 %float_2_71828175
+         %17 = OpConstantComposite %v4float %float_2_71828175 %float_2_71828175 %float_2_71828175 %float_2_71828175
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_0f70eb = OpFunction %void None %9
-         %12 = OpLabel
+ %exp_0f70eb = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %exp_0f70eb
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %exp_0f70eb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %exp_0f70eb
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %exp_0f70eb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp_0f70eb
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp_0f70eb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.wgsl
index 81aac1f..85ca55e 100644
--- a/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp/0f70eb.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn exp_0f70eb() {
   var res : vec4<f32> = exp(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_0f70eb();
diff --git a/test/tint/builtins/gen/literal/exp/13806d.wgsl b/test/tint/builtins/gen/literal/exp/13806d.wgsl
index ae8492e..becbfc0 100644
--- a/test/tint/builtins/gen/literal/exp/13806d.wgsl
+++ b/test/tint/builtins/gen/literal/exp/13806d.wgsl
@@ -26,7 +26,9 @@
 // fn exp(vec<3, f16>) -> vec<3, f16>
 fn exp_13806d() {
   var res: vec3<f16> = exp(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.dxc.hlsl
index d9a9550..a06cb77 100644
--- a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_13806d() {
   vector<float16_t, 3> res = (float16_t(2.716796875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.fxc.hlsl
index 5cb2b43..a5e5d72 100644
--- a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_13806d() {
   vector<float16_t, 3> res = (float16_t(2.716796875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.glsl
index 9b4e3f4..1431fa3 100644
--- a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp_13806d() {
   f16vec3 res = f16vec3(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp_13806d() {
   f16vec3 res = f16vec3(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp_13806d() {
   f16vec3 res = f16vec3(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.msl
index 24409f7..57fa26e 100644
--- a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_13806d() {
+void exp_13806d(device packed_half3* const tint_symbol_1) {
   half3 res = half3(2.716796875h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_13806d();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  exp_13806d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_13806d();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  exp_13806d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_13806d();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  exp_13806d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.spvasm
index 837fc5e..a73d0e2 100644
--- a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_13806d "exp_13806d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_5bcp_1 = OpConstant %half 0x1.5bcp+1
-         %16 = OpConstantComposite %v3half %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1
+         %19 = OpConstantComposite %v3half %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_13806d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %exp_13806d = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %exp_13806d
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %exp_13806d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp_13806d
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp_13806d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %exp_13806d
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %exp_13806d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.wgsl
index 4e78600..9ec5d1f 100644
--- a/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp/13806d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn exp_13806d() {
   var res : vec3<f16> = exp(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_13806d();
diff --git a/test/tint/builtins/gen/literal/exp/1951e7.wgsl b/test/tint/builtins/gen/literal/exp/1951e7.wgsl
index 26c7215..60575b2 100644
--- a/test/tint/builtins/gen/literal/exp/1951e7.wgsl
+++ b/test/tint/builtins/gen/literal/exp/1951e7.wgsl
@@ -24,7 +24,9 @@
 // fn exp(vec<2, f32>) -> vec<2, f32>
 fn exp_1951e7() {
   var res: vec2<f32> = exp(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.dxc.hlsl
index df1dea4..562480b 100644
--- a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_1951e7() {
   float2 res = (2.71828174591064453125f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.fxc.hlsl
index df1dea4..562480b 100644
--- a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_1951e7() {
   float2 res = (2.71828174591064453125f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.glsl
index cec115c..adb7d20 100644
--- a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp_1951e7() {
   vec2 res = vec2(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp_1951e7() {
   vec2 res = vec2(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp_1951e7() {
   vec2 res = vec2(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.msl
index 28541fa..d6f5ed7 100644
--- a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_1951e7() {
+void exp_1951e7(device float2* const tint_symbol_1) {
   float2 res = float2(2.71828174591064453125f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_1951e7();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  exp_1951e7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_1951e7();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  exp_1951e7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_1951e7();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  exp_1951e7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.spvasm
index ecf7ddc..1503119 100644
--- a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_1951e7 "exp_1951e7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_2_71828175 = OpConstant %float 2.71828175
-         %15 = OpConstantComposite %v2float %float_2_71828175 %float_2_71828175
+         %18 = OpConstantComposite %v2float %float_2_71828175 %float_2_71828175
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_1951e7 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+ %exp_1951e7 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %exp_1951e7
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %exp_1951e7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %exp_1951e7
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %exp_1951e7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp_1951e7
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp_1951e7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.wgsl
index 92784ca..406889d 100644
--- a/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp/1951e7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn exp_1951e7() {
   var res : vec2<f32> = exp(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_1951e7();
diff --git a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl
index 47f5320..d5d8d33 100644
--- a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl
+++ b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl
@@ -26,7 +26,9 @@
 // fn exp(vec<2, f16>) -> vec<2, f16>
 fn exp_2e08e2() {
   var res: vec2<f16> = exp(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.dxc.hlsl
index 2fafcbe..863a70e 100644
--- a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_2e08e2() {
   vector<float16_t, 2> res = (float16_t(2.716796875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.fxc.hlsl
index 10eb923..12f9da4 100644
--- a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_2e08e2() {
   vector<float16_t, 2> res = (float16_t(2.716796875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.glsl
index becbb7f..77dd7de 100644
--- a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp_2e08e2() {
   f16vec2 res = f16vec2(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp_2e08e2() {
   f16vec2 res = f16vec2(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp_2e08e2() {
   f16vec2 res = f16vec2(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.msl
index 1b3ef24..5f405b7 100644
--- a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_2e08e2() {
+void exp_2e08e2(device half2* const tint_symbol_1) {
   half2 res = half2(2.716796875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_2e08e2();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  exp_2e08e2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_2e08e2();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  exp_2e08e2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_2e08e2();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  exp_2e08e2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.spvasm
index d09432d..c8fb894 100644
--- a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_2e08e2 "exp_2e08e2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_5bcp_1 = OpConstant %half 0x1.5bcp+1
-         %16 = OpConstantComposite %v2half %half_0x1_5bcp_1 %half_0x1_5bcp_1
+         %19 = OpConstantComposite %v2half %half_0x1_5bcp_1 %half_0x1_5bcp_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_2e08e2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %exp_2e08e2 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %exp_2e08e2
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %exp_2e08e2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp_2e08e2
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp_2e08e2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %exp_2e08e2
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %exp_2e08e2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.wgsl
index 31ce159..fa8420a 100644
--- a/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp/2e08e2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn exp_2e08e2() {
   var res : vec2<f16> = exp(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_2e08e2();
diff --git a/test/tint/builtins/gen/literal/exp/49e4c5.wgsl b/test/tint/builtins/gen/literal/exp/49e4c5.wgsl
index 4bbe43e..2ac7821 100644
--- a/test/tint/builtins/gen/literal/exp/49e4c5.wgsl
+++ b/test/tint/builtins/gen/literal/exp/49e4c5.wgsl
@@ -25,7 +25,6 @@
 fn exp_49e4c5() {
   var res = exp(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_49e4c5();
diff --git a/test/tint/builtins/gen/literal/exp/611a87.wgsl b/test/tint/builtins/gen/literal/exp/611a87.wgsl
index 947bb87..19bc9e9 100644
--- a/test/tint/builtins/gen/literal/exp/611a87.wgsl
+++ b/test/tint/builtins/gen/literal/exp/611a87.wgsl
@@ -26,7 +26,9 @@
 // fn exp(vec<4, f16>) -> vec<4, f16>
 fn exp_611a87() {
   var res: vec4<f16> = exp(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.dxc.hlsl
index d0e47ae..b333873 100644
--- a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_611a87() {
   vector<float16_t, 4> res = (float16_t(2.716796875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.fxc.hlsl
index 93b8ff1..b2cfb0c 100644
--- a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_611a87() {
   vector<float16_t, 4> res = (float16_t(2.716796875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.glsl
index 640ace7..b057e86 100644
--- a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp_611a87() {
   f16vec4 res = f16vec4(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp_611a87() {
   f16vec4 res = f16vec4(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp_611a87() {
   f16vec4 res = f16vec4(2.716796875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.msl
index 2cea3b7..f763441 100644
--- a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_611a87() {
+void exp_611a87(device half4* const tint_symbol_1) {
   half4 res = half4(2.716796875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_611a87();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  exp_611a87(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_611a87();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  exp_611a87(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_611a87();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  exp_611a87(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.spvasm
index 3e3bd45..a8be136 100644
--- a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_611a87 "exp_611a87"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_5bcp_1 = OpConstant %half 0x1.5bcp+1
-         %16 = OpConstantComposite %v4half %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1
+         %19 = OpConstantComposite %v4half %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1 %half_0x1_5bcp_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_611a87 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %exp_611a87 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %exp_611a87
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %exp_611a87
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp_611a87
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp_611a87
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %exp_611a87
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %exp_611a87
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.wgsl
index 3b2b8d9..d5d8897 100644
--- a/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp/611a87.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn exp_611a87() {
   var res : vec4<f16> = exp(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_611a87();
diff --git a/test/tint/builtins/gen/literal/exp/699629.wgsl b/test/tint/builtins/gen/literal/exp/699629.wgsl
index b221d3b..cc14e73 100644
--- a/test/tint/builtins/gen/literal/exp/699629.wgsl
+++ b/test/tint/builtins/gen/literal/exp/699629.wgsl
@@ -25,7 +25,6 @@
 fn exp_699629() {
   var res = exp(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_699629();
diff --git a/test/tint/builtins/gen/literal/exp/771fd2.wgsl b/test/tint/builtins/gen/literal/exp/771fd2.wgsl
index ed6c4a0..b203832 100644
--- a/test/tint/builtins/gen/literal/exp/771fd2.wgsl
+++ b/test/tint/builtins/gen/literal/exp/771fd2.wgsl
@@ -24,7 +24,9 @@
 // fn exp(f32) -> f32
 fn exp_771fd2() {
   var res: f32 = exp(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.dxc.hlsl
index 1894900..3c4f669 100644
--- a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_771fd2() {
   float res = 2.71828174591064453125f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.fxc.hlsl
index 1894900..3c4f669 100644
--- a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_771fd2() {
   float res = 2.71828174591064453125f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.glsl
index a92f5aa..598d5c5 100644
--- a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp_771fd2() {
   float res = 2.71828174591064453125f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp_771fd2() {
   float res = 2.71828174591064453125f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp_771fd2() {
   float res = 2.71828174591064453125f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.msl
index fe77596..46a92ef 100644
--- a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_771fd2() {
+void exp_771fd2(device float* const tint_symbol_1) {
   float res = 2.71828174591064453125f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_771fd2();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  exp_771fd2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_771fd2();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  exp_771fd2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_771fd2();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  exp_771fd2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.spvasm
index c2b53f7..8a987ec 100644
--- a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_771fd2 "exp_771fd2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_2_71828175 = OpConstant %float 2.71828175
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_771fd2 = OpFunction %void None %9
-         %12 = OpLabel
+ %exp_771fd2 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_2_71828175
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %exp_771fd2
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %exp_771fd2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %exp_771fd2
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %exp_771fd2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %exp_771fd2
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %exp_771fd2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.wgsl
index 2ce7fdd..bda5724 100644
--- a/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp/771fd2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn exp_771fd2() {
   var res : f32 = exp(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_771fd2();
diff --git a/test/tint/builtins/gen/literal/exp/bda5bb.wgsl b/test/tint/builtins/gen/literal/exp/bda5bb.wgsl
index d76164e..9a7669e 100644
--- a/test/tint/builtins/gen/literal/exp/bda5bb.wgsl
+++ b/test/tint/builtins/gen/literal/exp/bda5bb.wgsl
@@ -25,7 +25,6 @@
 fn exp_bda5bb() {
   var res = exp(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_bda5bb();
diff --git a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl
index d265bf3..b005253 100644
--- a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl
+++ b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl
@@ -26,7 +26,9 @@
 // fn exp(f16) -> f16
 fn exp_c18fe9() {
   var res: f16 = exp(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.dxc.hlsl
index ba22674..bcd6a6e 100644
--- a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_c18fe9() {
   float16_t res = float16_t(2.716796875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.fxc.hlsl
index 782950b..dbee59b 100644
--- a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_c18fe9() {
   float16_t res = float16_t(2.716796875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.glsl
index a3fe909..21fb574 100644
--- a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp_c18fe9() {
   float16_t res = 2.716796875hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp_c18fe9() {
   float16_t res = 2.716796875hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp_c18fe9() {
   float16_t res = 2.716796875hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.msl
index 0b563f7..60028f6 100644
--- a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_c18fe9() {
+void exp_c18fe9(device half* const tint_symbol_1) {
   half res = 2.716796875h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_c18fe9();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  exp_c18fe9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_c18fe9();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  exp_c18fe9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_c18fe9();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  exp_c18fe9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.spvasm
index 6e7d8b2..0b87c37 100644
--- a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_c18fe9 "exp_c18fe9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_5bcp_1 = OpConstant %half 0x1.5bcp+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_c18fe9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %exp_c18fe9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_5bcp_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %exp_c18fe9
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %exp_c18fe9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %exp_c18fe9
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %exp_c18fe9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %exp_c18fe9
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %exp_c18fe9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.wgsl
index e9ea41f..1adc46a 100644
--- a/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp/c18fe9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn exp_c18fe9() {
   var res : f16 = exp(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_c18fe9();
diff --git a/test/tint/builtins/gen/literal/exp/d98450.wgsl b/test/tint/builtins/gen/literal/exp/d98450.wgsl
index fa45922..13ac8b0 100644
--- a/test/tint/builtins/gen/literal/exp/d98450.wgsl
+++ b/test/tint/builtins/gen/literal/exp/d98450.wgsl
@@ -24,7 +24,9 @@
 // fn exp(vec<3, f32>) -> vec<3, f32>
 fn exp_d98450() {
   var res: vec3<f32> = exp(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.dxc.hlsl
index bd62731..bb74a9b 100644
--- a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_d98450() {
   float3 res = (2.71828174591064453125f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.fxc.hlsl
index bd62731..bb74a9b 100644
--- a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_d98450() {
   float3 res = (2.71828174591064453125f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.glsl
index f6fc3b3..35859ff 100644
--- a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp_d98450() {
   vec3 res = vec3(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp_d98450() {
   vec3 res = vec3(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp_d98450() {
   vec3 res = vec3(2.71828174591064453125f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.msl
index dec059d..8b6bcea 100644
--- a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_d98450() {
+void exp_d98450(device packed_float3* const tint_symbol_1) {
   float3 res = float3(2.71828174591064453125f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_d98450();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  exp_d98450(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_d98450();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  exp_d98450(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_d98450();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  exp_d98450(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.spvasm
index 845e41f..3145866 100644
--- a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_d98450 "exp_d98450"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_2_71828175 = OpConstant %float 2.71828175
-         %15 = OpConstantComposite %v3float %float_2_71828175 %float_2_71828175 %float_2_71828175
+         %18 = OpConstantComposite %v3float %float_2_71828175 %float_2_71828175 %float_2_71828175
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_d98450 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+ %exp_d98450 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %exp_d98450
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %exp_d98450
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %exp_d98450
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %exp_d98450
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp_d98450
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp_d98450
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.wgsl
index ec3ce91..b52b0c5 100644
--- a/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp/d98450.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn exp_d98450() {
   var res : vec3<f32> = exp(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_d98450();
diff --git a/test/tint/builtins/gen/literal/exp/dad791.wgsl b/test/tint/builtins/gen/literal/exp/dad791.wgsl
index d9547b2..aa1b6be 100644
--- a/test/tint/builtins/gen/literal/exp/dad791.wgsl
+++ b/test/tint/builtins/gen/literal/exp/dad791.wgsl
@@ -25,7 +25,6 @@
 fn exp_dad791() {
   var res = exp(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_dad791();
diff --git a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl
index 1726a87..f121115 100644
--- a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl
@@ -26,7 +26,9 @@
 // fn exp2(vec<2, f16>) -> vec<2, f16>
 fn exp2_151a4c() {
   var res: vec2<f16> = exp2(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.dxc.hlsl
index 1e6efb6..8706d9b 100644
--- a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_151a4c() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.fxc.hlsl
index 968f53c..db10912 100644
--- a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_151a4c() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.glsl
index a399636..cebe48a 100644
--- a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp2_151a4c() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp2_151a4c() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp2_151a4c() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.msl
index 4a0818b..7459e26 100644
--- a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_151a4c() {
+void exp2_151a4c(device half2* const tint_symbol_1) {
   half2 res = half2(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_151a4c();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  exp2_151a4c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_151a4c();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  exp2_151a4c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_151a4c();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  exp2_151a4c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.spvasm
index 3d4fc8e..de61f94 100644
--- a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_151a4c "exp2_151a4c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_151a4c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%exp2_151a4c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %exp2_151a4c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %exp2_151a4c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp2_151a4c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp2_151a4c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %exp2_151a4c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %exp2_151a4c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.wgsl
index 7c28484..d59327a 100644
--- a/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/151a4c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn exp2_151a4c() {
   var res : vec2<f16> = exp2(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_151a4c();
diff --git a/test/tint/builtins/gen/literal/exp2/18aa76.wgsl b/test/tint/builtins/gen/literal/exp2/18aa76.wgsl
index 980fe29..600a579 100644
--- a/test/tint/builtins/gen/literal/exp2/18aa76.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/18aa76.wgsl
@@ -25,7 +25,6 @@
 fn exp2_18aa76() {
   var res = exp2(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_18aa76();
diff --git a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl
index b345fad..1feabc0 100644
--- a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl
@@ -24,7 +24,9 @@
 // fn exp2(vec<3, f32>) -> vec<3, f32>
 fn exp2_1f8680() {
   var res: vec3<f32> = exp2(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.dxc.hlsl
index 1b85c20..e11b2f0 100644
--- a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_1f8680() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.fxc.hlsl
index 1b85c20..e11b2f0 100644
--- a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_1f8680() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.glsl
index 1b8574a..6b0f67e 100644
--- a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp2_1f8680() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp2_1f8680() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp2_1f8680() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.msl
index 17bb4df..316a3f4 100644
--- a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_1f8680() {
+void exp2_1f8680(device packed_float3* const tint_symbol_1) {
   float3 res = float3(2.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_1f8680();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  exp2_1f8680(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_1f8680();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  exp2_1f8680(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_1f8680();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  exp2_1f8680(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.spvasm
index 8b711e0..01082d4 100644
--- a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_1f8680 "exp2_1f8680"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+         %18 = OpConstantComposite %v3float %float_2 %float_2 %float_2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_1f8680 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%exp2_1f8680 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %exp2_1f8680
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %exp2_1f8680
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %exp2_1f8680
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %exp2_1f8680
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp2_1f8680
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp2_1f8680
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.wgsl
index d2e3c74..77ec9f9 100644
--- a/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/1f8680.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn exp2_1f8680() {
   var res : vec3<f32> = exp2(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_1f8680();
diff --git a/test/tint/builtins/gen/literal/exp2/303753.wgsl b/test/tint/builtins/gen/literal/exp2/303753.wgsl
index 769be3a..12ea1ca 100644
--- a/test/tint/builtins/gen/literal/exp2/303753.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/303753.wgsl
@@ -25,7 +25,6 @@
 fn exp2_303753() {
   var res = exp2(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_303753();
diff --git a/test/tint/builtins/gen/literal/exp2/751377.wgsl b/test/tint/builtins/gen/literal/exp2/751377.wgsl
index dc570f2..865e591 100644
--- a/test/tint/builtins/gen/literal/exp2/751377.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/751377.wgsl
@@ -26,7 +26,9 @@
 // fn exp2(vec<3, f16>) -> vec<3, f16>
 fn exp2_751377() {
   var res: vec3<f16> = exp2(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.dxc.hlsl
index 6949b49..1ae01e3 100644
--- a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_751377() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.fxc.hlsl
index f4b5394..015bdc0 100644
--- a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_751377() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.glsl
index 8aa2e87..9c7f01e 100644
--- a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp2_751377() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp2_751377() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp2_751377() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.msl
index cf71cdd..db4fec5 100644
--- a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_751377() {
+void exp2_751377(device packed_half3* const tint_symbol_1) {
   half3 res = half3(2.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_751377();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  exp2_751377(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_751377();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  exp2_751377(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_751377();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  exp2_751377(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.spvasm
index 5b1fcd0..309d984 100644
--- a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_751377 "exp2_751377"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_751377 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%exp2_751377 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %exp2_751377
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %exp2_751377
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp2_751377
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp2_751377
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %exp2_751377
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %exp2_751377
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.wgsl
index effbce1..c1eabb1 100644
--- a/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/751377.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn exp2_751377() {
   var res : vec3<f16> = exp2(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_751377();
diff --git a/test/tint/builtins/gen/literal/exp2/8bd72d.wgsl b/test/tint/builtins/gen/literal/exp2/8bd72d.wgsl
index 9c63098..0cbebe5 100644
--- a/test/tint/builtins/gen/literal/exp2/8bd72d.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/8bd72d.wgsl
@@ -25,7 +25,6 @@
 fn exp2_8bd72d() {
   var res = exp2(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_8bd72d();
diff --git a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl
index 3e117bb..f76b691 100644
--- a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl
@@ -24,7 +24,9 @@
 // fn exp2(vec<4, f32>) -> vec<4, f32>
 fn exp2_a9d0a7() {
   var res: vec4<f32> = exp2(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.dxc.hlsl
index d941f89..96fa0aa 100644
--- a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_a9d0a7() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.fxc.hlsl
index d941f89..96fa0aa 100644
--- a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_a9d0a7() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.glsl
index 4d060ab..2f08340 100644
--- a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp2_a9d0a7() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp2_a9d0a7() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp2_a9d0a7() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.msl
index cdadda0..93cce84 100644
--- a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_a9d0a7() {
+void exp2_a9d0a7(device float4* const tint_symbol_1) {
   float4 res = float4(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_a9d0a7();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  exp2_a9d0a7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_a9d0a7();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  exp2_a9d0a7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_a9d0a7();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  exp2_a9d0a7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.spvasm
index 3773fa1..e94c66a 100644
--- a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_a9d0a7 "exp2_a9d0a7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %14 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+         %17 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_a9d0a7 = OpFunction %void None %9
-         %12 = OpLabel
+%exp2_a9d0a7 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %exp2_a9d0a7
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %exp2_a9d0a7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %exp2_a9d0a7
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %exp2_a9d0a7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp2_a9d0a7
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp2_a9d0a7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.wgsl
index 7224b0c..2b7d63e 100644
--- a/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/a9d0a7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn exp2_a9d0a7() {
   var res : vec4<f32> = exp2(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_a9d0a7();
diff --git a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl
index 99e021e..1a05a2c 100644
--- a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl
@@ -26,7 +26,9 @@
 // fn exp2(f16) -> f16
 fn exp2_b408e4() {
   var res: f16 = exp2(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.dxc.hlsl
index 794e9e2..e340f33 100644
--- a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_b408e4() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.fxc.hlsl
index e67153b..8053410 100644
--- a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_b408e4() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.glsl
index e87b6f9..a4e2794 100644
--- a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp2_b408e4() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp2_b408e4() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp2_b408e4() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.msl
index 2691f7f..cad35ee 100644
--- a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_b408e4() {
+void exp2_b408e4(device half* const tint_symbol_1) {
   half res = 2.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_b408e4();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  exp2_b408e4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_b408e4();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  exp2_b408e4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_b408e4();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  exp2_b408e4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.spvasm
index b8aab1c..568c6ad 100644
--- a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_b408e4 "exp2_b408e4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_b408e4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%exp2_b408e4 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %exp2_b408e4
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %exp2_b408e4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %exp2_b408e4
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %exp2_b408e4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %exp2_b408e4
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %exp2_b408e4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.wgsl
index b1c358e..75d4b2b 100644
--- a/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/b408e4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn exp2_b408e4() {
   var res : f16 = exp2(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_b408e4();
diff --git a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl
index dbf165f..2175771 100644
--- a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl
@@ -24,7 +24,9 @@
 // fn exp2(vec<2, f32>) -> vec<2, f32>
 fn exp2_d6777c() {
   var res: vec2<f32> = exp2(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.dxc.hlsl
index d490385..196a839 100644
--- a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_d6777c() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.fxc.hlsl
index d490385..196a839 100644
--- a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_d6777c() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.glsl
index 8acdc0b..0d2de0a 100644
--- a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp2_d6777c() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp2_d6777c() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp2_d6777c() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.msl
index 154fccc..37f747a 100644
--- a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_d6777c() {
+void exp2_d6777c(device float2* const tint_symbol_1) {
   float2 res = float2(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_d6777c();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  exp2_d6777c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_d6777c();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  exp2_d6777c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_d6777c();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  exp2_d6777c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.spvasm
index 977f17e..a9d82d6 100644
--- a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_d6777c "exp2_d6777c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v2float %float_2 %float_2
+         %18 = OpConstantComposite %v2float %float_2 %float_2
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_d6777c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%exp2_d6777c = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %exp2_d6777c
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %exp2_d6777c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %exp2_d6777c
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %exp2_d6777c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp2_d6777c
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp2_d6777c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.wgsl
index 636bec5..64f9e7d 100644
--- a/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/d6777c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn exp2_d6777c() {
   var res : vec2<f32> = exp2(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_d6777c();
diff --git a/test/tint/builtins/gen/literal/exp2/dea523.wgsl b/test/tint/builtins/gen/literal/exp2/dea523.wgsl
index a6ade8f..a766625 100644
--- a/test/tint/builtins/gen/literal/exp2/dea523.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/dea523.wgsl
@@ -24,7 +24,9 @@
 // fn exp2(f32) -> f32
 fn exp2_dea523() {
   var res: f32 = exp2(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.dxc.hlsl
index 66dac75..dcdb1b2a 100644
--- a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_dea523() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.fxc.hlsl
index 66dac75..dcdb1b2a 100644
--- a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_dea523() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.glsl
index 8b3865d..9fff12b 100644
--- a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp2_dea523() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp2_dea523() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp2_dea523() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.msl
index 6dc4efb..7381aa3 100644
--- a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_dea523() {
+void exp2_dea523(device float* const tint_symbol_1) {
   float res = 2.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_dea523();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  exp2_dea523(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_dea523();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  exp2_dea523(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_dea523();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  exp2_dea523(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.spvasm
index 81dd5e9..2bbe06b 100644
--- a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_dea523 "exp2_dea523"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_dea523 = OpFunction %void None %9
-         %12 = OpLabel
+%exp2_dea523 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_2
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %exp2_dea523
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %exp2_dea523
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %exp2_dea523
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %exp2_dea523
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %exp2_dea523
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %exp2_dea523
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.wgsl
index c54cfc6..47d5811 100644
--- a/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/dea523.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn exp2_dea523() {
   var res : f32 = exp2(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_dea523();
diff --git a/test/tint/builtins/gen/literal/exp2/f4f0f1.wgsl b/test/tint/builtins/gen/literal/exp2/f4f0f1.wgsl
index e82d413..944064f 100644
--- a/test/tint/builtins/gen/literal/exp2/f4f0f1.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/f4f0f1.wgsl
@@ -25,7 +25,6 @@
 fn exp2_f4f0f1() {
   var res = exp2(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_f4f0f1();
diff --git a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl
index 654851e..ccd2df3 100644
--- a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl
@@ -26,7 +26,9 @@
 // fn exp2(vec<4, f16>) -> vec<4, f16>
 fn exp2_ffa827() {
   var res: vec4<f16> = exp2(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.dxc.hlsl
index 7b48050..57aca0a 100644
--- a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_ffa827() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.fxc.hlsl
index ceda983..b8d120c 100644
--- a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_ffa827() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.glsl b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.glsl
index 935d0f3..499dd5c 100644
--- a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp2_ffa827() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp2_ffa827() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp2_ffa827() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.msl b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.msl
index 75b4b67..62f6e95 100644
--- a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_ffa827() {
+void exp2_ffa827(device half4* const tint_symbol_1) {
   half4 res = half4(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_ffa827();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  exp2_ffa827(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_ffa827();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  exp2_ffa827(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_ffa827();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  exp2_ffa827(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.spvasm
index 43ddda6..3912866 100644
--- a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_ffa827 "exp2_ffa827"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_ffa827 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%exp2_ffa827 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %exp2_ffa827
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %exp2_ffa827
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp2_ffa827
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp2_ffa827
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %exp2_ffa827
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %exp2_ffa827
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.wgsl
index 1bd743f..b8aae20 100644
--- a/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/exp2/ffa827.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn exp2_ffa827() {
   var res : vec4<f16> = exp2(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_ffa827();
diff --git a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl
index 69f21ac..f323141 100644
--- a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl
@@ -24,7 +24,9 @@
 // fn extractBits(vec<3, u32>, u32, u32) -> vec<3, u32>
 fn extractBits_12b197() {
   var res: vec3<u32> = extractBits(vec3<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.dxc.hlsl
index 895f98b..df0f96d 100644
--- a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_12b197() {
   uint3 res = (0u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.fxc.hlsl
index 895f98b..df0f96d 100644
--- a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_12b197() {
   uint3 res = (0u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.glsl b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.glsl
index 42ad28d..c21872c 100644
--- a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void extractBits_12b197() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void extractBits_12b197() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void extractBits_12b197() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.msl b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.msl
index e54b745..c2db697 100644
--- a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void extractBits_12b197() {
+void extractBits_12b197(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(0u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_12b197();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  extractBits_12b197(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_12b197();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_12b197(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_12b197();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_12b197(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.spvasm
index 1c44720..c26b199 100644
--- a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %extractBits_12b197 "extractBits_12b197"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-         %15 = OpConstantNull %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%extractBits_12b197 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %15
-               OpStore %res %15
+%extractBits_12b197 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %24 = OpLoad %v3uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %extractBits_12b197
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %extractBits_12b197
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %extractBits_12b197
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %extractBits_12b197
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %extractBits_12b197
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %extractBits_12b197
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.wgsl
index ec9c1ab..1bdeb09 100644
--- a/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/12b197.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn extractBits_12b197() {
   var res : vec3<u32> = extractBits(vec3<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_12b197();
diff --git a/test/tint/builtins/gen/literal/extractBits/249874.wgsl b/test/tint/builtins/gen/literal/extractBits/249874.wgsl
index 3f1e4a7..7a1a31d 100644
--- a/test/tint/builtins/gen/literal/extractBits/249874.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/249874.wgsl
@@ -24,7 +24,9 @@
 // fn extractBits(i32, u32, u32) -> i32
 fn extractBits_249874() {
   var res: i32 = extractBits(1i, 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.dxc.hlsl
index 6a01326..89fcaeb 100644
--- a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_249874() {
   int res = 0;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.fxc.hlsl
index 6a01326..89fcaeb 100644
--- a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_249874() {
   int res = 0;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.glsl b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.glsl
index 5b1cf69..910a74a 100644
--- a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void extractBits_249874() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void extractBits_249874() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void extractBits_249874() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.msl b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.msl
index 1cc7b4c..77f0aca 100644
--- a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void extractBits_249874() {
+void extractBits_249874(device int* const tint_symbol_1) {
   int res = 0;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_249874();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  extractBits_249874(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_249874();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_249874(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_249874();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_249874(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.spvasm
index a59e9c3..6a59713 100644
--- a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %extractBits_249874 "extractBits_249874"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
-         %14 = OpConstantNull %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %int
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%extractBits_249874 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %14
-               OpStore %res %14
+%extractBits_249874 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %extractBits_249874
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %extractBits_249874
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %extractBits_249874
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %extractBits_249874
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %extractBits_249874
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %extractBits_249874
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.wgsl
index ddc5e5d..9dbbbbf 100644
--- a/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/249874.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn extractBits_249874() {
   var res : i32 = extractBits(1i, 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_249874();
diff --git a/test/tint/builtins/gen/literal/extractBits/631377.wgsl b/test/tint/builtins/gen/literal/extractBits/631377.wgsl
index 8143f76..fcc5a5c 100644
--- a/test/tint/builtins/gen/literal/extractBits/631377.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/631377.wgsl
@@ -24,7 +24,9 @@
 // fn extractBits(vec<4, u32>, u32, u32) -> vec<4, u32>
 fn extractBits_631377() {
   var res: vec4<u32> = extractBits(vec4<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.dxc.hlsl
index a1ed698..b67da9b 100644
--- a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_631377() {
   uint4 res = (0u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.fxc.hlsl
index a1ed698..b67da9b 100644
--- a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_631377() {
   uint4 res = (0u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.glsl b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.glsl
index 85fb7c7..e3f07d9 100644
--- a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void extractBits_631377() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void extractBits_631377() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void extractBits_631377() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.msl b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.msl
index 803774c..f373d78 100644
--- a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void extractBits_631377() {
+void extractBits_631377(device uint4* const tint_symbol_1) {
   uint4 res = uint4(0u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_631377();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  extractBits_631377(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_631377();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_631377(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_631377();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_631377(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.spvasm
index c2bad0a..87621b8 100644
--- a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %extractBits_631377 "extractBits_631377"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-         %15 = OpConstantNull %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%extractBits_631377 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %15
-               OpStore %res %15
+%extractBits_631377 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %24 = OpLoad %v4uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %extractBits_631377
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %extractBits_631377
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %extractBits_631377
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %extractBits_631377
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %extractBits_631377
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %extractBits_631377
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.wgsl
index 24d0a72..28314a6 100644
--- a/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/631377.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn extractBits_631377() {
   var res : vec4<u32> = extractBits(vec4<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_631377();
diff --git a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl
index be0361d..73b11824 100644
--- a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl
@@ -24,7 +24,9 @@
 // fn extractBits(vec<2, i32>, u32, u32) -> vec<2, i32>
 fn extractBits_a99a8d() {
   var res: vec2<i32> = extractBits(vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.dxc.hlsl
index 8a3423e..2a6b13e 100644
--- a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_a99a8d() {
   int2 res = (0).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.fxc.hlsl
index 8a3423e..2a6b13e 100644
--- a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_a99a8d() {
   int2 res = (0).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.glsl
index ed2d067..d163b96 100644
--- a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void extractBits_a99a8d() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void extractBits_a99a8d() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void extractBits_a99a8d() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.msl b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.msl
index a3275ce..80e4982 100644
--- a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void extractBits_a99a8d() {
+void extractBits_a99a8d(device int2* const tint_symbol_1) {
   int2 res = int2(0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_a99a8d();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  extractBits_a99a8d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_a99a8d();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_a99a8d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_a99a8d();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_a99a8d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.spvasm
index f599ffb..fa149ea 100644
--- a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %extractBits_a99a8d "extractBits_a99a8d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-         %15 = OpConstantNull %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2int
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%extractBits_a99a8d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %15
-               OpStore %res %15
+%extractBits_a99a8d = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %25 = OpLoad %v2int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %extractBits_a99a8d
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %extractBits_a99a8d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %extractBits_a99a8d
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %extractBits_a99a8d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %extractBits_a99a8d
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %extractBits_a99a8d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.wgsl
index fc8ab5c..cbdebb5 100644
--- a/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/a99a8d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn extractBits_a99a8d() {
   var res : vec2<i32> = extractBits(vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_a99a8d();
diff --git a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl
index 7bed3b9..3333f12 100644
--- a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl
@@ -24,7 +24,9 @@
 // fn extractBits(u32, u32, u32) -> u32
 fn extractBits_ce81f8() {
   var res: u32 = extractBits(1u, 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.dxc.hlsl
index 7d634c6..387282e 100644
--- a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_ce81f8() {
   uint res = 0u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.fxc.hlsl
index 7d634c6..387282e 100644
--- a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_ce81f8() {
   uint res = 0u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.glsl
index 98abc22..4408979 100644
--- a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void extractBits_ce81f8() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void extractBits_ce81f8() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void extractBits_ce81f8() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.msl b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.msl
index 17f4809..5c4790b 100644
--- a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void extractBits_ce81f8() {
+void extractBits_ce81f8(device uint* const tint_symbol_1) {
   uint res = 0u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_ce81f8();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  extractBits_ce81f8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_ce81f8();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_ce81f8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_ce81f8();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_ce81f8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.spvasm
index dd2f870..4011980 100644
--- a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %extractBits_ce81f8 "extractBits_ce81f8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
-         %14 = OpConstantNull %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%extractBits_ce81f8 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %14
-               OpStore %res %14
+%extractBits_ce81f8 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %17
+               OpStore %res %17
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %extractBits_ce81f8
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %extractBits_ce81f8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %extractBits_ce81f8
+%fragment_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %extractBits_ce81f8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %extractBits_ce81f8
+%compute_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %extractBits_ce81f8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.wgsl
index 69137f2..9c3f36e 100644
--- a/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/ce81f8.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn extractBits_ce81f8() {
   var res : u32 = extractBits(1u, 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_ce81f8();
diff --git a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl
index 4fc7293..c811116 100644
--- a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl
@@ -24,7 +24,9 @@
 // fn extractBits(vec<3, i32>, u32, u32) -> vec<3, i32>
 fn extractBits_e04f5d() {
   var res: vec3<i32> = extractBits(vec3<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.dxc.hlsl
index 1a9ccc4..ac79784 100644
--- a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_e04f5d() {
   int3 res = (0).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.fxc.hlsl
index 1a9ccc4..ac79784 100644
--- a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_e04f5d() {
   int3 res = (0).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.glsl
index d246f70..ee841ff 100644
--- a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void extractBits_e04f5d() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void extractBits_e04f5d() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void extractBits_e04f5d() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.msl b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.msl
index 4e7e9f3..bcb968a 100644
--- a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void extractBits_e04f5d() {
+void extractBits_e04f5d(device packed_int3* const tint_symbol_1) {
   int3 res = int3(0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_e04f5d();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  extractBits_e04f5d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_e04f5d();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_e04f5d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_e04f5d();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_e04f5d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.spvasm
index 5bdeeef..5f6b3f7 100644
--- a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %extractBits_e04f5d "extractBits_e04f5d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-         %15 = OpConstantNull %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3int
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%extractBits_e04f5d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %15
-               OpStore %res %15
+%extractBits_e04f5d = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %25 = OpLoad %v3int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %extractBits_e04f5d
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %extractBits_e04f5d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %extractBits_e04f5d
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %extractBits_e04f5d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %extractBits_e04f5d
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %extractBits_e04f5d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.wgsl
index dadc3e4..50ef543 100644
--- a/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/e04f5d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn extractBits_e04f5d() {
   var res : vec3<i32> = extractBits(vec3<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_e04f5d();
diff --git a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl
index db73c01..60e2dcb 100644
--- a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl
@@ -24,7 +24,9 @@
 // fn extractBits(vec<2, u32>, u32, u32) -> vec<2, u32>
 fn extractBits_f28f69() {
   var res: vec2<u32> = extractBits(vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.dxc.hlsl
index dd5b07a..b0d3fac 100644
--- a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_f28f69() {
   uint2 res = (0u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.fxc.hlsl
index dd5b07a..b0d3fac 100644
--- a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_f28f69() {
   uint2 res = (0u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.glsl b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.glsl
index e9efb96..3b4f9e7 100644
--- a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void extractBits_f28f69() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void extractBits_f28f69() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void extractBits_f28f69() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.msl b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.msl
index a42bf13..af6c326 100644
--- a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void extractBits_f28f69() {
+void extractBits_f28f69(device uint2* const tint_symbol_1) {
   uint2 res = uint2(0u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_f28f69();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  extractBits_f28f69(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_f28f69();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_f28f69(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_f28f69();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_f28f69(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.spvasm
index f5b1f26..9848384 100644
--- a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %extractBits_f28f69 "extractBits_f28f69"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-         %15 = OpConstantNull %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%extractBits_f28f69 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %15
-               OpStore %res %15
+%extractBits_f28f69 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %24 = OpLoad %v2uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %extractBits_f28f69
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %extractBits_f28f69
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %extractBits_f28f69
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %extractBits_f28f69
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %extractBits_f28f69
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %extractBits_f28f69
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.wgsl
index c2e8d72..f0991c0 100644
--- a/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/f28f69.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn extractBits_f28f69() {
   var res : vec2<u32> = extractBits(vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_f28f69();
diff --git a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl
index 821ef14..8e95d87 100644
--- a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl
@@ -24,7 +24,9 @@
 // fn extractBits(vec<4, i32>, u32, u32) -> vec<4, i32>
 fn extractBits_fb850f() {
   var res: vec4<i32> = extractBits(vec4<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.dxc.hlsl
index e843b7c..da1d880 100644
--- a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_fb850f() {
   int4 res = (0).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.fxc.hlsl
index e843b7c..da1d880 100644
--- a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_fb850f() {
   int4 res = (0).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.glsl
index c132e9a..89ddca0 100644
--- a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void extractBits_fb850f() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void extractBits_fb850f() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void extractBits_fb850f() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.msl b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.msl
index bc43177..e03210e 100644
--- a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void extractBits_fb850f() {
+void extractBits_fb850f(device int4* const tint_symbol_1) {
   int4 res = int4(0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_fb850f();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  extractBits_fb850f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_fb850f();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_fb850f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_fb850f();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_fb850f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.spvasm
index b257879..b497ac6 100644
--- a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %extractBits_fb850f "extractBits_fb850f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-         %15 = OpConstantNull %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%extractBits_fb850f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %15
-               OpStore %res %15
+%extractBits_fb850f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %25 = OpLoad %v4int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %extractBits_fb850f
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %extractBits_fb850f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %extractBits_fb850f
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %extractBits_fb850f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %extractBits_fb850f
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %extractBits_fb850f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.wgsl
index 9d3b0e2..9a49704 100644
--- a/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/extractBits/fb850f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn extractBits_fb850f() {
   var res : vec4<i32> = extractBits(vec4<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_fb850f();
diff --git a/test/tint/builtins/gen/literal/faceForward/2c4d14.wgsl b/test/tint/builtins/gen/literal/faceForward/2c4d14.wgsl
index 52173e7..710fe73 100644
--- a/test/tint/builtins/gen/literal/faceForward/2c4d14.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/2c4d14.wgsl
@@ -25,7 +25,6 @@
 fn faceForward_2c4d14() {
   var res = faceForward(vec4(1.), vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_2c4d14();
diff --git a/test/tint/builtins/gen/literal/faceForward/524986.wgsl b/test/tint/builtins/gen/literal/faceForward/524986.wgsl
index aeb6d72..54e3ff5 100644
--- a/test/tint/builtins/gen/literal/faceForward/524986.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/524986.wgsl
@@ -26,7 +26,9 @@
 // fn faceForward(vec<3, f16>, vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn faceForward_524986() {
   var res: vec3<f16> = faceForward(vec3<f16>(1.h), vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.dxc.hlsl
index f5aa253..ed48f61 100644
--- a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_524986() {
   vector<float16_t, 3> res = (float16_t(-1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.fxc.hlsl
index dcbd12f..3c0652b 100644
--- a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_524986() {
   vector<float16_t, 3> res = (float16_t(-1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.glsl b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.glsl
index 20c69aa..19b5c81 100644
--- a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void faceForward_524986() {
   f16vec3 res = f16vec3(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void faceForward_524986() {
   f16vec3 res = f16vec3(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void faceForward_524986() {
   f16vec3 res = f16vec3(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.msl b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.msl
index 86bf786..376b69f 100644
--- a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_524986() {
+void faceForward_524986(device packed_half3* const tint_symbol_1) {
   half3 res = half3(-1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_524986();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  faceForward_524986(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_524986();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_524986(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_524986();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_524986(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.spvasm
index ed92cbd..d302c72 100644
--- a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_524986 "faceForward_524986"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1p_0 = OpConstant %half -0x1p+0
-         %16 = OpConstantComposite %v3half %half_n0x1p_0 %half_n0x1p_0 %half_n0x1p_0
+         %19 = OpConstantComposite %v3half %half_n0x1p_0 %half_n0x1p_0 %half_n0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_524986 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%faceForward_524986 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %faceForward_524986
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %faceForward_524986
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %faceForward_524986
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %faceForward_524986
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %faceForward_524986
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %faceForward_524986
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.wgsl
index 43b0b35..05a99fd 100644
--- a/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/524986.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn faceForward_524986() {
   var res : vec3<f16> = faceForward(vec3<f16>(1.0h), vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_524986();
diff --git a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl
index d106529..80e2fff 100644
--- a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl
@@ -24,7 +24,9 @@
 // fn faceForward(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn faceForward_5afbd5() {
   var res: vec3<f32> = faceForward(vec3<f32>(1.f), vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.dxc.hlsl
index 92df0ef..4d3e3b8 100644
--- a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_5afbd5() {
   float3 res = (-1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.fxc.hlsl
index 92df0ef..4d3e3b8 100644
--- a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_5afbd5() {
   float3 res = (-1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.glsl
index 1b7f845..7a2e953 100644
--- a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void faceForward_5afbd5() {
   vec3 res = vec3(-1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void faceForward_5afbd5() {
   vec3 res = vec3(-1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void faceForward_5afbd5() {
   vec3 res = vec3(-1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.msl b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.msl
index d9e6c01..a063c24 100644
--- a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_5afbd5() {
+void faceForward_5afbd5(device packed_float3* const tint_symbol_1) {
   float3 res = float3(-1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_5afbd5();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  faceForward_5afbd5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_5afbd5();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_5afbd5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_5afbd5();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_5afbd5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.spvasm
index 463be89..c00fb72 100644
--- a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_5afbd5 "faceForward_5afbd5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
    %float_n1 = OpConstant %float -1
-         %15 = OpConstantComposite %v3float %float_n1 %float_n1 %float_n1
+         %18 = OpConstantComposite %v3float %float_n1 %float_n1 %float_n1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_5afbd5 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%faceForward_5afbd5 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %faceForward_5afbd5
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %faceForward_5afbd5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %faceForward_5afbd5
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %faceForward_5afbd5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %faceForward_5afbd5
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %faceForward_5afbd5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.wgsl
index 4e3a582..8afbe05 100644
--- a/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/5afbd5.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn faceForward_5afbd5() {
   var res : vec3<f32> = faceForward(vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_5afbd5();
diff --git a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl
index 51136ce..c77a011 100644
--- a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl
@@ -24,7 +24,9 @@
 // fn faceForward(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn faceForward_b316e5() {
   var res: vec4<f32> = faceForward(vec4<f32>(1.f), vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.dxc.hlsl
index 9d9cb70..28b8413 100644
--- a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_b316e5() {
   float4 res = (-1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.fxc.hlsl
index 9d9cb70..28b8413 100644
--- a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_b316e5() {
   float4 res = (-1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.glsl
index 1aed1d9..6fc5734 100644
--- a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void faceForward_b316e5() {
   vec4 res = vec4(-1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void faceForward_b316e5() {
   vec4 res = vec4(-1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void faceForward_b316e5() {
   vec4 res = vec4(-1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.msl b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.msl
index 3eceafa..c955588 100644
--- a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_b316e5() {
+void faceForward_b316e5(device float4* const tint_symbol_1) {
   float4 res = float4(-1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_b316e5();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  faceForward_b316e5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_b316e5();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_b316e5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_b316e5();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_b316e5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.spvasm
index e52e7e2..0299ac7 100644
--- a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_b316e5 "faceForward_b316e5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
    %float_n1 = OpConstant %float -1
-         %14 = OpConstantComposite %v4float %float_n1 %float_n1 %float_n1 %float_n1
+         %17 = OpConstantComposite %v4float %float_n1 %float_n1 %float_n1 %float_n1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_b316e5 = OpFunction %void None %9
-         %12 = OpLabel
+%faceForward_b316e5 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %faceForward_b316e5
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %faceForward_b316e5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %faceForward_b316e5
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %faceForward_b316e5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %faceForward_b316e5
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %faceForward_b316e5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.wgsl
index c6efdfc..9817513 100644
--- a/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/b316e5.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn faceForward_b316e5() {
   var res : vec4<f32> = faceForward(vec4<f32>(1.0f), vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_b316e5();
diff --git a/test/tint/builtins/gen/literal/faceForward/b42ef3.wgsl b/test/tint/builtins/gen/literal/faceForward/b42ef3.wgsl
index 39a3905..3acfeb9 100644
--- a/test/tint/builtins/gen/literal/faceForward/b42ef3.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/b42ef3.wgsl
@@ -25,7 +25,6 @@
 fn faceForward_b42ef3() {
   var res = faceForward(vec2(1.), vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_b42ef3();
diff --git a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl
index d2b290a..3b7d7a6 100644
--- a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl
@@ -26,7 +26,9 @@
 // fn faceForward(vec<4, f16>, vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn faceForward_cc63dc() {
   var res: vec4<f16> = faceForward(vec4<f16>(1.h), vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.dxc.hlsl
index 59991b5..e63f368 100644
--- a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_cc63dc() {
   vector<float16_t, 4> res = (float16_t(-1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.fxc.hlsl
index 03437b6..4669b4c 100644
--- a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_cc63dc() {
   vector<float16_t, 4> res = (float16_t(-1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.glsl
index aec75dc..068e697 100644
--- a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void faceForward_cc63dc() {
   f16vec4 res = f16vec4(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void faceForward_cc63dc() {
   f16vec4 res = f16vec4(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void faceForward_cc63dc() {
   f16vec4 res = f16vec4(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.msl b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.msl
index f3e2791..30c78ce 100644
--- a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_cc63dc() {
+void faceForward_cc63dc(device half4* const tint_symbol_1) {
   half4 res = half4(-1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_cc63dc();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  faceForward_cc63dc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_cc63dc();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_cc63dc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_cc63dc();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_cc63dc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.spvasm
index a9dc6f1..b80704d 100644
--- a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_cc63dc "faceForward_cc63dc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1p_0 = OpConstant %half -0x1p+0
-         %16 = OpConstantComposite %v4half %half_n0x1p_0 %half_n0x1p_0 %half_n0x1p_0 %half_n0x1p_0
+         %19 = OpConstantComposite %v4half %half_n0x1p_0 %half_n0x1p_0 %half_n0x1p_0 %half_n0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_cc63dc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%faceForward_cc63dc = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %faceForward_cc63dc
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %faceForward_cc63dc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %faceForward_cc63dc
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %faceForward_cc63dc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %faceForward_cc63dc
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %faceForward_cc63dc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.wgsl
index 5a7e113..f76362d 100644
--- a/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/cc63dc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn faceForward_cc63dc() {
   var res : vec4<f16> = faceForward(vec4<f16>(1.0h), vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_cc63dc();
diff --git a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl
index cb3b447..14253bf 100644
--- a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl
@@ -24,7 +24,9 @@
 // fn faceForward(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn faceForward_e6908b() {
   var res: vec2<f32> = faceForward(vec2<f32>(1.f), vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.dxc.hlsl
index a69c897..d10f0bf 100644
--- a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_e6908b() {
   float2 res = (-1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.fxc.hlsl
index a69c897..d10f0bf 100644
--- a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_e6908b() {
   float2 res = (-1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.glsl
index 274e8f8..9be5d11 100644
--- a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void faceForward_e6908b() {
   vec2 res = vec2(-1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void faceForward_e6908b() {
   vec2 res = vec2(-1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void faceForward_e6908b() {
   vec2 res = vec2(-1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.msl b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.msl
index 026c548..666e8db 100644
--- a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_e6908b() {
+void faceForward_e6908b(device float2* const tint_symbol_1) {
   float2 res = float2(-1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_e6908b();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  faceForward_e6908b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_e6908b();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_e6908b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_e6908b();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_e6908b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.spvasm
index c759014..f9b660a 100644
--- a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_e6908b "faceForward_e6908b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
    %float_n1 = OpConstant %float -1
-         %15 = OpConstantComposite %v2float %float_n1 %float_n1
+         %18 = OpConstantComposite %v2float %float_n1 %float_n1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_e6908b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%faceForward_e6908b = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %faceForward_e6908b
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %faceForward_e6908b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %faceForward_e6908b
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %faceForward_e6908b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %faceForward_e6908b
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %faceForward_e6908b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.wgsl
index ee21409..625a49c 100644
--- a/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/e6908b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn faceForward_e6908b() {
   var res : vec2<f32> = faceForward(vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_e6908b();
diff --git a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl
index 69a787b..e2320a7 100644
--- a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl
@@ -26,7 +26,9 @@
 // fn faceForward(vec<2, f16>, vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn faceForward_fb0f2e() {
   var res: vec2<f16> = faceForward(vec2<f16>(1.h), vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.dxc.hlsl
index b8a27dc..a9ca8aa 100644
--- a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_fb0f2e() {
   vector<float16_t, 2> res = (float16_t(-1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.fxc.hlsl
index 493747e..f9c4ad8 100644
--- a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_fb0f2e() {
   vector<float16_t, 2> res = (float16_t(-1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.glsl
index c5385ad..ee07f88 100644
--- a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void faceForward_fb0f2e() {
   f16vec2 res = f16vec2(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void faceForward_fb0f2e() {
   f16vec2 res = f16vec2(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void faceForward_fb0f2e() {
   f16vec2 res = f16vec2(-1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.msl b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.msl
index 9140987..38c51c1 100644
--- a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_fb0f2e() {
+void faceForward_fb0f2e(device half2* const tint_symbol_1) {
   half2 res = half2(-1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_fb0f2e();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  faceForward_fb0f2e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_fb0f2e();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_fb0f2e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_fb0f2e();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_fb0f2e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.spvasm
index 7d7f40b..8daf3b9 100644
--- a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_fb0f2e "faceForward_fb0f2e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1p_0 = OpConstant %half -0x1p+0
-         %16 = OpConstantComposite %v2half %half_n0x1p_0 %half_n0x1p_0
+         %19 = OpConstantComposite %v2half %half_n0x1p_0 %half_n0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_fb0f2e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%faceForward_fb0f2e = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %faceForward_fb0f2e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %faceForward_fb0f2e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %faceForward_fb0f2e
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %faceForward_fb0f2e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %faceForward_fb0f2e
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %faceForward_fb0f2e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.wgsl
index 6f9ce4c..2eda5d0 100644
--- a/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/fb0f2e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn faceForward_fb0f2e() {
   var res : vec2<f16> = faceForward(vec2<f16>(1.0h), vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_fb0f2e();
diff --git a/test/tint/builtins/gen/literal/faceForward/fe522b.wgsl b/test/tint/builtins/gen/literal/faceForward/fe522b.wgsl
index fe8be54..4566339 100644
--- a/test/tint/builtins/gen/literal/faceForward/fe522b.wgsl
+++ b/test/tint/builtins/gen/literal/faceForward/fe522b.wgsl
@@ -25,7 +25,6 @@
 fn faceForward_fe522b() {
   var res = faceForward(vec3(1.), vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_fe522b();
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl
index 3890e8e..74c96d2 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl
@@ -24,7 +24,9 @@
 // fn firstLeadingBit(vec<4, u32>) -> vec<4, u32>
 fn firstLeadingBit_000ff3() {
   var res: vec4<u32> = firstLeadingBit(vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.dxc.hlsl
index 45ae76f..b2d439a 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_000ff3() {
   uint4 res = (0u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.fxc.hlsl
index 45ae76f..b2d439a 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_000ff3() {
   uint4 res = (0u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.glsl
index 01903b7..9d0060d 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_000ff3() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_000ff3() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_000ff3() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.msl
index 0fbd78d..f79da76 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstLeadingBit_000ff3() {
+void firstLeadingBit_000ff3(device uint4* const tint_symbol_1) {
   uint4 res = uint4(0u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_000ff3();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  firstLeadingBit_000ff3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_000ff3();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_000ff3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_000ff3();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_000ff3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.spvasm
index 6a77c3f..ce8e430 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstLeadingBit_000ff3 "firstLeadingBit_000ff3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-         %15 = OpConstantNull %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstLeadingBit_000ff3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %15
-               OpStore %res %15
+%firstLeadingBit_000ff3 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %24 = OpLoad %v4uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstLeadingBit_000ff3
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %firstLeadingBit_000ff3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstLeadingBit_000ff3
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %firstLeadingBit_000ff3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstLeadingBit_000ff3
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %firstLeadingBit_000ff3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.wgsl
index 01ed7cd..4078744 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/000ff3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstLeadingBit_000ff3() {
   var res : vec4<u32> = firstLeadingBit(vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_000ff3();
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl
index 262fd62..47f21d9 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl
@@ -24,7 +24,9 @@
 // fn firstLeadingBit(vec<3, i32>) -> vec<3, i32>
 fn firstLeadingBit_35053e() {
   var res: vec3<i32> = firstLeadingBit(vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.dxc.hlsl
index 64de243..f5024e5 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_35053e() {
   int3 res = (0).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.fxc.hlsl
index 64de243..f5024e5 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_35053e() {
   int3 res = (0).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.glsl
index 9f61ef1..6cac6f9 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_35053e() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_35053e() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_35053e() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.msl
index 251f337..d8ab219 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstLeadingBit_35053e() {
+void firstLeadingBit_35053e(device packed_int3* const tint_symbol_1) {
   int3 res = int3(0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_35053e();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  firstLeadingBit_35053e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_35053e();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_35053e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_35053e();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_35053e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.spvasm
index a026344..32d16cb 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstLeadingBit_35053e "firstLeadingBit_35053e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-         %15 = OpConstantNull %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3int
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstLeadingBit_35053e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %15
-               OpStore %res %15
+%firstLeadingBit_35053e = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %25 = OpLoad %v3int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstLeadingBit_35053e
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %firstLeadingBit_35053e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstLeadingBit_35053e
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %firstLeadingBit_35053e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstLeadingBit_35053e
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %firstLeadingBit_35053e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.wgsl
index 6cd97a3..0461720 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/35053e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstLeadingBit_35053e() {
   var res : vec3<i32> = firstLeadingBit(vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_35053e();
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl
index 54137f9..b784a14 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl
@@ -24,7 +24,9 @@
 // fn firstLeadingBit(vec<3, u32>) -> vec<3, u32>
 fn firstLeadingBit_3fd7d0() {
   var res: vec3<u32> = firstLeadingBit(vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.dxc.hlsl
index 453df54..42d5ad7 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_3fd7d0() {
   uint3 res = (0u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.fxc.hlsl
index 453df54..42d5ad7 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_3fd7d0() {
   uint3 res = (0u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.glsl
index 943e83a..a7c41cd 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_3fd7d0() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_3fd7d0() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_3fd7d0() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.msl
index 6204d0d..0b99aa2 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstLeadingBit_3fd7d0() {
+void firstLeadingBit_3fd7d0(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(0u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_3fd7d0();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  firstLeadingBit_3fd7d0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_3fd7d0();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_3fd7d0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_3fd7d0();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_3fd7d0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.spvasm
index 6960601..ba5e192 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstLeadingBit_3fd7d0 "firstLeadingBit_3fd7d0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-         %15 = OpConstantNull %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstLeadingBit_3fd7d0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %15
-               OpStore %res %15
+%firstLeadingBit_3fd7d0 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %24 = OpLoad %v3uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstLeadingBit_3fd7d0
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %firstLeadingBit_3fd7d0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstLeadingBit_3fd7d0
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %firstLeadingBit_3fd7d0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstLeadingBit_3fd7d0
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %firstLeadingBit_3fd7d0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.wgsl
index 70d440e..05b3c43 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/3fd7d0.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstLeadingBit_3fd7d0() {
   var res : vec3<u32> = firstLeadingBit(vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_3fd7d0();
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl
index 5f7ff62..2d8b3d3 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl
@@ -24,7 +24,9 @@
 // fn firstLeadingBit(i32) -> i32
 fn firstLeadingBit_57a1a3() {
   var res: i32 = firstLeadingBit(1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.dxc.hlsl
index a7803d3..2f67913 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_57a1a3() {
   int res = 0;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.fxc.hlsl
index a7803d3..2f67913 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_57a1a3() {
   int res = 0;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.glsl
index f084324..d40a235 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstLeadingBit_57a1a3() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstLeadingBit_57a1a3() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstLeadingBit_57a1a3() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.msl
index 44ced56..3bdfa4a 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstLeadingBit_57a1a3() {
+void firstLeadingBit_57a1a3(device int* const tint_symbol_1) {
   int res = 0;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_57a1a3();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  firstLeadingBit_57a1a3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_57a1a3();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_57a1a3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_57a1a3();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_57a1a3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.spvasm
index 544a0e5..633b439 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstLeadingBit_57a1a3 "firstLeadingBit_57a1a3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
-         %14 = OpConstantNull %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %int
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstLeadingBit_57a1a3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %14
-               OpStore %res %14
+%firstLeadingBit_57a1a3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %firstLeadingBit_57a1a3
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %firstLeadingBit_57a1a3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %firstLeadingBit_57a1a3
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %firstLeadingBit_57a1a3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %firstLeadingBit_57a1a3
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %firstLeadingBit_57a1a3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.wgsl
index 71b97c5..48df1b1 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/57a1a3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstLeadingBit_57a1a3() {
   var res : i32 = firstLeadingBit(1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_57a1a3();
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl
index ca5ba6e..c036a95 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl
@@ -24,7 +24,9 @@
 // fn firstLeadingBit(vec<2, u32>) -> vec<2, u32>
 fn firstLeadingBit_6fe804() {
   var res: vec2<u32> = firstLeadingBit(vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.dxc.hlsl
index 4a95cac..12165d0 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_6fe804() {
   uint2 res = (0u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.fxc.hlsl
index 4a95cac..12165d0 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_6fe804() {
   uint2 res = (0u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.glsl
index 8f5360e..e65ac93 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_6fe804() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_6fe804() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_6fe804() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.msl
index 51f630e..d9c8418 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstLeadingBit_6fe804() {
+void firstLeadingBit_6fe804(device uint2* const tint_symbol_1) {
   uint2 res = uint2(0u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_6fe804();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  firstLeadingBit_6fe804(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_6fe804();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_6fe804(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_6fe804();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_6fe804(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.spvasm
index 69f043e..92db483 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstLeadingBit_6fe804 "firstLeadingBit_6fe804"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-         %15 = OpConstantNull %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstLeadingBit_6fe804 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %15
-               OpStore %res %15
+%firstLeadingBit_6fe804 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %24 = OpLoad %v2uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstLeadingBit_6fe804
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %firstLeadingBit_6fe804
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstLeadingBit_6fe804
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %firstLeadingBit_6fe804
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstLeadingBit_6fe804
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %firstLeadingBit_6fe804
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.wgsl
index 3b5ed08..9be55e0 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/6fe804.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstLeadingBit_6fe804() {
   var res : vec2<u32> = firstLeadingBit(vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_6fe804();
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl
index 1b0795c..e5cff64 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl
@@ -24,7 +24,9 @@
 // fn firstLeadingBit(vec<2, i32>) -> vec<2, i32>
 fn firstLeadingBit_a622c2() {
   var res: vec2<i32> = firstLeadingBit(vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.dxc.hlsl
index 24723fb..467b45e 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_a622c2() {
   int2 res = (0).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.fxc.hlsl
index 24723fb..467b45e 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_a622c2() {
   int2 res = (0).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.glsl
index 276d3d7..43defbc 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_a622c2() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_a622c2() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_a622c2() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.msl
index 4edc0fd..c11dca6 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstLeadingBit_a622c2() {
+void firstLeadingBit_a622c2(device int2* const tint_symbol_1) {
   int2 res = int2(0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_a622c2();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  firstLeadingBit_a622c2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_a622c2();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_a622c2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_a622c2();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_a622c2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.spvasm
index f8d27c1..f5405ee 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstLeadingBit_a622c2 "firstLeadingBit_a622c2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-         %15 = OpConstantNull %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2int
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstLeadingBit_a622c2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %15
-               OpStore %res %15
+%firstLeadingBit_a622c2 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %25 = OpLoad %v2int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstLeadingBit_a622c2
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %firstLeadingBit_a622c2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstLeadingBit_a622c2
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %firstLeadingBit_a622c2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstLeadingBit_a622c2
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %firstLeadingBit_a622c2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.wgsl
index 5c52c9b..cde1357 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/a622c2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstLeadingBit_a622c2() {
   var res : vec2<i32> = firstLeadingBit(vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_a622c2();
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl
index 4d6f56d..4b79216 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl
@@ -24,7 +24,9 @@
 // fn firstLeadingBit(vec<4, i32>) -> vec<4, i32>
 fn firstLeadingBit_c1f940() {
   var res: vec4<i32> = firstLeadingBit(vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.dxc.hlsl
index 79d7e98..875919f 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_c1f940() {
   int4 res = (0).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.fxc.hlsl
index 79d7e98..875919f 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_c1f940() {
   int4 res = (0).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.glsl
index 94bfed3..26c1fa3 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_c1f940() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_c1f940() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_c1f940() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.msl
index 4b58a2f..0eecb2c 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstLeadingBit_c1f940() {
+void firstLeadingBit_c1f940(device int4* const tint_symbol_1) {
   int4 res = int4(0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_c1f940();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  firstLeadingBit_c1f940(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_c1f940();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_c1f940(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_c1f940();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_c1f940(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.spvasm
index 2a95961..5dc4d6d 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstLeadingBit_c1f940 "firstLeadingBit_c1f940"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-         %15 = OpConstantNull %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstLeadingBit_c1f940 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %15
-               OpStore %res %15
+%firstLeadingBit_c1f940 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %25 = OpLoad %v4int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstLeadingBit_c1f940
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %firstLeadingBit_c1f940
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstLeadingBit_c1f940
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %firstLeadingBit_c1f940
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstLeadingBit_c1f940
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %firstLeadingBit_c1f940
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.wgsl
index d80d822..3938c20 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/c1f940.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstLeadingBit_c1f940() {
   var res : vec4<i32> = firstLeadingBit(vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_c1f940();
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl
index 3534dcb..c93e924 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl
@@ -24,7 +24,9 @@
 // fn firstLeadingBit(u32) -> u32
 fn firstLeadingBit_f0779d() {
   var res: u32 = firstLeadingBit(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.dxc.hlsl
index f635198..ac069cc 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_f0779d() {
   uint res = 0u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.fxc.hlsl
index f635198..ac069cc 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_f0779d() {
   uint res = 0u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.glsl
index 55b2bdc..5cbd095 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstLeadingBit_f0779d() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstLeadingBit_f0779d() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstLeadingBit_f0779d() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.msl
index b673c0b..eb95c89 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstLeadingBit_f0779d() {
+void firstLeadingBit_f0779d(device uint* const tint_symbol_1) {
   uint res = 0u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_f0779d();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  firstLeadingBit_f0779d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_f0779d();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_f0779d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_f0779d();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_f0779d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.spvasm
index 227a546..6a8308a 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstLeadingBit_f0779d "firstLeadingBit_f0779d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
-         %14 = OpConstantNull %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstLeadingBit_f0779d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %14
-               OpStore %res %14
+%firstLeadingBit_f0779d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %17
+               OpStore %res %17
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %firstLeadingBit_f0779d
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %firstLeadingBit_f0779d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %firstLeadingBit_f0779d
+%fragment_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %firstLeadingBit_f0779d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %firstLeadingBit_f0779d
+%compute_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %firstLeadingBit_f0779d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.wgsl
index 5a3d105..ed9f27b 100644
--- a/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstLeadingBit/f0779d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstLeadingBit_f0779d() {
   var res : u32 = firstLeadingBit(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_f0779d();
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl
index b6b0339..9d53ae2 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl
@@ -24,7 +24,9 @@
 // fn firstTrailingBit(vec<4, u32>) -> vec<4, u32>
 fn firstTrailingBit_110f2c() {
   var res: vec4<u32> = firstTrailingBit(vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.dxc.hlsl
index 9be7e49..07ff3fb 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_110f2c() {
   uint4 res = (0u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.fxc.hlsl
index 9be7e49..07ff3fb 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_110f2c() {
   uint4 res = (0u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.glsl
index 94c175d..2aee31c 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_110f2c() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_110f2c() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_110f2c() {
   uvec4 res = uvec4(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.msl
index a8b4502..3a3ba82 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstTrailingBit_110f2c() {
+void firstTrailingBit_110f2c(device uint4* const tint_symbol_1) {
   uint4 res = uint4(0u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_110f2c();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  firstTrailingBit_110f2c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_110f2c();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_110f2c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_110f2c();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_110f2c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.spvasm
index bf6cca8..9062c8e 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstTrailingBit_110f2c "firstTrailingBit_110f2c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-         %15 = OpConstantNull %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstTrailingBit_110f2c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %15
-               OpStore %res %15
+%firstTrailingBit_110f2c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %24 = OpLoad %v4uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstTrailingBit_110f2c
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %firstTrailingBit_110f2c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstTrailingBit_110f2c
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %firstTrailingBit_110f2c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstTrailingBit_110f2c
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %firstTrailingBit_110f2c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.wgsl
index 3bf5233..c7c5bf3 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/110f2c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstTrailingBit_110f2c() {
   var res : vec4<u32> = firstTrailingBit(vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_110f2c();
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl
index 7e93a60..c235343 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl
@@ -24,7 +24,9 @@
 // fn firstTrailingBit(i32) -> i32
 fn firstTrailingBit_3a2acc() {
   var res: i32 = firstTrailingBit(1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.dxc.hlsl
index e84a941..a654dbf 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_3a2acc() {
   int res = 0;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.fxc.hlsl
index e84a941..a654dbf 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_3a2acc() {
   int res = 0;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.glsl
index c807448..e70aa45 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstTrailingBit_3a2acc() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstTrailingBit_3a2acc() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstTrailingBit_3a2acc() {
   int res = 0;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.msl
index 9c972c7..db6bf7b 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstTrailingBit_3a2acc() {
+void firstTrailingBit_3a2acc(device int* const tint_symbol_1) {
   int res = 0;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_3a2acc();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  firstTrailingBit_3a2acc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_3a2acc();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_3a2acc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_3a2acc();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_3a2acc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.spvasm
index 4991023..384d70b 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstTrailingBit_3a2acc "firstTrailingBit_3a2acc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
-         %14 = OpConstantNull %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %int
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstTrailingBit_3a2acc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %14
-               OpStore %res %14
+%firstTrailingBit_3a2acc = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %24 = OpLoad %int %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %firstTrailingBit_3a2acc
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %firstTrailingBit_3a2acc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %firstTrailingBit_3a2acc
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %firstTrailingBit_3a2acc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %firstTrailingBit_3a2acc
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %firstTrailingBit_3a2acc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.wgsl
index 10458dd..4508fab 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/3a2acc.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstTrailingBit_3a2acc() {
   var res : i32 = firstTrailingBit(1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_3a2acc();
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl
index 70e6f40..10524ba 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl
@@ -24,7 +24,9 @@
 // fn firstTrailingBit(vec<2, u32>) -> vec<2, u32>
 fn firstTrailingBit_45eb10() {
   var res: vec2<u32> = firstTrailingBit(vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.dxc.hlsl
index 6d20831..e48740a 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_45eb10() {
   uint2 res = (0u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.fxc.hlsl
index 6d20831..e48740a 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_45eb10() {
   uint2 res = (0u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.glsl
index e7ca9b2..fd25364 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_45eb10() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_45eb10() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_45eb10() {
   uvec2 res = uvec2(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.msl
index 90c1afd..21790d2 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstTrailingBit_45eb10() {
+void firstTrailingBit_45eb10(device uint2* const tint_symbol_1) {
   uint2 res = uint2(0u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_45eb10();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  firstTrailingBit_45eb10(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_45eb10();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_45eb10(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_45eb10();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_45eb10(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.spvasm
index 99a65b3..504afbb 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstTrailingBit_45eb10 "firstTrailingBit_45eb10"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-         %15 = OpConstantNull %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstTrailingBit_45eb10 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %15
-               OpStore %res %15
+%firstTrailingBit_45eb10 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %24 = OpLoad %v2uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstTrailingBit_45eb10
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %firstTrailingBit_45eb10
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstTrailingBit_45eb10
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %firstTrailingBit_45eb10
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstTrailingBit_45eb10
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %firstTrailingBit_45eb10
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.wgsl
index 0db7af4..4834ddf 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/45eb10.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstTrailingBit_45eb10() {
   var res : vec2<u32> = firstTrailingBit(vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_45eb10();
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl
index 1646d22..2fb41db 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl
@@ -24,7 +24,9 @@
 // fn firstTrailingBit(u32) -> u32
 fn firstTrailingBit_47d475() {
   var res: u32 = firstTrailingBit(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.dxc.hlsl
index 0aece4e..c099100 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_47d475() {
   uint res = 0u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.fxc.hlsl
index 0aece4e..c099100 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_47d475() {
   uint res = 0u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.glsl
index 7ae6bba..da006a5 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstTrailingBit_47d475() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstTrailingBit_47d475() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstTrailingBit_47d475() {
   uint res = 0u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.msl
index 7009d68..a7f9b30 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstTrailingBit_47d475() {
+void firstTrailingBit_47d475(device uint* const tint_symbol_1) {
   uint res = 0u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_47d475();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  firstTrailingBit_47d475(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_47d475();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_47d475(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_47d475();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_47d475(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.spvasm
index 3e70c04..eb85829 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstTrailingBit_47d475 "firstTrailingBit_47d475"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
-         %14 = OpConstantNull %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstTrailingBit_47d475 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %14
-               OpStore %res %14
+%firstTrailingBit_47d475 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %17
+               OpStore %res %17
+         %22 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %23 = OpLoad %uint %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %firstTrailingBit_47d475
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %firstTrailingBit_47d475
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %firstTrailingBit_47d475
+%fragment_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %firstTrailingBit_47d475
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %firstTrailingBit_47d475
+%compute_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %firstTrailingBit_47d475
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.wgsl
index 1673bcd..9a0738c 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/47d475.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstTrailingBit_47d475() {
   var res : u32 = firstTrailingBit(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_47d475();
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl
index 6a2da89..81f6c01 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl
@@ -24,7 +24,9 @@
 // fn firstTrailingBit(vec<2, i32>) -> vec<2, i32>
 fn firstTrailingBit_50c072() {
   var res: vec2<i32> = firstTrailingBit(vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.dxc.hlsl
index 7182ae5..969e897 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_50c072() {
   int2 res = (0).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.fxc.hlsl
index 7182ae5..969e897 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_50c072() {
   int2 res = (0).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.glsl
index 207e759..15417a7 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_50c072() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_50c072() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_50c072() {
   ivec2 res = ivec2(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.msl
index 723c4fc..1a1a0f3 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstTrailingBit_50c072() {
+void firstTrailingBit_50c072(device int2* const tint_symbol_1) {
   int2 res = int2(0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_50c072();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  firstTrailingBit_50c072(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_50c072();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_50c072(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_50c072();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_50c072(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.spvasm
index 3437073..2b4cdce 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstTrailingBit_50c072 "firstTrailingBit_50c072"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-         %15 = OpConstantNull %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2int
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstTrailingBit_50c072 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %15
-               OpStore %res %15
+%firstTrailingBit_50c072 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %25 = OpLoad %v2int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstTrailingBit_50c072
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %firstTrailingBit_50c072
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstTrailingBit_50c072
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %firstTrailingBit_50c072
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstTrailingBit_50c072
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %firstTrailingBit_50c072
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.wgsl
index b54afcc..c9b22d6 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/50c072.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstTrailingBit_50c072() {
   var res : vec2<i32> = firstTrailingBit(vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_50c072();
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl
index d01c02b..ea18620 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl
@@ -24,7 +24,9 @@
 // fn firstTrailingBit(vec<3, i32>) -> vec<3, i32>
 fn firstTrailingBit_7496d6() {
   var res: vec3<i32> = firstTrailingBit(vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.dxc.hlsl
index b2a4bd1..5eb9217 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_7496d6() {
   int3 res = (0).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.fxc.hlsl
index b2a4bd1..5eb9217 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_7496d6() {
   int3 res = (0).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.glsl
index 1aafc02..33957b8 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_7496d6() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_7496d6() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_7496d6() {
   ivec3 res = ivec3(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.msl
index f304f8c..159408f 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstTrailingBit_7496d6() {
+void firstTrailingBit_7496d6(device packed_int3* const tint_symbol_1) {
   int3 res = int3(0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_7496d6();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  firstTrailingBit_7496d6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_7496d6();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_7496d6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_7496d6();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_7496d6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.spvasm
index bd16ed2..2918007 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstTrailingBit_7496d6 "firstTrailingBit_7496d6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-         %15 = OpConstantNull %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3int
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstTrailingBit_7496d6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %15
-               OpStore %res %15
+%firstTrailingBit_7496d6 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %25 = OpLoad %v3int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstTrailingBit_7496d6
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %firstTrailingBit_7496d6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstTrailingBit_7496d6
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %firstTrailingBit_7496d6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstTrailingBit_7496d6
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %firstTrailingBit_7496d6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.wgsl
index 60cb2f5..01fad2b 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/7496d6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstTrailingBit_7496d6() {
   var res : vec3<i32> = firstTrailingBit(vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_7496d6();
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl
index 0a0551a..2b7a941 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl
@@ -24,7 +24,9 @@
 // fn firstTrailingBit(vec<4, i32>) -> vec<4, i32>
 fn firstTrailingBit_86551b() {
   var res: vec4<i32> = firstTrailingBit(vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.dxc.hlsl
index cfd124d..1930296 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_86551b() {
   int4 res = (0).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.fxc.hlsl
index cfd124d..1930296 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_86551b() {
   int4 res = (0).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.glsl
index 99a9d7a..5d43b79 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_86551b() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_86551b() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_86551b() {
   ivec4 res = ivec4(0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.msl
index c6cbfc7..3a1b730 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstTrailingBit_86551b() {
+void firstTrailingBit_86551b(device int4* const tint_symbol_1) {
   int4 res = int4(0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_86551b();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  firstTrailingBit_86551b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_86551b();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_86551b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_86551b();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_86551b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.spvasm
index 2baed71..f5676f1 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstTrailingBit_86551b "firstTrailingBit_86551b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-         %15 = OpConstantNull %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstTrailingBit_86551b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %15
-               OpStore %res %15
+%firstTrailingBit_86551b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %25 = OpLoad %v4int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstTrailingBit_86551b
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %firstTrailingBit_86551b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstTrailingBit_86551b
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %firstTrailingBit_86551b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstTrailingBit_86551b
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %firstTrailingBit_86551b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.wgsl
index 2b43f9d..e27f21a 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/86551b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstTrailingBit_86551b() {
   var res : vec4<i32> = firstTrailingBit(vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_86551b();
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl
index b096cd1..b7ed437 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl
@@ -24,7 +24,9 @@
 // fn firstTrailingBit(vec<3, u32>) -> vec<3, u32>
 fn firstTrailingBit_cb51ce() {
   var res: vec3<u32> = firstTrailingBit(vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.dxc.hlsl
index b70b3f0..35f617e 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_cb51ce() {
   uint3 res = (0u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.fxc.hlsl
index b70b3f0..35f617e 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_cb51ce() {
   uint3 res = (0u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.glsl
index 53f1934..b6c8695 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_cb51ce() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_cb51ce() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_cb51ce() {
   uvec3 res = uvec3(0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.msl
index fa8aac6..797c21f 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void firstTrailingBit_cb51ce() {
+void firstTrailingBit_cb51ce(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(0u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_cb51ce();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  firstTrailingBit_cb51ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_cb51ce();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_cb51ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_cb51ce();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_cb51ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.spvasm
index c79ad8e..792ba50 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %firstTrailingBit_cb51ce "firstTrailingBit_cb51ce"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-         %15 = OpConstantNull %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %18 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%firstTrailingBit_cb51ce = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %15
-               OpStore %res %15
+%firstTrailingBit_cb51ce = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %18
+               OpStore %res %18
+         %23 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %24 = OpLoad %v3uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %firstTrailingBit_cb51ce
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %firstTrailingBit_cb51ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %firstTrailingBit_cb51ce
+%fragment_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %firstTrailingBit_cb51ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %firstTrailingBit_cb51ce
+%compute_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %firstTrailingBit_cb51ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.wgsl
index e18b54e..ea87a14 100644
--- a/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/firstTrailingBit/cb51ce.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn firstTrailingBit_cb51ce() {
   var res : vec3<u32> = firstTrailingBit(vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_cb51ce();
diff --git a/test/tint/builtins/gen/literal/floor/218952.wgsl b/test/tint/builtins/gen/literal/floor/218952.wgsl
index cc3c8e6..1a340d9 100644
--- a/test/tint/builtins/gen/literal/floor/218952.wgsl
+++ b/test/tint/builtins/gen/literal/floor/218952.wgsl
@@ -25,7 +25,6 @@
 fn floor_218952() {
   var res = floor(vec4(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_218952();
diff --git a/test/tint/builtins/gen/literal/floor/3802c0.wgsl b/test/tint/builtins/gen/literal/floor/3802c0.wgsl
index a8cfcea..2156744 100644
--- a/test/tint/builtins/gen/literal/floor/3802c0.wgsl
+++ b/test/tint/builtins/gen/literal/floor/3802c0.wgsl
@@ -26,7 +26,9 @@
 // fn floor(vec<3, f16>) -> vec<3, f16>
 fn floor_3802c0() {
   var res: vec3<f16> = floor(vec3<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.dxc.hlsl
index 446e096..4fb4643 100644
--- a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_3802c0() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.fxc.hlsl
index 6e0253f..0c8e2f7 100644
--- a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_3802c0() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.glsl
index c3920b3..bfb8f5d 100644
--- a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void floor_3802c0() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void floor_3802c0() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void floor_3802c0() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.msl b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.msl
index 0a637cd..d7bb980 100644
--- a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_3802c0() {
+void floor_3802c0(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_3802c0();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  floor_3802c0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_3802c0();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  floor_3802c0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_3802c0();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  floor_3802c0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.spvasm
index f2c7055..36d6ce8 100644
--- a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_3802c0 "floor_3802c0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_3802c0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%floor_3802c0 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %floor_3802c0
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %floor_3802c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %floor_3802c0
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %floor_3802c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %floor_3802c0
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %floor_3802c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.wgsl
index 5840b54..9ef8ea0 100644
--- a/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/floor/3802c0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn floor_3802c0() {
   var res : vec3<f16> = floor(vec3<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_3802c0();
diff --git a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl
index 7a3f3f9..b4cabf4 100644
--- a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl
+++ b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl
@@ -24,7 +24,9 @@
 // fn floor(vec<4, f32>) -> vec<4, f32>
 fn floor_3bccc4() {
   var res: vec4<f32> = floor(vec4<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.dxc.hlsl
index b03dea0..5b6e4ba 100644
--- a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_3bccc4() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.fxc.hlsl
index b03dea0..5b6e4ba 100644
--- a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_3bccc4() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.glsl
index fd41de5..b632be2 100644
--- a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void floor_3bccc4() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void floor_3bccc4() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void floor_3bccc4() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.msl b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.msl
index f9859d0..2bb489e 100644
--- a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_3bccc4() {
+void floor_3bccc4(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_3bccc4();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  floor_3bccc4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_3bccc4();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  floor_3bccc4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_3bccc4();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  floor_3bccc4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.spvasm
index 0cb7fdd..312b151 100644
--- a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_3bccc4 "floor_3bccc4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%floor_3bccc4 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%floor_3bccc4 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %floor_3bccc4
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %floor_3bccc4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %floor_3bccc4
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %floor_3bccc4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %floor_3bccc4
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %floor_3bccc4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.wgsl
index 27a31b1..54f8206 100644
--- a/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/floor/3bccc4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn floor_3bccc4() {
   var res : vec4<f32> = floor(vec4<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_3bccc4();
diff --git a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl
index 325929f..4aca886 100644
--- a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl
+++ b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl
@@ -24,7 +24,9 @@
 // fn floor(vec<2, f32>) -> vec<2, f32>
 fn floor_5fc9ac() {
   var res: vec2<f32> = floor(vec2<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.dxc.hlsl
index b1a6fb9..fa2a4f2 100644
--- a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_5fc9ac() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.fxc.hlsl
index b1a6fb9..fa2a4f2 100644
--- a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_5fc9ac() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.glsl b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.glsl
index fdb4ad0..330a42f 100644
--- a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void floor_5fc9ac() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void floor_5fc9ac() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void floor_5fc9ac() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.msl b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.msl
index 914af9f..84d618c 100644
--- a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_5fc9ac() {
+void floor_5fc9ac(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_5fc9ac();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  floor_5fc9ac(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_5fc9ac();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  floor_5fc9ac(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_5fc9ac();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  floor_5fc9ac(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.spvasm
index 5e6c220..3f69b77 100644
--- a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_5fc9ac "floor_5fc9ac"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%floor_5fc9ac = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%floor_5fc9ac = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %floor_5fc9ac
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %floor_5fc9ac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %floor_5fc9ac
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %floor_5fc9ac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %floor_5fc9ac
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %floor_5fc9ac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.wgsl
index f40f05d..c8534bb 100644
--- a/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/floor/5fc9ac.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn floor_5fc9ac() {
   var res : vec2<f32> = floor(vec2<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_5fc9ac();
diff --git a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl
index 0d4e4d2..3b94981 100644
--- a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl
+++ b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl
@@ -24,7 +24,9 @@
 // fn floor(vec<3, f32>) -> vec<3, f32>
 fn floor_60d7ea() {
   var res: vec3<f32> = floor(vec3<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.dxc.hlsl
index 58338f6..a6483cd 100644
--- a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_60d7ea() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.fxc.hlsl
index 58338f6..a6483cd 100644
--- a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_60d7ea() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.glsl
index 95e670d..7acdcd0 100644
--- a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void floor_60d7ea() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void floor_60d7ea() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void floor_60d7ea() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.msl b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.msl
index c12a659..44b19ad 100644
--- a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_60d7ea() {
+void floor_60d7ea(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_60d7ea();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  floor_60d7ea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_60d7ea();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  floor_60d7ea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_60d7ea();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  floor_60d7ea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.spvasm
index 73458d9..d4c0f3f 100644
--- a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_60d7ea "floor_60d7ea"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%floor_60d7ea = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%floor_60d7ea = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %floor_60d7ea
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %floor_60d7ea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %floor_60d7ea
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %floor_60d7ea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %floor_60d7ea
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %floor_60d7ea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.wgsl
index 8fcf9a8..326899d 100644
--- a/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/floor/60d7ea.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn floor_60d7ea() {
   var res : vec3<f32> = floor(vec3<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_60d7ea();
diff --git a/test/tint/builtins/gen/literal/floor/66f154.wgsl b/test/tint/builtins/gen/literal/floor/66f154.wgsl
index a04339a..2ba9987 100644
--- a/test/tint/builtins/gen/literal/floor/66f154.wgsl
+++ b/test/tint/builtins/gen/literal/floor/66f154.wgsl
@@ -24,7 +24,9 @@
 // fn floor(f32) -> f32
 fn floor_66f154() {
   var res: f32 = floor(1.5f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.dxc.hlsl
index c0791ae..24233a5 100644
--- a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_66f154() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.fxc.hlsl
index c0791ae..24233a5 100644
--- a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_66f154() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.glsl b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.glsl
index 07a4a27..127cfb9 100644
--- a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void floor_66f154() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void floor_66f154() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void floor_66f154() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.msl b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.msl
index 9f7a0cd..a03434a 100644
--- a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_66f154() {
+void floor_66f154(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_66f154();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  floor_66f154(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_66f154();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  floor_66f154(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_66f154();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  floor_66f154(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.spvasm
index 9e74538..2eb5bc3 100644
--- a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_66f154 "floor_66f154"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%floor_66f154 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%floor_66f154 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %floor_66f154
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %floor_66f154
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %floor_66f154
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %floor_66f154
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %floor_66f154
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %floor_66f154
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.wgsl
index a665083..c80b77b 100644
--- a/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/floor/66f154.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn floor_66f154() {
   var res : f32 = floor(1.5f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_66f154();
diff --git a/test/tint/builtins/gen/literal/floor/84658c.wgsl b/test/tint/builtins/gen/literal/floor/84658c.wgsl
index 9cf2adb..4e8a5ed 100644
--- a/test/tint/builtins/gen/literal/floor/84658c.wgsl
+++ b/test/tint/builtins/gen/literal/floor/84658c.wgsl
@@ -26,7 +26,9 @@
 // fn floor(vec<2, f16>) -> vec<2, f16>
 fn floor_84658c() {
   var res: vec2<f16> = floor(vec2<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.dxc.hlsl
index dbdd75f..d451305 100644
--- a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_84658c() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.fxc.hlsl
index 1342297..ffccb1b 100644
--- a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_84658c() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.glsl
index dce9c85..bb96c97 100644
--- a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void floor_84658c() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void floor_84658c() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void floor_84658c() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.msl b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.msl
index c619d7c..688dc20 100644
--- a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_84658c() {
+void floor_84658c(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_84658c();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  floor_84658c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_84658c();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  floor_84658c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_84658c();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  floor_84658c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.spvasm
index b6a4945..c980aa4 100644
--- a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_84658c "floor_84658c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_84658c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%floor_84658c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %floor_84658c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %floor_84658c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %floor_84658c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %floor_84658c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %floor_84658c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %floor_84658c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.wgsl
index 4b7c4d6..b9d8599 100644
--- a/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/floor/84658c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn floor_84658c() {
   var res : vec2<f16> = floor(vec2<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_84658c();
diff --git a/test/tint/builtins/gen/literal/floor/953774.wgsl b/test/tint/builtins/gen/literal/floor/953774.wgsl
index 39a37a0..ac6bdd4 100644
--- a/test/tint/builtins/gen/literal/floor/953774.wgsl
+++ b/test/tint/builtins/gen/literal/floor/953774.wgsl
@@ -25,7 +25,6 @@
 fn floor_953774() {
   var res = floor(vec3(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_953774();
diff --git a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl
index f5d0a88..f1c718e 100644
--- a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl
+++ b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl
@@ -26,7 +26,9 @@
 // fn floor(vec<4, f16>) -> vec<4, f16>
 fn floor_a2d31b() {
   var res: vec4<f16> = floor(vec4<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.dxc.hlsl
index e8e43d8..9c6cad6 100644
--- a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_a2d31b() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.fxc.hlsl
index 0779860..b124d33 100644
--- a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_a2d31b() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.glsl
index 3463a7f..899a1aa 100644
--- a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void floor_a2d31b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void floor_a2d31b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void floor_a2d31b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.msl b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.msl
index a1b0f04..dc86bdd 100644
--- a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_a2d31b() {
+void floor_a2d31b(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_a2d31b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  floor_a2d31b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_a2d31b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  floor_a2d31b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_a2d31b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  floor_a2d31b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.spvasm
index 6f84fa2..40b9996 100644
--- a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_a2d31b "floor_a2d31b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_a2d31b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%floor_a2d31b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %floor_a2d31b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %floor_a2d31b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %floor_a2d31b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %floor_a2d31b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %floor_a2d31b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %floor_a2d31b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.wgsl
index 1772e94..e6f67df1 100644
--- a/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/floor/a2d31b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn floor_a2d31b() {
   var res : vec4<f16> = floor(vec4<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_a2d31b();
diff --git a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl
index 9eb9fa7..3cb0e98 100644
--- a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl
+++ b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl
@@ -26,7 +26,9 @@
 // fn floor(f16) -> f16
 fn floor_b6e09c() {
   var res: f16 = floor(1.5h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.dxc.hlsl
index fb8121e..4bbfc57 100644
--- a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_b6e09c() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.fxc.hlsl
index 18934a4..90dbb72 100644
--- a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_b6e09c() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.glsl
index 4cf7082..867c53d 100644
--- a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void floor_b6e09c() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void floor_b6e09c() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void floor_b6e09c() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.msl b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.msl
index b84aca8..b30d763 100644
--- a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_b6e09c() {
+void floor_b6e09c(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_b6e09c();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  floor_b6e09c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_b6e09c();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  floor_b6e09c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_b6e09c();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  floor_b6e09c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.spvasm
index bb1076b..5dc5bb8 100644
--- a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_b6e09c "floor_b6e09c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_b6e09c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%floor_b6e09c = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %floor_b6e09c
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %floor_b6e09c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %floor_b6e09c
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %floor_b6e09c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %floor_b6e09c
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %floor_b6e09c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.wgsl
index 35c2316..ec51f13 100644
--- a/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/floor/b6e09c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn floor_b6e09c() {
   var res : f16 = floor(1.5h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_b6e09c();
diff --git a/test/tint/builtins/gen/literal/floor/dcd5a2.wgsl b/test/tint/builtins/gen/literal/floor/dcd5a2.wgsl
index 8e20f51..91da688 100644
--- a/test/tint/builtins/gen/literal/floor/dcd5a2.wgsl
+++ b/test/tint/builtins/gen/literal/floor/dcd5a2.wgsl
@@ -25,7 +25,6 @@
 fn floor_dcd5a2() {
   var res = floor(1.5);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_dcd5a2();
diff --git a/test/tint/builtins/gen/literal/floor/e585ef.wgsl b/test/tint/builtins/gen/literal/floor/e585ef.wgsl
index 341157d..1e67b39 100644
--- a/test/tint/builtins/gen/literal/floor/e585ef.wgsl
+++ b/test/tint/builtins/gen/literal/floor/e585ef.wgsl
@@ -25,7 +25,6 @@
 fn floor_e585ef() {
   var res = floor(vec2(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_e585ef();
diff --git a/test/tint/builtins/gen/literal/fma/143d5d.wgsl b/test/tint/builtins/gen/literal/fma/143d5d.wgsl
index 5a83670..9af6dd8 100644
--- a/test/tint/builtins/gen/literal/fma/143d5d.wgsl
+++ b/test/tint/builtins/gen/literal/fma/143d5d.wgsl
@@ -25,7 +25,6 @@
 fn fma_143d5d() {
   var res = fma(vec4(1.), vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_143d5d();
diff --git a/test/tint/builtins/gen/literal/fma/1f5084.wgsl b/test/tint/builtins/gen/literal/fma/1f5084.wgsl
index 3453e11..57b11e1 100644
--- a/test/tint/builtins/gen/literal/fma/1f5084.wgsl
+++ b/test/tint/builtins/gen/literal/fma/1f5084.wgsl
@@ -25,7 +25,6 @@
 fn fma_1f5084() {
   var res = fma(vec2(1.), vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_1f5084();
diff --git a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl
index 3f3b6c7..70415f0 100644
--- a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl
+++ b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl
@@ -24,7 +24,9 @@
 // fn fma(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn fma_26a7a9() {
   var res: vec2<f32> = fma(vec2<f32>(1.f), vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.dxc.hlsl
index 7f4c278..2f35161 100644
--- a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_26a7a9() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.fxc.hlsl
index 7f4c278..2f35161 100644
--- a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_26a7a9() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.glsl
index ca63145..acfb0bb 100644
--- a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fma_26a7a9() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fma_26a7a9() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fma_26a7a9() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.msl b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.msl
index 77a1973..fe9e1a9 100644
--- a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_26a7a9() {
+void fma_26a7a9(device float2* const tint_symbol_1) {
   float2 res = float2(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_26a7a9();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  fma_26a7a9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_26a7a9();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  fma_26a7a9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_26a7a9();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  fma_26a7a9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.spvasm
index 63647d4..89ec1cf 100644
--- a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_26a7a9 "fma_26a7a9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v2float %float_2 %float_2
+         %18 = OpConstantComposite %v2float %float_2 %float_2
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_26a7a9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+ %fma_26a7a9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %fma_26a7a9
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %fma_26a7a9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %fma_26a7a9
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %fma_26a7a9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %fma_26a7a9
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %fma_26a7a9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.wgsl
index b58dda7..d6ca0b7 100644
--- a/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fma/26a7a9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fma_26a7a9() {
   var res : vec2<f32> = fma(vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_26a7a9();
diff --git a/test/tint/builtins/gen/literal/fma/466442.wgsl b/test/tint/builtins/gen/literal/fma/466442.wgsl
index e46749a..763826a 100644
--- a/test/tint/builtins/gen/literal/fma/466442.wgsl
+++ b/test/tint/builtins/gen/literal/fma/466442.wgsl
@@ -25,7 +25,6 @@
 fn fma_466442() {
   var res = fma(1., 1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_466442();
diff --git a/test/tint/builtins/gen/literal/fma/6a3283.wgsl b/test/tint/builtins/gen/literal/fma/6a3283.wgsl
index e38f857..3b60f5c 100644
--- a/test/tint/builtins/gen/literal/fma/6a3283.wgsl
+++ b/test/tint/builtins/gen/literal/fma/6a3283.wgsl
@@ -24,7 +24,9 @@
 // fn fma(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn fma_6a3283() {
   var res: vec4<f32> = fma(vec4<f32>(1.f), vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.dxc.hlsl
index a518076..75f562c 100644
--- a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_6a3283() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.fxc.hlsl
index a518076..75f562c 100644
--- a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_6a3283() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.glsl
index f18280d..439c32e 100644
--- a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fma_6a3283() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fma_6a3283() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fma_6a3283() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.msl b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.msl
index 747f0d6..00291a8 100644
--- a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_6a3283() {
+void fma_6a3283(device float4* const tint_symbol_1) {
   float4 res = float4(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_6a3283();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  fma_6a3283(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_6a3283();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  fma_6a3283(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_6a3283();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  fma_6a3283(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.spvasm
index 2f1ceb1..34f2284 100644
--- a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_6a3283 "fma_6a3283"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %14 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+         %17 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_6a3283 = OpFunction %void None %9
-         %12 = OpLabel
+ %fma_6a3283 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %fma_6a3283
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %fma_6a3283
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %fma_6a3283
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %fma_6a3283
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fma_6a3283
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fma_6a3283
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.wgsl
index 4a60892..a3f2d76 100644
--- a/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fma/6a3283.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fma_6a3283() {
   var res : vec4<f32> = fma(vec4<f32>(1.0f), vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_6a3283();
diff --git a/test/tint/builtins/gen/literal/fma/ab7818.wgsl b/test/tint/builtins/gen/literal/fma/ab7818.wgsl
index ab5ebb9..fe6275e 100644
--- a/test/tint/builtins/gen/literal/fma/ab7818.wgsl
+++ b/test/tint/builtins/gen/literal/fma/ab7818.wgsl
@@ -26,7 +26,9 @@
 // fn fma(vec<4, f16>, vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn fma_ab7818() {
   var res: vec4<f16> = fma(vec4<f16>(1.h), vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.dxc.hlsl
index aaafc9a..b5f9f5a 100644
--- a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_ab7818() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.fxc.hlsl
index 0c8bca8..39ad777 100644
--- a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_ab7818() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.glsl
index 034f24a..9774ca2 100644
--- a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fma_ab7818() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fma_ab7818() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fma_ab7818() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.msl b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.msl
index 77bd22d..5507fd3 100644
--- a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_ab7818() {
+void fma_ab7818(device half4* const tint_symbol_1) {
   half4 res = half4(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_ab7818();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  fma_ab7818(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_ab7818();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  fma_ab7818(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_ab7818();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  fma_ab7818(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.spvasm
index b278ae3..830acdb 100644
--- a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_ab7818 "fma_ab7818"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_ab7818 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %fma_ab7818 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %fma_ab7818
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %fma_ab7818
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fma_ab7818
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fma_ab7818
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fma_ab7818
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fma_ab7818
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.wgsl
index d0f3ce4..52b77e7 100644
--- a/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fma/ab7818.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn fma_ab7818() {
   var res : vec4<f16> = fma(vec4<f16>(1.0h), vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_ab7818();
diff --git a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl
index abfb8df..83d1bc5 100644
--- a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl
+++ b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl
@@ -26,7 +26,9 @@
 // fn fma(vec<2, f16>, vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn fma_bf21b6() {
   var res: vec2<f16> = fma(vec2<f16>(1.h), vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.dxc.hlsl
index 846fd33..4cfc8e2 100644
--- a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_bf21b6() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.fxc.hlsl
index 39996a8..f8b51c4 100644
--- a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_bf21b6() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.glsl
index fb633c8..ce9f5a9 100644
--- a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fma_bf21b6() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fma_bf21b6() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fma_bf21b6() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.msl b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.msl
index 69f9158..b71cd8c 100644
--- a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_bf21b6() {
+void fma_bf21b6(device half2* const tint_symbol_1) {
   half2 res = half2(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_bf21b6();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  fma_bf21b6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_bf21b6();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  fma_bf21b6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_bf21b6();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  fma_bf21b6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.spvasm
index d0c5c44..03dcde3 100644
--- a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_bf21b6 "fma_bf21b6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_bf21b6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %fma_bf21b6 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %fma_bf21b6
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %fma_bf21b6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fma_bf21b6
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fma_bf21b6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fma_bf21b6
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fma_bf21b6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.wgsl
index 6d9f0bd..1981e92 100644
--- a/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fma/bf21b6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn fma_bf21b6() {
   var res : vec2<f16> = fma(vec2<f16>(1.0h), vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_bf21b6();
diff --git a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl
index 8d5b616..b8afd7d 100644
--- a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl
+++ b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl
@@ -24,7 +24,9 @@
 // fn fma(f32, f32, f32) -> f32
 fn fma_c10ba3() {
   var res: f32 = fma(1.f, 1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.dxc.hlsl
index b8ef7d6..0192e90 100644
--- a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_c10ba3() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.fxc.hlsl
index b8ef7d6..0192e90 100644
--- a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_c10ba3() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.glsl
index 009c216..f5dea9c 100644
--- a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fma_c10ba3() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fma_c10ba3() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fma_c10ba3() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.msl b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.msl
index e222ebd..33c1cd8 100644
--- a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_c10ba3() {
+void fma_c10ba3(device float* const tint_symbol_1) {
   float res = 2.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_c10ba3();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  fma_c10ba3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_c10ba3();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  fma_c10ba3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_c10ba3();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  fma_c10ba3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.spvasm
index 5335567..a486175 100644
--- a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_c10ba3 "fma_c10ba3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_c10ba3 = OpFunction %void None %9
-         %12 = OpLabel
+ %fma_c10ba3 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_2
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %fma_c10ba3
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %fma_c10ba3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %fma_c10ba3
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %fma_c10ba3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %fma_c10ba3
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %fma_c10ba3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.wgsl
index 178dcd2..d18dab2 100644
--- a/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fma/c10ba3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fma_c10ba3() {
   var res : f32 = fma(1.0f, 1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_c10ba3();
diff --git a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl
index 3dfeb73..06591d5 100644
--- a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl
+++ b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl
@@ -26,7 +26,9 @@
 // fn fma(f16, f16, f16) -> f16
 fn fma_c8abb3() {
   var res: f16 = fma(1.h, 1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.dxc.hlsl
index ad0ae1e..1ab33b6 100644
--- a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_c8abb3() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.fxc.hlsl
index 001d75c..1592b24 100644
--- a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_c8abb3() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.glsl
index 172c792..8c53811 100644
--- a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fma_c8abb3() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fma_c8abb3() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fma_c8abb3() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.msl b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.msl
index 58ba67a..63a0026 100644
--- a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_c8abb3() {
+void fma_c8abb3(device half* const tint_symbol_1) {
   half res = 2.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_c8abb3();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  fma_c8abb3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_c8abb3();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  fma_c8abb3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_c8abb3();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  fma_c8abb3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.spvasm
index 16b175f..1dc78ad 100644
--- a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_c8abb3 "fma_c8abb3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_c8abb3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %fma_c8abb3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %fma_c8abb3
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %fma_c8abb3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %fma_c8abb3
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %fma_c8abb3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %fma_c8abb3
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %fma_c8abb3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.wgsl
index 400a45e..d46632f 100644
--- a/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fma/c8abb3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn fma_c8abb3() {
   var res : f16 = fma(1.0h, 1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_c8abb3();
diff --git a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl
index b167e37..3710a71 100644
--- a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl
+++ b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl
@@ -24,7 +24,9 @@
 // fn fma(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn fma_e17c5c() {
   var res: vec3<f32> = fma(vec3<f32>(1.f), vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.dxc.hlsl
index ba5da32..40e1e9f 100644
--- a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_e17c5c() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.fxc.hlsl
index ba5da32..40e1e9f 100644
--- a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_e17c5c() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.glsl
index 7285005..c88101e 100644
--- a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fma_e17c5c() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fma_e17c5c() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fma_e17c5c() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.msl b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.msl
index 24c7af4..414f161 100644
--- a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_e17c5c() {
+void fma_e17c5c(device packed_float3* const tint_symbol_1) {
   float3 res = float3(2.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_e17c5c();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  fma_e17c5c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_e17c5c();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  fma_e17c5c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_e17c5c();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  fma_e17c5c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.spvasm
index 87bcc0e..46d8976 100644
--- a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_e17c5c "fma_e17c5c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+         %18 = OpConstantComposite %v3float %float_2 %float_2 %float_2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_e17c5c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+ %fma_e17c5c = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %fma_e17c5c
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %fma_e17c5c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %fma_e17c5c
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %fma_e17c5c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %fma_e17c5c
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %fma_e17c5c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.wgsl
index 8ddabbe..7a79ddb 100644
--- a/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fma/e17c5c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fma_e17c5c() {
   var res : vec3<f32> = fma(vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_e17c5c();
diff --git a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl
index 1d0b583..2c7e091 100644
--- a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl
+++ b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl
@@ -26,7 +26,9 @@
 // fn fma(vec<3, f16>, vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn fma_e7abdc() {
   var res: vec3<f16> = fma(vec3<f16>(1.h), vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.dxc.hlsl
index 7229fbb..9b20b02 100644
--- a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_e7abdc() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.fxc.hlsl
index 6951b31..217100a 100644
--- a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_e7abdc() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.glsl
index 3e06476..af0444d 100644
--- a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fma_e7abdc() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fma_e7abdc() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fma_e7abdc() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.msl b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.msl
index cd1a833..9ba422e 100644
--- a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_e7abdc() {
+void fma_e7abdc(device packed_half3* const tint_symbol_1) {
   half3 res = half3(2.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_e7abdc();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  fma_e7abdc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_e7abdc();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  fma_e7abdc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_e7abdc();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  fma_e7abdc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.spvasm
index 0af3de3..93db90d 100644
--- a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_e7abdc "fma_e7abdc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_e7abdc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %fma_e7abdc = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %fma_e7abdc
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %fma_e7abdc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fma_e7abdc
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fma_e7abdc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fma_e7abdc
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fma_e7abdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.wgsl
index b83db18..b8bf11d 100644
--- a/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fma/e7abdc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn fma_e7abdc() {
   var res : vec3<f16> = fma(vec3<f16>(1.0h), vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_e7abdc();
diff --git a/test/tint/builtins/gen/literal/fma/eb25d7.wgsl b/test/tint/builtins/gen/literal/fma/eb25d7.wgsl
index e136fa3..2e5c053 100644
--- a/test/tint/builtins/gen/literal/fma/eb25d7.wgsl
+++ b/test/tint/builtins/gen/literal/fma/eb25d7.wgsl
@@ -25,7 +25,6 @@
 fn fma_eb25d7() {
   var res = fma(vec3(1.), vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_eb25d7();
diff --git a/test/tint/builtins/gen/literal/fract/181aa9.wgsl b/test/tint/builtins/gen/literal/fract/181aa9.wgsl
index d439e1b..470f929 100644
--- a/test/tint/builtins/gen/literal/fract/181aa9.wgsl
+++ b/test/tint/builtins/gen/literal/fract/181aa9.wgsl
@@ -26,7 +26,9 @@
 // fn fract(vec<2, f16>) -> vec<2, f16>
 fn fract_181aa9() {
   var res: vec2<f16> = fract(vec2<f16>(1.25h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.dxc.hlsl
index c888c8f..535ea58 100644
--- a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_181aa9() {
   vector<float16_t, 2> res = (float16_t(0.25h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.fxc.hlsl
index 4c80772..8675ec6 100644
--- a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_181aa9() {
   vector<float16_t, 2> res = (float16_t(0.25h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.glsl
index 4404f23..b20b7e8 100644
--- a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fract_181aa9() {
   f16vec2 res = f16vec2(0.25hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fract_181aa9() {
   f16vec2 res = f16vec2(0.25hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fract_181aa9() {
   f16vec2 res = f16vec2(0.25hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.msl b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.msl
index b915124..7ca67c5 100644
--- a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_181aa9() {
+void fract_181aa9(device half2* const tint_symbol_1) {
   half2 res = half2(0.25h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_181aa9();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  fract_181aa9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_181aa9();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  fract_181aa9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_181aa9();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  fract_181aa9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.spvasm
index e489898..4379c15 100644
--- a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_181aa9 "fract_181aa9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1pn2 = OpConstant %half 0x1p-2
-         %16 = OpConstantComposite %v2half %half_0x1pn2 %half_0x1pn2
+         %19 = OpConstantComposite %v2half %half_0x1pn2 %half_0x1pn2
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_181aa9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%fract_181aa9 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %fract_181aa9
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %fract_181aa9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fract_181aa9
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fract_181aa9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fract_181aa9
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fract_181aa9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.wgsl
index 86ca468..de55eea 100644
--- a/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fract/181aa9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn fract_181aa9() {
   var res : vec2<f16> = fract(vec2<f16>(1.25h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_181aa9();
diff --git a/test/tint/builtins/gen/literal/fract/2eddfe.wgsl b/test/tint/builtins/gen/literal/fract/2eddfe.wgsl
index 27effad..bcfb116 100644
--- a/test/tint/builtins/gen/literal/fract/2eddfe.wgsl
+++ b/test/tint/builtins/gen/literal/fract/2eddfe.wgsl
@@ -25,7 +25,6 @@
 fn fract_2eddfe() {
   var res = fract(1.25);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_2eddfe();
diff --git a/test/tint/builtins/gen/literal/fract/498c77.wgsl b/test/tint/builtins/gen/literal/fract/498c77.wgsl
index 83e2bdc..6e6c51b 100644
--- a/test/tint/builtins/gen/literal/fract/498c77.wgsl
+++ b/test/tint/builtins/gen/literal/fract/498c77.wgsl
@@ -26,7 +26,9 @@
 // fn fract(vec<4, f16>) -> vec<4, f16>
 fn fract_498c77() {
   var res: vec4<f16> = fract(vec4<f16>(1.25h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.dxc.hlsl
index e3d3cec..bb5ad6c 100644
--- a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_498c77() {
   vector<float16_t, 4> res = (float16_t(0.25h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.fxc.hlsl
index 5e2826e..218fbde 100644
--- a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_498c77() {
   vector<float16_t, 4> res = (float16_t(0.25h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.glsl
index 7fdb86a..112c21b 100644
--- a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fract_498c77() {
   f16vec4 res = f16vec4(0.25hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fract_498c77() {
   f16vec4 res = f16vec4(0.25hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fract_498c77() {
   f16vec4 res = f16vec4(0.25hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.msl b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.msl
index 61516a2..f5189ee 100644
--- a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_498c77() {
+void fract_498c77(device half4* const tint_symbol_1) {
   half4 res = half4(0.25h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_498c77();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  fract_498c77(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_498c77();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  fract_498c77(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_498c77();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  fract_498c77(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.spvasm
index bb9242b..98b9572 100644
--- a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_498c77 "fract_498c77"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1pn2 = OpConstant %half 0x1p-2
-         %16 = OpConstantComposite %v4half %half_0x1pn2 %half_0x1pn2 %half_0x1pn2 %half_0x1pn2
+         %19 = OpConstantComposite %v4half %half_0x1pn2 %half_0x1pn2 %half_0x1pn2 %half_0x1pn2
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_498c77 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%fract_498c77 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %fract_498c77
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %fract_498c77
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fract_498c77
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fract_498c77
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fract_498c77
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fract_498c77
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.wgsl
index adbf6ff..d7814b6 100644
--- a/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fract/498c77.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn fract_498c77() {
   var res : vec4<f16> = fract(vec4<f16>(1.25h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_498c77();
diff --git a/test/tint/builtins/gen/literal/fract/7e3f2d.wgsl b/test/tint/builtins/gen/literal/fract/7e3f2d.wgsl
index 0ee5db0..9830f20 100644
--- a/test/tint/builtins/gen/literal/fract/7e3f2d.wgsl
+++ b/test/tint/builtins/gen/literal/fract/7e3f2d.wgsl
@@ -25,7 +25,6 @@
 fn fract_7e3f2d() {
   var res = fract(vec4(1.25));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_7e3f2d();
diff --git a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl
index 3b2112a..a3c9c83 100644
--- a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl
+++ b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl
@@ -24,7 +24,9 @@
 // fn fract(vec<4, f32>) -> vec<4, f32>
 fn fract_8bc1e9() {
   var res: vec4<f32> = fract(vec4<f32>(1.25f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.dxc.hlsl
index 7f353c6..e0469fc 100644
--- a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_8bc1e9() {
   float4 res = (0.25f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.fxc.hlsl
index 7f353c6..e0469fc 100644
--- a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_8bc1e9() {
   float4 res = (0.25f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.glsl
index ecb59a2..fab6770 100644
--- a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fract_8bc1e9() {
   vec4 res = vec4(0.25f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fract_8bc1e9() {
   vec4 res = vec4(0.25f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fract_8bc1e9() {
   vec4 res = vec4(0.25f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.msl b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.msl
index 41c4c87..39f5bea 100644
--- a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_8bc1e9() {
+void fract_8bc1e9(device float4* const tint_symbol_1) {
   float4 res = float4(0.25f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_8bc1e9();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  fract_8bc1e9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_8bc1e9();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  fract_8bc1e9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_8bc1e9();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  fract_8bc1e9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.spvasm
index 01e4bb2..693c84a 100644
--- a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_8bc1e9 "fract_8bc1e9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
  %float_0_25 = OpConstant %float 0.25
-         %14 = OpConstantComposite %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25
+         %17 = OpConstantComposite %v4float %float_0_25 %float_0_25 %float_0_25 %float_0_25
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_8bc1e9 = OpFunction %void None %9
-         %12 = OpLabel
+%fract_8bc1e9 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %fract_8bc1e9
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %fract_8bc1e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %fract_8bc1e9
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %fract_8bc1e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fract_8bc1e9
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fract_8bc1e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.wgsl
index 487ef1b..ca1c4b6 100644
--- a/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fract/8bc1e9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fract_8bc1e9() {
   var res : vec4<f32> = fract(vec4<f32>(1.25f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_8bc1e9();
diff --git a/test/tint/builtins/gen/literal/fract/943cb1.wgsl b/test/tint/builtins/gen/literal/fract/943cb1.wgsl
index 1841bab..dcbe34e 100644
--- a/test/tint/builtins/gen/literal/fract/943cb1.wgsl
+++ b/test/tint/builtins/gen/literal/fract/943cb1.wgsl
@@ -24,7 +24,9 @@
 // fn fract(vec<2, f32>) -> vec<2, f32>
 fn fract_943cb1() {
   var res: vec2<f32> = fract(vec2<f32>(1.25f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.dxc.hlsl
index 29149b5..8729128 100644
--- a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_943cb1() {
   float2 res = (0.25f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.fxc.hlsl
index 29149b5..8729128 100644
--- a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_943cb1() {
   float2 res = (0.25f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.glsl
index 0bef25d..4dc9943 100644
--- a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fract_943cb1() {
   vec2 res = vec2(0.25f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fract_943cb1() {
   vec2 res = vec2(0.25f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fract_943cb1() {
   vec2 res = vec2(0.25f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.msl b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.msl
index f80f8f8..68c3921 100644
--- a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_943cb1() {
+void fract_943cb1(device float2* const tint_symbol_1) {
   float2 res = float2(0.25f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_943cb1();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  fract_943cb1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_943cb1();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  fract_943cb1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_943cb1();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  fract_943cb1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.spvasm
index 2f70370..49dbfcc 100644
--- a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_943cb1 "fract_943cb1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
  %float_0_25 = OpConstant %float 0.25
-         %15 = OpConstantComposite %v2float %float_0_25 %float_0_25
+         %18 = OpConstantComposite %v2float %float_0_25 %float_0_25
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_943cb1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%fract_943cb1 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %fract_943cb1
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %fract_943cb1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %fract_943cb1
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %fract_943cb1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %fract_943cb1
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %fract_943cb1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.wgsl
index 790e0db..9c649d6 100644
--- a/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fract/943cb1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fract_943cb1() {
   var res : vec2<f32> = fract(vec2<f32>(1.25f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_943cb1();
diff --git a/test/tint/builtins/gen/literal/fract/958a1d.wgsl b/test/tint/builtins/gen/literal/fract/958a1d.wgsl
index f519e63..457698d 100644
--- a/test/tint/builtins/gen/literal/fract/958a1d.wgsl
+++ b/test/tint/builtins/gen/literal/fract/958a1d.wgsl
@@ -26,7 +26,9 @@
 // fn fract(vec<3, f16>) -> vec<3, f16>
 fn fract_958a1d() {
   var res: vec3<f16> = fract(vec3<f16>(1.25h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.dxc.hlsl
index f5d91ea..9eb0e4a 100644
--- a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_958a1d() {
   vector<float16_t, 3> res = (float16_t(0.25h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.fxc.hlsl
index 87bf0c4..ddc3b0a 100644
--- a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_958a1d() {
   vector<float16_t, 3> res = (float16_t(0.25h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.glsl
index 95cb787..bbd0eb8 100644
--- a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fract_958a1d() {
   f16vec3 res = f16vec3(0.25hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fract_958a1d() {
   f16vec3 res = f16vec3(0.25hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fract_958a1d() {
   f16vec3 res = f16vec3(0.25hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.msl b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.msl
index 5d654de..fef2b16 100644
--- a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_958a1d() {
+void fract_958a1d(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.25h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_958a1d();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  fract_958a1d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_958a1d();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  fract_958a1d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_958a1d();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  fract_958a1d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.spvasm
index bfe99f8..3dcf3f5 100644
--- a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_958a1d "fract_958a1d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1pn2 = OpConstant %half 0x1p-2
-         %16 = OpConstantComposite %v3half %half_0x1pn2 %half_0x1pn2 %half_0x1pn2
+         %19 = OpConstantComposite %v3half %half_0x1pn2 %half_0x1pn2 %half_0x1pn2
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_958a1d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%fract_958a1d = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %fract_958a1d
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %fract_958a1d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fract_958a1d
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fract_958a1d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fract_958a1d
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fract_958a1d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.wgsl
index edc6410..2deac70 100644
--- a/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fract/958a1d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn fract_958a1d() {
   var res : vec3<f16> = fract(vec3<f16>(1.25h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_958a1d();
diff --git a/test/tint/builtins/gen/literal/fract/a49758.wgsl b/test/tint/builtins/gen/literal/fract/a49758.wgsl
index 44c4d1c..ad80c87 100644
--- a/test/tint/builtins/gen/literal/fract/a49758.wgsl
+++ b/test/tint/builtins/gen/literal/fract/a49758.wgsl
@@ -24,7 +24,9 @@
 // fn fract(vec<3, f32>) -> vec<3, f32>
 fn fract_a49758() {
   var res: vec3<f32> = fract(vec3<f32>(1.25f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.dxc.hlsl
index 86bcc35..e9a51e8 100644
--- a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_a49758() {
   float3 res = (0.25f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.fxc.hlsl
index 86bcc35..e9a51e8 100644
--- a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_a49758() {
   float3 res = (0.25f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.glsl
index 7723da4..4bda86e 100644
--- a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fract_a49758() {
   vec3 res = vec3(0.25f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fract_a49758() {
   vec3 res = vec3(0.25f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fract_a49758() {
   vec3 res = vec3(0.25f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.msl b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.msl
index c42aff4..9b1b3fe 100644
--- a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_a49758() {
+void fract_a49758(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.25f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_a49758();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  fract_a49758(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_a49758();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  fract_a49758(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_a49758();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  fract_a49758(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.spvasm
index 3a709c2..ac380f2 100644
--- a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_a49758 "fract_a49758"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
  %float_0_25 = OpConstant %float 0.25
-         %15 = OpConstantComposite %v3float %float_0_25 %float_0_25 %float_0_25
+         %18 = OpConstantComposite %v3float %float_0_25 %float_0_25 %float_0_25
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_a49758 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%fract_a49758 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %fract_a49758
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %fract_a49758
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %fract_a49758
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %fract_a49758
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %fract_a49758
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %fract_a49758
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.wgsl
index e5291fb..7831550 100644
--- a/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fract/a49758.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fract_a49758() {
   var res : vec3<f32> = fract(vec3<f32>(1.25f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_a49758();
diff --git a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl
index 007ceb0..17f4043 100644
--- a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl
+++ b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl
@@ -26,7 +26,9 @@
 // fn fract(f16) -> f16
 fn fract_eb38ce() {
   var res: f16 = fract(1.25h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.dxc.hlsl
index f9b3793..e791054 100644
--- a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_eb38ce() {
   float16_t res = float16_t(0.25h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.fxc.hlsl
index eff8b41..569c5d4 100644
--- a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_eb38ce() {
   float16_t res = float16_t(0.25h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.glsl
index 0cb166c..0cb9509 100644
--- a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fract_eb38ce() {
   float16_t res = 0.25hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fract_eb38ce() {
   float16_t res = 0.25hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fract_eb38ce() {
   float16_t res = 0.25hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.msl
index 207c702..fe919f9 100644
--- a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_eb38ce() {
+void fract_eb38ce(device half* const tint_symbol_1) {
   half res = 0.25h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_eb38ce();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  fract_eb38ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_eb38ce();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  fract_eb38ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_eb38ce();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  fract_eb38ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.spvasm
index 506c880..9dcda37 100644
--- a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_eb38ce "fract_eb38ce"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1pn2 = OpConstant %half 0x1p-2
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_eb38ce = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%fract_eb38ce = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1pn2
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %fract_eb38ce
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %fract_eb38ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %fract_eb38ce
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %fract_eb38ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %fract_eb38ce
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %fract_eb38ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.wgsl
index 2573566..0494706 100644
--- a/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fract/eb38ce.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn fract_eb38ce() {
   var res : f16 = fract(1.25h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_eb38ce();
diff --git a/test/tint/builtins/gen/literal/fract/ed00ca.wgsl b/test/tint/builtins/gen/literal/fract/ed00ca.wgsl
index 7ecb626..93d223b 100644
--- a/test/tint/builtins/gen/literal/fract/ed00ca.wgsl
+++ b/test/tint/builtins/gen/literal/fract/ed00ca.wgsl
@@ -25,7 +25,6 @@
 fn fract_ed00ca() {
   var res = fract(vec2(1.25));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_ed00ca();
diff --git a/test/tint/builtins/gen/literal/fract/ed2f79.wgsl b/test/tint/builtins/gen/literal/fract/ed2f79.wgsl
index b4f0d9d..c4076ac 100644
--- a/test/tint/builtins/gen/literal/fract/ed2f79.wgsl
+++ b/test/tint/builtins/gen/literal/fract/ed2f79.wgsl
@@ -25,7 +25,6 @@
 fn fract_ed2f79() {
   var res = fract(vec3(1.25));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_ed2f79();
diff --git a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl
index 8a7bc3d..a690632 100644
--- a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl
+++ b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl
@@ -24,7 +24,9 @@
 // fn fract(f32) -> f32
 fn fract_fa5c71() {
   var res: f32 = fract(1.25f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.dxc.hlsl
index 30c1d2a..b392541 100644
--- a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_fa5c71() {
   float res = 0.25f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.fxc.hlsl
index 30c1d2a..b392541 100644
--- a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_fa5c71() {
   float res = 0.25f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.glsl
index 58d2cff..2fe2002 100644
--- a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fract_fa5c71() {
   float res = 0.25f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fract_fa5c71() {
   float res = 0.25f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fract_fa5c71() {
   float res = 0.25f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.msl b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.msl
index b08afbe..ef212b6 100644
--- a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_fa5c71() {
+void fract_fa5c71(device float* const tint_symbol_1) {
   float res = 0.25f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_fa5c71();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  fract_fa5c71(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_fa5c71();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  fract_fa5c71(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_fa5c71();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  fract_fa5c71(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.spvasm
index 3a4850d..921b902 100644
--- a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_fa5c71 "fract_fa5c71"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
  %float_0_25 = OpConstant %float 0.25
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_fa5c71 = OpFunction %void None %9
-         %12 = OpLabel
+%fract_fa5c71 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_25
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %fract_fa5c71
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %fract_fa5c71
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %fract_fa5c71
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %fract_fa5c71
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %fract_fa5c71
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %fract_fa5c71
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.wgsl
index a614981..80e0147 100644
--- a/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fract/fa5c71.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fract_fa5c71() {
   var res : f32 = fract(1.25f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_fa5c71();
diff --git a/test/tint/builtins/gen/literal/frexp/34bbfb.wgsl b/test/tint/builtins/gen/literal/frexp/34bbfb.wgsl
index c6e393a..91d1d32 100644
--- a/test/tint/builtins/gen/literal/frexp/34bbfb.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/34bbfb.wgsl
@@ -25,7 +25,6 @@
 fn frexp_34bbfb() {
   var res = frexp(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_34bbfb();
diff --git a/test/tint/builtins/gen/literal/frexp/3dd21e.wgsl b/test/tint/builtins/gen/literal/frexp/3dd21e.wgsl
index 17720e6..398178d 100644
--- a/test/tint/builtins/gen/literal/frexp/3dd21e.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/3dd21e.wgsl
@@ -27,7 +27,6 @@
 fn frexp_3dd21e() {
   var res = frexp(vec4<f16>(1.h));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_3dd21e();
diff --git a/test/tint/builtins/gen/literal/frexp/4b2200.wgsl b/test/tint/builtins/gen/literal/frexp/4b2200.wgsl
index 271abc5..5e54230 100644
--- a/test/tint/builtins/gen/literal/frexp/4b2200.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/4b2200.wgsl
@@ -25,7 +25,6 @@
 fn frexp_4b2200() {
   var res = frexp(1.f);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_4b2200();
diff --git a/test/tint/builtins/gen/literal/frexp/5257dd.wgsl b/test/tint/builtins/gen/literal/frexp/5257dd.wgsl
index 2843cee..4cf0826 100644
--- a/test/tint/builtins/gen/literal/frexp/5257dd.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/5257dd.wgsl
@@ -27,7 +27,6 @@
 fn frexp_5257dd() {
   var res = frexp(1.h);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_5257dd();
diff --git a/test/tint/builtins/gen/literal/frexp/5f47bf.wgsl b/test/tint/builtins/gen/literal/frexp/5f47bf.wgsl
index 9483fb2..74f62cc 100644
--- a/test/tint/builtins/gen/literal/frexp/5f47bf.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/5f47bf.wgsl
@@ -27,7 +27,6 @@
 fn frexp_5f47bf() {
   var res = frexp(vec2<f16>(1.h));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_5f47bf();
diff --git a/test/tint/builtins/gen/literal/frexp/6fb3ad.wgsl b/test/tint/builtins/gen/literal/frexp/6fb3ad.wgsl
index 5b10ae9..28bd438 100644
--- a/test/tint/builtins/gen/literal/frexp/6fb3ad.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/6fb3ad.wgsl
@@ -25,7 +25,6 @@
 fn frexp_6fb3ad() {
   var res = frexp(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_6fb3ad();
diff --git a/test/tint/builtins/gen/literal/frexp/77af93.wgsl b/test/tint/builtins/gen/literal/frexp/77af93.wgsl
index 489f812..9006953 100644
--- a/test/tint/builtins/gen/literal/frexp/77af93.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/77af93.wgsl
@@ -25,7 +25,6 @@
 fn frexp_77af93() {
   var res = frexp(vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_77af93();
diff --git a/test/tint/builtins/gen/literal/frexp/979800.wgsl b/test/tint/builtins/gen/literal/frexp/979800.wgsl
index 24f1217..cca5715 100644
--- a/test/tint/builtins/gen/literal/frexp/979800.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/979800.wgsl
@@ -25,7 +25,6 @@
 fn frexp_979800() {
   var res = frexp(vec3<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_979800();
diff --git a/test/tint/builtins/gen/literal/frexp/ae4a66.wgsl b/test/tint/builtins/gen/literal/frexp/ae4a66.wgsl
index 774db54..c74dda9 100644
--- a/test/tint/builtins/gen/literal/frexp/ae4a66.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/ae4a66.wgsl
@@ -27,7 +27,6 @@
 fn frexp_ae4a66() {
   var res = frexp(vec3<f16>(1.h));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_ae4a66();
diff --git a/test/tint/builtins/gen/literal/frexp/bee870.wgsl b/test/tint/builtins/gen/literal/frexp/bee870.wgsl
index 62bdbc6..32dc0d9 100644
--- a/test/tint/builtins/gen/literal/frexp/bee870.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/bee870.wgsl
@@ -25,7 +25,6 @@
 fn frexp_bee870() {
   var res = frexp(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_bee870();
diff --git a/test/tint/builtins/gen/literal/frexp/bf45ae.wgsl b/test/tint/builtins/gen/literal/frexp/bf45ae.wgsl
index 87876d6..1d6a093 100644
--- a/test/tint/builtins/gen/literal/frexp/bf45ae.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/bf45ae.wgsl
@@ -25,7 +25,6 @@
 fn frexp_bf45ae() {
   var res = frexp(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_bf45ae();
diff --git a/test/tint/builtins/gen/literal/frexp/eb2421.wgsl b/test/tint/builtins/gen/literal/frexp/eb2421.wgsl
index 2f5b30b..c9fda3a 100644
--- a/test/tint/builtins/gen/literal/frexp/eb2421.wgsl
+++ b/test/tint/builtins/gen/literal/frexp/eb2421.wgsl
@@ -25,7 +25,6 @@
 fn frexp_eb2421() {
   var res = frexp(vec2<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_eb2421();
diff --git a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl
index 3a7ffe1..d3f247c 100644
--- a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl
+++ b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl
@@ -24,7 +24,9 @@
 // fn fwidth(vec<3, f32>) -> vec<3, f32>
 fn fwidth_5d1b39() {
   var res: vec3<f32> = fwidth(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.dxc.hlsl
index f93dd5c..2dd92cc 100644
--- a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_5d1b39() {
   float3 res = fwidth((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.fxc.hlsl
index f93dd5c..2dd92cc 100644
--- a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_5d1b39() {
   float3 res = fwidth((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.glsl
index 197e3fe..c502207 100644
--- a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fwidth_5d1b39() {
   vec3 res = fwidth(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.msl
index 94e9749..1e4ec7e 100644
--- a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidth_5d1b39() {
+void fwidth_5d1b39(device packed_float3* const tint_symbol) {
   float3 res = fwidth(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  fwidth_5d1b39();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  fwidth_5d1b39(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.spvasm
index 65a1aac..a2823c0 100644
--- a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidth_5d1b39 "fwidth_5d1b39"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%fwidth_5d1b39 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpFwidth %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%fwidth_5d1b39 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpFwidth %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidth_5d1b39
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidth_5d1b39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.wgsl
index d85e56e..5570867 100644
--- a/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidth/5d1b39.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidth_5d1b39() {
   var res : vec3<f32> = fwidth(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   fwidth_5d1b39();
diff --git a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl
index a476130..0cbddc4 100644
--- a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl
+++ b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl
@@ -24,7 +24,9 @@
 // fn fwidth(vec<2, f32>) -> vec<2, f32>
 fn fwidth_b83ebb() {
   var res: vec2<f32> = fwidth(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.dxc.hlsl
index 498cad2..9566c8a 100644
--- a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_b83ebb() {
   float2 res = fwidth((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.fxc.hlsl
index 498cad2..9566c8a 100644
--- a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_b83ebb() {
   float2 res = fwidth((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.glsl
index b6d81ce..8f82445 100644
--- a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fwidth_b83ebb() {
   vec2 res = fwidth(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.msl
index ee894eb..485bdd8 100644
--- a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidth_b83ebb() {
+void fwidth_b83ebb(device float2* const tint_symbol) {
   float2 res = fwidth(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidth_b83ebb();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  fwidth_b83ebb(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.spvasm
index 929683f..8546415 100644
--- a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidth_b83ebb "fwidth_b83ebb"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%fwidth_b83ebb = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpFwidth %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%fwidth_b83ebb = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpFwidth %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidth_b83ebb
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidth_b83ebb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.wgsl
index 8e23172..0dcab49 100644
--- a/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidth/b83ebb.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidth_b83ebb() {
   var res : vec2<f32> = fwidth(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   fwidth_b83ebb();
diff --git a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl
index 91c85c7..a03a881 100644
--- a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl
+++ b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl
@@ -24,7 +24,9 @@
 // fn fwidth(vec<4, f32>) -> vec<4, f32>
 fn fwidth_d2ab9a() {
   var res: vec4<f32> = fwidth(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.dxc.hlsl
index 0da0237..df1532f 100644
--- a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_d2ab9a() {
   float4 res = fwidth((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.fxc.hlsl
index 0da0237..df1532f 100644
--- a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_d2ab9a() {
   float4 res = fwidth((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.glsl
index b4f2144..28ae1c3 100644
--- a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fwidth_d2ab9a() {
   vec4 res = fwidth(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.msl
index d2969e1..c6e1a52 100644
--- a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidth_d2ab9a() {
+void fwidth_d2ab9a(device float4* const tint_symbol) {
   float4 res = fwidth(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidth_d2ab9a();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  fwidth_d2ab9a(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.spvasm
index 1f46a28..07954ba 100644
--- a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.spvasm
@@ -1,32 +1,48 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidth_d2ab9a "fwidth_d2ab9a"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%fwidth_d2ab9a = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpFwidth %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%fwidth_d2ab9a = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpFwidth %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidth_d2ab9a
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidth_d2ab9a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.wgsl
index 50d3dd7..d8da19e 100644
--- a/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidth/d2ab9a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidth_d2ab9a() {
   var res : vec4<f32> = fwidth(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   fwidth_d2ab9a();
diff --git a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl
index 3a5861a..8a36fc5 100644
--- a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl
+++ b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl
@@ -24,7 +24,9 @@
 // fn fwidth(f32) -> f32
 fn fwidth_df38ef() {
   var res: f32 = fwidth(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.dxc.hlsl
index 35d42bf..6595b72 100644
--- a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_df38ef() {
   float res = fwidth(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.fxc.hlsl
index 35d42bf..6595b72 100644
--- a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_df38ef() {
   float res = fwidth(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.glsl
index 170e9b2..46ccfa0 100644
--- a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fwidth_df38ef() {
   float res = fwidth(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.msl
index 3af325a..45b6479 100644
--- a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidth_df38ef() {
+void fwidth_df38ef(device float* const tint_symbol) {
   float res = fwidth(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidth_df38ef();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  fwidth_df38ef(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.spvasm
index 977acdf..266c2f9 100644
--- a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.spvasm
@@ -1,30 +1,46 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidth_df38ef "fwidth_df38ef"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%fwidth_df38ef = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpFwidth %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%fwidth_df38ef = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpFwidth %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %fwidth_df38ef
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %fwidth_df38ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.wgsl
index 7d20601..ee12651 100644
--- a/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidth/df38ef.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidth_df38ef() {
   var res : f32 = fwidth(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   fwidth_df38ef();
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl
index a1b5541..7e92c4f 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl
@@ -24,7 +24,9 @@
 // fn fwidthCoarse(f32) -> f32
 fn fwidthCoarse_159c8a() {
   var res: f32 = fwidthCoarse(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.dxc.hlsl
index 1c2d09b..58e7e36 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_159c8a() {
   float res = fwidth(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.fxc.hlsl
index 1c2d09b..58e7e36 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_159c8a() {
   float res = fwidth(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.glsl
index e5d5b6f..dfaddff 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fwidthCoarse_159c8a() {
   float res = fwidth(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.msl
index 31ad6a1..bda79aa 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthCoarse_159c8a() {
+void fwidthCoarse_159c8a(device float* const tint_symbol) {
   float res = fwidth(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthCoarse_159c8a();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  fwidthCoarse_159c8a(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.spvasm
index 9eaa84c..d7f5b05 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.spvasm
@@ -1,31 +1,47 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthCoarse_159c8a "fwidthCoarse_159c8a"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%fwidthCoarse_159c8a = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpFwidthCoarse %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%fwidthCoarse_159c8a = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpFwidthCoarse %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %fwidthCoarse_159c8a
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %fwidthCoarse_159c8a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.wgsl
index 37c5011..69a43c6 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/159c8a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidthCoarse_159c8a() {
   var res : f32 = fwidthCoarse(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   fwidthCoarse_159c8a();
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl
index 027f9b4..968e5c7 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl
@@ -24,7 +24,9 @@
 // fn fwidthCoarse(vec<3, f32>) -> vec<3, f32>
 fn fwidthCoarse_1e59d9() {
   var res: vec3<f32> = fwidthCoarse(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.dxc.hlsl
index 4b73859..0d7881a 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_1e59d9() {
   float3 res = fwidth((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.fxc.hlsl
index 4b73859..0d7881a 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_1e59d9() {
   float3 res = fwidth((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.glsl
index a614e22..0333768 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fwidthCoarse_1e59d9() {
   vec3 res = fwidth(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.msl
index 15a129d..1074418 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthCoarse_1e59d9() {
+void fwidthCoarse_1e59d9(device packed_float3* const tint_symbol) {
   float3 res = fwidth(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  fwidthCoarse_1e59d9();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  fwidthCoarse_1e59d9(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.spvasm
index 5e0ce8f..31111a2 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthCoarse_1e59d9 "fwidthCoarse_1e59d9"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%fwidthCoarse_1e59d9 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpFwidthCoarse %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%fwidthCoarse_1e59d9 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpFwidthCoarse %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidthCoarse_1e59d9
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidthCoarse_1e59d9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.wgsl
index f6c7053..99bfa2d 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/1e59d9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidthCoarse_1e59d9() {
   var res : vec3<f32> = fwidthCoarse(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthCoarse_1e59d9();
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl
index bb61f99..b2971cb 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl
@@ -24,7 +24,9 @@
 // fn fwidthCoarse(vec<4, f32>) -> vec<4, f32>
 fn fwidthCoarse_4e4fc4() {
   var res: vec4<f32> = fwidthCoarse(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.dxc.hlsl
index 7a1a11c..a61991d 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_4e4fc4() {
   float4 res = fwidth((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.fxc.hlsl
index 7a1a11c..a61991d 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_4e4fc4() {
   float4 res = fwidth((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.glsl
index 1243378..8624b26 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fwidthCoarse_4e4fc4() {
   vec4 res = fwidth(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.msl
index 259259d..639d0aa 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthCoarse_4e4fc4() {
+void fwidthCoarse_4e4fc4(device float4* const tint_symbol) {
   float4 res = fwidth(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthCoarse_4e4fc4();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  fwidthCoarse_4e4fc4(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.spvasm
index 36cdd19..a5dcd32 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthCoarse_4e4fc4 "fwidthCoarse_4e4fc4"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%fwidthCoarse_4e4fc4 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpFwidthCoarse %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%fwidthCoarse_4e4fc4 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpFwidthCoarse %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidthCoarse_4e4fc4
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidthCoarse_4e4fc4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
index e401616..1981cb6 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidthCoarse_4e4fc4() {
   var res : vec4<f32> = fwidthCoarse(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthCoarse_4e4fc4();
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl
index 91b88e2..a577088 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl
@@ -24,7 +24,9 @@
 // fn fwidthCoarse(vec<2, f32>) -> vec<2, f32>
 fn fwidthCoarse_e653f7() {
   var res: vec2<f32> = fwidthCoarse(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.dxc.hlsl
index 934ddfa..29aca9c 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_e653f7() {
   float2 res = fwidth((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.fxc.hlsl
index 934ddfa..29aca9c 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_e653f7() {
   float2 res = fwidth((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.glsl
index 8c4eecb..7930d4c 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fwidthCoarse_e653f7() {
   vec2 res = fwidth(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.msl
index 64fcbfd..3d490a5 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthCoarse_e653f7() {
+void fwidthCoarse_e653f7(device float2* const tint_symbol) {
   float2 res = fwidth(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthCoarse_e653f7();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  fwidthCoarse_e653f7(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.spvasm
index dda4c3c..7381922 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthCoarse_e653f7 "fwidthCoarse_e653f7"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%fwidthCoarse_e653f7 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpFwidthCoarse %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%fwidthCoarse_e653f7 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpFwidthCoarse %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidthCoarse_e653f7
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidthCoarse_e653f7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.wgsl
index 31805c9..9d67e17 100644
--- a/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthCoarse/e653f7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidthCoarse_e653f7() {
   var res : vec2<f32> = fwidthCoarse(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthCoarse_e653f7();
diff --git a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl
index 780f8df..1feabb3 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl
@@ -24,7 +24,9 @@
 // fn fwidthFine(vec<3, f32>) -> vec<3, f32>
 fn fwidthFine_523fdc() {
   var res: vec3<f32> = fwidthFine(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.dxc.hlsl
index 88b4f91..d4dc2b7 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_523fdc() {
   float3 res = fwidth((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.fxc.hlsl
index 88b4f91..d4dc2b7 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_523fdc() {
   float3 res = fwidth((1.0f).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.glsl
index b0341a5..bdefc5c 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fwidthFine_523fdc() {
   vec3 res = fwidth(vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.msl
index 578816b..3c1d71c 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthFine_523fdc() {
+void fwidthFine_523fdc(device packed_float3* const tint_symbol) {
   float3 res = fwidth(float3(1.0f));
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  fwidthFine_523fdc();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  fwidthFine_523fdc(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.spvasm
index 7bc84fc..c3e9883 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthFine_523fdc "fwidthFine_523fdc"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %12 = OpConstantNull %v3float
-%fwidthFine_523fdc = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %12
-          %5 = OpFwidthFine %v3float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%fwidthFine_523fdc = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %15
+         %10 = OpFwidthFine %v3float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %20 = OpLoad %v3float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidthFine_523fdc
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidthFine_523fdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.wgsl
index ccccfeb..9f0a663 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/523fdc.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidthFine_523fdc() {
   var res : vec3<f32> = fwidthFine(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthFine_523fdc();
diff --git a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl
index 73cb7e4..2ac7831 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl
@@ -24,7 +24,9 @@
 // fn fwidthFine(vec<4, f32>) -> vec<4, f32>
 fn fwidthFine_68f4ef() {
   var res: vec4<f32> = fwidthFine(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.dxc.hlsl
index a6ba6fa..947222f 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_68f4ef() {
   float4 res = fwidth((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.fxc.hlsl
index a6ba6fa..947222f 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_68f4ef() {
   float4 res = fwidth((1.0f).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.glsl
index bb48166..381a64c 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fwidthFine_68f4ef() {
   vec4 res = fwidth(vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.msl
index 9a32402..3c2bf35 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthFine_68f4ef() {
+void fwidthFine_68f4ef(device float4* const tint_symbol) {
   float4 res = fwidth(float4(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthFine_68f4ef();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  fwidthFine_68f4ef(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.spvasm
index 2e87a7c..c939e8f 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthFine_68f4ef "fwidthFine_68f4ef"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %12 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %12 = OpConstantNull %v4float
-%fwidthFine_68f4ef = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %12
-          %5 = OpFwidthFine %v4float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%fwidthFine_68f4ef = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %15
+         %10 = OpFwidthFine %v4float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %20 = OpLoad %v4float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidthFine_68f4ef
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidthFine_68f4ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.wgsl
index 4914826..da8d4b5 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/68f4ef.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidthFine_68f4ef() {
   var res : vec4<f32> = fwidthFine(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthFine_68f4ef();
diff --git a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl
index a562717..3886590 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl
@@ -24,7 +24,9 @@
 // fn fwidthFine(f32) -> f32
 fn fwidthFine_f1742d() {
   var res: f32 = fwidthFine(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.dxc.hlsl
index ca2184f..ec70a68 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_f1742d() {
   float res = fwidth(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.fxc.hlsl
index ca2184f..ec70a68 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_f1742d() {
   float res = fwidth(1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.glsl
index 51d0730..58eeb03 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fwidthFine_f1742d() {
   float res = fwidth(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.msl
index 33102d3..4a2e078 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthFine_f1742d() {
+void fwidthFine_f1742d(device float* const tint_symbol) {
   float res = fwidth(1.0f);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthFine_f1742d();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  fwidthFine_f1742d(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.spvasm
index 801d9d7..67ecc4e 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.spvasm
@@ -1,31 +1,47 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 14
+; Bound: 22
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthFine_f1742d "fwidthFine_f1742d"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %10 = OpConstantNull %float
-%fwidthFine_f1742d = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %10
-          %5 = OpFwidthFine %float %float_1
-               OpStore %res %5
+         %13 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%fwidthFine_f1742d = OpFunction %void None %5
+          %8 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %13
+          %9 = OpFwidthFine %float %float_1
+               OpStore %res %9
+         %17 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %18 = OpLoad %float %res
+               OpStore %17 %18
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %12 = OpLabel
-         %13 = OpFunctionCall %void %fwidthFine_f1742d
+%fragment_main = OpFunction %void None %5
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %fwidthFine_f1742d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.wgsl
index 0f0f6eb..4f258b0 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/f1742d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidthFine_f1742d() {
   var res : f32 = fwidthFine(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   fwidthFine_f1742d();
diff --git a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl
index d1c8eb9..7507781 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl
@@ -24,7 +24,9 @@
 // fn fwidthFine(vec<2, f32>) -> vec<2, f32>
 fn fwidthFine_ff6aa0() {
   var res: vec2<f32> = fwidthFine(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.dxc.hlsl
index ec674cc..b9e2d02 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_ff6aa0() {
   float2 res = fwidth((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.fxc.hlsl
index ec674cc..b9e2d02 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_ff6aa0() {
   float2 res = fwidth((1.0f).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.glsl
index 95868ae..edff893 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fwidthFine_ff6aa0() {
   vec2 res = fwidth(vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.msl b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.msl
index ea88962..c054945 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthFine_ff6aa0() {
+void fwidthFine_ff6aa0(device float2* const tint_symbol) {
   float2 res = fwidth(float2(1.0f));
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthFine_ff6aa0();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  fwidthFine_ff6aa0(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.spvasm
index 7e79325..40187f0 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.spvasm
@@ -1,33 +1,49 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthFine_ff6aa0 "fwidthFine_ff6aa0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %9 = OpConstantComposite %v2float %float_1 %float_1
+         %12 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %12 = OpConstantNull %v2float
-%fwidthFine_ff6aa0 = OpFunction %void None %1
-          %4 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %12
-          %5 = OpFwidthFine %v2float %9
-               OpStore %res %5
+         %15 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%fwidthFine_ff6aa0 = OpFunction %void None %6
+          %9 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %15
+         %10 = OpFwidthFine %v2float %12
+               OpStore %res %10
+         %19 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %20 = OpLoad %v2float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidthFine_ff6aa0
+%fragment_main = OpFunction %void None %6
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidthFine_ff6aa0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.wgsl
index 69a64643..de1dae7 100644
--- a/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/fwidthFine/ff6aa0.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn fwidthFine_ff6aa0() {
   var res : vec2<f32> = fwidthFine(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthFine_ff6aa0();
diff --git a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl
index 185b481..dc0c9f7 100644
--- a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl
@@ -24,7 +24,9 @@
 // fn insertBits(vec<2, u32>, vec<2, u32>, u32, u32) -> vec<2, u32>
 fn insertBits_3c7ba5() {
   var res: vec2<u32> = insertBits(vec2<u32>(1u), vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.dxc.hlsl
index afc5773..8015a16 100644
--- a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_3c7ba5() {
   uint2 res = (3u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.fxc.hlsl
index afc5773..8015a16 100644
--- a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_3c7ba5() {
   uint2 res = (3u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.glsl
index f664ffc..67b51a6 100644
--- a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void insertBits_3c7ba5() {
   uvec2 res = uvec2(3u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void insertBits_3c7ba5() {
   uvec2 res = uvec2(3u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void insertBits_3c7ba5() {
   uvec2 res = uvec2(3u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.msl b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.msl
index a412b68..283e839 100644
--- a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void insertBits_3c7ba5() {
+void insertBits_3c7ba5(device uint2* const tint_symbol_1) {
   uint2 res = uint2(3u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_3c7ba5();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  insertBits_3c7ba5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_3c7ba5();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_3c7ba5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_3c7ba5();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_3c7ba5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.spvasm
index cef27ea..a8c140a 100644
--- a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %insertBits_3c7ba5 "insertBits_3c7ba5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_3 = OpConstant %uint 3
-         %16 = OpConstantComposite %v2uint %uint_3 %uint_3
+         %19 = OpConstantComposite %v2uint %uint_3 %uint_3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%insertBits_3c7ba5 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+%insertBits_3c7ba5 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %insertBits_3c7ba5
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %insertBits_3c7ba5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %insertBits_3c7ba5
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %insertBits_3c7ba5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %insertBits_3c7ba5
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %insertBits_3c7ba5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.wgsl
index 0d296c6..5541c4e 100644
--- a/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/3c7ba5.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn insertBits_3c7ba5() {
   var res : vec2<u32> = insertBits(vec2<u32>(1u), vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_3c7ba5();
diff --git a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl
index 75bee4f..63aee05 100644
--- a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl
@@ -24,7 +24,9 @@
 // fn insertBits(vec<3, i32>, vec<3, i32>, u32, u32) -> vec<3, i32>
 fn insertBits_428b0b() {
   var res: vec3<i32> = insertBits(vec3<i32>(1i), vec3<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.dxc.hlsl
index 04df023..1834c40 100644
--- a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_428b0b() {
   int3 res = (3).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.fxc.hlsl
index 04df023..1834c40 100644
--- a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_428b0b() {
   int3 res = (3).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.glsl
index 67a44a2..9d718ff 100644
--- a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void insertBits_428b0b() {
   ivec3 res = ivec3(3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void insertBits_428b0b() {
   ivec3 res = ivec3(3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void insertBits_428b0b() {
   ivec3 res = ivec3(3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.msl b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.msl
index 8774770..97f5b24 100644
--- a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void insertBits_428b0b() {
+void insertBits_428b0b(device packed_int3* const tint_symbol_1) {
   int3 res = int3(3);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_428b0b();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  insertBits_428b0b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_428b0b();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_428b0b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_428b0b();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_428b0b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.spvasm
index 4aa5619..f399b3e 100644
--- a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %insertBits_428b0b "insertBits_428b0b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_3 = OpConstant %int 3
-         %16 = OpConstantComposite %v3int %int_3 %int_3 %int_3
+         %19 = OpConstantComposite %v3int %int_3 %int_3 %int_3
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%insertBits_428b0b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+%insertBits_428b0b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %insertBits_428b0b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %insertBits_428b0b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %insertBits_428b0b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %insertBits_428b0b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %insertBits_428b0b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %insertBits_428b0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.wgsl
index cbf84f0..50091d5 100644
--- a/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/428b0b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn insertBits_428b0b() {
   var res : vec3<i32> = insertBits(vec3<i32>(1i), vec3<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_428b0b();
diff --git a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl
index 1a518a0..6313305 100644
--- a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl
@@ -24,7 +24,9 @@
 // fn insertBits(vec<4, u32>, vec<4, u32>, u32, u32) -> vec<4, u32>
 fn insertBits_51ede1() {
   var res: vec4<u32> = insertBits(vec4<u32>(1u), vec4<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.dxc.hlsl
index 3e2e173..430d374 100644
--- a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_51ede1() {
   uint4 res = (3u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.fxc.hlsl
index 3e2e173..430d374 100644
--- a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_51ede1() {
   uint4 res = (3u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.glsl
index 9d67c29..665669f 100644
--- a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void insertBits_51ede1() {
   uvec4 res = uvec4(3u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void insertBits_51ede1() {
   uvec4 res = uvec4(3u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void insertBits_51ede1() {
   uvec4 res = uvec4(3u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.msl b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.msl
index 7f0158c..13d6cdd 100644
--- a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void insertBits_51ede1() {
+void insertBits_51ede1(device uint4* const tint_symbol_1) {
   uint4 res = uint4(3u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_51ede1();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  insertBits_51ede1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_51ede1();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_51ede1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_51ede1();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_51ede1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.spvasm
index 37a228e..f94f6a5 100644
--- a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %insertBits_51ede1 "insertBits_51ede1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_3 = OpConstant %uint 3
-         %16 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
+         %19 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%insertBits_51ede1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+%insertBits_51ede1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %insertBits_51ede1
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %insertBits_51ede1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %insertBits_51ede1
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %insertBits_51ede1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %insertBits_51ede1
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %insertBits_51ede1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.wgsl
index facb770..4447f76 100644
--- a/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/51ede1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn insertBits_51ede1() {
   var res : vec4<u32> = insertBits(vec4<u32>(1u), vec4<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_51ede1();
diff --git a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl
index d97a365..ffd0303 100644
--- a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl
@@ -24,7 +24,9 @@
 // fn insertBits(i32, i32, u32, u32) -> i32
 fn insertBits_65468b() {
   var res: i32 = insertBits(1i, 1i, 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.dxc.hlsl
index 9482530..91b127b 100644
--- a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_65468b() {
   int res = 3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.fxc.hlsl
index 9482530..91b127b 100644
--- a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_65468b() {
   int res = 3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.glsl
index 3d7ce5c..bc06255 100644
--- a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void insertBits_65468b() {
   int res = 3;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void insertBits_65468b() {
   int res = 3;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void insertBits_65468b() {
   int res = 3;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.msl b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.msl
index 959af5c..521c5b7 100644
--- a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void insertBits_65468b() {
+void insertBits_65468b(device int* const tint_symbol_1) {
   int res = 3;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_65468b();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  insertBits_65468b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_65468b();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_65468b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_65468b();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_65468b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.spvasm
index e51f4a2..515cf3b 100644
--- a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %insertBits_65468b "insertBits_65468b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_3 = OpConstant %int 3
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%insertBits_65468b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+%insertBits_65468b = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_3
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %insertBits_65468b
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %insertBits_65468b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %insertBits_65468b
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %insertBits_65468b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %insertBits_65468b
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %insertBits_65468b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.wgsl
index ae4e3b2..e486103 100644
--- a/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/65468b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn insertBits_65468b() {
   var res : i32 = insertBits(1i, 1i, 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_65468b();
diff --git a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl
index b3b8115..e8aadb1 100644
--- a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl
@@ -24,7 +24,9 @@
 // fn insertBits(vec<3, u32>, vec<3, u32>, u32, u32) -> vec<3, u32>
 fn insertBits_87826b() {
   var res: vec3<u32> = insertBits(vec3<u32>(1u), vec3<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.dxc.hlsl
index 1c1f0ca..b2de8a1 100644
--- a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_87826b() {
   uint3 res = (3u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.fxc.hlsl
index 1c1f0ca..b2de8a1 100644
--- a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_87826b() {
   uint3 res = (3u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.glsl
index 12710a5..91fb139 100644
--- a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void insertBits_87826b() {
   uvec3 res = uvec3(3u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void insertBits_87826b() {
   uvec3 res = uvec3(3u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void insertBits_87826b() {
   uvec3 res = uvec3(3u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.msl b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.msl
index 776b271..71fc47fdb 100644
--- a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void insertBits_87826b() {
+void insertBits_87826b(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(3u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_87826b();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  insertBits_87826b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_87826b();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_87826b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_87826b();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_87826b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.spvasm
index 76b42f1..af304f7 100644
--- a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %insertBits_87826b "insertBits_87826b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_3 = OpConstant %uint 3
-         %16 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
+         %19 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%insertBits_87826b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+%insertBits_87826b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %insertBits_87826b
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %insertBits_87826b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %insertBits_87826b
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %insertBits_87826b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %insertBits_87826b
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %insertBits_87826b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.wgsl
index 2c88061..b576844 100644
--- a/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/87826b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn insertBits_87826b() {
   var res : vec3<u32> = insertBits(vec3<u32>(1u), vec3<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_87826b();
diff --git a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl
index ca1e799..9442ad0 100644
--- a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl
@@ -24,7 +24,9 @@
 // fn insertBits(vec<4, i32>, vec<4, i32>, u32, u32) -> vec<4, i32>
 fn insertBits_d86978() {
   var res: vec4<i32> = insertBits(vec4<i32>(1i), vec4<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.dxc.hlsl
index 106b71a..e6682ae 100644
--- a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_d86978() {
   int4 res = (3).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.fxc.hlsl
index 106b71a..e6682ae 100644
--- a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_d86978() {
   int4 res = (3).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.glsl b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.glsl
index 53b7d9e..769d196 100644
--- a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void insertBits_d86978() {
   ivec4 res = ivec4(3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void insertBits_d86978() {
   ivec4 res = ivec4(3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void insertBits_d86978() {
   ivec4 res = ivec4(3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.msl b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.msl
index 7e4d1bd..0579ffb 100644
--- a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void insertBits_d86978() {
+void insertBits_d86978(device int4* const tint_symbol_1) {
   int4 res = int4(3);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_d86978();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  insertBits_d86978(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_d86978();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_d86978(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_d86978();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_d86978(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.spvasm
index bdf19b8..fd24b1a 100644
--- a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %insertBits_d86978 "insertBits_d86978"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_3 = OpConstant %int 3
-         %16 = OpConstantComposite %v4int %int_3 %int_3 %int_3 %int_3
+         %19 = OpConstantComposite %v4int %int_3 %int_3 %int_3 %int_3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%insertBits_d86978 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+%insertBits_d86978 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %insertBits_d86978
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %insertBits_d86978
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %insertBits_d86978
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %insertBits_d86978
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %insertBits_d86978
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %insertBits_d86978
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.wgsl
index baa7afb..bfd3ac0 100644
--- a/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/d86978.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn insertBits_d86978() {
   var res : vec4<i32> = insertBits(vec4<i32>(1i), vec4<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_d86978();
diff --git a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl
index 08349de..a31f20c 100644
--- a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl
@@ -24,7 +24,9 @@
 // fn insertBits(u32, u32, u32, u32) -> u32
 fn insertBits_e3e3a2() {
   var res: u32 = insertBits(1u, 1u, 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.dxc.hlsl
index a5f4bf4..69d3f2e 100644
--- a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_e3e3a2() {
   uint res = 3u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.fxc.hlsl
index a5f4bf4..69d3f2e 100644
--- a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_e3e3a2() {
   uint res = 3u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.glsl
index 4b430e6..dd7687e 100644
--- a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void insertBits_e3e3a2() {
   uint res = 3u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void insertBits_e3e3a2() {
   uint res = 3u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void insertBits_e3e3a2() {
   uint res = 3u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.msl b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.msl
index e4b988c..eb7d2e6 100644
--- a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void insertBits_e3e3a2() {
+void insertBits_e3e3a2(device uint* const tint_symbol_1) {
   uint res = 3u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_e3e3a2();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  insertBits_e3e3a2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_e3e3a2();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_e3e3a2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_e3e3a2();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_e3e3a2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.spvasm
index e347759..0df5f21 100644
--- a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %insertBits_e3e3a2 "insertBits_e3e3a2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_3 = OpConstant %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%insertBits_e3e3a2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%insertBits_e3e3a2 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_3
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %insertBits_e3e3a2
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %insertBits_e3e3a2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %insertBits_e3e3a2
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %insertBits_e3e3a2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %insertBits_e3e3a2
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %insertBits_e3e3a2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.wgsl
index 8ea1692..40d00a3 100644
--- a/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/e3e3a2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn insertBits_e3e3a2() {
   var res : u32 = insertBits(1u, 1u, 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_e3e3a2();
diff --git a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl
index f47083e..52c4d7f 100644
--- a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl
@@ -24,7 +24,9 @@
 // fn insertBits(vec<2, i32>, vec<2, i32>, u32, u32) -> vec<2, i32>
 fn insertBits_fe6ba6() {
   var res: vec2<i32> = insertBits(vec2<i32>(1i), vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.dxc.hlsl
index 7e1fa26..702384b 100644
--- a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_fe6ba6() {
   int2 res = (3).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.fxc.hlsl
index 7e1fa26..702384b 100644
--- a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_fe6ba6() {
   int2 res = (3).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.glsl
index 1a48f38..ae9ce94 100644
--- a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void insertBits_fe6ba6() {
   ivec2 res = ivec2(3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void insertBits_fe6ba6() {
   ivec2 res = ivec2(3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void insertBits_fe6ba6() {
   ivec2 res = ivec2(3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.msl b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.msl
index 9198fa1..936b934 100644
--- a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void insertBits_fe6ba6() {
+void insertBits_fe6ba6(device int2* const tint_symbol_1) {
   int2 res = int2(3);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_fe6ba6();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  insertBits_fe6ba6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_fe6ba6();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_fe6ba6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_fe6ba6();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_fe6ba6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.spvasm
index 1b4a987..fb50f89 100644
--- a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %insertBits_fe6ba6 "insertBits_fe6ba6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_3 = OpConstant %int 3
-         %16 = OpConstantComposite %v2int %int_3 %int_3
+         %19 = OpConstantComposite %v2int %int_3 %int_3
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%insertBits_fe6ba6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+%insertBits_fe6ba6 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %insertBits_fe6ba6
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %insertBits_fe6ba6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %insertBits_fe6ba6
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %insertBits_fe6ba6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %insertBits_fe6ba6
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %insertBits_fe6ba6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.wgsl
index 521866b..2616e36 100644
--- a/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/insertBits/fe6ba6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn insertBits_fe6ba6() {
   var res : vec2<i32> = insertBits(vec2<i32>(1i), vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_fe6ba6();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl
index 6cea8be..e2cf7b7 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl
@@ -25,7 +25,6 @@
 fn inverseSqrt_07a6fe() {
   var res = inverseSqrt(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_07a6fe();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl
index afe3a8b..390a275 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl
@@ -26,7 +26,9 @@
 // fn inverseSqrt(f16) -> f16
 fn inverseSqrt_440300() {
   var res: f16 = inverseSqrt(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.dxc.hlsl
index ea9d0d1..48d83d0 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_440300() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.fxc.hlsl
index 461b3d2..51f0585 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_440300() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.glsl
index 6c6c2d9..1f6a5ff 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void inverseSqrt_440300() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void inverseSqrt_440300() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void inverseSqrt_440300() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.msl
index 7f4e0ad..95517d7 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_440300() {
+void inverseSqrt_440300(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_440300();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  inverseSqrt_440300(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_440300();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_440300(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_440300();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_440300(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.spvasm
index fa3bb0e..f5664a7 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_440300 "inverseSqrt_440300"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%inverseSqrt_440300 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%inverseSqrt_440300 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %inverseSqrt_440300
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %inverseSqrt_440300
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %inverseSqrt_440300
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %inverseSqrt_440300
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %inverseSqrt_440300
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %inverseSqrt_440300
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.wgsl
index 239d135..7bec97d 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn inverseSqrt_440300() {
   var res : f16 = inverseSqrt(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_440300();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl
index a795517..c97cb1e 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl
@@ -25,7 +25,6 @@
 fn inverseSqrt_4ca6d6() {
   var res = inverseSqrt(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_4ca6d6();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl
index 453596b..30161d0 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl
@@ -26,7 +26,9 @@
 // fn inverseSqrt(vec<2, f16>) -> vec<2, f16>
 fn inverseSqrt_5f51f8() {
   var res: vec2<f16> = inverseSqrt(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
index 9604298..1df7c82 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_5f51f8() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.fxc.hlsl
index d4de415..fb74170 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_5f51f8() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.glsl
index 16ffe9d..be6a1d7 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_5f51f8() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_5f51f8() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_5f51f8() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.msl
index 938bf4b..aaf7abc 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_5f51f8() {
+void inverseSqrt_5f51f8(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_5f51f8();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  inverseSqrt_5f51f8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_5f51f8();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_5f51f8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_5f51f8();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_5f51f8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.spvasm
index 2cf9ebd..7c1a13c 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_5f51f8 "inverseSqrt_5f51f8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%inverseSqrt_5f51f8 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%inverseSqrt_5f51f8 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %inverseSqrt_5f51f8
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_5f51f8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %inverseSqrt_5f51f8
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %inverseSqrt_5f51f8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %inverseSqrt_5f51f8
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %inverseSqrt_5f51f8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.wgsl
index 6db63ba..31d805f 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn inverseSqrt_5f51f8() {
   var res : vec2<f16> = inverseSqrt(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_5f51f8();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl
index 3fc562b..89ea4aa 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl
@@ -25,7 +25,6 @@
 fn inverseSqrt_6d0783() {
   var res = inverseSqrt(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_6d0783();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl
index 8d819ef..68669b4 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl
@@ -24,7 +24,9 @@
 // fn inverseSqrt(f32) -> f32
 fn inverseSqrt_84407e() {
   var res: f32 = inverseSqrt(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
index 51f00ab..d434973 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_84407e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
index 51f00ab..d434973 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_84407e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.glsl
index c916c26..d5fa2e6 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void inverseSqrt_84407e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void inverseSqrt_84407e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void inverseSqrt_84407e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.msl
index ba05bad..3e0dbb0 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_84407e() {
+void inverseSqrt_84407e(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_84407e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  inverseSqrt_84407e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_84407e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_84407e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_84407e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_84407e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.spvasm
index fb86daa..ded3424 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_84407e "inverseSqrt_84407e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%inverseSqrt_84407e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%inverseSqrt_84407e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %inverseSqrt_84407e
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %inverseSqrt_84407e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %inverseSqrt_84407e
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %inverseSqrt_84407e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %inverseSqrt_84407e
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %inverseSqrt_84407e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.wgsl
index 1afdfc4..b544343 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn inverseSqrt_84407e() {
   var res : f32 = inverseSqrt(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_84407e();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl
index 24b8f51..6c1330b 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl
@@ -24,7 +24,9 @@
 // fn inverseSqrt(vec<2, f32>) -> vec<2, f32>
 fn inverseSqrt_8f2bd2() {
   var res: vec2<f32> = inverseSqrt(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
index 9dec115..469e611 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_8f2bd2() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
index 9dec115..469e611 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_8f2bd2() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.glsl
index 07b6be3..96b7328 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_8f2bd2() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_8f2bd2() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_8f2bd2() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.msl
index 13e1fcd..0cb05d6 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_8f2bd2() {
+void inverseSqrt_8f2bd2(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_8f2bd2();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  inverseSqrt_8f2bd2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_8f2bd2();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_8f2bd2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_8f2bd2();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_8f2bd2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.spvasm
index 7dbff4a..2e86c3c 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_8f2bd2 "inverseSqrt_8f2bd2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%inverseSqrt_8f2bd2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%inverseSqrt_8f2bd2 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %inverseSqrt_8f2bd2
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %inverseSqrt_8f2bd2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %inverseSqrt_8f2bd2
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %inverseSqrt_8f2bd2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %inverseSqrt_8f2bd2
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %inverseSqrt_8f2bd2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.wgsl
index 1fe7a7c..1011b15 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn inverseSqrt_8f2bd2() {
   var res : vec2<f32> = inverseSqrt(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_8f2bd2();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl
index c1144e4..4448be4 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl
@@ -24,7 +24,9 @@
 // fn inverseSqrt(vec<3, f32>) -> vec<3, f32>
 fn inverseSqrt_b197b1() {
   var res: vec3<f32> = inverseSqrt(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
index 037015c..b7c6858 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_b197b1() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
index 037015c..b7c6858 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_b197b1() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.glsl
index 51e05ed..d7f050c 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b197b1() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b197b1() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b197b1() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.msl
index d2a6c8d..2ce7d52 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_b197b1() {
+void inverseSqrt_b197b1(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_b197b1();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  inverseSqrt_b197b1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_b197b1();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_b197b1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_b197b1();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_b197b1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.spvasm
index 25e90d3..9592311 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_b197b1 "inverseSqrt_b197b1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%inverseSqrt_b197b1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%inverseSqrt_b197b1 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %inverseSqrt_b197b1
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %inverseSqrt_b197b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %inverseSqrt_b197b1
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %inverseSqrt_b197b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %inverseSqrt_b197b1
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %inverseSqrt_b197b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.wgsl
index f8920cd..6eafa3b 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn inverseSqrt_b197b1() {
   var res : vec3<f32> = inverseSqrt(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_b197b1();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl
index da9f44f..ce89b2e 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl
@@ -26,7 +26,9 @@
 // fn inverseSqrt(vec<3, f16>) -> vec<3, f16>
 fn inverseSqrt_b85ebd() {
   var res: vec3<f16> = inverseSqrt(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
index 9eca601..f1a1416 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_b85ebd() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.fxc.hlsl
index 06b6b5d..efbd3e4 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_b85ebd() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.glsl
index b9ea92f..1e25a81 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b85ebd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b85ebd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b85ebd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.msl
index 3c62a0f..cf98309 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_b85ebd() {
+void inverseSqrt_b85ebd(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_b85ebd();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  inverseSqrt_b85ebd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_b85ebd();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_b85ebd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_b85ebd();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_b85ebd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.spvasm
index a8f788b..48371c0 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_b85ebd "inverseSqrt_b85ebd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%inverseSqrt_b85ebd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%inverseSqrt_b85ebd = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %inverseSqrt_b85ebd
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_b85ebd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %inverseSqrt_b85ebd
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %inverseSqrt_b85ebd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %inverseSqrt_b85ebd
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %inverseSqrt_b85ebd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.wgsl
index 8345b10..65ec18d 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn inverseSqrt_b85ebd() {
   var res : vec3<f16> = inverseSqrt(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_b85ebd();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl
index 368317b..559c858 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl
@@ -24,7 +24,9 @@
 // fn inverseSqrt(vec<4, f32>) -> vec<4, f32>
 fn inverseSqrt_c22347() {
   var res: vec4<f32> = inverseSqrt(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
index 44658f1..4a060f1 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_c22347() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
index 44658f1..4a060f1 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_c22347() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.glsl
index da480d2..fce68e3 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_c22347() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_c22347() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_c22347() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.msl
index ac90098..09ee559 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_c22347() {
+void inverseSqrt_c22347(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_c22347();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  inverseSqrt_c22347(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_c22347();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_c22347(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_c22347();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_c22347(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.spvasm
index b3194e7..5703481 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_c22347 "inverseSqrt_c22347"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%inverseSqrt_c22347 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%inverseSqrt_c22347 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %inverseSqrt_c22347
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_c22347
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %inverseSqrt_c22347
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %inverseSqrt_c22347
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %inverseSqrt_c22347
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %inverseSqrt_c22347
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.wgsl
index cbcfd78..5bb583c 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn inverseSqrt_c22347() {
   var res : vec4<f32> = inverseSqrt(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_c22347();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl
index 3763326..465f2ec 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl
@@ -26,7 +26,9 @@
 // fn inverseSqrt(vec<4, f16>) -> vec<4, f16>
 fn inverseSqrt_cbdc70() {
   var res: vec4<f16> = inverseSqrt(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
index 1eee4b3..bbbd424 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_cbdc70() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.fxc.hlsl
index 4a576d8..a8d1b42 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_cbdc70() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.glsl
index b96052a..a648762 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_cbdc70() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_cbdc70() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_cbdc70() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.msl
index 896e7f6..a66c194 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_cbdc70() {
+void inverseSqrt_cbdc70(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_cbdc70();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  inverseSqrt_cbdc70(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_cbdc70();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_cbdc70(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_cbdc70();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_cbdc70(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.spvasm
index 369740c..9544e3f 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_cbdc70 "inverseSqrt_cbdc70"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%inverseSqrt_cbdc70 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%inverseSqrt_cbdc70 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %inverseSqrt_cbdc70
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_cbdc70
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %inverseSqrt_cbdc70
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %inverseSqrt_cbdc70
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %inverseSqrt_cbdc70
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %inverseSqrt_cbdc70
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.wgsl
index 8ef3f09..26b1e8d 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn inverseSqrt_cbdc70() {
   var res : vec4<f16> = inverseSqrt(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_cbdc70();
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl
index 21275a2..4331881 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl
@@ -25,7 +25,6 @@
 fn inverseSqrt_f60c1c() {
   var res = inverseSqrt(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_f60c1c();
diff --git a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl
index 1c5e386..57629cc 100644
--- a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl
@@ -26,7 +26,9 @@
 // fn ldexp(f16, ia) -> f16
 fn ldexp_082c1f() {
   var res: f16 = ldexp(1.h, 1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.dxc.hlsl
index 21753fd..3fe8d98 100644
--- a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_082c1f() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.fxc.hlsl
index e749e36..78c4263 100644
--- a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_082c1f() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.glsl
index b0f4401..b722aea 100644
--- a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_082c1f() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_082c1f() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_082c1f() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.msl
index eca9a85..6e12587 100644
--- a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_082c1f() {
+void ldexp_082c1f(device half* const tint_symbol_1) {
   half res = 2.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_082c1f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  ldexp_082c1f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_082c1f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_082c1f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_082c1f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_082c1f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.spvasm
index 9da2f38..5fd6946 100644
--- a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_082c1f "ldexp_082c1f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_082c1f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%ldexp_082c1f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %ldexp_082c1f
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %ldexp_082c1f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %ldexp_082c1f
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %ldexp_082c1f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ldexp_082c1f
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ldexp_082c1f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.wgsl
index d1cc9fb..0e3e8af 100644
--- a/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/082c1f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ldexp_082c1f() {
   var res : f16 = ldexp(1.0h, 1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_082c1f();
diff --git a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl
index 06890c6..f2252e8 100644
--- a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl
@@ -26,7 +26,9 @@
 // fn ldexp(vec<2, f16>, vec<2, ia>) -> vec<2, f16>
 fn ldexp_217a31() {
   var res: vec2<f16> = ldexp(vec2<f16>(1.h), vec2(1));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.dxc.hlsl
index 8909c44..65f47ae 100644
--- a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_217a31() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.fxc.hlsl
index 9162ec6..9b131f2 100644
--- a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_217a31() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.glsl
index 774e529..d9c5cba 100644
--- a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_217a31() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_217a31() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_217a31() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.msl
index 11399f1..fd08bc0 100644
--- a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_217a31() {
+void ldexp_217a31(device half2* const tint_symbol_1) {
   half2 res = half2(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_217a31();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  ldexp_217a31(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_217a31();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_217a31(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_217a31();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_217a31(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.spvasm
index cf4aff8..f9f0c3d 100644
--- a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_217a31 "ldexp_217a31"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_217a31 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%ldexp_217a31 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ldexp_217a31
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ldexp_217a31
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_217a31
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_217a31
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ldexp_217a31
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ldexp_217a31
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.wgsl
index bdeebb0..1c25d42 100644
--- a/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/217a31.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ldexp_217a31() {
   var res : vec2<f16> = ldexp(vec2<f16>(1.0h), vec2(1));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_217a31();
diff --git a/test/tint/builtins/gen/literal/ldexp/2bfc68.wgsl b/test/tint/builtins/gen/literal/ldexp/2bfc68.wgsl
index fe9f9a6..1fa80e2 100644
--- a/test/tint/builtins/gen/literal/ldexp/2bfc68.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/2bfc68.wgsl
@@ -25,7 +25,6 @@
 fn ldexp_2bfc68() {
   var res = ldexp(vec2(1.), vec2<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_2bfc68();
diff --git a/test/tint/builtins/gen/literal/ldexp/2c6370.wgsl b/test/tint/builtins/gen/literal/ldexp/2c6370.wgsl
index c42490f..7a701bc 100644
--- a/test/tint/builtins/gen/literal/ldexp/2c6370.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/2c6370.wgsl
@@ -25,7 +25,6 @@
 fn ldexp_2c6370() {
   var res = ldexp(vec2(1.), vec2(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_2c6370();
diff --git a/test/tint/builtins/gen/literal/ldexp/376938.wgsl b/test/tint/builtins/gen/literal/ldexp/376938.wgsl
index 3cfa91b..3e4bb76 100644
--- a/test/tint/builtins/gen/literal/ldexp/376938.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/376938.wgsl
@@ -25,7 +25,6 @@
 fn ldexp_376938() {
   var res = ldexp(vec4(1.), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_376938();
diff --git a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl
index c5c06c3..4a60ae7 100644
--- a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl
@@ -26,7 +26,9 @@
 // fn ldexp(vec<2, f16>, vec<2, i32>) -> vec<2, f16>
 fn ldexp_3d90b4() {
   var res: vec2<f16> = ldexp(vec2<f16>(1.h), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.dxc.hlsl
index 69b9724..2cec3b0 100644
--- a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_3d90b4() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.fxc.hlsl
index 5ad70e2..a645898 100644
--- a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_3d90b4() {
   vector<float16_t, 2> res = (float16_t(2.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.glsl
index 0c83237..b615aa8 100644
--- a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_3d90b4() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_3d90b4() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_3d90b4() {
   f16vec2 res = f16vec2(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.msl
index 02e836c..ca24cc7 100644
--- a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_3d90b4() {
+void ldexp_3d90b4(device half2* const tint_symbol_1) {
   half2 res = half2(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_3d90b4();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  ldexp_3d90b4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_3d90b4();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_3d90b4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_3d90b4();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_3d90b4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.spvasm
index 14b8d00..af74496 100644
--- a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_3d90b4 "ldexp_3d90b4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_3d90b4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%ldexp_3d90b4 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ldexp_3d90b4
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ldexp_3d90b4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_3d90b4
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_3d90b4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ldexp_3d90b4
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ldexp_3d90b4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.wgsl
index 5c65862..fe2b21f 100644
--- a/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/3d90b4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ldexp_3d90b4() {
   var res : vec2<f16> = ldexp(vec2<f16>(1.0h), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_3d90b4();
diff --git a/test/tint/builtins/gen/literal/ldexp/4a3ad9.wgsl b/test/tint/builtins/gen/literal/ldexp/4a3ad9.wgsl
index f28017c..ea674be 100644
--- a/test/tint/builtins/gen/literal/ldexp/4a3ad9.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/4a3ad9.wgsl
@@ -25,7 +25,6 @@
 fn ldexp_4a3ad9() {
   var res = ldexp(vec3(1.), vec3(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_4a3ad9();
diff --git a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl
index 280871f..e513d85 100644
--- a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl
@@ -24,7 +24,9 @@
 // fn ldexp(vec<3, f32>, vec<3, ia>) -> vec<3, f32>
 fn ldexp_593ff3() {
   var res: vec3<f32> = ldexp(vec3<f32>(1.f), vec3(1));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.dxc.hlsl
index 9bb2916..2b8e616 100644
--- a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_593ff3() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.fxc.hlsl
index 9bb2916..2b8e616 100644
--- a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_593ff3() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.glsl
index a35a95b..54bc72b 100644
--- a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_593ff3() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_593ff3() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_593ff3() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.msl
index 2746bb7..80ee529 100644
--- a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_593ff3() {
+void ldexp_593ff3(device packed_float3* const tint_symbol_1) {
   float3 res = float3(2.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_593ff3();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  ldexp_593ff3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_593ff3();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_593ff3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_593ff3();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_593ff3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.spvasm
index 6a465d8..bbf1184 100644
--- a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_593ff3 "ldexp_593ff3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+         %18 = OpConstantComposite %v3float %float_2 %float_2 %float_2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_593ff3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%ldexp_593ff3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %ldexp_593ff3
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %ldexp_593ff3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ldexp_593ff3
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ldexp_593ff3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %ldexp_593ff3
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %ldexp_593ff3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.wgsl
index 846a389..3b2c833 100644
--- a/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/593ff3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ldexp_593ff3() {
   var res : vec3<f32> = ldexp(vec3<f32>(1.0f), vec3(1));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_593ff3();
diff --git a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl
index 555800b..9c3a6a5 100644
--- a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl
@@ -26,7 +26,9 @@
 // fn ldexp(f16, i32) -> f16
 fn ldexp_624e0c() {
   var res: f16 = ldexp(1.h, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.dxc.hlsl
index a2b6203..1617ea3 100644
--- a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_624e0c() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.fxc.hlsl
index a203546..d1b524f 100644
--- a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_624e0c() {
   float16_t res = float16_t(2.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.glsl
index 86a0a7a..fb4c0b8 100644
--- a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_624e0c() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_624e0c() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_624e0c() {
   float16_t res = 2.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.msl
index c2af249..2275d1b 100644
--- a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_624e0c() {
+void ldexp_624e0c(device half* const tint_symbol_1) {
   half res = 2.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_624e0c();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  ldexp_624e0c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_624e0c();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_624e0c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_624e0c();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_624e0c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.spvasm
index 15a4bac..f17dea8 100644
--- a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_624e0c "ldexp_624e0c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_624e0c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%ldexp_624e0c = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %ldexp_624e0c
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %ldexp_624e0c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %ldexp_624e0c
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %ldexp_624e0c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ldexp_624e0c
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ldexp_624e0c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.wgsl
index 540d1ad..5309c3b 100644
--- a/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/624e0c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ldexp_624e0c() {
   var res : f16 = ldexp(1.0h, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_624e0c();
diff --git a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl
index 631d76f..4e09250 100644
--- a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl
@@ -24,7 +24,9 @@
 // fn ldexp(vec<4, f32>, vec<4, ia>) -> vec<4, f32>
 fn ldexp_65a7bd() {
   var res: vec4<f32> = ldexp(vec4<f32>(1.f), vec4(1));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.dxc.hlsl
index 7618199..8f278ff 100644
--- a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_65a7bd() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.fxc.hlsl
index 7618199..8f278ff 100644
--- a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_65a7bd() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.glsl
index 596e044..eaee884 100644
--- a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_65a7bd() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_65a7bd() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_65a7bd() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.msl
index 4524da5..4f9bffa 100644
--- a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_65a7bd() {
+void ldexp_65a7bd(device float4* const tint_symbol_1) {
   float4 res = float4(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_65a7bd();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  ldexp_65a7bd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_65a7bd();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_65a7bd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_65a7bd();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_65a7bd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.spvasm
index b39d530..5198eed 100644
--- a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_65a7bd "ldexp_65a7bd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %14 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+         %17 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_65a7bd = OpFunction %void None %9
-         %12 = OpLabel
+%ldexp_65a7bd = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %ldexp_65a7bd
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %ldexp_65a7bd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %ldexp_65a7bd
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %ldexp_65a7bd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_65a7bd
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_65a7bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.wgsl
index 82cdf95..465c778 100644
--- a/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/65a7bd.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ldexp_65a7bd() {
   var res : vec4<f32> = ldexp(vec4<f32>(1.0f), vec4(1));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_65a7bd();
diff --git a/test/tint/builtins/gen/literal/ldexp/71ebe3.wgsl b/test/tint/builtins/gen/literal/ldexp/71ebe3.wgsl
index a40a398..bf16bbb 100644
--- a/test/tint/builtins/gen/literal/ldexp/71ebe3.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/71ebe3.wgsl
@@ -25,7 +25,6 @@
 fn ldexp_71ebe3() {
   var res = ldexp(1., 1i);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_71ebe3();
diff --git a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl
index 2ec9d3c..83ee951 100644
--- a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl
@@ -26,7 +26,9 @@
 // fn ldexp(vec<3, f16>, vec<3, i32>) -> vec<3, f16>
 fn ldexp_7485ce() {
   var res: vec3<f16> = ldexp(vec3<f16>(1.h), vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.dxc.hlsl
index 8b46162..03e68b5 100644
--- a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_7485ce() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.fxc.hlsl
index 5af754b..d419d9a 100644
--- a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_7485ce() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.glsl
index 733e1a8..b9e4d9d 100644
--- a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_7485ce() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_7485ce() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_7485ce() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.msl
index fd47d21..23c208b 100644
--- a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_7485ce() {
+void ldexp_7485ce(device packed_half3* const tint_symbol_1) {
   half3 res = half3(2.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_7485ce();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  ldexp_7485ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_7485ce();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_7485ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_7485ce();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_7485ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.spvasm
index beb358b..a796d98 100644
--- a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_7485ce "ldexp_7485ce"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_7485ce = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%ldexp_7485ce = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ldexp_7485ce
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ldexp_7485ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_7485ce
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_7485ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ldexp_7485ce
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ldexp_7485ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.wgsl
index d55a6aa..9d3fbb8 100644
--- a/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/7485ce.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ldexp_7485ce() {
   var res : vec3<f16> = ldexp(vec3<f16>(1.0h), vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_7485ce();
diff --git a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl
index 03cec0f..78e5086 100644
--- a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl
@@ -26,7 +26,9 @@
 // fn ldexp(vec<4, f16>, vec<4, i32>) -> vec<4, f16>
 fn ldexp_7fa13c() {
   var res: vec4<f16> = ldexp(vec4<f16>(1.h), vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.dxc.hlsl
index b887087..cdb914f 100644
--- a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_7fa13c() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.fxc.hlsl
index 6d04fdc..8ef71b4 100644
--- a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_7fa13c() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.glsl
index 2ceef88..0fb894e 100644
--- a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_7fa13c() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_7fa13c() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_7fa13c() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.msl
index f9410cf..cee77b0 100644
--- a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_7fa13c() {
+void ldexp_7fa13c(device half4* const tint_symbol_1) {
   half4 res = half4(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_7fa13c();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  ldexp_7fa13c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_7fa13c();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_7fa13c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_7fa13c();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_7fa13c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.spvasm
index fc3ef1d..1886b46 100644
--- a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_7fa13c "ldexp_7fa13c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_7fa13c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%ldexp_7fa13c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ldexp_7fa13c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ldexp_7fa13c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_7fa13c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_7fa13c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ldexp_7fa13c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ldexp_7fa13c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.wgsl
index 9c2998f..2a3bf56 100644
--- a/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/7fa13c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ldexp_7fa13c() {
   var res : vec4<f16> = ldexp(vec4<f16>(1.0h), vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_7fa13c();
diff --git a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl
index 3f7f79a..90f92e0 100644
--- a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl
@@ -26,7 +26,9 @@
 // fn ldexp(vec<4, f16>, vec<4, ia>) -> vec<4, f16>
 fn ldexp_8a0c2f() {
   var res: vec4<f16> = ldexp(vec4<f16>(1.h), vec4(1));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.dxc.hlsl
index 88109b6..90f83e1 100644
--- a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_8a0c2f() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.fxc.hlsl
index 99e3a79..3fcccbf 100644
--- a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_8a0c2f() {
   vector<float16_t, 4> res = (float16_t(2.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.glsl
index 7b4220b..a1b5c49 100644
--- a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_8a0c2f() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_8a0c2f() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_8a0c2f() {
   f16vec4 res = f16vec4(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.msl
index ba2809a..3df406b 100644
--- a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_8a0c2f() {
+void ldexp_8a0c2f(device half4* const tint_symbol_1) {
   half4 res = half4(2.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_8a0c2f();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  ldexp_8a0c2f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_8a0c2f();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_8a0c2f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_8a0c2f();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_8a0c2f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.spvasm
index c40bb28..3344125 100644
--- a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_8a0c2f "ldexp_8a0c2f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_8a0c2f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%ldexp_8a0c2f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ldexp_8a0c2f
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ldexp_8a0c2f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_8a0c2f
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_8a0c2f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ldexp_8a0c2f
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ldexp_8a0c2f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.wgsl
index ed2cd1e..2516063 100644
--- a/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/8a0c2f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ldexp_8a0c2f() {
   var res : vec4<f16> = ldexp(vec4<f16>(1.0h), vec4(1));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_8a0c2f();
diff --git a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl
index 3d32e42..1a646d4 100644
--- a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl
@@ -26,7 +26,9 @@
 // fn ldexp(vec<3, f16>, vec<3, ia>) -> vec<3, f16>
 fn ldexp_8e43e9() {
   var res: vec3<f16> = ldexp(vec3<f16>(1.h), vec3(1));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.dxc.hlsl
index b2d3816..c06b6b2 100644
--- a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_8e43e9() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.fxc.hlsl
index b624962..319bb56 100644
--- a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_8e43e9() {
   vector<float16_t, 3> res = (float16_t(2.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.glsl
index a3d738c..d71e096 100644
--- a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_8e43e9() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_8e43e9() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_8e43e9() {
   f16vec3 res = f16vec3(2.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.msl
index 0f02cac..78380cb 100644
--- a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_8e43e9() {
+void ldexp_8e43e9(device packed_half3* const tint_symbol_1) {
   half3 res = half3(2.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_8e43e9();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  ldexp_8e43e9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_8e43e9();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_8e43e9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_8e43e9();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_8e43e9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.spvasm
index f94ca99b0..f093bb4 100644
--- a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_8e43e9 "ldexp_8e43e9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_8e43e9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%ldexp_8e43e9 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ldexp_8e43e9
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ldexp_8e43e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_8e43e9
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_8e43e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ldexp_8e43e9
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ldexp_8e43e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.wgsl
index 6c05752..a06ba8b 100644
--- a/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/8e43e9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn ldexp_8e43e9() {
   var res : vec3<f16> = ldexp(vec3<f16>(1.0h), vec3(1));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_8e43e9();
diff --git a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl
index c3f51b3..cb11943 100644
--- a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl
@@ -24,7 +24,9 @@
 // fn ldexp(vec<2, f32>, vec<2, ia>) -> vec<2, f32>
 fn ldexp_a22679() {
   var res: vec2<f32> = ldexp(vec2<f32>(1.f), vec2(1));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.dxc.hlsl
index bccd1a5..b2580ed 100644
--- a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_a22679() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.fxc.hlsl
index bccd1a5..b2580ed 100644
--- a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_a22679() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.glsl
index 22cff50..f1b4e9a 100644
--- a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_a22679() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_a22679() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_a22679() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.msl
index 3548b48..00a5873f 100644
--- a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_a22679() {
+void ldexp_a22679(device float2* const tint_symbol_1) {
   float2 res = float2(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_a22679();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  ldexp_a22679(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_a22679();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_a22679(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_a22679();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_a22679(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.spvasm
index 43f2cbf..80f77ca 100644
--- a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_a22679 "ldexp_a22679"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v2float %float_2 %float_2
+         %18 = OpConstantComposite %v2float %float_2 %float_2
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_a22679 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%ldexp_a22679 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %ldexp_a22679
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %ldexp_a22679
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ldexp_a22679
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ldexp_a22679
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %ldexp_a22679
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %ldexp_a22679
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.wgsl
index c97e9a8..f9fd541 100644
--- a/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/a22679.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ldexp_a22679() {
   var res : vec2<f32> = ldexp(vec2<f32>(1.0f), vec2(1));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_a22679();
diff --git a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl
index b710d66..5a9a19b 100644
--- a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl
@@ -24,7 +24,9 @@
 // fn ldexp(vec<3, f32>, vec<3, i32>) -> vec<3, f32>
 fn ldexp_a31cdc() {
   var res: vec3<f32> = ldexp(vec3<f32>(1.f), vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.dxc.hlsl
index f23dd5c..516443f 100644
--- a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_a31cdc() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.fxc.hlsl
index f23dd5c..516443f 100644
--- a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_a31cdc() {
   float3 res = (2.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.glsl
index 030040b..e6997dc 100644
--- a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_a31cdc() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_a31cdc() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_a31cdc() {
   vec3 res = vec3(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.msl
index c9c07bf..4419e4d 100644
--- a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_a31cdc() {
+void ldexp_a31cdc(device packed_float3* const tint_symbol_1) {
   float3 res = float3(2.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_a31cdc();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  ldexp_a31cdc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_a31cdc();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_a31cdc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_a31cdc();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_a31cdc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.spvasm
index 3dc1f32..df6cffa 100644
--- a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_a31cdc "ldexp_a31cdc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+         %18 = OpConstantComposite %v3float %float_2 %float_2 %float_2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_a31cdc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%ldexp_a31cdc = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %ldexp_a31cdc
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %ldexp_a31cdc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ldexp_a31cdc
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ldexp_a31cdc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %ldexp_a31cdc
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %ldexp_a31cdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.wgsl
index b778a6f..fe9f67c 100644
--- a/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/a31cdc.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ldexp_a31cdc() {
   var res : vec3<f32> = ldexp(vec3<f32>(1.0f), vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_a31cdc();
diff --git a/test/tint/builtins/gen/literal/ldexp/a6126e.wgsl b/test/tint/builtins/gen/literal/ldexp/a6126e.wgsl
index 717c2a8..4eb4637 100644
--- a/test/tint/builtins/gen/literal/ldexp/a6126e.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/a6126e.wgsl
@@ -25,7 +25,6 @@
 fn ldexp_a6126e() {
   var res = ldexp(vec3(1.), vec3<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_a6126e();
diff --git a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl
index 2d0b53c..fe23c96 100644
--- a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl
@@ -24,7 +24,9 @@
 // fn ldexp(vec<2, f32>, vec<2, i32>) -> vec<2, f32>
 fn ldexp_abd718() {
   var res: vec2<f32> = ldexp(vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.dxc.hlsl
index a4ae26e..6afc9e2 100644
--- a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_abd718() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.fxc.hlsl
index a4ae26e..6afc9e2 100644
--- a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_abd718() {
   float2 res = (2.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.glsl
index 67212c5..31d199d 100644
--- a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_abd718() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_abd718() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_abd718() {
   vec2 res = vec2(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.msl
index d7463d8..1f2841b 100644
--- a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_abd718() {
+void ldexp_abd718(device float2* const tint_symbol_1) {
   float2 res = float2(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_abd718();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  ldexp_abd718(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_abd718();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_abd718(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_abd718();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_abd718(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.spvasm
index 29673d9..03686b3 100644
--- a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_abd718 "ldexp_abd718"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v2float %float_2 %float_2
+         %18 = OpConstantComposite %v2float %float_2 %float_2
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_abd718 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%ldexp_abd718 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %ldexp_abd718
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %ldexp_abd718
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ldexp_abd718
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ldexp_abd718
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %ldexp_abd718
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %ldexp_abd718
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.wgsl
index 1b44f45..b6a73e1 100644
--- a/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/abd718.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ldexp_abd718() {
   var res : vec2<f32> = ldexp(vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_abd718();
diff --git a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl
index 9724c84..7f2b771 100644
--- a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl
@@ -24,7 +24,9 @@
 // fn ldexp(f32, ia) -> f32
 fn ldexp_c9d0b7() {
   var res: f32 = ldexp(1.f, 1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.dxc.hlsl
index 1b12fc5..db562b1 100644
--- a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_c9d0b7() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.fxc.hlsl
index 1b12fc5..db562b1 100644
--- a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_c9d0b7() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.glsl
index 7351482..6014ab6 100644
--- a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_c9d0b7() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_c9d0b7() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_c9d0b7() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.msl
index 724f18e..102188b 100644
--- a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_c9d0b7() {
+void ldexp_c9d0b7(device float* const tint_symbol_1) {
   float res = 2.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_c9d0b7();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  ldexp_c9d0b7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_c9d0b7();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_c9d0b7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_c9d0b7();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_c9d0b7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.spvasm
index 67bd842..27b39e6c 100644
--- a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_c9d0b7 "ldexp_c9d0b7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_c9d0b7 = OpFunction %void None %9
-         %12 = OpLabel
+%ldexp_c9d0b7 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_2
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %ldexp_c9d0b7
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %ldexp_c9d0b7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %ldexp_c9d0b7
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %ldexp_c9d0b7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ldexp_c9d0b7
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ldexp_c9d0b7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.wgsl
index 024a1cb..771eb7b 100644
--- a/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/c9d0b7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ldexp_c9d0b7() {
   var res : f32 = ldexp(1.0f, 1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_c9d0b7();
diff --git a/test/tint/builtins/gen/literal/ldexp/cb0faf.wgsl b/test/tint/builtins/gen/literal/ldexp/cb0faf.wgsl
index 66e9b94..091d32f 100644
--- a/test/tint/builtins/gen/literal/ldexp/cb0faf.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/cb0faf.wgsl
@@ -25,7 +25,6 @@
 fn ldexp_cb0faf() {
   var res = ldexp(vec4(1.), vec4(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_cb0faf();
diff --git a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl
index a0a138e..968415f 100644
--- a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl
@@ -24,7 +24,9 @@
 // fn ldexp(vec<4, f32>, vec<4, i32>) -> vec<4, f32>
 fn ldexp_cc9cde() {
   var res: vec4<f32> = ldexp(vec4<f32>(1.f), vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.dxc.hlsl
index 5f43a92..0caa335 100644
--- a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_cc9cde() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.fxc.hlsl
index 5f43a92..0caa335 100644
--- a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_cc9cde() {
   float4 res = (2.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.glsl
index fb12c43..38c420c 100644
--- a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_cc9cde() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_cc9cde() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_cc9cde() {
   vec4 res = vec4(2.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.msl
index 0e0510d..215e070 100644
--- a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_cc9cde() {
+void ldexp_cc9cde(device float4* const tint_symbol_1) {
   float4 res = float4(2.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_cc9cde();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  ldexp_cc9cde(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_cc9cde();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_cc9cde(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_cc9cde();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_cc9cde(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.spvasm
index 26ef769..abb308d 100644
--- a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_cc9cde "ldexp_cc9cde"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %14 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+         %17 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_cc9cde = OpFunction %void None %9
-         %12 = OpLabel
+%ldexp_cc9cde = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %ldexp_cc9cde
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %ldexp_cc9cde
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %ldexp_cc9cde
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %ldexp_cc9cde
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_cc9cde
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_cc9cde
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.wgsl
index 09ac081..99aae63 100644
--- a/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/cc9cde.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ldexp_cc9cde() {
   var res : vec4<f32> = ldexp(vec4<f32>(1.0f), vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_cc9cde();
diff --git a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl
index 938642a..3c9e3f6 100644
--- a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl
@@ -24,7 +24,9 @@
 // fn ldexp(f32, i32) -> f32
 fn ldexp_db8b49() {
   var res: f32 = ldexp(1.f, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.dxc.hlsl
index dbe98d7..d20c527 100644
--- a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_db8b49() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.fxc.hlsl
index dbe98d7..d20c527 100644
--- a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_db8b49() {
   float res = 2.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.glsl b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.glsl
index 7a94486..b7914a7 100644
--- a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_db8b49() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_db8b49() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_db8b49() {
   float res = 2.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.msl b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.msl
index 9f8afd0..0532f54 100644
--- a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_db8b49() {
+void ldexp_db8b49(device float* const tint_symbol_1) {
   float res = 2.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_db8b49();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  ldexp_db8b49(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_db8b49();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_db8b49(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_db8b49();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_db8b49(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.spvasm
index 0a3680a..5357050 100644
--- a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_db8b49 "ldexp_db8b49"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_db8b49 = OpFunction %void None %9
-         %12 = OpLabel
+%ldexp_db8b49 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_2
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %ldexp_db8b49
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %ldexp_db8b49
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %ldexp_db8b49
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %ldexp_db8b49
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ldexp_db8b49
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ldexp_db8b49
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.wgsl
index 5425c53..d8c08a3 100644
--- a/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/db8b49.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn ldexp_db8b49() {
   var res : f32 = ldexp(1.0f, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_db8b49();
diff --git a/test/tint/builtins/gen/literal/ldexp/fdbc7b.wgsl b/test/tint/builtins/gen/literal/ldexp/fdbc7b.wgsl
index 7f88d2f..75d1f0c 100644
--- a/test/tint/builtins/gen/literal/ldexp/fdbc7b.wgsl
+++ b/test/tint/builtins/gen/literal/ldexp/fdbc7b.wgsl
@@ -25,7 +25,6 @@
 fn ldexp_fdbc7b() {
   var res = ldexp(1., 1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_fdbc7b();
diff --git a/test/tint/builtins/gen/literal/length/056071.wgsl b/test/tint/builtins/gen/literal/length/056071.wgsl
index e8d182c..9c0923c 100644
--- a/test/tint/builtins/gen/literal/length/056071.wgsl
+++ b/test/tint/builtins/gen/literal/length/056071.wgsl
@@ -24,7 +24,9 @@
 // fn length(vec<3, f32>) -> f32
 fn length_056071() {
   var res: f32 = length(vec3<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.dxc.hlsl
index 5866d13..5e78758 100644
--- a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_056071() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.fxc.hlsl
index 5866d13..5e78758 100644
--- a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_056071() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.glsl b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.glsl
index d70b411..030911a 100644
--- a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_056071() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_056071() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_056071() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.msl b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.msl
index 7ccfb33..9d74e49 100644
--- a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_056071() {
+void length_056071(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_056071();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  length_056071(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_056071();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  length_056071(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_056071();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  length_056071(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.spvasm
index 0a8134b..16146a9 100644
--- a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_056071 "length_056071"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_056071 = OpFunction %void None %9
-         %12 = OpLabel
+%length_056071 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %length_056071
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %length_056071
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %length_056071
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %length_056071
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %length_056071
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %length_056071
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.wgsl
index 34f59eb..6d395c0 100644
--- a/test/tint/builtins/gen/literal/length/056071.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/length/056071.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn length_056071() {
   var res : f32 = length(vec3<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_056071();
diff --git a/test/tint/builtins/gen/literal/length/3f0e13.wgsl b/test/tint/builtins/gen/literal/length/3f0e13.wgsl
index 44fc5bf..ab68899 100644
--- a/test/tint/builtins/gen/literal/length/3f0e13.wgsl
+++ b/test/tint/builtins/gen/literal/length/3f0e13.wgsl
@@ -26,7 +26,9 @@
 // fn length(vec<2, f16>) -> f16
 fn length_3f0e13() {
   var res: f16 = length(vec2<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.dxc.hlsl
index 25a71d7..b3087b4 100644
--- a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_3f0e13() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.fxc.hlsl
index e70a858..246a8c5 100644
--- a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_3f0e13() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.glsl b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.glsl
index aa45582..194f7aa 100644
--- a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_3f0e13() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_3f0e13() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_3f0e13() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.msl b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.msl
index 4709c0d..138d4c7 100644
--- a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_3f0e13() {
+void length_3f0e13(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_3f0e13();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  length_3f0e13(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_3f0e13();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  length_3f0e13(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_3f0e13();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  length_3f0e13(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.spvasm
index 8e47cf3..cb62ec0 100644
--- a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_3f0e13 "length_3f0e13"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_3f0e13 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%length_3f0e13 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %length_3f0e13
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %length_3f0e13
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %length_3f0e13
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %length_3f0e13
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %length_3f0e13
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %length_3f0e13
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.wgsl
index 920ea1a..7a313b4 100644
--- a/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/length/3f0e13.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn length_3f0e13() {
   var res : f16 = length(vec2<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_3f0e13();
diff --git a/test/tint/builtins/gen/literal/length/555aba.wgsl b/test/tint/builtins/gen/literal/length/555aba.wgsl
index 595bb1b..a75f0f5 100644
--- a/test/tint/builtins/gen/literal/length/555aba.wgsl
+++ b/test/tint/builtins/gen/literal/length/555aba.wgsl
@@ -25,7 +25,6 @@
 fn length_555aba() {
   var res = length(vec3(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_555aba();
diff --git a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl
index a15a013..cb953d2 100644
--- a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl
+++ b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl
@@ -26,7 +26,9 @@
 // fn length(vec<4, f16>) -> f16
 fn length_5b1a9b() {
   var res: f16 = length(vec4<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.dxc.hlsl
index 1e64383..f157c5c 100644
--- a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_5b1a9b() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.fxc.hlsl
index 887fc10..ae0a218 100644
--- a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_5b1a9b() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.glsl
index 27c14fd..4f01c86 100644
--- a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_5b1a9b() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_5b1a9b() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_5b1a9b() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.msl b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.msl
index 5fd0861..9ce288a 100644
--- a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_5b1a9b() {
+void length_5b1a9b(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_5b1a9b();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  length_5b1a9b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_5b1a9b();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  length_5b1a9b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_5b1a9b();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  length_5b1a9b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.spvasm
index 3d31fb3..c44b48b 100644
--- a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_5b1a9b "length_5b1a9b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_5b1a9b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%length_5b1a9b = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %length_5b1a9b
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %length_5b1a9b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %length_5b1a9b
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %length_5b1a9b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %length_5b1a9b
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %length_5b1a9b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.wgsl
index c218c4a..327ecf0 100644
--- a/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/length/5b1a9b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn length_5b1a9b() {
   var res : f16 = length(vec4<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_5b1a9b();
diff --git a/test/tint/builtins/gen/literal/length/602a17.wgsl b/test/tint/builtins/gen/literal/length/602a17.wgsl
index 491582f..cd6b354 100644
--- a/test/tint/builtins/gen/literal/length/602a17.wgsl
+++ b/test/tint/builtins/gen/literal/length/602a17.wgsl
@@ -24,7 +24,9 @@
 // fn length(f32) -> f32
 fn length_602a17() {
   var res: f32 = length(0.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.dxc.hlsl
index 68960df..7b4073c 100644
--- a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_602a17() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.fxc.hlsl
index 68960df..7b4073c 100644
--- a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_602a17() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.glsl b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.glsl
index 579e675..77a1b1e 100644
--- a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_602a17() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_602a17() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_602a17() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.msl b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.msl
index ee0c167..0c17e97 100644
--- a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_602a17() {
+void length_602a17(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_602a17();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  length_602a17(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_602a17();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  length_602a17(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_602a17();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  length_602a17(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.spvasm
index d0aedc4..432f45a 100644
--- a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_602a17 "length_602a17"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_602a17 = OpFunction %void None %9
-         %12 = OpLabel
+%length_602a17 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %length_602a17
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %length_602a17
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %length_602a17
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %length_602a17
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %length_602a17
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %length_602a17
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.wgsl
index e1220e5..29543a2 100644
--- a/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/length/602a17.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn length_602a17() {
   var res : f32 = length(0.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_602a17();
diff --git a/test/tint/builtins/gen/literal/length/7b4741.wgsl b/test/tint/builtins/gen/literal/length/7b4741.wgsl
index 359f2a0..e8dbdff 100644
--- a/test/tint/builtins/gen/literal/length/7b4741.wgsl
+++ b/test/tint/builtins/gen/literal/length/7b4741.wgsl
@@ -25,7 +25,6 @@
 fn length_7b4741() {
   var res = length(vec2(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_7b4741();
diff --git a/test/tint/builtins/gen/literal/length/936ad5.wgsl b/test/tint/builtins/gen/literal/length/936ad5.wgsl
index 1a5ea92..113b65b 100644
--- a/test/tint/builtins/gen/literal/length/936ad5.wgsl
+++ b/test/tint/builtins/gen/literal/length/936ad5.wgsl
@@ -25,7 +25,6 @@
 fn length_936ad5() {
   var res = length(0.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_936ad5();
diff --git a/test/tint/builtins/gen/literal/length/afde8b.wgsl b/test/tint/builtins/gen/literal/length/afde8b.wgsl
index 722e73f..8c444e3 100644
--- a/test/tint/builtins/gen/literal/length/afde8b.wgsl
+++ b/test/tint/builtins/gen/literal/length/afde8b.wgsl
@@ -24,7 +24,9 @@
 // fn length(vec<2, f32>) -> f32
 fn length_afde8b() {
   var res: f32 = length(vec2<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.dxc.hlsl
index 42456bf..b198a96 100644
--- a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_afde8b() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.fxc.hlsl
index 42456bf..b198a96 100644
--- a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_afde8b() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.glsl
index 769f7f0..441cb84 100644
--- a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_afde8b() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_afde8b() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_afde8b() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.msl b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.msl
index 5fed668..4b24cea 100644
--- a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_afde8b() {
+void length_afde8b(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_afde8b();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  length_afde8b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_afde8b();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  length_afde8b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_afde8b();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  length_afde8b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.spvasm
index e17edea..282e7d3 100644
--- a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_afde8b "length_afde8b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_afde8b = OpFunction %void None %9
-         %12 = OpLabel
+%length_afde8b = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %length_afde8b
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %length_afde8b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %length_afde8b
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %length_afde8b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %length_afde8b
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %length_afde8b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.wgsl
index 06b7d27..ad4f09f 100644
--- a/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/length/afde8b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn length_afde8b() {
   var res : f32 = length(vec2<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_afde8b();
diff --git a/test/tint/builtins/gen/literal/length/ba16d6.wgsl b/test/tint/builtins/gen/literal/length/ba16d6.wgsl
index 1319ded..87a760f 100644
--- a/test/tint/builtins/gen/literal/length/ba16d6.wgsl
+++ b/test/tint/builtins/gen/literal/length/ba16d6.wgsl
@@ -26,7 +26,9 @@
 // fn length(vec<3, f16>) -> f16
 fn length_ba16d6() {
   var res: f16 = length(vec3<f16>(0.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.dxc.hlsl
index 6439c99..b174d7f 100644
--- a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_ba16d6() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.fxc.hlsl
index 780b4c1..7938298 100644
--- a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_ba16d6() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.glsl
index 11ed9cc..4f95328 100644
--- a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_ba16d6() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_ba16d6() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_ba16d6() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.msl b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.msl
index f0ac6aa..c8d5fe8 100644
--- a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_ba16d6() {
+void length_ba16d6(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_ba16d6();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  length_ba16d6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_ba16d6();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  length_ba16d6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_ba16d6();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  length_ba16d6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.spvasm
index 4dc8dc4..e85925f 100644
--- a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_ba16d6 "length_ba16d6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_ba16d6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%length_ba16d6 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %length_ba16d6
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %length_ba16d6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %length_ba16d6
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %length_ba16d6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %length_ba16d6
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %length_ba16d6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.wgsl
index 16aee35..36ce298 100644
--- a/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/length/ba16d6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn length_ba16d6() {
   var res : f16 = length(vec3<f16>(0.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_ba16d6();
diff --git a/test/tint/builtins/gen/literal/length/becebf.wgsl b/test/tint/builtins/gen/literal/length/becebf.wgsl
index 55981c8..f2bb319 100644
--- a/test/tint/builtins/gen/literal/length/becebf.wgsl
+++ b/test/tint/builtins/gen/literal/length/becebf.wgsl
@@ -24,7 +24,9 @@
 // fn length(vec<4, f32>) -> f32
 fn length_becebf() {
   var res: f32 = length(vec4<f32>(0.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.dxc.hlsl
index 340a531..19d4565 100644
--- a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_becebf() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.fxc.hlsl
index 340a531..19d4565 100644
--- a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_becebf() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.glsl
index 1f7b1da..597596a 100644
--- a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_becebf() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_becebf() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_becebf() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.msl b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.msl
index 5ddf5a6..e3c201b 100644
--- a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_becebf() {
+void length_becebf(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_becebf();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  length_becebf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_becebf();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  length_becebf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_becebf();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  length_becebf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.spvasm
index a5cc92d..185584e 100644
--- a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_becebf "length_becebf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_becebf = OpFunction %void None %9
-         %12 = OpLabel
+%length_becebf = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %length_becebf
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %length_becebf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %length_becebf
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %length_becebf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %length_becebf
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %length_becebf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.wgsl
index 4433e77..12e87d4 100644
--- a/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/length/becebf.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn length_becebf() {
   var res : f32 = length(vec4<f32>(0.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_becebf();
diff --git a/test/tint/builtins/gen/literal/length/c158da.wgsl b/test/tint/builtins/gen/literal/length/c158da.wgsl
index 9733c9e..45d13c8 100644
--- a/test/tint/builtins/gen/literal/length/c158da.wgsl
+++ b/test/tint/builtins/gen/literal/length/c158da.wgsl
@@ -26,7 +26,9 @@
 // fn length(f16) -> f16
 fn length_c158da() {
   var res: f16 = length(0.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.dxc.hlsl
index 26407dc..33865fe 100644
--- a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_c158da() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.fxc.hlsl
index cb41861..4170b52 100644
--- a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_c158da() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.glsl b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.glsl
index b276e06..d1f1b48 100644
--- a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_c158da() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_c158da() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_c158da() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.msl b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.msl
index 432f101..8e12052 100644
--- a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_c158da() {
+void length_c158da(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_c158da();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  length_c158da(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_c158da();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  length_c158da(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_c158da();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  length_c158da(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.spvasm
index f822ca5..85964e4 100644
--- a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_c158da "length_c158da"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_c158da = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%length_c158da = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %length_c158da
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %length_c158da
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %length_c158da
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %length_c158da
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %length_c158da
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %length_c158da
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.wgsl
index 46edf49..cf968bd 100644
--- a/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/length/c158da.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn length_c158da() {
   var res : f16 = length(0.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_c158da();
diff --git a/test/tint/builtins/gen/literal/length/c2c544.wgsl b/test/tint/builtins/gen/literal/length/c2c544.wgsl
index 516c67f..ce9e946 100644
--- a/test/tint/builtins/gen/literal/length/c2c544.wgsl
+++ b/test/tint/builtins/gen/literal/length/c2c544.wgsl
@@ -25,7 +25,6 @@
 fn length_c2c544() {
   var res = length(vec4(0.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_c2c544();
diff --git a/test/tint/builtins/gen/literal/log/3da25a.wgsl b/test/tint/builtins/gen/literal/log/3da25a.wgsl
index 7cb7b97..64078f5 100644
--- a/test/tint/builtins/gen/literal/log/3da25a.wgsl
+++ b/test/tint/builtins/gen/literal/log/3da25a.wgsl
@@ -24,7 +24,9 @@
 // fn log(vec<4, f32>) -> vec<4, f32>
 fn log_3da25a() {
   var res: vec4<f32> = log(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.dxc.hlsl
index 8893465..56127d9 100644
--- a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_3da25a() {
   float4 res = (0.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.fxc.hlsl
index 8893465..56127d9 100644
--- a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_3da25a() {
   float4 res = (0.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.glsl
index fe91114..a8c97e8 100644
--- a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log_3da25a() {
   vec4 res = vec4(0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log_3da25a() {
   vec4 res = vec4(0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log_3da25a() {
   vec4 res = vec4(0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.msl b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.msl
index e70b8f9..c8bb020 100644
--- a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_3da25a() {
+void log_3da25a(device float4* const tint_symbol_1) {
   float4 res = float4(0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_3da25a();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  log_3da25a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_3da25a();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  log_3da25a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_3da25a();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  log_3da25a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.spvasm
index 0966583..5dc6fe9 100644
--- a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_3da25a "log_3da25a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_3da25a = OpFunction %void None %9
-         %12 = OpLabel
+ %log_3da25a = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %res %5
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %log_3da25a
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %log_3da25a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %log_3da25a
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %log_3da25a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log_3da25a
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log_3da25a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.wgsl
index 1b52a98..09b5b0a 100644
--- a/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log/3da25a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn log_3da25a() {
   var res : vec4<f32> = log(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_3da25a();
diff --git a/test/tint/builtins/gen/literal/log/655989.wgsl b/test/tint/builtins/gen/literal/log/655989.wgsl
index 4d2b233..d43b1ce 100644
--- a/test/tint/builtins/gen/literal/log/655989.wgsl
+++ b/test/tint/builtins/gen/literal/log/655989.wgsl
@@ -25,7 +25,6 @@
 fn log_655989() {
   var res = log(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_655989();
diff --git a/test/tint/builtins/gen/literal/log/697e1d.wgsl b/test/tint/builtins/gen/literal/log/697e1d.wgsl
index 20086fb..aa7bf03 100644
--- a/test/tint/builtins/gen/literal/log/697e1d.wgsl
+++ b/test/tint/builtins/gen/literal/log/697e1d.wgsl
@@ -25,7 +25,6 @@
 fn log_697e1d() {
   var res = log(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_697e1d();
diff --git a/test/tint/builtins/gen/literal/log/6ff86f.wgsl b/test/tint/builtins/gen/literal/log/6ff86f.wgsl
index 21cfca0..4874582 100644
--- a/test/tint/builtins/gen/literal/log/6ff86f.wgsl
+++ b/test/tint/builtins/gen/literal/log/6ff86f.wgsl
@@ -26,7 +26,9 @@
 // fn log(vec<3, f16>) -> vec<3, f16>
 fn log_6ff86f() {
   var res: vec3<f16> = log(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.dxc.hlsl
index f537033..d140922 100644
--- a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_6ff86f() {
   vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.fxc.hlsl
index 2b3e8a3..5e9a03e 100644
--- a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_6ff86f() {
   vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.glsl
index 9fc5abc..78bc60c 100644
--- a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log_6ff86f() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log_6ff86f() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log_6ff86f() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.msl b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.msl
index f16f293..110e583 100644
--- a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_6ff86f() {
+void log_6ff86f(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_6ff86f();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  log_6ff86f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_6ff86f();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  log_6ff86f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_6ff86f();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  log_6ff86f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.spvasm
index bfd7974..8ef58c2 100644
--- a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_6ff86f "log_6ff86f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-         %15 = OpConstantNull %v3half
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3half
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_6ff86f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %15
-               OpStore %res %15
+ %log_6ff86f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %25 = OpLoad %v3half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %log_6ff86f
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %log_6ff86f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log_6ff86f
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log_6ff86f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %log_6ff86f
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %log_6ff86f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.wgsl
index 856ac22..36c9436 100644
--- a/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log/6ff86f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn log_6ff86f() {
   var res : vec3<f16> = log(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_6ff86f();
diff --git a/test/tint/builtins/gen/literal/log/7114a6.wgsl b/test/tint/builtins/gen/literal/log/7114a6.wgsl
index 6363655..60bc1b6 100644
--- a/test/tint/builtins/gen/literal/log/7114a6.wgsl
+++ b/test/tint/builtins/gen/literal/log/7114a6.wgsl
@@ -24,7 +24,9 @@
 // fn log(f32) -> f32
 fn log_7114a6() {
   var res: f32 = log(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.dxc.hlsl
index 4875199..8451b7f 100644
--- a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_7114a6() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.fxc.hlsl
index 4875199..8451b7f 100644
--- a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_7114a6() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.glsl
index 6e2be1a..8995b76 100644
--- a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log_7114a6() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log_7114a6() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log_7114a6() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.msl b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.msl
index 6f3b9c4..760a000 100644
--- a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_7114a6() {
+void log_7114a6(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_7114a6();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  log_7114a6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_7114a6();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  log_7114a6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_7114a6();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  log_7114a6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.spvasm
index 17e7f0d..7c1e990 100644
--- a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_7114a6 "log_7114a6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_7114a6 = OpFunction %void None %9
-         %12 = OpLabel
+ %log_7114a6 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %log_7114a6
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %log_7114a6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %log_7114a6
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %log_7114a6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log_7114a6
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log_7114a6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.wgsl
index 176e330..188f646 100644
--- a/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log/7114a6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn log_7114a6() {
   var res : f32 = log(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_7114a6();
diff --git a/test/tint/builtins/gen/literal/log/8f0e32.wgsl b/test/tint/builtins/gen/literal/log/8f0e32.wgsl
index 82cf025..21aa8a2 100644
--- a/test/tint/builtins/gen/literal/log/8f0e32.wgsl
+++ b/test/tint/builtins/gen/literal/log/8f0e32.wgsl
@@ -26,7 +26,9 @@
 // fn log(vec<2, f16>) -> vec<2, f16>
 fn log_8f0e32() {
   var res: vec2<f16> = log(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.dxc.hlsl
index ef49c8f..12b433e 100644
--- a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_8f0e32() {
   vector<float16_t, 2> res = (float16_t(0.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.fxc.hlsl
index b63aa1d..ebad2a0 100644
--- a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_8f0e32() {
   vector<float16_t, 2> res = (float16_t(0.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.glsl
index b5dd01d..8394c1d 100644
--- a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log_8f0e32() {
   f16vec2 res = f16vec2(0.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log_8f0e32() {
   f16vec2 res = f16vec2(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log_8f0e32() {
   f16vec2 res = f16vec2(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.msl b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.msl
index 33d2dab..a9034e5 100644
--- a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_8f0e32() {
+void log_8f0e32(device half2* const tint_symbol_1) {
   half2 res = half2(0.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_8f0e32();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  log_8f0e32(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_8f0e32();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  log_8f0e32(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_8f0e32();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  log_8f0e32(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.spvasm
index 5960ad5..b818dfe 100644
--- a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_8f0e32 "log_8f0e32"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-         %15 = OpConstantNull %v2half
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2half
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_8f0e32 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %15
-               OpStore %res %15
+ %log_8f0e32 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %25 = OpLoad %v2half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %log_8f0e32
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %log_8f0e32
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log_8f0e32
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log_8f0e32
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %log_8f0e32
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %log_8f0e32
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.wgsl
index d483486..5cbe4d9 100644
--- a/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log/8f0e32.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn log_8f0e32() {
   var res : vec2<f16> = log(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_8f0e32();
diff --git a/test/tint/builtins/gen/literal/log/b2ce28.wgsl b/test/tint/builtins/gen/literal/log/b2ce28.wgsl
index 9cd5b41..25ec05b 100644
--- a/test/tint/builtins/gen/literal/log/b2ce28.wgsl
+++ b/test/tint/builtins/gen/literal/log/b2ce28.wgsl
@@ -24,7 +24,9 @@
 // fn log(vec<2, f32>) -> vec<2, f32>
 fn log_b2ce28() {
   var res: vec2<f32> = log(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.dxc.hlsl
index 200c199..be4cd2b 100644
--- a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_b2ce28() {
   float2 res = (0.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.fxc.hlsl
index 200c199..be4cd2b 100644
--- a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_b2ce28() {
   float2 res = (0.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.glsl
index 223eccd..58dc2bf 100644
--- a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log_b2ce28() {
   vec2 res = vec2(0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log_b2ce28() {
   vec2 res = vec2(0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log_b2ce28() {
   vec2 res = vec2(0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.msl b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.msl
index 9f693c4..4843e9c 100644
--- a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_b2ce28() {
+void log_b2ce28(device float2* const tint_symbol_1) {
   float2 res = float2(0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_b2ce28();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  log_b2ce28(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_b2ce28();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  log_b2ce28(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_b2ce28();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  log_b2ce28(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.spvasm
index fc4c327..2611117 100644
--- a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_b2ce28 "log_b2ce28"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
-         %14 = OpConstantNull %v2float
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v2float
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_b2ce28 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %14
-               OpStore %res %14
+ %log_b2ce28 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %24 = OpLoad %v2float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %log_b2ce28
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %log_b2ce28
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log_b2ce28
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log_b2ce28
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %log_b2ce28
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %log_b2ce28
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.wgsl
index 3fafdad..2f75558 100644
--- a/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log/b2ce28.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn log_b2ce28() {
   var res : vec2<f32> = log(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_b2ce28();
diff --git a/test/tint/builtins/gen/literal/log/b8088d.wgsl b/test/tint/builtins/gen/literal/log/b8088d.wgsl
index f110dec..e96e874 100644
--- a/test/tint/builtins/gen/literal/log/b8088d.wgsl
+++ b/test/tint/builtins/gen/literal/log/b8088d.wgsl
@@ -25,7 +25,6 @@
 fn log_b8088d() {
   var res = log(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_b8088d();
diff --git a/test/tint/builtins/gen/literal/log/c9f489.wgsl b/test/tint/builtins/gen/literal/log/c9f489.wgsl
index 905c963..1b60eb3 100644
--- a/test/tint/builtins/gen/literal/log/c9f489.wgsl
+++ b/test/tint/builtins/gen/literal/log/c9f489.wgsl
@@ -26,7 +26,9 @@
 // fn log(f16) -> f16
 fn log_c9f489() {
   var res: f16 = log(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.dxc.hlsl
index 2102cac..33a8f2e 100644
--- a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_c9f489() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.fxc.hlsl
index 20ba298..ca9e213 100644
--- a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_c9f489() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.glsl
index c632da4..a450a76 100644
--- a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log_c9f489() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log_c9f489() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log_c9f489() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.msl b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.msl
index a879c66..1a364a2 100644
--- a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_c9f489() {
+void log_c9f489(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_c9f489();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  log_c9f489(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_c9f489();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  log_c9f489(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_c9f489();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  log_c9f489(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.spvasm
index f056297..3086959 100644
--- a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_c9f489 "log_c9f489"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_c9f489 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+ %log_c9f489 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %log_c9f489
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %log_c9f489
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log_c9f489
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log_c9f489
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %log_c9f489
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %log_c9f489
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.wgsl
index b3b61f4..e390745 100644
--- a/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log/c9f489.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn log_c9f489() {
   var res : f16 = log(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_c9f489();
diff --git a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl
index 92cf108..dd863ee 100644
--- a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl
+++ b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl
@@ -26,7 +26,9 @@
 // fn log(vec<4, f16>) -> vec<4, f16>
 fn log_cdbdc1() {
   var res: vec4<f16> = log(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.dxc.hlsl
index 63f6f0c..df050fa 100644
--- a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_cdbdc1() {
   vector<float16_t, 4> res = (float16_t(0.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.fxc.hlsl
index 3659ee5..24eeafa 100644
--- a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_cdbdc1() {
   vector<float16_t, 4> res = (float16_t(0.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.glsl
index 5533178..45e2473 100644
--- a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log_cdbdc1() {
   f16vec4 res = f16vec4(0.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log_cdbdc1() {
   f16vec4 res = f16vec4(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log_cdbdc1() {
   f16vec4 res = f16vec4(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.msl b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.msl
index 49a8c75..d3e2005 100644
--- a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_cdbdc1() {
+void log_cdbdc1(device half4* const tint_symbol_1) {
   half4 res = half4(0.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_cdbdc1();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  log_cdbdc1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_cdbdc1();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  log_cdbdc1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_cdbdc1();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  log_cdbdc1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.spvasm
index 29db7fc..c8629a8 100644
--- a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_cdbdc1 "log_cdbdc1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-         %15 = OpConstantNull %v4half
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4half
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_cdbdc1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %15
-               OpStore %res %15
+ %log_cdbdc1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %25 = OpLoad %v4half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %log_cdbdc1
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %log_cdbdc1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log_cdbdc1
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log_cdbdc1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %log_cdbdc1
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %log_cdbdc1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.wgsl
index dbe96d2..b1b6dd5 100644
--- a/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log/cdbdc1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn log_cdbdc1() {
   var res : vec4<f16> = log(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_cdbdc1();
diff --git a/test/tint/builtins/gen/literal/log/f4c570.wgsl b/test/tint/builtins/gen/literal/log/f4c570.wgsl
index fad4f65..4a353a3 100644
--- a/test/tint/builtins/gen/literal/log/f4c570.wgsl
+++ b/test/tint/builtins/gen/literal/log/f4c570.wgsl
@@ -24,7 +24,9 @@
 // fn log(vec<3, f32>) -> vec<3, f32>
 fn log_f4c570() {
   var res: vec3<f32> = log(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.dxc.hlsl
index 1a94527..5ea0007 100644
--- a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_f4c570() {
   float3 res = (0.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.fxc.hlsl
index 1a94527..5ea0007 100644
--- a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_f4c570() {
   float3 res = (0.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.glsl
index 2537bba..6e6a2cf 100644
--- a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log_f4c570() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log_f4c570() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log_f4c570() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.msl b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.msl
index afa7672..33ef79b 100644
--- a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_f4c570() {
+void log_f4c570(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_f4c570();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  log_f4c570(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_f4c570();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  log_f4c570(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_f4c570();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  log_f4c570(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.spvasm
index 799dd64..eacd4e5 100644
--- a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_f4c570 "log_f4c570"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
-         %14 = OpConstantNull %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v3float
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_f4c570 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %14
-               OpStore %res %14
+ %log_f4c570 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %24 = OpLoad %v3float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %log_f4c570
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %log_f4c570
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log_f4c570
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log_f4c570
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %log_f4c570
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %log_f4c570
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.wgsl
index 6e7dd27..a54a0fb 100644
--- a/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log/f4c570.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn log_f4c570() {
   var res : vec3<f32> = log(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_f4c570();
diff --git a/test/tint/builtins/gen/literal/log/f60cc7.wgsl b/test/tint/builtins/gen/literal/log/f60cc7.wgsl
index 971c4e1..89445d5 100644
--- a/test/tint/builtins/gen/literal/log/f60cc7.wgsl
+++ b/test/tint/builtins/gen/literal/log/f60cc7.wgsl
@@ -25,7 +25,6 @@
 fn log_f60cc7() {
   var res = log(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_f60cc7();
diff --git a/test/tint/builtins/gen/literal/log2/0fbd39.wgsl b/test/tint/builtins/gen/literal/log2/0fbd39.wgsl
index 4e61b7b..e48a2b7 100644
--- a/test/tint/builtins/gen/literal/log2/0fbd39.wgsl
+++ b/test/tint/builtins/gen/literal/log2/0fbd39.wgsl
@@ -25,7 +25,6 @@
 fn log2_0fbd39() {
   var res = log2(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_0fbd39();
diff --git a/test/tint/builtins/gen/literal/log2/38b478.wgsl b/test/tint/builtins/gen/literal/log2/38b478.wgsl
index ae09148..d93b093 100644
--- a/test/tint/builtins/gen/literal/log2/38b478.wgsl
+++ b/test/tint/builtins/gen/literal/log2/38b478.wgsl
@@ -26,7 +26,9 @@
 // fn log2(vec<3, f16>) -> vec<3, f16>
 fn log2_38b478() {
   var res: vec3<f16> = log2(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.dxc.hlsl
index e03ccef..7abdf88 100644
--- a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_38b478() {
   vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.fxc.hlsl
index c26fa6f..571924e 100644
--- a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_38b478() {
   vector<float16_t, 3> res = (float16_t(0.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.glsl
index 747de5e..a08ba07 100644
--- a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log2_38b478() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log2_38b478() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log2_38b478() {
   f16vec3 res = f16vec3(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.msl b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.msl
index c5df79a..2d64273 100644
--- a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_38b478() {
+void log2_38b478(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_38b478();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  log2_38b478(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_38b478();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  log2_38b478(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_38b478();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  log2_38b478(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.spvasm
index e8a7567..4a3cf6d 100644
--- a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_38b478 "log2_38b478"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-         %15 = OpConstantNull %v3half
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3half
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_38b478 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %15
-               OpStore %res %15
+%log2_38b478 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %25 = OpLoad %v3half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %log2_38b478
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %log2_38b478
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log2_38b478
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log2_38b478
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %log2_38b478
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %log2_38b478
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.wgsl
index 993448c..c1854f6 100644
--- a/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log2/38b478.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn log2_38b478() {
   var res : vec3<f16> = log2(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_38b478();
diff --git a/test/tint/builtins/gen/literal/log2/4036ed.wgsl b/test/tint/builtins/gen/literal/log2/4036ed.wgsl
index 8766b24..64a8d74 100644
--- a/test/tint/builtins/gen/literal/log2/4036ed.wgsl
+++ b/test/tint/builtins/gen/literal/log2/4036ed.wgsl
@@ -24,7 +24,9 @@
 // fn log2(f32) -> f32
 fn log2_4036ed() {
   var res: f32 = log2(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.dxc.hlsl
index da5dd4e..6eff04e 100644
--- a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_4036ed() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.fxc.hlsl
index da5dd4e..6eff04e 100644
--- a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_4036ed() {
   float res = 0.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.glsl
index 01c3ca0..f1bc93b 100644
--- a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log2_4036ed() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log2_4036ed() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log2_4036ed() {
   float res = 0.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.msl b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.msl
index 12a5aec..d1abb531 100644
--- a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_4036ed() {
+void log2_4036ed(device float* const tint_symbol_1) {
   float res = 0.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_4036ed();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  log2_4036ed(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_4036ed();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  log2_4036ed(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_4036ed();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  log2_4036ed(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.spvasm
index 0f87a46..822d252 100644
--- a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_4036ed "log2_4036ed"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_4036ed = OpFunction %void None %9
-         %12 = OpLabel
+%log2_4036ed = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %8
+         %21 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %22 = OpLoad %float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %log2_4036ed
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %log2_4036ed
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %log2_4036ed
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %log2_4036ed
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log2_4036ed
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log2_4036ed
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.wgsl
index 316b9cd..ecd5e50 100644
--- a/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log2/4036ed.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn log2_4036ed() {
   var res : f32 = log2(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_4036ed();
diff --git a/test/tint/builtins/gen/literal/log2/5b464b.wgsl b/test/tint/builtins/gen/literal/log2/5b464b.wgsl
index 4610d94..7f6fe61 100644
--- a/test/tint/builtins/gen/literal/log2/5b464b.wgsl
+++ b/test/tint/builtins/gen/literal/log2/5b464b.wgsl
@@ -25,7 +25,6 @@
 fn log2_5b464b() {
   var res = log2(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_5b464b();
diff --git a/test/tint/builtins/gen/literal/log2/6b8954.wgsl b/test/tint/builtins/gen/literal/log2/6b8954.wgsl
index 0455660..e3ca0c4 100644
--- a/test/tint/builtins/gen/literal/log2/6b8954.wgsl
+++ b/test/tint/builtins/gen/literal/log2/6b8954.wgsl
@@ -25,7 +25,6 @@
 fn log2_6b8954() {
   var res = log2(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_6b8954();
diff --git a/test/tint/builtins/gen/literal/log2/776088.wgsl b/test/tint/builtins/gen/literal/log2/776088.wgsl
index 4ee097b..404d458 100644
--- a/test/tint/builtins/gen/literal/log2/776088.wgsl
+++ b/test/tint/builtins/gen/literal/log2/776088.wgsl
@@ -26,7 +26,9 @@
 // fn log2(vec<4, f16>) -> vec<4, f16>
 fn log2_776088() {
   var res: vec4<f16> = log2(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.dxc.hlsl
index 6eba104..994a80f 100644
--- a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_776088() {
   vector<float16_t, 4> res = (float16_t(0.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.fxc.hlsl
index f683880..33b3fdb 100644
--- a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_776088() {
   vector<float16_t, 4> res = (float16_t(0.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.glsl
index 75dfbd1..b9b860c 100644
--- a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log2_776088() {
   f16vec4 res = f16vec4(0.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log2_776088() {
   f16vec4 res = f16vec4(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log2_776088() {
   f16vec4 res = f16vec4(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.msl b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.msl
index e88c875..f1e52d9 100644
--- a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_776088() {
+void log2_776088(device half4* const tint_symbol_1) {
   half4 res = half4(0.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_776088();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  log2_776088(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_776088();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  log2_776088(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_776088();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  log2_776088(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.spvasm
index 965facb..9bc8d19 100644
--- a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_776088 "log2_776088"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-         %15 = OpConstantNull %v4half
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4half
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_776088 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %15
-               OpStore %res %15
+%log2_776088 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %25 = OpLoad %v4half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %log2_776088
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %log2_776088
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log2_776088
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log2_776088
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %log2_776088
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %log2_776088
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.wgsl
index 252f507..f855ee1 100644
--- a/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log2/776088.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn log2_776088() {
   var res : vec4<f16> = log2(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_776088();
diff --git a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl
index c330372..cb6a4f2 100644
--- a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl
+++ b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl
@@ -26,7 +26,9 @@
 // fn log2(f16) -> f16
 fn log2_8c10b3() {
   var res: f16 = log2(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.dxc.hlsl
index af4452e..84e8912 100644
--- a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_8c10b3() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.fxc.hlsl
index 36ce200..45322ac 100644
--- a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_8c10b3() {
   float16_t res = float16_t(0.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.glsl
index 34fdf37..deae391 100644
--- a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log2_8c10b3() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log2_8c10b3() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log2_8c10b3() {
   float16_t res = 0.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.msl b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.msl
index c1d8b32..513ee51 100644
--- a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_8c10b3() {
+void log2_8c10b3(device half* const tint_symbol_1) {
   half res = 0.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_8c10b3();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  log2_8c10b3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_8c10b3();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  log2_8c10b3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_8c10b3();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  log2_8c10b3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.spvasm
index 994bb14..ea1cbfe 100644
--- a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_8c10b3 "log2_8c10b3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,38 +39,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_8c10b3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %res %14
+%log2_8c10b3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %24 = OpLoad %half %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %log2_8c10b3
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %log2_8c10b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log2_8c10b3
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log2_8c10b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %log2_8c10b3
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %log2_8c10b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.wgsl
index f92de71..63d2f60 100644
--- a/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log2/8c10b3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn log2_8c10b3() {
   var res : f16 = log2(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_8c10b3();
diff --git a/test/tint/builtins/gen/literal/log2/902988.wgsl b/test/tint/builtins/gen/literal/log2/902988.wgsl
index 630c20d..c2a507d 100644
--- a/test/tint/builtins/gen/literal/log2/902988.wgsl
+++ b/test/tint/builtins/gen/literal/log2/902988.wgsl
@@ -24,7 +24,9 @@
 // fn log2(vec<4, f32>) -> vec<4, f32>
 fn log2_902988() {
   var res: vec4<f32> = log2(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.dxc.hlsl
index d9ea63b..c225670 100644
--- a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_902988() {
   float4 res = (0.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.fxc.hlsl
index d9ea63b..c225670 100644
--- a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_902988() {
   float4 res = (0.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.glsl
index 472adc5..87b6987 100644
--- a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log2_902988() {
   vec4 res = vec4(0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log2_902988() {
   vec4 res = vec4(0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log2_902988() {
   vec4 res = vec4(0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.msl b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.msl
index 8d88fe8..a401457 100644
--- a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_902988() {
+void log2_902988(device float4* const tint_symbol_1) {
   float4 res = float4(0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_902988();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  log2_902988(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_902988();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  log2_902988(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_902988();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  log2_902988(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.spvasm
index 6d40f39..edae399 100644
--- a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_902988 "log2_902988"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %15 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %23 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_902988 = OpFunction %void None %9
-         %12 = OpLabel
+%log2_902988 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %res %5
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %15
-         %17 = OpLabel
-         %18 = OpFunctionCall %void %log2_902988
+%vertex_main_inner = OpFunction %v4float None %23
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %log2_902988
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %20 = OpLabel
-         %21 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %21
+%vertex_main = OpFunction %void None %12
+         %28 = OpLabel
+         %29 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %29
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %log2_902988
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %log2_902988
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log2_902988
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log2_902988
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.wgsl
index a0a76d1..a5b878f 100644
--- a/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log2/902988.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn log2_902988() {
   var res : vec4<f32> = log2(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_902988();
diff --git a/test/tint/builtins/gen/literal/log2/a52bbb.wgsl b/test/tint/builtins/gen/literal/log2/a52bbb.wgsl
index bde0cbb..60d0e82 100644
--- a/test/tint/builtins/gen/literal/log2/a52bbb.wgsl
+++ b/test/tint/builtins/gen/literal/log2/a52bbb.wgsl
@@ -25,7 +25,6 @@
 fn log2_a52bbb() {
   var res = log2(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_a52bbb();
diff --git a/test/tint/builtins/gen/literal/log2/adb233.wgsl b/test/tint/builtins/gen/literal/log2/adb233.wgsl
index b7914e4..dacc82a 100644
--- a/test/tint/builtins/gen/literal/log2/adb233.wgsl
+++ b/test/tint/builtins/gen/literal/log2/adb233.wgsl
@@ -24,7 +24,9 @@
 // fn log2(vec<3, f32>) -> vec<3, f32>
 fn log2_adb233() {
   var res: vec3<f32> = log2(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.dxc.hlsl
index 04376aa..a514fae 100644
--- a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_adb233() {
   float3 res = (0.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.fxc.hlsl
index 04376aa..a514fae 100644
--- a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_adb233() {
   float3 res = (0.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.glsl
index 35de9d3..a4174d6 100644
--- a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log2_adb233() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log2_adb233() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log2_adb233() {
   vec3 res = vec3(0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.msl b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.msl
index 8b5e766..c4e1247 100644
--- a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_adb233() {
+void log2_adb233(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_adb233();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  log2_adb233(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_adb233();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  log2_adb233(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_adb233();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  log2_adb233(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.spvasm
index 6f2635a..a679420 100644
--- a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_adb233 "log2_adb233"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
-         %14 = OpConstantNull %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v3float
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_adb233 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %14
-               OpStore %res %14
+%log2_adb233 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %24 = OpLoad %v3float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %log2_adb233
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %log2_adb233
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log2_adb233
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log2_adb233
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %log2_adb233
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %log2_adb233
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.wgsl
index 326a8e1..8f95579 100644
--- a/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log2/adb233.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn log2_adb233() {
   var res : vec3<f32> = log2(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_adb233();
diff --git a/test/tint/builtins/gen/literal/log2/aea659.wgsl b/test/tint/builtins/gen/literal/log2/aea659.wgsl
index d9f6a9f..e4e2bc7 100644
--- a/test/tint/builtins/gen/literal/log2/aea659.wgsl
+++ b/test/tint/builtins/gen/literal/log2/aea659.wgsl
@@ -24,7 +24,9 @@
 // fn log2(vec<2, f32>) -> vec<2, f32>
 fn log2_aea659() {
   var res: vec2<f32> = log2(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.dxc.hlsl
index e6088a3..9fc6ef6 100644
--- a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_aea659() {
   float2 res = (0.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.fxc.hlsl
index e6088a3..9fc6ef6 100644
--- a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_aea659() {
   float2 res = (0.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.glsl
index 354998d..de0de8b 100644
--- a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log2_aea659() {
   vec2 res = vec2(0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log2_aea659() {
   vec2 res = vec2(0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log2_aea659() {
   vec2 res = vec2(0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.msl b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.msl
index ecd1f50..9132239 100644
--- a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_aea659() {
+void log2_aea659(device float2* const tint_symbol_1) {
   float2 res = float2(0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_aea659();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  log2_aea659(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_aea659();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  log2_aea659(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_aea659();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  log2_aea659(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.spvasm
index 3c63c4a..603423b 100644
--- a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_aea659 "log2_aea659"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
-         %14 = OpConstantNull %v2float
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v2float
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_aea659 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %14
-               OpStore %res %14
+%log2_aea659 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %17
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %24 = OpLoad %v2float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %log2_aea659
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %log2_aea659
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log2_aea659
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log2_aea659
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %log2_aea659
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %log2_aea659
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.wgsl
index 039526e..64f911b 100644
--- a/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log2/aea659.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn log2_aea659() {
   var res : vec2<f32> = log2(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_aea659();
diff --git a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl
index 09b40fd..6b511b6 100644
--- a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl
+++ b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl
@@ -26,7 +26,9 @@
 // fn log2(vec<2, f16>) -> vec<2, f16>
 fn log2_fb9f0b() {
   var res: vec2<f16> = log2(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.dxc.hlsl
index b09eff5..4f6dde4 100644
--- a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_fb9f0b() {
   vector<float16_t, 2> res = (float16_t(0.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.fxc.hlsl
index 40ca080..3908444 100644
--- a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_fb9f0b() {
   vector<float16_t, 2> res = (float16_t(0.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.glsl
index 75a4369..df3f339 100644
--- a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log2_fb9f0b() {
   f16vec2 res = f16vec2(0.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log2_fb9f0b() {
   f16vec2 res = f16vec2(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log2_fb9f0b() {
   f16vec2 res = f16vec2(0.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.msl b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.msl
index 0e844fd..b44bdcd 100644
--- a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_fb9f0b() {
+void log2_fb9f0b(device half2* const tint_symbol_1) {
   half2 res = half2(0.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_fb9f0b();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  log2_fb9f0b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_fb9f0b();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  log2_fb9f0b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_fb9f0b();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  log2_fb9f0b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.spvasm
index 8c6b96e..4d58054 100644
--- a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_fb9f0b "log2_fb9f0b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-         %15 = OpConstantNull %v2half
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2half
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %18 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_fb9f0b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %15
-               OpStore %res %15
+%log2_fb9f0b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %18
+               OpStore %res %18
+         %24 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %25 = OpLoad %v2half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %log2_fb9f0b
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %log2_fb9f0b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %14
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %log2_fb9f0b
+%fragment_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %log2_fb9f0b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %log2_fb9f0b
+%compute_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %log2_fb9f0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.wgsl
index 1967a3f..9b10d18 100644
--- a/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/log2/fb9f0b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn log2_fb9f0b() {
   var res : vec2<f16> = log2(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_fb9f0b();
diff --git a/test/tint/builtins/gen/literal/max/067f3a.wgsl b/test/tint/builtins/gen/literal/max/067f3a.wgsl
index 6065ff3..8347830 100644
--- a/test/tint/builtins/gen/literal/max/067f3a.wgsl
+++ b/test/tint/builtins/gen/literal/max/067f3a.wgsl
@@ -25,7 +25,6 @@
 fn max_067f3a() {
   var res = max(vec2(1), vec2(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_067f3a();
diff --git a/test/tint/builtins/gen/literal/max/0c0aae.wgsl b/test/tint/builtins/gen/literal/max/0c0aae.wgsl
index d1208ff..e98fdc7 100644
--- a/test/tint/builtins/gen/literal/max/0c0aae.wgsl
+++ b/test/tint/builtins/gen/literal/max/0c0aae.wgsl
@@ -24,7 +24,9 @@
 // fn max(u32, u32) -> u32
 fn max_0c0aae() {
   var res: u32 = max(1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.dxc.hlsl
index 0d4762d..313e59a 100644
--- a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_0c0aae() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.fxc.hlsl
index 0d4762d..313e59a 100644
--- a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_0c0aae() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.glsl
index 4eb3287..4ec846c 100644
--- a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void max_0c0aae() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void max_0c0aae() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void max_0c0aae() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.msl
index 6ff69f7..5a94126 100644
--- a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_0c0aae() {
+void max_0c0aae(device uint* const tint_symbol_1) {
   uint res = 1u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_0c0aae();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  max_0c0aae(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_0c0aae();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  max_0c0aae(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_0c0aae();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  max_0c0aae(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.spvasm
index 3ea7e9e..e4c9757 100644
--- a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_0c0aae "max_0c0aae"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_0c0aae = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %max_0c0aae = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_1
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %max_0c0aae
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %max_0c0aae
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %max_0c0aae
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %max_0c0aae
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %max_0c0aae
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %max_0c0aae
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.wgsl
index 33e2de9..65f5867 100644
--- a/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/0c0aae.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_0c0aae() {
   var res : u32 = max(1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_0c0aae();
diff --git a/test/tint/builtins/gen/literal/max/111ac0.wgsl b/test/tint/builtins/gen/literal/max/111ac0.wgsl
index 6166980..b1f11f6 100644
--- a/test/tint/builtins/gen/literal/max/111ac0.wgsl
+++ b/test/tint/builtins/gen/literal/max/111ac0.wgsl
@@ -26,7 +26,9 @@
 // fn max(f16, f16) -> f16
 fn max_111ac0() {
   var res: f16 = max(1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.dxc.hlsl
index 7d95f64..f077d29 100644
--- a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_111ac0() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.fxc.hlsl
index 5c7b1b6..1c3fcfe 100644
--- a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_111ac0() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.glsl
index 6207fa1..896968b 100644
--- a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void max_111ac0() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void max_111ac0() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void max_111ac0() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.msl
index 0f7a84f..f96b8b4 100644
--- a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_111ac0() {
+void max_111ac0(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_111ac0();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  max_111ac0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_111ac0();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  max_111ac0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_111ac0();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  max_111ac0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.spvasm
index 35c5bbe..09902cf 100644
--- a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_111ac0 "max_111ac0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_111ac0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %max_111ac0 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %max_111ac0
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %max_111ac0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %max_111ac0
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_111ac0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %max_111ac0
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %max_111ac0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.wgsl
index 831d7f5..dfd0cf1 100644
--- a/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/111ac0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn max_111ac0() {
   var res : f16 = max(1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_111ac0();
diff --git a/test/tint/builtins/gen/literal/max/19070a.wgsl b/test/tint/builtins/gen/literal/max/19070a.wgsl
index a4b4cf3..1b2dac3 100644
--- a/test/tint/builtins/gen/literal/max/19070a.wgsl
+++ b/test/tint/builtins/gen/literal/max/19070a.wgsl
@@ -25,7 +25,6 @@
 fn max_19070a() {
   var res = max(vec4(1), vec4(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_19070a();
diff --git a/test/tint/builtins/gen/literal/max/25eafe.wgsl b/test/tint/builtins/gen/literal/max/25eafe.wgsl
index d94c505..485d1b6 100644
--- a/test/tint/builtins/gen/literal/max/25eafe.wgsl
+++ b/test/tint/builtins/gen/literal/max/25eafe.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<3, i32>, vec<3, i32>) -> vec<3, i32>
 fn max_25eafe() {
   var res: vec3<i32> = max(vec3<i32>(1i), vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.dxc.hlsl
index b04947f..1bf23d2 100644
--- a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_25eafe() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.fxc.hlsl
index b04947f..1bf23d2 100644
--- a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_25eafe() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.glsl
index 12fb45e..093ba48 100644
--- a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void max_25eafe() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void max_25eafe() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void max_25eafe() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.msl
index 9df3891..f4a7200 100644
--- a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_25eafe() {
+void max_25eafe(device packed_int3* const tint_symbol_1) {
   int3 res = int3(1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_25eafe();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  max_25eafe(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_25eafe();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  max_25eafe(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_25eafe();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  max_25eafe(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.spvasm
index bd921b9..d754ae3 100644
--- a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_25eafe "max_25eafe"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_25eafe = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+ %max_25eafe = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_25eafe
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %max_25eafe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_25eafe
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %max_25eafe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_25eafe
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %max_25eafe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.wgsl
index ac1fd8b..02fe2e6 100644
--- a/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/25eafe.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_25eafe() {
   var res : vec3<i32> = max(vec3<i32>(1i), vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_25eafe();
diff --git a/test/tint/builtins/gen/literal/max/320815.wgsl b/test/tint/builtins/gen/literal/max/320815.wgsl
index 73169ef..eddb58e 100644
--- a/test/tint/builtins/gen/literal/max/320815.wgsl
+++ b/test/tint/builtins/gen/literal/max/320815.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<2, u32>, vec<2, u32>) -> vec<2, u32>
 fn max_320815() {
   var res: vec2<u32> = max(vec2<u32>(1u), vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.dxc.hlsl
index 5651f35..f55126a 100644
--- a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_320815() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.fxc.hlsl
index 5651f35..f55126a 100644
--- a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_320815() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.glsl
index 63398f3..fc1e645 100644
--- a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void max_320815() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void max_320815() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void max_320815() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.msl
index 6add814..036b86c 100644
--- a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_320815() {
+void max_320815(device uint2* const tint_symbol_1) {
   uint2 res = uint2(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_320815();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  max_320815(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_320815();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  max_320815(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_320815();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  max_320815(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.spvasm
index 426ea4c..34223e3 100644
--- a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_320815 "max_320815"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_320815 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+ %max_320815 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_320815
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %max_320815
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_320815
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_320815
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_320815
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %max_320815
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.wgsl
index d47c2e1..8567228 100644
--- a/test/tint/builtins/gen/literal/max/320815.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/320815.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_320815() {
   var res : vec2<u32> = max(vec2<u32>(1u), vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_320815();
diff --git a/test/tint/builtins/gen/literal/max/34956e.wgsl b/test/tint/builtins/gen/literal/max/34956e.wgsl
index 39bbadc..a175451 100644
--- a/test/tint/builtins/gen/literal/max/34956e.wgsl
+++ b/test/tint/builtins/gen/literal/max/34956e.wgsl
@@ -26,7 +26,9 @@
 // fn max(vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn max_34956e() {
   var res: vec2<f16> = max(vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.dxc.hlsl
index 6410f13..c304141 100644
--- a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_34956e() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.fxc.hlsl
index 39fb2a3..9ecfc3b 100644
--- a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_34956e() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.glsl
index 8482965..1567d40 100644
--- a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void max_34956e() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void max_34956e() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void max_34956e() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.msl
index 77b92a0..cd5e3c2 100644
--- a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_34956e() {
+void max_34956e(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_34956e();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  max_34956e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_34956e();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  max_34956e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_34956e();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  max_34956e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.spvasm
index b918261..d2fd6f3 100644
--- a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_34956e "max_34956e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_34956e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %max_34956e = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_34956e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %max_34956e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_34956e
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %max_34956e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_34956e
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %max_34956e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.wgsl
index 59c80c2..12d6284 100644
--- a/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/34956e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn max_34956e() {
   var res : vec2<f16> = max(vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_34956e();
diff --git a/test/tint/builtins/gen/literal/max/445169.wgsl b/test/tint/builtins/gen/literal/max/445169.wgsl
index 50d4b67..ff0805d 100644
--- a/test/tint/builtins/gen/literal/max/445169.wgsl
+++ b/test/tint/builtins/gen/literal/max/445169.wgsl
@@ -26,7 +26,9 @@
 // fn max(vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn max_445169() {
   var res: vec3<f16> = max(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.dxc.hlsl
index dba568b..eae23f9 100644
--- a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_445169() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.fxc.hlsl
index 23c4eee..fe5efe6 100644
--- a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_445169() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.glsl
index 9aef87d..b375d3a 100644
--- a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void max_445169() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void max_445169() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void max_445169() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.msl
index a11f513..70347d0 100644
--- a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_445169() {
+void max_445169(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_445169();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  max_445169(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_445169();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  max_445169(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_445169();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  max_445169(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.spvasm
index a5e471d..71d4638 100644
--- a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_445169 "max_445169"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_445169 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %max_445169 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_445169
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %max_445169
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_445169
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %max_445169
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_445169
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %max_445169
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.wgsl
index 738ca7d..d97d66f 100644
--- a/test/tint/builtins/gen/literal/max/445169.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/445169.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn max_445169() {
   var res : vec3<f16> = max(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_445169();
diff --git a/test/tint/builtins/gen/literal/max/44a39d.wgsl b/test/tint/builtins/gen/literal/max/44a39d.wgsl
index 0cce358..3b83e70 100644
--- a/test/tint/builtins/gen/literal/max/44a39d.wgsl
+++ b/test/tint/builtins/gen/literal/max/44a39d.wgsl
@@ -24,7 +24,9 @@
 // fn max(f32, f32) -> f32
 fn max_44a39d() {
   var res: f32 = max(1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.dxc.hlsl
index df6650e..ba36927 100644
--- a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_44a39d() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.fxc.hlsl
index df6650e..ba36927 100644
--- a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_44a39d() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.glsl
index 002344b..a60597c 100644
--- a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void max_44a39d() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void max_44a39d() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void max_44a39d() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.msl
index cfb1e3b..15a7971 100644
--- a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_44a39d() {
+void max_44a39d(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_44a39d();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  max_44a39d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_44a39d();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  max_44a39d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_44a39d();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  max_44a39d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.spvasm
index b7dcd9e..f681f7d 100644
--- a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_44a39d "max_44a39d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
- %max_44a39d = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+ %max_44a39d = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %max_44a39d
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %max_44a39d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %max_44a39d
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %max_44a39d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %max_44a39d
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_44a39d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.wgsl
index e485a04..809da53 100644
--- a/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/44a39d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_44a39d() {
   var res : f32 = max(1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_44a39d();
diff --git a/test/tint/builtins/gen/literal/max/453e04.wgsl b/test/tint/builtins/gen/literal/max/453e04.wgsl
index 07bb04c..62f8f08 100644
--- a/test/tint/builtins/gen/literal/max/453e04.wgsl
+++ b/test/tint/builtins/gen/literal/max/453e04.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<4, u32>, vec<4, u32>) -> vec<4, u32>
 fn max_453e04() {
   var res: vec4<u32> = max(vec4<u32>(1u), vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.dxc.hlsl
index ceda3d5..36c0d6a 100644
--- a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_453e04() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.fxc.hlsl
index ceda3d5..36c0d6a 100644
--- a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_453e04() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.glsl
index d2a1001..8fd2610 100644
--- a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void max_453e04() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void max_453e04() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void max_453e04() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.msl
index ab31609..9e4a968 100644
--- a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_453e04() {
+void max_453e04(device uint4* const tint_symbol_1) {
   uint4 res = uint4(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_453e04();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  max_453e04(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_453e04();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  max_453e04(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_453e04();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  max_453e04(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.spvasm
index e4ebd24..8f782eb 100644
--- a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_453e04 "max_453e04"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_453e04 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+ %max_453e04 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_453e04
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %max_453e04
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_453e04
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_453e04
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_453e04
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %max_453e04
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.wgsl
index 49573f5..106df96 100644
--- a/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/453e04.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_453e04() {
   var res : vec4<u32> = max(vec4<u32>(1u), vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_453e04();
diff --git a/test/tint/builtins/gen/literal/max/462050.wgsl b/test/tint/builtins/gen/literal/max/462050.wgsl
index f7eac58..7efbc5d 100644
--- a/test/tint/builtins/gen/literal/max/462050.wgsl
+++ b/test/tint/builtins/gen/literal/max/462050.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn max_462050() {
   var res: vec2<f32> = max(vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.dxc.hlsl
index aa14956..89c41ec 100644
--- a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_462050() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.fxc.hlsl
index aa14956..89c41ec 100644
--- a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_462050() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.glsl
index e4cc622..3685ac3 100644
--- a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void max_462050() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void max_462050() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void max_462050() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.msl
index a75ed20..fef4bdc 100644
--- a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_462050() {
+void max_462050(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_462050();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  max_462050(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_462050();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  max_462050(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_462050();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  max_462050(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.spvasm
index dddd6d9..04ccd17 100644
--- a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_462050 "max_462050"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
- %max_462050 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+ %max_462050 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %max_462050
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %max_462050
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %max_462050
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_462050
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %max_462050
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %max_462050
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.wgsl
index f28ca59..24763d6 100644
--- a/test/tint/builtins/gen/literal/max/462050.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/462050.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_462050() {
   var res : vec2<f32> = max(vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_462050();
diff --git a/test/tint/builtins/gen/literal/max/482d23.wgsl b/test/tint/builtins/gen/literal/max/482d23.wgsl
index 223df4a..68b8950 100644
--- a/test/tint/builtins/gen/literal/max/482d23.wgsl
+++ b/test/tint/builtins/gen/literal/max/482d23.wgsl
@@ -25,7 +25,6 @@
 fn max_482d23() {
   var res = max(vec3(1), vec3(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_482d23();
diff --git a/test/tint/builtins/gen/literal/max/4883ac.wgsl b/test/tint/builtins/gen/literal/max/4883ac.wgsl
index cef3a73..5fdf72a 100644
--- a/test/tint/builtins/gen/literal/max/4883ac.wgsl
+++ b/test/tint/builtins/gen/literal/max/4883ac.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn max_4883ac() {
   var res: vec3<f32> = max(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.dxc.hlsl
index 37bd1fb..7593532 100644
--- a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_4883ac() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.fxc.hlsl
index 37bd1fb..7593532 100644
--- a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_4883ac() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.glsl
index e3dc512..ec6d243 100644
--- a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void max_4883ac() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void max_4883ac() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void max_4883ac() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.msl
index ea7bfc0..0be6762 100644
--- a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_4883ac() {
+void max_4883ac(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_4883ac();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  max_4883ac(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_4883ac();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  max_4883ac(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_4883ac();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  max_4883ac(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.spvasm
index d94f62b..44fa896 100644
--- a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_4883ac "max_4883ac"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
- %max_4883ac = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+ %max_4883ac = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %max_4883ac
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %max_4883ac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %max_4883ac
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_4883ac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %max_4883ac
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %max_4883ac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.wgsl
index 2178c76..8361894 100644
--- a/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/4883ac.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_4883ac() {
   var res : vec3<f32> = max(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_4883ac();
diff --git a/test/tint/builtins/gen/literal/max/4bbff2.wgsl b/test/tint/builtins/gen/literal/max/4bbff2.wgsl
index 077c52e..8f6adc2 100644
--- a/test/tint/builtins/gen/literal/max/4bbff2.wgsl
+++ b/test/tint/builtins/gen/literal/max/4bbff2.wgsl
@@ -25,7 +25,6 @@
 fn max_4bbff2() {
   var res = max(vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_4bbff2();
diff --git a/test/tint/builtins/gen/literal/max/85e6bc.wgsl b/test/tint/builtins/gen/literal/max/85e6bc.wgsl
index e7129a6..ca7b39c 100644
--- a/test/tint/builtins/gen/literal/max/85e6bc.wgsl
+++ b/test/tint/builtins/gen/literal/max/85e6bc.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<4, i32>, vec<4, i32>) -> vec<4, i32>
 fn max_85e6bc() {
   var res: vec4<i32> = max(vec4<i32>(1i), vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.dxc.hlsl
index 6f3f3eb..ab1b5d6 100644
--- a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_85e6bc() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.fxc.hlsl
index 6f3f3eb..ab1b5d6 100644
--- a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_85e6bc() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.glsl
index 65079ff..101baea 100644
--- a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void max_85e6bc() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void max_85e6bc() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void max_85e6bc() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.msl
index aee22fa..07fedbc 100644
--- a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_85e6bc() {
+void max_85e6bc(device int4* const tint_symbol_1) {
   int4 res = int4(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_85e6bc();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  max_85e6bc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_85e6bc();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  max_85e6bc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_85e6bc();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  max_85e6bc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.spvasm
index c4dcb60..0a2f24b 100644
--- a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_85e6bc "max_85e6bc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_85e6bc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+ %max_85e6bc = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_85e6bc
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %max_85e6bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_85e6bc
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %max_85e6bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_85e6bc
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %max_85e6bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.wgsl
index df2e77d..d470131 100644
--- a/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/85e6bc.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_85e6bc() {
   var res : vec4<i32> = max(vec4<i32>(1i), vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_85e6bc();
diff --git a/test/tint/builtins/gen/literal/max/a1b196.wgsl b/test/tint/builtins/gen/literal/max/a1b196.wgsl
index 9ee35c8..e015ea9 100644
--- a/test/tint/builtins/gen/literal/max/a1b196.wgsl
+++ b/test/tint/builtins/gen/literal/max/a1b196.wgsl
@@ -25,7 +25,6 @@
 fn max_a1b196() {
   var res = max(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_a1b196();
diff --git a/test/tint/builtins/gen/literal/max/a93419.wgsl b/test/tint/builtins/gen/literal/max/a93419.wgsl
index 8616a73..2b9aea6 100644
--- a/test/tint/builtins/gen/literal/max/a93419.wgsl
+++ b/test/tint/builtins/gen/literal/max/a93419.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn max_a93419() {
   var res: vec4<f32> = max(vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.dxc.hlsl
index 7784c6b..d9ecad1 100644
--- a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_a93419() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.fxc.hlsl
index 7784c6b..d9ecad1 100644
--- a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_a93419() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.glsl
index 319bccc..874f79e 100644
--- a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void max_a93419() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void max_a93419() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void max_a93419() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.msl
index d0104de..9325652 100644
--- a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_a93419() {
+void max_a93419(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_a93419();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  max_a93419(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_a93419();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  max_a93419(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_a93419();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  max_a93419(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.spvasm
index e48697c..e203f47 100644
--- a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_a93419 "max_a93419"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
- %max_a93419 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+ %max_a93419 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %max_a93419
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %max_a93419
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %max_a93419
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %max_a93419
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_a93419
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_a93419
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.wgsl
index 3bf5ae7..dc7e05f 100644
--- a/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/a93419.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_a93419() {
   var res : vec4<f32> = max(vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_a93419();
diff --git a/test/tint/builtins/gen/literal/max/b1b73a.wgsl b/test/tint/builtins/gen/literal/max/b1b73a.wgsl
index 059fa7c..02bcb786 100644
--- a/test/tint/builtins/gen/literal/max/b1b73a.wgsl
+++ b/test/tint/builtins/gen/literal/max/b1b73a.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<3, u32>, vec<3, u32>) -> vec<3, u32>
 fn max_b1b73a() {
   var res: vec3<u32> = max(vec3<u32>(1u), vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.dxc.hlsl
index 15ac424..3bbbc8e 100644
--- a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_b1b73a() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.fxc.hlsl
index 15ac424..3bbbc8e 100644
--- a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_b1b73a() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.glsl
index 3463dfa..ec4706f 100644
--- a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void max_b1b73a() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void max_b1b73a() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void max_b1b73a() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.msl
index 5854d89..3c10904b 100644
--- a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_b1b73a() {
+void max_b1b73a(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(1u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_b1b73a();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  max_b1b73a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_b1b73a();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  max_b1b73a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_b1b73a();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  max_b1b73a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.spvasm
index 98dfa8a..0665e7a 100644
--- a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_b1b73a "max_b1b73a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_b1b73a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+ %max_b1b73a = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_b1b73a
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %max_b1b73a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_b1b73a
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_b1b73a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_b1b73a
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %max_b1b73a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.wgsl
index 545f4ef..9293b1c 100644
--- a/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/b1b73a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_b1b73a() {
   var res : vec3<u32> = max(vec3<u32>(1u), vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_b1b73a();
diff --git a/test/tint/builtins/gen/literal/max/c023dd.wgsl b/test/tint/builtins/gen/literal/max/c023dd.wgsl
index 7237735..3cccfd3 100644
--- a/test/tint/builtins/gen/literal/max/c023dd.wgsl
+++ b/test/tint/builtins/gen/literal/max/c023dd.wgsl
@@ -25,7 +25,6 @@
 fn max_c023dd() {
   var res = max(1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_c023dd();
diff --git a/test/tint/builtins/gen/literal/max/caa3d7.wgsl b/test/tint/builtins/gen/literal/max/caa3d7.wgsl
index f483e37..98cae0c 100644
--- a/test/tint/builtins/gen/literal/max/caa3d7.wgsl
+++ b/test/tint/builtins/gen/literal/max/caa3d7.wgsl
@@ -25,7 +25,6 @@
 fn max_caa3d7() {
   var res = max(1, 1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_caa3d7();
diff --git a/test/tint/builtins/gen/literal/max/ce7c30.wgsl b/test/tint/builtins/gen/literal/max/ce7c30.wgsl
index d7adc0a..97a4ad0 100644
--- a/test/tint/builtins/gen/literal/max/ce7c30.wgsl
+++ b/test/tint/builtins/gen/literal/max/ce7c30.wgsl
@@ -24,7 +24,9 @@
 // fn max(i32, i32) -> i32
 fn max_ce7c30() {
   var res: i32 = max(1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.dxc.hlsl
index 27cb5c5..a28191c 100644
--- a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_ce7c30() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.fxc.hlsl
index 27cb5c5..a28191c 100644
--- a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_ce7c30() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.glsl
index a7d29fb..1005cda 100644
--- a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void max_ce7c30() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void max_ce7c30() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void max_ce7c30() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.msl
index 22abaa9..51dc388 100644
--- a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_ce7c30() {
+void max_ce7c30(device int* const tint_symbol_1) {
   int res = 1;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_ce7c30();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  max_ce7c30(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_ce7c30();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  max_ce7c30(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_ce7c30();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  max_ce7c30(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.spvasm
index 8933ceb..e29b7d4 100644
--- a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_ce7c30 "max_ce7c30"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_ce7c30 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+ %max_ce7c30 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %max_ce7c30
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %max_ce7c30
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %max_ce7c30
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_ce7c30
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %max_ce7c30
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %max_ce7c30
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.wgsl
index ff0fc81..0c850b4 100644
--- a/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/ce7c30.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_ce7c30() {
   var res : i32 = max(1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_ce7c30();
diff --git a/test/tint/builtins/gen/literal/max/de6b87.wgsl b/test/tint/builtins/gen/literal/max/de6b87.wgsl
index 934b8e2..09947e5 100644
--- a/test/tint/builtins/gen/literal/max/de6b87.wgsl
+++ b/test/tint/builtins/gen/literal/max/de6b87.wgsl
@@ -25,7 +25,6 @@
 fn max_de6b87() {
   var res = max(vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_de6b87();
diff --git a/test/tint/builtins/gen/literal/max/e14f2b.wgsl b/test/tint/builtins/gen/literal/max/e14f2b.wgsl
index f5ef502..1dc3e9d 100644
--- a/test/tint/builtins/gen/literal/max/e14f2b.wgsl
+++ b/test/tint/builtins/gen/literal/max/e14f2b.wgsl
@@ -26,7 +26,9 @@
 // fn max(vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn max_e14f2b() {
   var res: vec4<f16> = max(vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.dxc.hlsl
index 469fc6d..6b0c1df 100644
--- a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_e14f2b() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.fxc.hlsl
index e4268e6..9d85582 100644
--- a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_e14f2b() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.glsl
index fb193b0..116f5f7 100644
--- a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void max_e14f2b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void max_e14f2b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void max_e14f2b() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.msl
index 4a91dd7..28112f8 100644
--- a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_e14f2b() {
+void max_e14f2b(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_e14f2b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  max_e14f2b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_e14f2b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  max_e14f2b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_e14f2b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  max_e14f2b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.spvasm
index b093326..a41f8f1e 100644
--- a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_e14f2b "max_e14f2b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_e14f2b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %max_e14f2b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_e14f2b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %max_e14f2b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_e14f2b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %max_e14f2b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_e14f2b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %max_e14f2b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.wgsl
index c15e410..a21ff59 100644
--- a/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/e14f2b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn max_e14f2b() {
   var res : vec4<f16> = max(vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_e14f2b();
diff --git a/test/tint/builtins/gen/literal/max/e8192f.wgsl b/test/tint/builtins/gen/literal/max/e8192f.wgsl
index 7da69eb..900b01a 100644
--- a/test/tint/builtins/gen/literal/max/e8192f.wgsl
+++ b/test/tint/builtins/gen/literal/max/e8192f.wgsl
@@ -24,7 +24,9 @@
 // fn max(vec<2, i32>, vec<2, i32>) -> vec<2, i32>
 fn max_e8192f() {
   var res: vec2<i32> = max(vec2<i32>(1i), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.dxc.hlsl
index d63e56b..6d8ac58 100644
--- a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_e8192f() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.fxc.hlsl
index d63e56b..6d8ac58 100644
--- a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_e8192f() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.glsl
index ab11900..33bdf75 100644
--- a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void max_e8192f() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void max_e8192f() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void max_e8192f() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.msl b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.msl
index 3233d81..e328e24 100644
--- a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_e8192f() {
+void max_e8192f(device int2* const tint_symbol_1) {
   int2 res = int2(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_e8192f();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  max_e8192f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_e8192f();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  max_e8192f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_e8192f();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  max_e8192f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.spvasm
index bf943c1..8e462a3 100644
--- a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_e8192f "max_e8192f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_e8192f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+ %max_e8192f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %max_e8192f
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %max_e8192f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %max_e8192f
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %max_e8192f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %max_e8192f
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %max_e8192f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.wgsl
index 8931dd7..7b5f8b2 100644
--- a/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/max/e8192f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn max_e8192f() {
   var res : vec2<i32> = max(vec2<i32>(1i), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_e8192f();
diff --git a/test/tint/builtins/gen/literal/min/03c7e3.wgsl b/test/tint/builtins/gen/literal/min/03c7e3.wgsl
index e8dca14..a361a51 100644
--- a/test/tint/builtins/gen/literal/min/03c7e3.wgsl
+++ b/test/tint/builtins/gen/literal/min/03c7e3.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<2, i32>, vec<2, i32>) -> vec<2, i32>
 fn min_03c7e3() {
   var res: vec2<i32> = min(vec2<i32>(1i), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.dxc.hlsl
index 1c74dbe..1050e55 100644
--- a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_03c7e3() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.fxc.hlsl
index 1c74dbe..1050e55 100644
--- a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_03c7e3() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.glsl
index d3db29c..7902113 100644
--- a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void min_03c7e3() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void min_03c7e3() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void min_03c7e3() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.msl
index 7b75cb4..86f3b77 100644
--- a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_03c7e3() {
+void min_03c7e3(device int2* const tint_symbol_1) {
   int2 res = int2(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_03c7e3();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  min_03c7e3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_03c7e3();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  min_03c7e3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_03c7e3();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  min_03c7e3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.spvasm
index aa6e1fc..b798137 100644
--- a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_03c7e3 "min_03c7e3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_03c7e3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+ %min_03c7e3 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_03c7e3
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %min_03c7e3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_03c7e3
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %min_03c7e3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_03c7e3
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %min_03c7e3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.wgsl
index 17f015b..ef373f5 100644
--- a/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/03c7e3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_03c7e3() {
   var res : vec2<i32> = min(vec2<i32>(1i), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_03c7e3();
diff --git a/test/tint/builtins/gen/literal/min/0dc614.wgsl b/test/tint/builtins/gen/literal/min/0dc614.wgsl
index 8696fa2..6ea7879 100644
--- a/test/tint/builtins/gen/literal/min/0dc614.wgsl
+++ b/test/tint/builtins/gen/literal/min/0dc614.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<4, u32>, vec<4, u32>) -> vec<4, u32>
 fn min_0dc614() {
   var res: vec4<u32> = min(vec4<u32>(1u), vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.dxc.hlsl
index 5ffbd91..94ac868 100644
--- a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_0dc614() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.fxc.hlsl
index 5ffbd91..94ac868 100644
--- a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_0dc614() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.glsl
index 24f7480..f1ae3fe 100644
--- a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void min_0dc614() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void min_0dc614() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void min_0dc614() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.msl
index ac09e2e..7183348 100644
--- a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_0dc614() {
+void min_0dc614(device uint4* const tint_symbol_1) {
   uint4 res = uint4(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_0dc614();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  min_0dc614(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_0dc614();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  min_0dc614(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_0dc614();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  min_0dc614(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.spvasm
index 191f501..b6be401 100644
--- a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_0dc614 "min_0dc614"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_0dc614 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+ %min_0dc614 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_0dc614
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %min_0dc614
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_0dc614
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_0dc614
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_0dc614
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %min_0dc614
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.wgsl
index a9491e2..7dea8a9 100644
--- a/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/0dc614.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_0dc614() {
   var res : vec4<u32> = min(vec4<u32>(1u), vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_0dc614();
diff --git a/test/tint/builtins/gen/literal/min/364910.wgsl b/test/tint/builtins/gen/literal/min/364910.wgsl
index 8c79b20..8b974ba 100644
--- a/test/tint/builtins/gen/literal/min/364910.wgsl
+++ b/test/tint/builtins/gen/literal/min/364910.wgsl
@@ -25,7 +25,6 @@
 fn min_364910() {
   var res = min(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_364910();
diff --git a/test/tint/builtins/gen/literal/min/371bd6.wgsl b/test/tint/builtins/gen/literal/min/371bd6.wgsl
index 04aa197..24f3999 100644
--- a/test/tint/builtins/gen/literal/min/371bd6.wgsl
+++ b/test/tint/builtins/gen/literal/min/371bd6.wgsl
@@ -25,7 +25,6 @@
 fn min_371bd6() {
   var res = min(vec3(1), vec3(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_371bd6();
diff --git a/test/tint/builtins/gen/literal/min/3941e1.wgsl b/test/tint/builtins/gen/literal/min/3941e1.wgsl
index 8e57a50..a7d4cd0 100644
--- a/test/tint/builtins/gen/literal/min/3941e1.wgsl
+++ b/test/tint/builtins/gen/literal/min/3941e1.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<4, i32>, vec<4, i32>) -> vec<4, i32>
 fn min_3941e1() {
   var res: vec4<i32> = min(vec4<i32>(1i), vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.dxc.hlsl
index 6c14f5e..02b84d7 100644
--- a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_3941e1() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.fxc.hlsl
index 6c14f5e..02b84d7 100644
--- a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_3941e1() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.glsl
index b8b4e73..fe1b381 100644
--- a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void min_3941e1() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void min_3941e1() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void min_3941e1() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.msl
index 8f57a49..4c48213 100644
--- a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_3941e1() {
+void min_3941e1(device int4* const tint_symbol_1) {
   int4 res = int4(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_3941e1();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  min_3941e1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_3941e1();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  min_3941e1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_3941e1();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  min_3941e1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.spvasm
index 2b743fa..b22b2dd 100644
--- a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_3941e1 "min_3941e1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_3941e1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+ %min_3941e1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_3941e1
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %min_3941e1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_3941e1
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %min_3941e1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_3941e1
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %min_3941e1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.wgsl
index f131dd9..6ad370b 100644
--- a/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/3941e1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_3941e1() {
   var res : vec4<i32> = min(vec4<i32>(1i), vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_3941e1();
diff --git a/test/tint/builtins/gen/literal/min/46c5d3.wgsl b/test/tint/builtins/gen/literal/min/46c5d3.wgsl
index d846085..67b1247 100644
--- a/test/tint/builtins/gen/literal/min/46c5d3.wgsl
+++ b/test/tint/builtins/gen/literal/min/46c5d3.wgsl
@@ -24,7 +24,9 @@
 // fn min(u32, u32) -> u32
 fn min_46c5d3() {
   var res: u32 = min(1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.dxc.hlsl
index 2adc546..d9cd5ba 100644
--- a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_46c5d3() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.fxc.hlsl
index 2adc546..d9cd5ba 100644
--- a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_46c5d3() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.glsl
index 444617b..621e991 100644
--- a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void min_46c5d3() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void min_46c5d3() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void min_46c5d3() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.msl
index 3e33fa4..c718e75 100644
--- a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_46c5d3() {
+void min_46c5d3(device uint* const tint_symbol_1) {
   uint res = 1u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_46c5d3();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  min_46c5d3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_46c5d3();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  min_46c5d3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_46c5d3();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  min_46c5d3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.spvasm
index 7bfb18a..8b5689e 100644
--- a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_46c5d3 "min_46c5d3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_46c5d3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %min_46c5d3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_1
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %min_46c5d3
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %min_46c5d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %min_46c5d3
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %min_46c5d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %min_46c5d3
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %min_46c5d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.wgsl
index c4d2300..4f7046c 100644
--- a/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/46c5d3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_46c5d3() {
   var res : u32 = min(1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_46c5d3();
diff --git a/test/tint/builtins/gen/literal/min/527b79.wgsl b/test/tint/builtins/gen/literal/min/527b79.wgsl
index 3b6488d..9e21f7f 100644
--- a/test/tint/builtins/gen/literal/min/527b79.wgsl
+++ b/test/tint/builtins/gen/literal/min/527b79.wgsl
@@ -25,7 +25,6 @@
 fn min_527b79() {
   var res = min(vec2(1), vec2(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_527b79();
diff --git a/test/tint/builtins/gen/literal/min/717257.wgsl b/test/tint/builtins/gen/literal/min/717257.wgsl
index 2c23153..c14c902 100644
--- a/test/tint/builtins/gen/literal/min/717257.wgsl
+++ b/test/tint/builtins/gen/literal/min/717257.wgsl
@@ -25,7 +25,6 @@
 fn min_717257() {
   var res = min(vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_717257();
diff --git a/test/tint/builtins/gen/literal/min/794711.wgsl b/test/tint/builtins/gen/literal/min/794711.wgsl
index f798f47..1d12254 100644
--- a/test/tint/builtins/gen/literal/min/794711.wgsl
+++ b/test/tint/builtins/gen/literal/min/794711.wgsl
@@ -25,7 +25,6 @@
 fn min_794711() {
   var res = min(1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_794711();
diff --git a/test/tint/builtins/gen/literal/min/7c710a.wgsl b/test/tint/builtins/gen/literal/min/7c710a.wgsl
index 4b6d299..44bb4b7 100644
--- a/test/tint/builtins/gen/literal/min/7c710a.wgsl
+++ b/test/tint/builtins/gen/literal/min/7c710a.wgsl
@@ -26,7 +26,9 @@
 // fn min(vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn min_7c710a() {
   var res: vec4<f16> = min(vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.dxc.hlsl
index 8b0eba7..de74ce6 100644
--- a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_7c710a() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.fxc.hlsl
index fe0a5bd..90e9bb9 100644
--- a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_7c710a() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.glsl
index 310bb20..65a9a1d 100644
--- a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void min_7c710a() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void min_7c710a() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void min_7c710a() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.msl
index b684958..221d3b4 100644
--- a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_7c710a() {
+void min_7c710a(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_7c710a();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  min_7c710a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_7c710a();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  min_7c710a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_7c710a();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  min_7c710a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.spvasm
index 90068e0..4097505 100644
--- a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_7c710a "min_7c710a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_7c710a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %min_7c710a = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_7c710a
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %min_7c710a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_7c710a
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %min_7c710a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_7c710a
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %min_7c710a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.wgsl
index adefdcf..1ac22c5 100644
--- a/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/7c710a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn min_7c710a() {
   var res : vec4<f16> = min(vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_7c710a();
diff --git a/test/tint/builtins/gen/literal/min/82b28f.wgsl b/test/tint/builtins/gen/literal/min/82b28f.wgsl
index bc98a80..20e0676 100644
--- a/test/tint/builtins/gen/literal/min/82b28f.wgsl
+++ b/test/tint/builtins/gen/literal/min/82b28f.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<2, u32>, vec<2, u32>) -> vec<2, u32>
 fn min_82b28f() {
   var res: vec2<u32> = min(vec2<u32>(1u), vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.dxc.hlsl
index 3e00f1c..95f3f32 100644
--- a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_82b28f() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.fxc.hlsl
index 3e00f1c..95f3f32 100644
--- a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_82b28f() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.glsl
index 6e386ba..0091d51 100644
--- a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void min_82b28f() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void min_82b28f() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void min_82b28f() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.msl
index 4661bd4..3d1a78e 100644
--- a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_82b28f() {
+void min_82b28f(device uint2* const tint_symbol_1) {
   uint2 res = uint2(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_82b28f();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  min_82b28f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_82b28f();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  min_82b28f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_82b28f();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  min_82b28f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.spvasm
index 9334349..68f3c71 100644
--- a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_82b28f "min_82b28f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_82b28f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+ %min_82b28f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_82b28f
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %min_82b28f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_82b28f
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_82b28f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_82b28f
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %min_82b28f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.wgsl
index cfd2297..59b0176 100644
--- a/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/82b28f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_82b28f() {
   var res : vec2<u32> = min(vec2<u32>(1u), vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_82b28f();
diff --git a/test/tint/builtins/gen/literal/min/84c9fe.wgsl b/test/tint/builtins/gen/literal/min/84c9fe.wgsl
index dfb2bf1..fdb868a 100644
--- a/test/tint/builtins/gen/literal/min/84c9fe.wgsl
+++ b/test/tint/builtins/gen/literal/min/84c9fe.wgsl
@@ -25,7 +25,6 @@
 fn min_84c9fe() {
   var res = min(1, 1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_84c9fe();
diff --git a/test/tint/builtins/gen/literal/min/93cfc4.wgsl b/test/tint/builtins/gen/literal/min/93cfc4.wgsl
index 70218a3..cf2dd31 100644
--- a/test/tint/builtins/gen/literal/min/93cfc4.wgsl
+++ b/test/tint/builtins/gen/literal/min/93cfc4.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn min_93cfc4() {
   var res: vec3<f32> = min(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.dxc.hlsl
index 7f3d36b..bcbead3 100644
--- a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_93cfc4() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.fxc.hlsl
index 7f3d36b..bcbead3 100644
--- a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_93cfc4() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.glsl
index 0da21a3..b4abf64 100644
--- a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void min_93cfc4() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void min_93cfc4() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void min_93cfc4() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.msl
index 969ee0c..02e284d 100644
--- a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_93cfc4() {
+void min_93cfc4(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_93cfc4();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  min_93cfc4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_93cfc4();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  min_93cfc4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_93cfc4();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  min_93cfc4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.spvasm
index e8f8373..7669360 100644
--- a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_93cfc4 "min_93cfc4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
- %min_93cfc4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+ %min_93cfc4 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %min_93cfc4
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %min_93cfc4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %min_93cfc4
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_93cfc4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %min_93cfc4
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %min_93cfc4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.wgsl
index a9b796d..da57997 100644
--- a/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/93cfc4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_93cfc4() {
   var res : vec3<f32> = min(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_93cfc4();
diff --git a/test/tint/builtins/gen/literal/min/98e797.wgsl b/test/tint/builtins/gen/literal/min/98e797.wgsl
index 87e2c90..1713bc6 100644
--- a/test/tint/builtins/gen/literal/min/98e797.wgsl
+++ b/test/tint/builtins/gen/literal/min/98e797.wgsl
@@ -25,7 +25,6 @@
 fn min_98e797() {
   var res = min(vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_98e797();
diff --git a/test/tint/builtins/gen/literal/min/a45171.wgsl b/test/tint/builtins/gen/literal/min/a45171.wgsl
index 0770ca5..07dadc9 100644
--- a/test/tint/builtins/gen/literal/min/a45171.wgsl
+++ b/test/tint/builtins/gen/literal/min/a45171.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<3, i32>, vec<3, i32>) -> vec<3, i32>
 fn min_a45171() {
   var res: vec3<i32> = min(vec3<i32>(1i), vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.dxc.hlsl
index 51826ce..ac18550 100644
--- a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_a45171() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.fxc.hlsl
index 51826ce..ac18550 100644
--- a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_a45171() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.glsl
index 1f3ea6c..3342319 100644
--- a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void min_a45171() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void min_a45171() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void min_a45171() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.msl
index 2dfdbb9..c1c549f 100644
--- a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_a45171() {
+void min_a45171(device packed_int3* const tint_symbol_1) {
   int3 res = int3(1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_a45171();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  min_a45171(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_a45171();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  min_a45171(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_a45171();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  min_a45171(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.spvasm
index e062b5d..f7f4d17 100644
--- a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_a45171 "min_a45171"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_a45171 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+ %min_a45171 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_a45171
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %min_a45171
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_a45171
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %min_a45171
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_a45171
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %min_a45171
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.wgsl
index af8954f..b591429 100644
--- a/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/a45171.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_a45171() {
   var res : vec3<i32> = min(vec3<i32>(1i), vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_a45171();
diff --git a/test/tint/builtins/gen/literal/min/aa28ad.wgsl b/test/tint/builtins/gen/literal/min/aa28ad.wgsl
index 97ac59d..6d16b35 100644
--- a/test/tint/builtins/gen/literal/min/aa28ad.wgsl
+++ b/test/tint/builtins/gen/literal/min/aa28ad.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn min_aa28ad() {
   var res: vec2<f32> = min(vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.dxc.hlsl
index 43b8243..c00ace3 100644
--- a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_aa28ad() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.fxc.hlsl
index 43b8243..c00ace3 100644
--- a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_aa28ad() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.glsl
index f27d2cf..d0c283d 100644
--- a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void min_aa28ad() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void min_aa28ad() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void min_aa28ad() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.msl
index eee90b1..db3fe17 100644
--- a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_aa28ad() {
+void min_aa28ad(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_aa28ad();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  min_aa28ad(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_aa28ad();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  min_aa28ad(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_aa28ad();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  min_aa28ad(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.spvasm
index 90bae0b..fffe8ab 100644
--- a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_aa28ad "min_aa28ad"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
- %min_aa28ad = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+ %min_aa28ad = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %min_aa28ad
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %min_aa28ad
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %min_aa28ad
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_aa28ad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %min_aa28ad
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %min_aa28ad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.wgsl
index 7be6f81..931ca01 100644
--- a/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/aa28ad.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_aa28ad() {
   var res : vec2<f32> = min(vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_aa28ad();
diff --git a/test/tint/builtins/gen/literal/min/ab0acd.wgsl b/test/tint/builtins/gen/literal/min/ab0acd.wgsl
index 767c17e..57ffa6b 100644
--- a/test/tint/builtins/gen/literal/min/ab0acd.wgsl
+++ b/test/tint/builtins/gen/literal/min/ab0acd.wgsl
@@ -26,7 +26,9 @@
 // fn min(vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn min_ab0acd() {
   var res: vec3<f16> = min(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.dxc.hlsl
index c20edb6..d553489 100644
--- a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_ab0acd() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.fxc.hlsl
index 400eef0..813c98d 100644
--- a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_ab0acd() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.glsl
index ca18250..3489a96 100644
--- a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void min_ab0acd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void min_ab0acd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void min_ab0acd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.msl
index 933adbc..3114c13 100644
--- a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_ab0acd() {
+void min_ab0acd(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_ab0acd();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  min_ab0acd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_ab0acd();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  min_ab0acd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_ab0acd();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  min_ab0acd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.spvasm
index 73f4d5f..3f37f69 100644
--- a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_ab0acd "min_ab0acd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_ab0acd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %min_ab0acd = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_ab0acd
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %min_ab0acd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_ab0acd
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %min_ab0acd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_ab0acd
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %min_ab0acd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.wgsl
index 2ad7141..f1f04e3 100644
--- a/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/ab0acd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn min_ab0acd() {
   var res : vec3<f16> = min(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_ab0acd();
diff --git a/test/tint/builtins/gen/literal/min/ac84d6.wgsl b/test/tint/builtins/gen/literal/min/ac84d6.wgsl
index e56adbe..ea0d453 100644
--- a/test/tint/builtins/gen/literal/min/ac84d6.wgsl
+++ b/test/tint/builtins/gen/literal/min/ac84d6.wgsl
@@ -26,7 +26,9 @@
 // fn min(f16, f16) -> f16
 fn min_ac84d6() {
   var res: f16 = min(1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.dxc.hlsl
index 8584a03..470ecbb 100644
--- a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_ac84d6() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.fxc.hlsl
index 217bcce..94817b8 100644
--- a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_ac84d6() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.glsl
index 56599e6..60e3d18 100644
--- a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void min_ac84d6() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void min_ac84d6() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void min_ac84d6() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.msl
index 8fd9348..66ab6cd 100644
--- a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_ac84d6() {
+void min_ac84d6(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_ac84d6();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  min_ac84d6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_ac84d6();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  min_ac84d6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_ac84d6();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  min_ac84d6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.spvasm
index 90b0ce6..7bde6e5 100644
--- a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_ac84d6 "min_ac84d6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_ac84d6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %min_ac84d6 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %min_ac84d6
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %min_ac84d6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %min_ac84d6
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_ac84d6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %min_ac84d6
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %min_ac84d6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.wgsl
index 317af36..79d64bb 100644
--- a/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/ac84d6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn min_ac84d6() {
   var res : f16 = min(1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_ac84d6();
diff --git a/test/tint/builtins/gen/literal/min/af326d.wgsl b/test/tint/builtins/gen/literal/min/af326d.wgsl
index 83ed240..89cd94f 100644
--- a/test/tint/builtins/gen/literal/min/af326d.wgsl
+++ b/test/tint/builtins/gen/literal/min/af326d.wgsl
@@ -24,7 +24,9 @@
 // fn min(f32, f32) -> f32
 fn min_af326d() {
   var res: f32 = min(1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.dxc.hlsl
index e409519..7ba20e2 100644
--- a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_af326d() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.fxc.hlsl
index e409519..7ba20e2 100644
--- a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_af326d() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.glsl
index 15dd3c8..b6cba2f 100644
--- a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void min_af326d() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void min_af326d() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void min_af326d() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.msl
index 03a37d6..5c94ecc 100644
--- a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_af326d() {
+void min_af326d(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_af326d();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  min_af326d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_af326d();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  min_af326d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_af326d();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  min_af326d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.spvasm
index 7d44ab4..727a75f 100644
--- a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_af326d "min_af326d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
- %min_af326d = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+ %min_af326d = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %min_af326d
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %min_af326d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %min_af326d
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %min_af326d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %min_af326d
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_af326d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.wgsl
index 237752f..e7808df 100644
--- a/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/af326d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_af326d() {
   var res : f32 = min(1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_af326d();
diff --git a/test/tint/builtins/gen/literal/min/af364e.wgsl b/test/tint/builtins/gen/literal/min/af364e.wgsl
index b862304..b044fe7 100644
--- a/test/tint/builtins/gen/literal/min/af364e.wgsl
+++ b/test/tint/builtins/gen/literal/min/af364e.wgsl
@@ -25,7 +25,6 @@
 fn min_af364e() {
   var res = min(vec4(1), vec4(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_af364e();
diff --git a/test/tint/builtins/gen/literal/min/c70bb7.wgsl b/test/tint/builtins/gen/literal/min/c70bb7.wgsl
index 3c29081..4ac3001 100644
--- a/test/tint/builtins/gen/literal/min/c70bb7.wgsl
+++ b/test/tint/builtins/gen/literal/min/c70bb7.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<3, u32>, vec<3, u32>) -> vec<3, u32>
 fn min_c70bb7() {
   var res: vec3<u32> = min(vec3<u32>(1u), vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.dxc.hlsl
index 88ee250..b19247d 100644
--- a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c70bb7() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.fxc.hlsl
index 88ee250..b19247d 100644
--- a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c70bb7() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.glsl
index 298f471..b26106a 100644
--- a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void min_c70bb7() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void min_c70bb7() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void min_c70bb7() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.msl
index 1a6ed4d..7bfdd9a 100644
--- a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_c70bb7() {
+void min_c70bb7(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(1u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_c70bb7();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  min_c70bb7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_c70bb7();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  min_c70bb7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_c70bb7();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  min_c70bb7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.spvasm
index b015710..07032dd 100644
--- a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_c70bb7 "min_c70bb7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_c70bb7 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+ %min_c70bb7 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_c70bb7
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %min_c70bb7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_c70bb7
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_c70bb7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_c70bb7
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %min_c70bb7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.wgsl
index 827caf58..c82ba39 100644
--- a/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/c70bb7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_c70bb7() {
   var res : vec3<u32> = min(vec3<u32>(1u), vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_c70bb7();
diff --git a/test/tint/builtins/gen/literal/min/c73147.wgsl b/test/tint/builtins/gen/literal/min/c73147.wgsl
index fb79aec..9958295 100644
--- a/test/tint/builtins/gen/literal/min/c73147.wgsl
+++ b/test/tint/builtins/gen/literal/min/c73147.wgsl
@@ -24,7 +24,9 @@
 // fn min(i32, i32) -> i32
 fn min_c73147() {
   var res: i32 = min(1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.dxc.hlsl
index fd9c4ad..d459e9a 100644
--- a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c73147() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.fxc.hlsl
index fd9c4ad..d459e9a 100644
--- a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c73147() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.glsl
index 8395410..da3994e 100644
--- a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void min_c73147() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void min_c73147() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void min_c73147() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.msl
index 061b14d..7556db1 100644
--- a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_c73147() {
+void min_c73147(device int* const tint_symbol_1) {
   int res = 1;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_c73147();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  min_c73147(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_c73147();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  min_c73147(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_c73147();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  min_c73147(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.spvasm
index 7922d75..90450b2 100644
--- a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_c73147 "min_c73147"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_c73147 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+ %min_c73147 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %min_c73147
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %min_c73147
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %min_c73147
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_c73147
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %min_c73147
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %min_c73147
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.wgsl
index b785d30..99d55b7 100644
--- a/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/c73147.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_c73147() {
   var res : i32 = min(1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_c73147();
diff --git a/test/tint/builtins/gen/literal/min/c76fa6.wgsl b/test/tint/builtins/gen/literal/min/c76fa6.wgsl
index a936998..9baaa6d 100644
--- a/test/tint/builtins/gen/literal/min/c76fa6.wgsl
+++ b/test/tint/builtins/gen/literal/min/c76fa6.wgsl
@@ -24,7 +24,9 @@
 // fn min(vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn min_c76fa6() {
   var res: vec4<f32> = min(vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.dxc.hlsl
index a7d64ae..749c38f 100644
--- a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c76fa6() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.fxc.hlsl
index a7d64ae..749c38f 100644
--- a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c76fa6() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.glsl
index 59b5b30..e348b3e 100644
--- a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void min_c76fa6() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void min_c76fa6() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void min_c76fa6() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.msl
index e82368b..1777f74 100644
--- a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_c76fa6() {
+void min_c76fa6(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_c76fa6();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  min_c76fa6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_c76fa6();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  min_c76fa6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_c76fa6();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  min_c76fa6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.spvasm
index cccef6c..57aeb80 100644
--- a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_c76fa6 "min_c76fa6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
- %min_c76fa6 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+ %min_c76fa6 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %min_c76fa6
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %min_c76fa6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %min_c76fa6
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %min_c76fa6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_c76fa6
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_c76fa6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.wgsl
index 9c3f82e..4ee2e6b 100644
--- a/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/c76fa6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn min_c76fa6() {
   var res : vec4<f32> = min(vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_c76fa6();
diff --git a/test/tint/builtins/gen/literal/min/e780f9.wgsl b/test/tint/builtins/gen/literal/min/e780f9.wgsl
index 0b6c927..c34497c 100644
--- a/test/tint/builtins/gen/literal/min/e780f9.wgsl
+++ b/test/tint/builtins/gen/literal/min/e780f9.wgsl
@@ -26,7 +26,9 @@
 // fn min(vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn min_e780f9() {
   var res: vec2<f16> = min(vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.dxc.hlsl
index 9914bd4..b007280 100644
--- a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_e780f9() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.fxc.hlsl
index 0d0bc7c..fcd37ac 100644
--- a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_e780f9() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.glsl
index 572cc19..a735735 100644
--- a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void min_e780f9() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void min_e780f9() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void min_e780f9() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.msl b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.msl
index bc9d3d0..fcc564a 100644
--- a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_e780f9() {
+void min_e780f9(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_e780f9();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  min_e780f9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_e780f9();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  min_e780f9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_e780f9();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  min_e780f9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.spvasm
index 53c6dbe..94e2fc7 100644
--- a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_e780f9 "min_e780f9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_e780f9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %min_e780f9 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %min_e780f9
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %min_e780f9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %min_e780f9
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %min_e780f9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %min_e780f9
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %min_e780f9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.wgsl
index 4b146a5..026e764 100644
--- a/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/min/e780f9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn min_e780f9() {
   var res : vec2<f16> = min(vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_e780f9();
diff --git a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl
index 32ff6cf..362ae3a 100644
--- a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl
+++ b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl
@@ -24,7 +24,9 @@
 // fn mix(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn mix_0c8c33() {
   var res: vec3<f32> = mix(vec3<f32>(1.f), vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.dxc.hlsl
index 83a0b0b..2bbff24 100644
--- a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_0c8c33() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.fxc.hlsl
index 83a0b0b..2bbff24 100644
--- a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_0c8c33() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.glsl
index 5bcc9eb..e79183b 100644
--- a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_0c8c33() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_0c8c33() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_0c8c33() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.msl
index 32b65ed..99752b1 100644
--- a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_0c8c33() {
+void mix_0c8c33(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_0c8c33();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  mix_0c8c33(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_0c8c33();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  mix_0c8c33(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_0c8c33();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  mix_0c8c33(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.spvasm
index ee967f0..63140b0 100644
--- a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_0c8c33 "mix_0c8c33"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
- %mix_0c8c33 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+ %mix_0c8c33 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %mix_0c8c33
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %mix_0c8c33
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %mix_0c8c33
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %mix_0c8c33
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_0c8c33
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_0c8c33
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.wgsl
index ad66345..e13f536 100644
--- a/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/0c8c33.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn mix_0c8c33() {
   var res : vec3<f32> = mix(vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_0c8c33();
diff --git a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl
index d562597..31c2598 100644
--- a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl
+++ b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl
@@ -24,7 +24,9 @@
 // fn mix(vec<4, f32>, vec<4, f32>, f32) -> vec<4, f32>
 fn mix_1faeb1() {
   var res: vec4<f32> = mix(vec4<f32>(1.f), vec4<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.dxc.hlsl
index b61c673..d83898d 100644
--- a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_1faeb1() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.fxc.hlsl
index b61c673..d83898d 100644
--- a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_1faeb1() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.glsl
index e3267bd..a19289e 100644
--- a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_1faeb1() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_1faeb1() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_1faeb1() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.msl
index d5da2da..94a43e7 100644
--- a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_1faeb1() {
+void mix_1faeb1(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_1faeb1();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  mix_1faeb1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_1faeb1();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  mix_1faeb1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_1faeb1();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  mix_1faeb1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.spvasm
index 213f22e..5c52693 100644
--- a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_1faeb1 "mix_1faeb1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
- %mix_1faeb1 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+ %mix_1faeb1 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %mix_1faeb1
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %mix_1faeb1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %mix_1faeb1
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %mix_1faeb1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %mix_1faeb1
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %mix_1faeb1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.wgsl
index 6743370..a29b87d 100644
--- a/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/1faeb1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn mix_1faeb1() {
   var res : vec4<f32> = mix(vec4<f32>(1.0f), vec4<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_1faeb1();
diff --git a/test/tint/builtins/gen/literal/mix/275cac.wgsl b/test/tint/builtins/gen/literal/mix/275cac.wgsl
index 7acdc6b..c9d810d 100644
--- a/test/tint/builtins/gen/literal/mix/275cac.wgsl
+++ b/test/tint/builtins/gen/literal/mix/275cac.wgsl
@@ -25,7 +25,6 @@
 fn mix_275cac() {
   var res = mix(vec4(1.), vec4(1.), 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_275cac();
diff --git a/test/tint/builtins/gen/literal/mix/2fadab.wgsl b/test/tint/builtins/gen/literal/mix/2fadab.wgsl
index 98a69d1..99404e7 100644
--- a/test/tint/builtins/gen/literal/mix/2fadab.wgsl
+++ b/test/tint/builtins/gen/literal/mix/2fadab.wgsl
@@ -24,7 +24,9 @@
 // fn mix(vec<2, f32>, vec<2, f32>, f32) -> vec<2, f32>
 fn mix_2fadab() {
   var res: vec2<f32> = mix(vec2<f32>(1.f), vec2<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.dxc.hlsl
index 968f973..10f9355 100644
--- a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_2fadab() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.fxc.hlsl
index 968f973..10f9355 100644
--- a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_2fadab() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.glsl
index 8720a30..919ad87 100644
--- a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_2fadab() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_2fadab() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_2fadab() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.msl
index a8d4ec6..0548854 100644
--- a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_2fadab() {
+void mix_2fadab(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_2fadab();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  mix_2fadab(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_2fadab();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  mix_2fadab(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_2fadab();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  mix_2fadab(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.spvasm
index 072ddbe..b3652b9 100644
--- a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_2fadab "mix_2fadab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
- %mix_2fadab = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+ %mix_2fadab = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %mix_2fadab
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %mix_2fadab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %mix_2fadab
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %mix_2fadab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_2fadab
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_2fadab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.wgsl
index 1584368..0a084af 100644
--- a/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/2fadab.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn mix_2fadab() {
   var res : vec2<f32> = mix(vec2<f32>(1.0f), vec2<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_2fadab();
diff --git a/test/tint/builtins/gen/literal/mix/30de36.wgsl b/test/tint/builtins/gen/literal/mix/30de36.wgsl
index eba5a1d..dab06d6 100644
--- a/test/tint/builtins/gen/literal/mix/30de36.wgsl
+++ b/test/tint/builtins/gen/literal/mix/30de36.wgsl
@@ -25,7 +25,6 @@
 fn mix_30de36() {
   var res = mix(1., 1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_30de36();
diff --git a/test/tint/builtins/gen/literal/mix/315264.wgsl b/test/tint/builtins/gen/literal/mix/315264.wgsl
index 2f59044..fc2b406 100644
--- a/test/tint/builtins/gen/literal/mix/315264.wgsl
+++ b/test/tint/builtins/gen/literal/mix/315264.wgsl
@@ -24,7 +24,9 @@
 // fn mix(vec<3, f32>, vec<3, f32>, f32) -> vec<3, f32>
 fn mix_315264() {
   var res: vec3<f32> = mix(vec3<f32>(1.f), vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.dxc.hlsl
index 56d0028..a495f48 100644
--- a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_315264() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.fxc.hlsl
index 56d0028..a495f48 100644
--- a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_315264() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.glsl
index 2c2368a..c7bdaab 100644
--- a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_315264() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_315264() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_315264() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.msl
index ad33b82..f56d85c 100644
--- a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_315264() {
+void mix_315264(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_315264();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  mix_315264(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_315264();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  mix_315264(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_315264();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  mix_315264(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.spvasm
index 7c9dfbf..df8a3e7 100644
--- a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_315264 "mix_315264"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
- %mix_315264 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+ %mix_315264 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %mix_315264
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %mix_315264
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %mix_315264
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %mix_315264
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_315264
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_315264
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.wgsl
index 4596da5..4994e24 100644
--- a/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/315264.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn mix_315264() {
   var res : vec3<f32> = mix(vec3<f32>(1.0f), vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_315264();
diff --git a/test/tint/builtins/gen/literal/mix/343c49.wgsl b/test/tint/builtins/gen/literal/mix/343c49.wgsl
index 5af07aa..99a7b61 100644
--- a/test/tint/builtins/gen/literal/mix/343c49.wgsl
+++ b/test/tint/builtins/gen/literal/mix/343c49.wgsl
@@ -25,7 +25,6 @@
 fn mix_343c49() {
   var res = mix(vec3(1.), vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_343c49();
diff --git a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl
index 336f36d..ee67230 100644
--- a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl
+++ b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl
@@ -26,7 +26,9 @@
 // fn mix(f16, f16, f16) -> f16
 fn mix_38cbbb() {
   var res: f16 = mix(1.h, 1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.dxc.hlsl
index 16c39b2..84f0121 100644
--- a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_38cbbb() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.fxc.hlsl
index 8079d2a..ff551e2 100644
--- a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_38cbbb() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.glsl
index 8b9c4ea..2a3810f 100644
--- a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void mix_38cbbb() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void mix_38cbbb() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void mix_38cbbb() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.msl
index 167110e..6332af7 100644
--- a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_38cbbb() {
+void mix_38cbbb(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_38cbbb();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  mix_38cbbb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_38cbbb();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  mix_38cbbb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_38cbbb();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  mix_38cbbb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.spvasm
index c2a3bad..018e149 100644
--- a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_38cbbb "mix_38cbbb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_38cbbb = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %mix_38cbbb = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %mix_38cbbb
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %mix_38cbbb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %mix_38cbbb
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %mix_38cbbb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_38cbbb
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_38cbbb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.wgsl
index b4d4b19..6d0d528 100644
--- a/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/38cbbb.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn mix_38cbbb() {
   var res : f16 = mix(1.0h, 1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_38cbbb();
diff --git a/test/tint/builtins/gen/literal/mix/42d11d.wgsl b/test/tint/builtins/gen/literal/mix/42d11d.wgsl
index 0056fbe..b687653 100644
--- a/test/tint/builtins/gen/literal/mix/42d11d.wgsl
+++ b/test/tint/builtins/gen/literal/mix/42d11d.wgsl
@@ -25,7 +25,6 @@
 fn mix_42d11d() {
   var res = mix(vec2(1.), vec2(1.), 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_42d11d();
diff --git a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl
index 51cefc7..f072ca7 100644
--- a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl
+++ b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl
@@ -24,7 +24,9 @@
 // fn mix(f32, f32, f32) -> f32
 fn mix_4f0b5e() {
   var res: f32 = mix(1.f, 1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.dxc.hlsl
index 158371b..5d38281 100644
--- a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_4f0b5e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.fxc.hlsl
index 158371b..5d38281 100644
--- a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_4f0b5e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.glsl
index 2ebd100..db6c8f6 100644
--- a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void mix_4f0b5e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void mix_4f0b5e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void mix_4f0b5e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.msl
index 62d35b7..44b6207 100644
--- a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_4f0b5e() {
+void mix_4f0b5e(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_4f0b5e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  mix_4f0b5e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_4f0b5e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  mix_4f0b5e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_4f0b5e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  mix_4f0b5e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.spvasm
index effdf99..a946f7b 100644
--- a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_4f0b5e "mix_4f0b5e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
- %mix_4f0b5e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+ %mix_4f0b5e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %mix_4f0b5e
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %mix_4f0b5e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %mix_4f0b5e
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %mix_4f0b5e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %mix_4f0b5e
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %mix_4f0b5e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.wgsl
index a8a790a..38e9774 100644
--- a/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/4f0b5e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn mix_4f0b5e() {
   var res : f32 = mix(1.0f, 1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_4f0b5e();
diff --git a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl
index 3e9338d..b2179fc 100644
--- a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl
+++ b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl
@@ -26,7 +26,9 @@
 // fn mix(vec<3, f16>, vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn mix_63f2fd() {
   var res: vec3<f16> = mix(vec3<f16>(1.h), vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.dxc.hlsl
index 793450d..ae0c2d8 100644
--- a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_63f2fd() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.fxc.hlsl
index 1f151f0..3159dda 100644
--- a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_63f2fd() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.glsl
index 2aeb90c..1979214 100644
--- a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_63f2fd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_63f2fd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_63f2fd() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.msl
index 9d44601..357e27e 100644
--- a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_63f2fd() {
+void mix_63f2fd(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_63f2fd();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  mix_63f2fd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_63f2fd();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  mix_63f2fd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_63f2fd();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  mix_63f2fd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.spvasm
index d081928..e3a7577 100644
--- a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_63f2fd "mix_63f2fd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_63f2fd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %mix_63f2fd = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %mix_63f2fd
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %mix_63f2fd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %mix_63f2fd
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %mix_63f2fd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_63f2fd
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_63f2fd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.wgsl
index bbf29ed..2500f82 100644
--- a/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/63f2fd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn mix_63f2fd() {
   var res : vec3<f16> = mix(vec3<f16>(1.0h), vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_63f2fd();
diff --git a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl
index 7674096..6912425 100644
--- a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl
+++ b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl
@@ -24,7 +24,9 @@
 // fn mix(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn mix_6f8adc() {
   var res: vec2<f32> = mix(vec2<f32>(1.f), vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.dxc.hlsl
index 9ddadda..95fdd74 100644
--- a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_6f8adc() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.fxc.hlsl
index 9ddadda..95fdd74 100644
--- a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_6f8adc() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.glsl
index b573b11..f29f13a 100644
--- a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_6f8adc() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_6f8adc() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_6f8adc() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.msl
index 4cdd381..bfce4c9 100644
--- a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_6f8adc() {
+void mix_6f8adc(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_6f8adc();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  mix_6f8adc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_6f8adc();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  mix_6f8adc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_6f8adc();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  mix_6f8adc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.spvasm
index d924a6b..7ce5e8e 100644
--- a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_6f8adc "mix_6f8adc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
- %mix_6f8adc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+ %mix_6f8adc = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %mix_6f8adc
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %mix_6f8adc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %mix_6f8adc
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %mix_6f8adc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_6f8adc
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_6f8adc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.wgsl
index 1fbda72..345f376 100644
--- a/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/6f8adc.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn mix_6f8adc() {
   var res : vec2<f32> = mix(vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_6f8adc();
diff --git a/test/tint/builtins/gen/literal/mix/98007a.wgsl b/test/tint/builtins/gen/literal/mix/98007a.wgsl
index 379bd11..9a9e3f1 100644
--- a/test/tint/builtins/gen/literal/mix/98007a.wgsl
+++ b/test/tint/builtins/gen/literal/mix/98007a.wgsl
@@ -25,7 +25,6 @@
 fn mix_98007a() {
   var res = mix(vec4(1.), vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_98007a();
diff --git a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl
index e8a4274..fd57d13 100644
--- a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl
+++ b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl
@@ -26,7 +26,9 @@
 // fn mix(vec<2, f16>, vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn mix_98ee3e() {
   var res: vec2<f16> = mix(vec2<f16>(1.h), vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.dxc.hlsl
index bcb5778..fb8f4ce 100644
--- a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_98ee3e() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.fxc.hlsl
index 15d13d0..ba85375 100644
--- a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_98ee3e() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.glsl
index ce3bf4b..c461857 100644
--- a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_98ee3e() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_98ee3e() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_98ee3e() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.msl
index 5479bce..9198c2e 100644
--- a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_98ee3e() {
+void mix_98ee3e(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_98ee3e();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  mix_98ee3e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_98ee3e();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  mix_98ee3e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_98ee3e();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  mix_98ee3e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.spvasm
index d934c75..e2c3143 100644
--- a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_98ee3e "mix_98ee3e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_98ee3e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %mix_98ee3e = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %mix_98ee3e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %mix_98ee3e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %mix_98ee3e
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %mix_98ee3e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_98ee3e
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_98ee3e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.wgsl
index c159cdb..3e93be0 100644
--- a/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/98ee3e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn mix_98ee3e() {
   var res : vec2<f16> = mix(vec2<f16>(1.0h), vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_98ee3e();
diff --git a/test/tint/builtins/gen/literal/mix/9c2681.wgsl b/test/tint/builtins/gen/literal/mix/9c2681.wgsl
index 3d9491e..f18616c 100644
--- a/test/tint/builtins/gen/literal/mix/9c2681.wgsl
+++ b/test/tint/builtins/gen/literal/mix/9c2681.wgsl
@@ -25,7 +25,6 @@
 fn mix_9c2681() {
   var res = mix(vec3(1.), vec3(1.), 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_9c2681();
diff --git a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl
index 5b83bcd..a54283c 100644
--- a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl
+++ b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl
@@ -26,7 +26,9 @@
 // fn mix(vec<3, f16>, vec<3, f16>, f16) -> vec<3, f16>
 fn mix_c1aec6() {
   var res: vec3<f16> = mix(vec3<f16>(1.h), vec3<f16>(1.h), 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.dxc.hlsl
index 4f489f7..f494a0e 100644
--- a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_c1aec6() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.fxc.hlsl
index 3600377..341b1c7 100644
--- a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_c1aec6() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.glsl
index 2344501..234e03a 100644
--- a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_c1aec6() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_c1aec6() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_c1aec6() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.msl
index d4da437..22c7ae6 100644
--- a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_c1aec6() {
+void mix_c1aec6(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_c1aec6();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  mix_c1aec6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_c1aec6();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  mix_c1aec6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_c1aec6();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  mix_c1aec6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.spvasm
index 444d111..930835b 100644
--- a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_c1aec6 "mix_c1aec6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_c1aec6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %mix_c1aec6 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %mix_c1aec6
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %mix_c1aec6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %mix_c1aec6
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %mix_c1aec6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_c1aec6
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_c1aec6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.wgsl
index a3e11f3..1e01717 100644
--- a/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/c1aec6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn mix_c1aec6() {
   var res : vec3<f16> = mix(vec3<f16>(1.0h), vec3<f16>(1.0h), 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_c1aec6();
diff --git a/test/tint/builtins/gen/literal/mix/c37ede.wgsl b/test/tint/builtins/gen/literal/mix/c37ede.wgsl
index 06e0326..02aec00 100644
--- a/test/tint/builtins/gen/literal/mix/c37ede.wgsl
+++ b/test/tint/builtins/gen/literal/mix/c37ede.wgsl
@@ -24,7 +24,9 @@
 // fn mix(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn mix_c37ede() {
   var res: vec4<f32> = mix(vec4<f32>(1.f), vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.dxc.hlsl
index cbc08ef..b48499b 100644
--- a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_c37ede() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.fxc.hlsl
index cbc08ef..b48499b 100644
--- a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_c37ede() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.glsl
index 93e2c94..7126a79 100644
--- a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_c37ede() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_c37ede() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_c37ede() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.msl
index 74ddc4d..7100238 100644
--- a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_c37ede() {
+void mix_c37ede(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_c37ede();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  mix_c37ede(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_c37ede();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  mix_c37ede(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_c37ede();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  mix_c37ede(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.spvasm
index 7076823..b159bcf 100644
--- a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_c37ede "mix_c37ede"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
- %mix_c37ede = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+ %mix_c37ede = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %mix_c37ede
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %mix_c37ede
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %mix_c37ede
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %mix_c37ede
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %mix_c37ede
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %mix_c37ede
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.wgsl
index 71abfdf..f62a92b 100644
--- a/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/c37ede.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn mix_c37ede() {
   var res : vec4<f32> = mix(vec4<f32>(1.0f), vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_c37ede();
diff --git a/test/tint/builtins/gen/literal/mix/e46a83.wgsl b/test/tint/builtins/gen/literal/mix/e46a83.wgsl
index 454dc07..822b4fa 100644
--- a/test/tint/builtins/gen/literal/mix/e46a83.wgsl
+++ b/test/tint/builtins/gen/literal/mix/e46a83.wgsl
@@ -26,7 +26,9 @@
 // fn mix(vec<2, f16>, vec<2, f16>, f16) -> vec<2, f16>
 fn mix_e46a83() {
   var res: vec2<f16> = mix(vec2<f16>(1.h), vec2<f16>(1.h), 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.dxc.hlsl
index cc30659..8c5809c 100644
--- a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_e46a83() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.fxc.hlsl
index 4b80684..d2771cc 100644
--- a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_e46a83() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.glsl
index 557f0cf..2276376 100644
--- a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_e46a83() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_e46a83() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_e46a83() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.msl
index bc1c9e8..f1d3855 100644
--- a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_e46a83() {
+void mix_e46a83(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_e46a83();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  mix_e46a83(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_e46a83();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  mix_e46a83(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_e46a83();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  mix_e46a83(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.spvasm
index 7c9eb75..9f94357 100644
--- a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_e46a83 "mix_e46a83"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_e46a83 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %mix_e46a83 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %mix_e46a83
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %mix_e46a83
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %mix_e46a83
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %mix_e46a83
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_e46a83
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_e46a83
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.wgsl
index bc20255..fc5264c 100644
--- a/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/e46a83.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn mix_e46a83() {
   var res : vec2<f16> = mix(vec2<f16>(1.0h), vec2<f16>(1.0h), 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_e46a83();
diff --git a/test/tint/builtins/gen/literal/mix/ee2468.wgsl b/test/tint/builtins/gen/literal/mix/ee2468.wgsl
index 1f93f66..ae3961e 100644
--- a/test/tint/builtins/gen/literal/mix/ee2468.wgsl
+++ b/test/tint/builtins/gen/literal/mix/ee2468.wgsl
@@ -26,7 +26,9 @@
 // fn mix(vec<4, f16>, vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn mix_ee2468() {
   var res: vec4<f16> = mix(vec4<f16>(1.h), vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.dxc.hlsl
index 2b2597d..1a9a23d 100644
--- a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_ee2468() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.fxc.hlsl
index 8d98116..2fbc091 100644
--- a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_ee2468() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.glsl
index aa1dc5a..2066f8c 100644
--- a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_ee2468() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_ee2468() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_ee2468() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.msl
index 83ad2c8..2739fa8 100644
--- a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_ee2468() {
+void mix_ee2468(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_ee2468();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  mix_ee2468(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_ee2468();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  mix_ee2468(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_ee2468();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  mix_ee2468(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.spvasm
index 149725f..15d8ec4 100644
--- a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_ee2468 "mix_ee2468"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_ee2468 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %mix_ee2468 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %mix_ee2468
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %mix_ee2468
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %mix_ee2468
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %mix_ee2468
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_ee2468
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_ee2468
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.wgsl
index 2e3a3b8..860b1f6 100644
--- a/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/ee2468.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn mix_ee2468() {
   var res : vec4<f16> = mix(vec4<f16>(1.0h), vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_ee2468();
diff --git a/test/tint/builtins/gen/literal/mix/ef3575.wgsl b/test/tint/builtins/gen/literal/mix/ef3575.wgsl
index 76e6cad..494fe74 100644
--- a/test/tint/builtins/gen/literal/mix/ef3575.wgsl
+++ b/test/tint/builtins/gen/literal/mix/ef3575.wgsl
@@ -25,7 +25,6 @@
 fn mix_ef3575() {
   var res = mix(vec2(1.), vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_ef3575();
diff --git a/test/tint/builtins/gen/literal/mix/f1a543.wgsl b/test/tint/builtins/gen/literal/mix/f1a543.wgsl
index 99c4e02..70c836b 100644
--- a/test/tint/builtins/gen/literal/mix/f1a543.wgsl
+++ b/test/tint/builtins/gen/literal/mix/f1a543.wgsl
@@ -26,7 +26,9 @@
 // fn mix(vec<4, f16>, vec<4, f16>, f16) -> vec<4, f16>
 fn mix_f1a543() {
   var res: vec4<f16> = mix(vec4<f16>(1.h), vec4<f16>(1.h), 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.dxc.hlsl
index e2d4c1c..6bd4bf0 100644
--- a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_f1a543() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.fxc.hlsl
index a73fb63..bc67507 100644
--- a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_f1a543() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.glsl b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.glsl
index 7b887c4..476abd1 100644
--- a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_f1a543() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_f1a543() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_f1a543() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.msl b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.msl
index 6de3db3..cf63bf6 100644
--- a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_f1a543() {
+void mix_f1a543(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_f1a543();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  mix_f1a543(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_f1a543();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  mix_f1a543(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_f1a543();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  mix_f1a543(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.spvasm
index a5f3468..ae9c656 100644
--- a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_f1a543 "mix_f1a543"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_f1a543 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %mix_f1a543 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %mix_f1a543
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %mix_f1a543
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %mix_f1a543
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %mix_f1a543
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_f1a543
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_f1a543
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.wgsl
index 90cd459..69e596c 100644
--- a/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/mix/f1a543.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn mix_f1a543() {
   var res : vec4<f16> = mix(vec4<f16>(1.0h), vec4<f16>(1.0h), 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_f1a543();
diff --git a/test/tint/builtins/gen/literal/modf/2d50da.wgsl b/test/tint/builtins/gen/literal/modf/2d50da.wgsl
index e3212fc..239393c 100644
--- a/test/tint/builtins/gen/literal/modf/2d50da.wgsl
+++ b/test/tint/builtins/gen/literal/modf/2d50da.wgsl
@@ -25,7 +25,6 @@
 fn modf_2d50da() {
   var res = modf(vec2<f32>(-1.5f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_2d50da();
diff --git a/test/tint/builtins/gen/literal/modf/45005f.wgsl b/test/tint/builtins/gen/literal/modf/45005f.wgsl
index 2b413ac..563c249 100644
--- a/test/tint/builtins/gen/literal/modf/45005f.wgsl
+++ b/test/tint/builtins/gen/literal/modf/45005f.wgsl
@@ -27,7 +27,6 @@
 fn modf_45005f() {
   var res = modf(vec3<f16>(-1.5h));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_45005f();
diff --git a/test/tint/builtins/gen/literal/modf/4bfced.wgsl b/test/tint/builtins/gen/literal/modf/4bfced.wgsl
index 86e3824..7c5eb1c 100644
--- a/test/tint/builtins/gen/literal/modf/4bfced.wgsl
+++ b/test/tint/builtins/gen/literal/modf/4bfced.wgsl
@@ -25,7 +25,6 @@
 fn modf_4bfced() {
   var res = modf(vec4<f32>(-1.5f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_4bfced();
diff --git a/test/tint/builtins/gen/literal/modf/5ea256.wgsl b/test/tint/builtins/gen/literal/modf/5ea256.wgsl
index 1d6a103..3f76274 100644
--- a/test/tint/builtins/gen/literal/modf/5ea256.wgsl
+++ b/test/tint/builtins/gen/literal/modf/5ea256.wgsl
@@ -25,7 +25,6 @@
 fn modf_5ea256() {
   var res = modf(vec3<f32>(-1.5f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_5ea256();
diff --git a/test/tint/builtins/gen/literal/modf/68d8ee.wgsl b/test/tint/builtins/gen/literal/modf/68d8ee.wgsl
index e7a605a..0f19637 100644
--- a/test/tint/builtins/gen/literal/modf/68d8ee.wgsl
+++ b/test/tint/builtins/gen/literal/modf/68d8ee.wgsl
@@ -25,7 +25,6 @@
 fn modf_68d8ee() {
   var res = modf(vec3(-1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_68d8ee();
diff --git a/test/tint/builtins/gen/literal/modf/732aa6.wgsl b/test/tint/builtins/gen/literal/modf/732aa6.wgsl
index 0ede926..b71f025 100644
--- a/test/tint/builtins/gen/literal/modf/732aa6.wgsl
+++ b/test/tint/builtins/gen/literal/modf/732aa6.wgsl
@@ -25,7 +25,6 @@
 fn modf_732aa6() {
   var res = modf(vec2(-1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_732aa6();
diff --git a/test/tint/builtins/gen/literal/modf/8dbbbf.wgsl b/test/tint/builtins/gen/literal/modf/8dbbbf.wgsl
index 2af78fd..cd2024a 100644
--- a/test/tint/builtins/gen/literal/modf/8dbbbf.wgsl
+++ b/test/tint/builtins/gen/literal/modf/8dbbbf.wgsl
@@ -27,7 +27,6 @@
 fn modf_8dbbbf() {
   var res = modf(-1.5h);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_8dbbbf();
diff --git a/test/tint/builtins/gen/literal/modf/995934.wgsl b/test/tint/builtins/gen/literal/modf/995934.wgsl
index 59170ae..e8d3e02 100644
--- a/test/tint/builtins/gen/literal/modf/995934.wgsl
+++ b/test/tint/builtins/gen/literal/modf/995934.wgsl
@@ -27,7 +27,6 @@
 fn modf_995934() {
   var res = modf(vec4<f16>(-1.5h));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_995934();
diff --git a/test/tint/builtins/gen/literal/modf/a545b9.wgsl b/test/tint/builtins/gen/literal/modf/a545b9.wgsl
index a1c1c6e..668a50e 100644
--- a/test/tint/builtins/gen/literal/modf/a545b9.wgsl
+++ b/test/tint/builtins/gen/literal/modf/a545b9.wgsl
@@ -27,7 +27,6 @@
 fn modf_a545b9() {
   var res = modf(vec2<f16>(-1.5h));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_a545b9();
diff --git a/test/tint/builtins/gen/literal/modf/bbf7f7.wgsl b/test/tint/builtins/gen/literal/modf/bbf7f7.wgsl
index bdcd0f0..ee955d9 100644
--- a/test/tint/builtins/gen/literal/modf/bbf7f7.wgsl
+++ b/test/tint/builtins/gen/literal/modf/bbf7f7.wgsl
@@ -25,7 +25,6 @@
 fn modf_bbf7f7() {
   var res = modf(-1.5f);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_bbf7f7();
diff --git a/test/tint/builtins/gen/literal/modf/c15f48.wgsl b/test/tint/builtins/gen/literal/modf/c15f48.wgsl
index 637bc29..de2b4cb 100644
--- a/test/tint/builtins/gen/literal/modf/c15f48.wgsl
+++ b/test/tint/builtins/gen/literal/modf/c15f48.wgsl
@@ -25,7 +25,6 @@
 fn modf_c15f48() {
   var res = modf(-1.5);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_c15f48();
diff --git a/test/tint/builtins/gen/literal/modf/f3d1f9.wgsl b/test/tint/builtins/gen/literal/modf/f3d1f9.wgsl
index 9eab652..173d26d 100644
--- a/test/tint/builtins/gen/literal/modf/f3d1f9.wgsl
+++ b/test/tint/builtins/gen/literal/modf/f3d1f9.wgsl
@@ -25,7 +25,6 @@
 fn modf_f3d1f9() {
   var res = modf(vec4(-1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_f3d1f9();
diff --git a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl
index 7e2eb67..759baae 100644
--- a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl
@@ -26,7 +26,9 @@
 // fn normalize(vec<3, f16>) -> vec<3, f16>
 fn normalize_39d5ec() {
   var res: vec3<f16> = normalize(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.dxc.hlsl
index befe3df..cb63507 100644
--- a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_39d5ec() {
   vector<float16_t, 3> res = (float16_t(0.5771484375h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.fxc.hlsl
index e472907..715a498 100644
--- a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_39d5ec() {
-  vector<float16_t, 3> res = (float16_t(0.577148438h)).xxx;
+  vector<float16_t, 3> res = (float16_t(0.5771484375h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.glsl b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.glsl
index 3bd03af..413130f 100644
--- a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void normalize_39d5ec() {
   f16vec3 res = f16vec3(0.5771484375hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void normalize_39d5ec() {
   f16vec3 res = f16vec3(0.5771484375hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void normalize_39d5ec() {
   f16vec3 res = f16vec3(0.5771484375hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.msl b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.msl
index afa6c5d..98fbb34 100644
--- a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_39d5ec() {
+void normalize_39d5ec(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.5771484375h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_39d5ec();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  normalize_39d5ec(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_39d5ec();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  normalize_39d5ec(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_39d5ec();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  normalize_39d5ec(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.spvasm
index 2eefc87..3549b8b 100644
--- a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_39d5ec "normalize_39d5ec"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_278pn1 = OpConstant %half 0x1.278p-1
-         %16 = OpConstantComposite %v3half %half_0x1_278pn1 %half_0x1_278pn1 %half_0x1_278pn1
+         %19 = OpConstantComposite %v3half %half_0x1_278pn1 %half_0x1_278pn1 %half_0x1_278pn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_39d5ec = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%normalize_39d5ec = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %normalize_39d5ec
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %normalize_39d5ec
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %normalize_39d5ec
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %normalize_39d5ec
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %normalize_39d5ec
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %normalize_39d5ec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.wgsl
index 27eaacd..b9636e4 100644
--- a/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/39d5ec.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn normalize_39d5ec() {
   var res : vec3<f16> = normalize(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_39d5ec();
diff --git a/test/tint/builtins/gen/literal/normalize/4eaf61.wgsl b/test/tint/builtins/gen/literal/normalize/4eaf61.wgsl
index fbf5698..99dbf5f 100644
--- a/test/tint/builtins/gen/literal/normalize/4eaf61.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/4eaf61.wgsl
@@ -25,7 +25,6 @@
 fn normalize_4eaf61() {
   var res = normalize(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_4eaf61();
diff --git a/test/tint/builtins/gen/literal/normalize/584e47.wgsl b/test/tint/builtins/gen/literal/normalize/584e47.wgsl
index 9a263eb..48c2442 100644
--- a/test/tint/builtins/gen/literal/normalize/584e47.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/584e47.wgsl
@@ -25,7 +25,6 @@
 fn normalize_584e47() {
   var res = normalize(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_584e47();
diff --git a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl
index 7b6fcda..0c0cd95 100644
--- a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl
@@ -24,7 +24,9 @@
 // fn normalize(vec<3, f32>) -> vec<3, f32>
 fn normalize_64d8c0() {
   var res: vec3<f32> = normalize(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.dxc.hlsl
index bf9c4b9..19516e4 100644
--- a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_64d8c0() {
   float3 res = (0.57735025882720947266f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.fxc.hlsl
index bf9c4b9..19516e4 100644
--- a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_64d8c0() {
   float3 res = (0.57735025882720947266f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.glsl
index fcdb09e..060c00d 100644
--- a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void normalize_64d8c0() {
   vec3 res = vec3(0.57735025882720947266f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void normalize_64d8c0() {
   vec3 res = vec3(0.57735025882720947266f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void normalize_64d8c0() {
   vec3 res = vec3(0.57735025882720947266f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.msl b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.msl
index d67eae3..8865137 100644
--- a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_64d8c0() {
+void normalize_64d8c0(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.57735025882720947266f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_64d8c0();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  normalize_64d8c0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_64d8c0();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  normalize_64d8c0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_64d8c0();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  normalize_64d8c0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.spvasm
index 1c825df..f11e7b3 100644
--- a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_64d8c0 "normalize_64d8c0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_577350259 = OpConstant %float 0.577350259
-         %15 = OpConstantComposite %v3float %float_0_577350259 %float_0_577350259 %float_0_577350259
+         %18 = OpConstantComposite %v3float %float_0_577350259 %float_0_577350259 %float_0_577350259
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_64d8c0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%normalize_64d8c0 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %normalize_64d8c0
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %normalize_64d8c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %normalize_64d8c0
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %normalize_64d8c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %normalize_64d8c0
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %normalize_64d8c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.wgsl
index 4e73ed0..5e4d46c 100644
--- a/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/64d8c0.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn normalize_64d8c0() {
   var res : vec3<f32> = normalize(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_64d8c0();
diff --git a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl
index 5dcb17c..90d5ed0 100644
--- a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl
@@ -26,7 +26,9 @@
 // fn normalize(vec<2, f16>) -> vec<2, f16>
 fn normalize_7990f3() {
   var res: vec2<f16> = normalize(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.dxc.hlsl
index f031fc9..601dfd5 100644
--- a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_7990f3() {
   vector<float16_t, 2> res = (float16_t(0.70703125h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.fxc.hlsl
index b459130..e041fac 100644
--- a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_7990f3() {
   vector<float16_t, 2> res = (float16_t(0.70703125h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.glsl
index 7e627a3..72bbf4c 100644
--- a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void normalize_7990f3() {
   f16vec2 res = f16vec2(0.70703125hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void normalize_7990f3() {
   f16vec2 res = f16vec2(0.70703125hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void normalize_7990f3() {
   f16vec2 res = f16vec2(0.70703125hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.msl b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.msl
index 12287c0..6564891 100644
--- a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_7990f3() {
+void normalize_7990f3(device half2* const tint_symbol_1) {
   half2 res = half2(0.70703125h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_7990f3();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  normalize_7990f3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_7990f3();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  normalize_7990f3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_7990f3();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  normalize_7990f3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.spvasm
index 9a4dbcd..fec34ef 100644
--- a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_7990f3 "normalize_7990f3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_6apn1 = OpConstant %half 0x1.6ap-1
-         %16 = OpConstantComposite %v2half %half_0x1_6apn1 %half_0x1_6apn1
+         %19 = OpConstantComposite %v2half %half_0x1_6apn1 %half_0x1_6apn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_7990f3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%normalize_7990f3 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %normalize_7990f3
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %normalize_7990f3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %normalize_7990f3
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %normalize_7990f3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %normalize_7990f3
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %normalize_7990f3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.wgsl
index 996f7d3..475fc1e 100644
--- a/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/7990f3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn normalize_7990f3() {
   var res : vec2<f16> = normalize(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_7990f3();
diff --git a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl
index 7c6d61f..bc1008d 100644
--- a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl
@@ -24,7 +24,9 @@
 // fn normalize(vec<4, f32>) -> vec<4, f32>
 fn normalize_9a0aab() {
   var res: vec4<f32> = normalize(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.dxc.hlsl
index aaa870e..1ce8c0d 100644
--- a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_9a0aab() {
   float4 res = (0.5f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.fxc.hlsl
index aaa870e..1ce8c0d 100644
--- a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_9a0aab() {
   float4 res = (0.5f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.glsl
index 9132a7f..b87e23f 100644
--- a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void normalize_9a0aab() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void normalize_9a0aab() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void normalize_9a0aab() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.msl b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.msl
index c5ef37d..33fe171 100644
--- a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_9a0aab() {
+void normalize_9a0aab(device float4* const tint_symbol_1) {
   float4 res = float4(0.5f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_9a0aab();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  normalize_9a0aab(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_9a0aab();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  normalize_9a0aab(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_9a0aab();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  normalize_9a0aab(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.spvasm
index 7aec576..28b4978 100644
--- a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_9a0aab "normalize_9a0aab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %14 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+         %17 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_9a0aab = OpFunction %void None %9
-         %12 = OpLabel
+%normalize_9a0aab = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %normalize_9a0aab
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %normalize_9a0aab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %normalize_9a0aab
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %normalize_9a0aab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %normalize_9a0aab
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %normalize_9a0aab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.wgsl
index 336e47d..15fbbaf 100644
--- a/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/9a0aab.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn normalize_9a0aab() {
   var res : vec4<f32> = normalize(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_9a0aab();
diff --git a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl
index 6b73d2f..7732e2e 100644
--- a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl
@@ -26,7 +26,9 @@
 // fn normalize(vec<4, f16>) -> vec<4, f16>
 fn normalize_b8cb8d() {
   var res: vec4<f16> = normalize(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.dxc.hlsl
index 2c3c1e3..2278bf4 100644
--- a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_b8cb8d() {
   vector<float16_t, 4> res = (float16_t(0.5h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.fxc.hlsl
index 90dc540..95f591a 100644
--- a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_b8cb8d() {
   vector<float16_t, 4> res = (float16_t(0.5h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.glsl
index 9200dcd..c7d7784 100644
--- a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void normalize_b8cb8d() {
   f16vec4 res = f16vec4(0.5hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void normalize_b8cb8d() {
   f16vec4 res = f16vec4(0.5hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void normalize_b8cb8d() {
   f16vec4 res = f16vec4(0.5hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.msl b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.msl
index dac83d3..4ceeadc 100644
--- a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_b8cb8d() {
+void normalize_b8cb8d(device half4* const tint_symbol_1) {
   half4 res = half4(0.5h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_b8cb8d();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  normalize_b8cb8d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_b8cb8d();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  normalize_b8cb8d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_b8cb8d();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  normalize_b8cb8d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.spvasm
index e79d052..39b66f9 100644
--- a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_b8cb8d "normalize_b8cb8d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
-         %16 = OpConstantComposite %v4half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
+         %19 = OpConstantComposite %v4half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_b8cb8d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%normalize_b8cb8d = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %normalize_b8cb8d
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %normalize_b8cb8d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %normalize_b8cb8d
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %normalize_b8cb8d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %normalize_b8cb8d
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %normalize_b8cb8d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.wgsl
index 2549e2b..5fa58cc 100644
--- a/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/b8cb8d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn normalize_b8cb8d() {
   var res : vec4<f16> = normalize(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_b8cb8d();
diff --git a/test/tint/builtins/gen/literal/normalize/e7def8.wgsl b/test/tint/builtins/gen/literal/normalize/e7def8.wgsl
index ba825ee..1cb9d84 100644
--- a/test/tint/builtins/gen/literal/normalize/e7def8.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/e7def8.wgsl
@@ -25,7 +25,6 @@
 fn normalize_e7def8() {
   var res = normalize(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_e7def8();
diff --git a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl
index acc47ca..04b7abc 100644
--- a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl
@@ -24,7 +24,9 @@
 // fn normalize(vec<2, f32>) -> vec<2, f32>
 fn normalize_fc2ef1() {
   var res: vec2<f32> = normalize(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.dxc.hlsl
index eded47d..8f478f4 100644
--- a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_fc2ef1() {
   float2 res = (0.70710676908493041992f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.fxc.hlsl
index eded47d..8f478f4 100644
--- a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_fc2ef1() {
   float2 res = (0.70710676908493041992f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.glsl
index d1bb408..fcc987e 100644
--- a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void normalize_fc2ef1() {
   vec2 res = vec2(0.70710676908493041992f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void normalize_fc2ef1() {
   vec2 res = vec2(0.70710676908493041992f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void normalize_fc2ef1() {
   vec2 res = vec2(0.70710676908493041992f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.msl b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.msl
index 5bd8afa..bb4ee21 100644
--- a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_fc2ef1() {
+void normalize_fc2ef1(device float2* const tint_symbol_1) {
   float2 res = float2(0.70710676908493041992f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_fc2ef1();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  normalize_fc2ef1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_fc2ef1();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  normalize_fc2ef1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_fc2ef1();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  normalize_fc2ef1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.spvasm
index 04dd16a..7942379 100644
--- a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_fc2ef1 "normalize_fc2ef1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_707106769 = OpConstant %float 0.707106769
-         %15 = OpConstantComposite %v2float %float_0_707106769 %float_0_707106769
+         %18 = OpConstantComposite %v2float %float_0_707106769 %float_0_707106769
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_fc2ef1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%normalize_fc2ef1 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %normalize_fc2ef1
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %normalize_fc2ef1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %normalize_fc2ef1
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %normalize_fc2ef1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %normalize_fc2ef1
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %normalize_fc2ef1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.wgsl
index ef05b25..0ee3e11 100644
--- a/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/normalize/fc2ef1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn normalize_fc2ef1() {
   var res : vec2<f32> = normalize(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_fc2ef1();
diff --git a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl
index 6786f51..c358533 100644
--- a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl
+++ b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl
@@ -24,7 +24,9 @@
 // fn pack2x16float(vec2<f32>) -> u32
 fn pack2x16float_0e97b3() {
   var res: u32 = pack2x16float(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.dxc.hlsl
index 13f5cf6..47825a4 100644
--- a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16float_0e97b3() {
   uint res = 1006648320u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.fxc.hlsl
index 13f5cf6..47825a4 100644
--- a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16float_0e97b3() {
   uint res = 1006648320u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.glsl
index 92f303b..21862b4 100644
--- a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16float_0e97b3() {
   uint res = 1006648320u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16float_0e97b3() {
   uint res = 1006648320u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16float_0e97b3() {
   uint res = 1006648320u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.msl b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.msl
index b15071e..449325e 100644
--- a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack2x16float_0e97b3() {
+void pack2x16float_0e97b3(device uint* const tint_symbol_1) {
   uint res = 1006648320u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack2x16float_0e97b3();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack2x16float_0e97b3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack2x16float_0e97b3();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack2x16float_0e97b3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack2x16float_0e97b3();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack2x16float_0e97b3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.spvasm
index 06736f5..d866bbd 100644
--- a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack2x16float_0e97b3 "pack2x16float_0e97b3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %uint_1006648320 = OpConstant %uint 1006648320
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%pack2x16float_0e97b3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%pack2x16float_0e97b3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_1006648320
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %pack2x16float_0e97b3
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %pack2x16float_0e97b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pack2x16float_0e97b3
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %pack2x16float_0e97b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pack2x16float_0e97b3
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %pack2x16float_0e97b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.wgsl
index 966d268..6bc601e 100644
--- a/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pack2x16float/0e97b3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pack2x16float_0e97b3() {
   var res : u32 = pack2x16float(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack2x16float_0e97b3();
diff --git a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl
index 2fd8fa0..4f2653b 100644
--- a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl
+++ b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl
@@ -24,7 +24,9 @@
 // fn pack2x16snorm(vec2<f32>) -> u32
 fn pack2x16snorm_6c169b() {
   var res: u32 = pack2x16snorm(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.dxc.hlsl
index 0e999a4..c657fc0 100644
--- a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16snorm_6c169b() {
   uint res = 2147450879u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.fxc.hlsl
index 0e999a4..c657fc0 100644
--- a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16snorm_6c169b() {
   uint res = 2147450879u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.glsl
index 6bd01fc..a046756 100644
--- a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16snorm_6c169b() {
   uint res = 2147450879u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16snorm_6c169b() {
   uint res = 2147450879u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16snorm_6c169b() {
   uint res = 2147450879u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.msl b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.msl
index c79bd58..8e69f6a 100644
--- a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack2x16snorm_6c169b() {
+void pack2x16snorm_6c169b(device uint* const tint_symbol_1) {
   uint res = 2147450879u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack2x16snorm_6c169b();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack2x16snorm_6c169b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack2x16snorm_6c169b();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack2x16snorm_6c169b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack2x16snorm_6c169b();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack2x16snorm_6c169b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.spvasm
index e228cf7..f363e7b 100644
--- a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack2x16snorm_6c169b "pack2x16snorm_6c169b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %uint_2147450879 = OpConstant %uint 2147450879
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%pack2x16snorm_6c169b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%pack2x16snorm_6c169b = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_2147450879
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %pack2x16snorm_6c169b
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %pack2x16snorm_6c169b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pack2x16snorm_6c169b
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %pack2x16snorm_6c169b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pack2x16snorm_6c169b
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %pack2x16snorm_6c169b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.wgsl
index 6878ce5..509e16a 100644
--- a/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pack2x16snorm/6c169b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pack2x16snorm_6c169b() {
   var res : u32 = pack2x16snorm(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack2x16snorm_6c169b();
diff --git a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl
index 4850d21..7946f9b 100644
--- a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl
+++ b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl
@@ -24,7 +24,9 @@
 // fn pack2x16unorm(vec2<f32>) -> u32
 fn pack2x16unorm_0f08e4() {
   var res: u32 = pack2x16unorm(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.dxc.hlsl
index 19cd7ce..d4bb634 100644
--- a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16unorm_0f08e4() {
   uint res = 4294967295u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.fxc.hlsl
index 19cd7ce..d4bb634 100644
--- a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16unorm_0f08e4() {
   uint res = 4294967295u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.glsl
index 5cce930..9cbae25 100644
--- a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16unorm_0f08e4() {
   uint res = 4294967295u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16unorm_0f08e4() {
   uint res = 4294967295u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16unorm_0f08e4() {
   uint res = 4294967295u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.msl b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.msl
index a14b346..8312089 100644
--- a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack2x16unorm_0f08e4() {
+void pack2x16unorm_0f08e4(device uint* const tint_symbol_1) {
   uint res = 4294967295u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack2x16unorm_0f08e4();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack2x16unorm_0f08e4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack2x16unorm_0f08e4();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack2x16unorm_0f08e4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack2x16unorm_0f08e4();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack2x16unorm_0f08e4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.spvasm
index 6dbf08f..fb0a725 100644
--- a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack2x16unorm_0f08e4 "pack2x16unorm_0f08e4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %uint_4294967295 = OpConstant %uint 4294967295
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%pack2x16unorm_0f08e4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%pack2x16unorm_0f08e4 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_4294967295
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %pack2x16unorm_0f08e4
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %pack2x16unorm_0f08e4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pack2x16unorm_0f08e4
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %pack2x16unorm_0f08e4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pack2x16unorm_0f08e4
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %pack2x16unorm_0f08e4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.wgsl
index dbec285..8991055 100644
--- a/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pack2x16unorm/0f08e4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pack2x16unorm_0f08e4() {
   var res : u32 = pack2x16unorm(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack2x16unorm_0f08e4();
diff --git a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl
index 085bb2d..7a51749 100644
--- a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl
+++ b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl
@@ -24,7 +24,9 @@
 // fn pack4x8snorm(vec4<f32>) -> u32
 fn pack4x8snorm_4d22e7() {
   var res: u32 = pack4x8snorm(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.dxc.hlsl
index 78a722c..0bb4f19 100644
--- a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack4x8snorm_4d22e7() {
   uint res = 2139062143u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.fxc.hlsl
index 78a722c..0bb4f19 100644
--- a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack4x8snorm_4d22e7() {
   uint res = 2139062143u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.glsl
index b36fc11..1cba533 100644
--- a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8snorm_4d22e7() {
   uint res = 2139062143u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8snorm_4d22e7() {
   uint res = 2139062143u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8snorm_4d22e7() {
   uint res = 2139062143u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.msl b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.msl
index df8cf27..e059021 100644
--- a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack4x8snorm_4d22e7() {
+void pack4x8snorm_4d22e7(device uint* const tint_symbol_1) {
   uint res = 2139062143u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack4x8snorm_4d22e7();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack4x8snorm_4d22e7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack4x8snorm_4d22e7();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack4x8snorm_4d22e7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack4x8snorm_4d22e7();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack4x8snorm_4d22e7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.spvasm
index f7d4e8c..5af7596 100644
--- a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack4x8snorm_4d22e7 "pack4x8snorm_4d22e7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %uint_2139062143 = OpConstant %uint 2139062143
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%pack4x8snorm_4d22e7 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%pack4x8snorm_4d22e7 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_2139062143
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %pack4x8snorm_4d22e7
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %pack4x8snorm_4d22e7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pack4x8snorm_4d22e7
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %pack4x8snorm_4d22e7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pack4x8snorm_4d22e7
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %pack4x8snorm_4d22e7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.wgsl
index 1ff4946..e8b3f12 100644
--- a/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pack4x8snorm/4d22e7.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pack4x8snorm_4d22e7() {
   var res : u32 = pack4x8snorm(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack4x8snorm_4d22e7();
diff --git a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl
index d130a03..36e283b 100644
--- a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl
+++ b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl
@@ -24,7 +24,9 @@
 // fn pack4x8unorm(vec4<f32>) -> u32
 fn pack4x8unorm_95c456() {
   var res: u32 = pack4x8unorm(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.dxc.hlsl
index 3d39cf4..058464f 100644
--- a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack4x8unorm_95c456() {
   uint res = 4294967295u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.fxc.hlsl
index 3d39cf4..058464f 100644
--- a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack4x8unorm_95c456() {
   uint res = 4294967295u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.glsl
index bab2370..a50410d 100644
--- a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8unorm_95c456() {
   uint res = 4294967295u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8unorm_95c456() {
   uint res = 4294967295u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8unorm_95c456() {
   uint res = 4294967295u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.msl b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.msl
index f280a43..f8942f7 100644
--- a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack4x8unorm_95c456() {
+void pack4x8unorm_95c456(device uint* const tint_symbol_1) {
   uint res = 4294967295u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack4x8unorm_95c456();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack4x8unorm_95c456(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack4x8unorm_95c456();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack4x8unorm_95c456(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack4x8unorm_95c456();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack4x8unorm_95c456(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.spvasm
index a90f29f..b048912 100644
--- a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack4x8unorm_95c456 "pack4x8unorm_95c456"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %uint_4294967295 = OpConstant %uint 4294967295
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%pack4x8unorm_95c456 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%pack4x8unorm_95c456 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_4294967295
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %pack4x8unorm_95c456
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %pack4x8unorm_95c456
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pack4x8unorm_95c456
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %pack4x8unorm_95c456
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pack4x8unorm_95c456
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %pack4x8unorm_95c456
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.wgsl
index 9b6adee..b293dd0 100644
--- a/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pack4x8unorm/95c456.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pack4x8unorm_95c456() {
   var res : u32 = pack4x8unorm(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack4x8unorm_95c456();
diff --git a/test/tint/builtins/gen/literal/pow/04a908.wgsl b/test/tint/builtins/gen/literal/pow/04a908.wgsl
index a1e91aa..22b4d56 100644
--- a/test/tint/builtins/gen/literal/pow/04a908.wgsl
+++ b/test/tint/builtins/gen/literal/pow/04a908.wgsl
@@ -24,7 +24,9 @@
 // fn pow(vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn pow_04a908() {
   var res: vec4<f32> = pow(vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.dxc.hlsl
index 1ae0105..de7e352 100644
--- a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_04a908() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.fxc.hlsl
index 1ae0105..de7e352 100644
--- a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_04a908() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.glsl
index 139e5c2..43ef0b6 100644
--- a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void pow_04a908() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void pow_04a908() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void pow_04a908() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.msl b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.msl
index 47d2531..72d5d44 100644
--- a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_04a908() {
+void pow_04a908(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_04a908();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  pow_04a908(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_04a908();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  pow_04a908(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_04a908();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  pow_04a908(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.spvasm
index fdf4f0a..e2a9ca8 100644
--- a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_04a908 "pow_04a908"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
- %pow_04a908 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+ %pow_04a908 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %pow_04a908
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %pow_04a908
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %pow_04a908
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %pow_04a908
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %pow_04a908
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %pow_04a908
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.wgsl
index a89bbf4..60d62b8 100644
--- a/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pow/04a908.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pow_04a908() {
   var res : vec4<f32> = pow(vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_04a908();
diff --git a/test/tint/builtins/gen/literal/pow/46e029.wgsl b/test/tint/builtins/gen/literal/pow/46e029.wgsl
index c87906a..d1f0bf9 100644
--- a/test/tint/builtins/gen/literal/pow/46e029.wgsl
+++ b/test/tint/builtins/gen/literal/pow/46e029.wgsl
@@ -24,7 +24,9 @@
 // fn pow(f32, f32) -> f32
 fn pow_46e029() {
   var res: f32 = pow(1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.dxc.hlsl
index 5d97ebd..2afb349 100644
--- a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_46e029() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.fxc.hlsl
index 5d97ebd..2afb349 100644
--- a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_46e029() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.glsl
index 570c291..ff7be7d 100644
--- a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void pow_46e029() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void pow_46e029() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void pow_46e029() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.msl b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.msl
index f6b1cd9..6b7c5ad 100644
--- a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_46e029() {
+void pow_46e029(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_46e029();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  pow_46e029(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_46e029();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  pow_46e029(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_46e029();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  pow_46e029(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.spvasm
index dba627f..78f3d7b 100644
--- a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_46e029 "pow_46e029"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
- %pow_46e029 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+ %pow_46e029 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %pow_46e029
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %pow_46e029
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %pow_46e029
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %pow_46e029
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pow_46e029
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pow_46e029
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.wgsl
index 892a9ae..2bdf4ad 100644
--- a/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pow/46e029.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pow_46e029() {
   var res : f32 = pow(1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_46e029();
diff --git a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl
index 8320290..2e32b54 100644
--- a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl
+++ b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl
@@ -24,7 +24,9 @@
 // fn pow(vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn pow_4a46c9() {
   var res: vec3<f32> = pow(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.dxc.hlsl
index 56a6bf7..9e6d5a3 100644
--- a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_4a46c9() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.fxc.hlsl
index 56a6bf7..9e6d5a3 100644
--- a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_4a46c9() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.glsl
index 11cb9b9..cd88272 100644
--- a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void pow_4a46c9() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void pow_4a46c9() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void pow_4a46c9() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.msl b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.msl
index 2c06a34..9e3ec55 100644
--- a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_4a46c9() {
+void pow_4a46c9(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_4a46c9();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  pow_4a46c9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_4a46c9();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  pow_4a46c9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_4a46c9();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  pow_4a46c9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.spvasm
index dd4ce26..ae50dba 100644
--- a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_4a46c9 "pow_4a46c9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
- %pow_4a46c9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+ %pow_4a46c9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %pow_4a46c9
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %pow_4a46c9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pow_4a46c9
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pow_4a46c9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pow_4a46c9
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %pow_4a46c9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.wgsl
index c28a611..04c5bb3 100644
--- a/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pow/4a46c9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pow_4a46c9() {
   var res : vec3<f32> = pow(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_4a46c9();
diff --git a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl
index b6306ef..d3a1c2c 100644
--- a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl
+++ b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl
@@ -26,7 +26,9 @@
 // fn pow(vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn pow_4f33b2() {
   var res: vec4<f16> = pow(vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.dxc.hlsl
index b265ae4..4782a6a 100644
--- a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_4f33b2() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.fxc.hlsl
index ab480e6..9956e02 100644
--- a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_4f33b2() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.glsl
index 685d969..c18960b 100644
--- a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void pow_4f33b2() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void pow_4f33b2() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void pow_4f33b2() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.msl b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.msl
index 652fe80..f63e651 100644
--- a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_4f33b2() {
+void pow_4f33b2(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_4f33b2();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  pow_4f33b2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_4f33b2();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  pow_4f33b2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_4f33b2();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  pow_4f33b2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.spvasm
index 475e4b4..e81c4b0 100644
--- a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_4f33b2 "pow_4f33b2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %pow_4f33b2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %pow_4f33b2 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %pow_4f33b2
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %pow_4f33b2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %pow_4f33b2
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %pow_4f33b2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %pow_4f33b2
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %pow_4f33b2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.wgsl
index 241f554..34e6f8c 100644
--- a/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pow/4f33b2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn pow_4f33b2() {
   var res : vec4<f16> = pow(vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_4f33b2();
diff --git a/test/tint/builtins/gen/literal/pow/749c42.wgsl b/test/tint/builtins/gen/literal/pow/749c42.wgsl
index e1c6acc..b05e4d2 100644
--- a/test/tint/builtins/gen/literal/pow/749c42.wgsl
+++ b/test/tint/builtins/gen/literal/pow/749c42.wgsl
@@ -25,7 +25,6 @@
 fn pow_749c42() {
   var res = pow(1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_749c42();
diff --git a/test/tint/builtins/gen/literal/pow/a8f6b2.wgsl b/test/tint/builtins/gen/literal/pow/a8f6b2.wgsl
index 83e8d64..617954e 100644
--- a/test/tint/builtins/gen/literal/pow/a8f6b2.wgsl
+++ b/test/tint/builtins/gen/literal/pow/a8f6b2.wgsl
@@ -25,7 +25,6 @@
 fn pow_a8f6b2() {
   var res = pow(vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_a8f6b2();
diff --git a/test/tint/builtins/gen/literal/pow/bc91ed.wgsl b/test/tint/builtins/gen/literal/pow/bc91ed.wgsl
index 3885637..ea1cede 100644
--- a/test/tint/builtins/gen/literal/pow/bc91ed.wgsl
+++ b/test/tint/builtins/gen/literal/pow/bc91ed.wgsl
@@ -25,7 +25,6 @@
 fn pow_bc91ed() {
   var res = pow(vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_bc91ed();
diff --git a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl
index b2c268d..e356c75 100644
--- a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl
+++ b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl
@@ -26,7 +26,9 @@
 // fn pow(f16, f16) -> f16
 fn pow_ce9ef5() {
   var res: f16 = pow(1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.dxc.hlsl
index dc03903..9e92a3f 100644
--- a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_ce9ef5() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.fxc.hlsl
index b9060e8..195f878 100644
--- a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_ce9ef5() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.glsl
index a3e589a..532311d 100644
--- a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void pow_ce9ef5() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void pow_ce9ef5() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void pow_ce9ef5() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.msl b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.msl
index 46b6ca6..a1bcf9c 100644
--- a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_ce9ef5() {
+void pow_ce9ef5(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_ce9ef5();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  pow_ce9ef5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_ce9ef5();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  pow_ce9ef5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_ce9ef5();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  pow_ce9ef5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.spvasm
index 6d2f5a7..dbbda46 100644
--- a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_ce9ef5 "pow_ce9ef5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %pow_ce9ef5 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %pow_ce9ef5 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %pow_ce9ef5
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %pow_ce9ef5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pow_ce9ef5
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pow_ce9ef5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pow_ce9ef5
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %pow_ce9ef5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.wgsl
index ba7dac9..96980fe 100644
--- a/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pow/ce9ef5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn pow_ce9ef5() {
   var res : f16 = pow(1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_ce9ef5();
diff --git a/test/tint/builtins/gen/literal/pow/e42f20.wgsl b/test/tint/builtins/gen/literal/pow/e42f20.wgsl
index 066b74a..8636fc6 100644
--- a/test/tint/builtins/gen/literal/pow/e42f20.wgsl
+++ b/test/tint/builtins/gen/literal/pow/e42f20.wgsl
@@ -25,7 +25,6 @@
 fn pow_e42f20() {
   var res = pow(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_e42f20();
diff --git a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl
index 1b880fb..3be5621 100644
--- a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl
+++ b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl
@@ -24,7 +24,9 @@
 // fn pow(vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn pow_e60ea5() {
   var res: vec2<f32> = pow(vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.dxc.hlsl
index 972f4c3..784a51a 100644
--- a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_e60ea5() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.fxc.hlsl
index 972f4c3..784a51a 100644
--- a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_e60ea5() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.glsl
index 09a81b2..436ca79 100644
--- a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void pow_e60ea5() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void pow_e60ea5() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void pow_e60ea5() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.msl b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.msl
index f416b4c..1415190 100644
--- a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_e60ea5() {
+void pow_e60ea5(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_e60ea5();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  pow_e60ea5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_e60ea5();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  pow_e60ea5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_e60ea5();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  pow_e60ea5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.spvasm
index 79fe8c3..5d432c0 100644
--- a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_e60ea5 "pow_e60ea5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
- %pow_e60ea5 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+ %pow_e60ea5 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %pow_e60ea5
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %pow_e60ea5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pow_e60ea5
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pow_e60ea5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pow_e60ea5
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %pow_e60ea5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.wgsl
index f1d54b0..40c92a4 100644
--- a/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pow/e60ea5.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn pow_e60ea5() {
   var res : vec2<f32> = pow(vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_e60ea5();
diff --git a/test/tint/builtins/gen/literal/pow/f37b25.wgsl b/test/tint/builtins/gen/literal/pow/f37b25.wgsl
index 9a19834..173044a 100644
--- a/test/tint/builtins/gen/literal/pow/f37b25.wgsl
+++ b/test/tint/builtins/gen/literal/pow/f37b25.wgsl
@@ -26,7 +26,9 @@
 // fn pow(vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn pow_f37b25() {
   var res: vec2<f16> = pow(vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.dxc.hlsl
index e2d71b3..8cca74f 100644
--- a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_f37b25() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.fxc.hlsl
index 9bbb1f7..1f0f65a 100644
--- a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_f37b25() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.glsl
index bc15e2a..4d839b3 100644
--- a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void pow_f37b25() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void pow_f37b25() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void pow_f37b25() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.msl b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.msl
index 9510344..81fc397 100644
--- a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_f37b25() {
+void pow_f37b25(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_f37b25();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  pow_f37b25(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_f37b25();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  pow_f37b25(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_f37b25();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  pow_f37b25(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.spvasm
index 2ab5bca..362ed0c 100644
--- a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_f37b25 "pow_f37b25"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %pow_f37b25 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %pow_f37b25 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %pow_f37b25
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %pow_f37b25
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %pow_f37b25
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %pow_f37b25
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %pow_f37b25
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %pow_f37b25
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.wgsl
index 4ab482e..583f49f 100644
--- a/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pow/f37b25.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn pow_f37b25() {
   var res : vec2<f16> = pow(vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_f37b25();
diff --git a/test/tint/builtins/gen/literal/pow/fa5429.wgsl b/test/tint/builtins/gen/literal/pow/fa5429.wgsl
index 8e718c8..cc58994 100644
--- a/test/tint/builtins/gen/literal/pow/fa5429.wgsl
+++ b/test/tint/builtins/gen/literal/pow/fa5429.wgsl
@@ -26,7 +26,9 @@
 // fn pow(vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn pow_fa5429() {
   var res: vec3<f16> = pow(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.dxc.hlsl
index dae5676..5610a37 100644
--- a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_fa5429() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.fxc.hlsl
index 63cddb3..7ec1d2a 100644
--- a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_fa5429() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.glsl b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.glsl
index be0b8fd..55d7219 100644
--- a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void pow_fa5429() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void pow_fa5429() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void pow_fa5429() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.msl b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.msl
index 2148fc7..daf9da8 100644
--- a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_fa5429() {
+void pow_fa5429(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_fa5429();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  pow_fa5429(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_fa5429();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  pow_fa5429(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_fa5429();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  pow_fa5429(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.spvasm
index 5ad9738..2868cb7 100644
--- a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_fa5429 "pow_fa5429"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %pow_fa5429 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %pow_fa5429 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %pow_fa5429
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %pow_fa5429
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %pow_fa5429
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %pow_fa5429
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %pow_fa5429
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %pow_fa5429
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.wgsl
index 703d869..17c008c 100644
--- a/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/pow/fa5429.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn pow_fa5429() {
   var res : vec3<f16> = pow(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_fa5429();
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl
index c20e612..bef3bb9 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl
@@ -24,7 +24,9 @@
 // fn quantizeToF16(f32) -> f32
 fn quantizeToF16_12e50e() {
   var res: f32 = quantizeToF16(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.dxc.hlsl
index 4ed0cbc..7303e63 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_12e50e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.fxc.hlsl
index 4ed0cbc..7303e63 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_12e50e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.glsl
index 531c0b2..da4668e 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void quantizeToF16_12e50e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void quantizeToF16_12e50e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void quantizeToF16_12e50e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.msl b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.msl
index 1299d62..a032901 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void quantizeToF16_12e50e() {
+void quantizeToF16_12e50e(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  quantizeToF16_12e50e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  quantizeToF16_12e50e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  quantizeToF16_12e50e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  quantizeToF16_12e50e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  quantizeToF16_12e50e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  quantizeToF16_12e50e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.spvasm
index 623716f..705d04c 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %quantizeToF16_12e50e "quantizeToF16_12e50e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%quantizeToF16_12e50e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%quantizeToF16_12e50e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %quantizeToF16_12e50e
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %quantizeToF16_12e50e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %quantizeToF16_12e50e
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %quantizeToF16_12e50e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %quantizeToF16_12e50e
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %quantizeToF16_12e50e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.wgsl
index 5c68e18..031696a 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/12e50e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn quantizeToF16_12e50e() {
   var res : f32 = quantizeToF16(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   quantizeToF16_12e50e();
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl
index 9d496cd..5c9017b 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl
@@ -24,7 +24,9 @@
 // fn quantizeToF16(vec<2, f32>) -> vec<2, f32>
 fn quantizeToF16_2cddf3() {
   var res: vec2<f32> = quantizeToF16(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.dxc.hlsl
index ef0fc56..4f1adc9 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_2cddf3() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.fxc.hlsl
index ef0fc56..4f1adc9 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_2cddf3() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.glsl
index 1a895b1..f26617a 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void quantizeToF16_2cddf3() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void quantizeToF16_2cddf3() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void quantizeToF16_2cddf3() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.msl b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.msl
index eccd5ae..f9548e6 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void quantizeToF16_2cddf3() {
+void quantizeToF16_2cddf3(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  quantizeToF16_2cddf3();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  quantizeToF16_2cddf3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  quantizeToF16_2cddf3();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  quantizeToF16_2cddf3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  quantizeToF16_2cddf3();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  quantizeToF16_2cddf3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.spvasm
index b71e9da..ada729c 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %quantizeToF16_2cddf3 "quantizeToF16_2cddf3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%quantizeToF16_2cddf3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%quantizeToF16_2cddf3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %quantizeToF16_2cddf3
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %quantizeToF16_2cddf3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %quantizeToF16_2cddf3
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %quantizeToF16_2cddf3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %quantizeToF16_2cddf3
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %quantizeToF16_2cddf3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.wgsl
index 277ced8..68a02e4 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/2cddf3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn quantizeToF16_2cddf3() {
   var res : vec2<f32> = quantizeToF16(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   quantizeToF16_2cddf3();
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl
index 118fd3b..b209e3a 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl
@@ -24,7 +24,9 @@
 // fn quantizeToF16(vec<4, f32>) -> vec<4, f32>
 fn quantizeToF16_cba294() {
   var res: vec4<f32> = quantizeToF16(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.dxc.hlsl
index e597919..c4eb0d7 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_cba294() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.fxc.hlsl
index e597919..c4eb0d7 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_cba294() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.glsl b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.glsl
index dc1eb66..46f30e3 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void quantizeToF16_cba294() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void quantizeToF16_cba294() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void quantizeToF16_cba294() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.msl b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.msl
index 6dbfc50..dd0d46b 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void quantizeToF16_cba294() {
+void quantizeToF16_cba294(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  quantizeToF16_cba294();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  quantizeToF16_cba294(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  quantizeToF16_cba294();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  quantizeToF16_cba294(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  quantizeToF16_cba294();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  quantizeToF16_cba294(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.spvasm
index bea6961..df714b9 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %quantizeToF16_cba294 "quantizeToF16_cba294"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%quantizeToF16_cba294 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%quantizeToF16_cba294 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %quantizeToF16_cba294
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %quantizeToF16_cba294
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %quantizeToF16_cba294
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %quantizeToF16_cba294
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %quantizeToF16_cba294
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %quantizeToF16_cba294
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.wgsl
index 0a4cc64..a2cdb0e 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/cba294.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn quantizeToF16_cba294() {
   var res : vec4<f32> = quantizeToF16(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   quantizeToF16_cba294();
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl
index 9d44801..ee2e72b 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl
@@ -24,7 +24,9 @@
 // fn quantizeToF16(vec<3, f32>) -> vec<3, f32>
 fn quantizeToF16_e8fd14() {
   var res: vec3<f32> = quantizeToF16(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.dxc.hlsl
index c403817..00cf8b7 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_e8fd14() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.fxc.hlsl
index c403817..00cf8b7 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_e8fd14() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.glsl b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.glsl
index b5cf6bf..90cb0f9 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void quantizeToF16_e8fd14() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void quantizeToF16_e8fd14() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void quantizeToF16_e8fd14() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.msl b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.msl
index cef9dc2..1380f39 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void quantizeToF16_e8fd14() {
+void quantizeToF16_e8fd14(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  quantizeToF16_e8fd14();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  quantizeToF16_e8fd14(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  quantizeToF16_e8fd14();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  quantizeToF16_e8fd14(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  quantizeToF16_e8fd14();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  quantizeToF16_e8fd14(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.spvasm
index 83f1845..06510e0 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %quantizeToF16_e8fd14 "quantizeToF16_e8fd14"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%quantizeToF16_e8fd14 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%quantizeToF16_e8fd14 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %quantizeToF16_e8fd14
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %quantizeToF16_e8fd14
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %quantizeToF16_e8fd14
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %quantizeToF16_e8fd14
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %quantizeToF16_e8fd14
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %quantizeToF16_e8fd14
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.wgsl
index 29a4c4c..10f0825 100644
--- a/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/quantizeToF16/e8fd14.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn quantizeToF16_e8fd14() {
   var res : vec3<f32> = quantizeToF16(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   quantizeToF16_e8fd14();
diff --git a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl
index 4b214c1..9cbb76e 100644
--- a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl
+++ b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl
@@ -24,7 +24,9 @@
 // fn radians(vec<4, f32>) -> vec<4, f32>
 fn radians_09b7fc() {
   var res: vec4<f32> = radians(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.dxc.hlsl
index 96e2ebe..3f2e687 100644
--- a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_09b7fc() {
   float4 res = (0.01745329238474369049f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.fxc.hlsl
index 96e2ebe..3f2e687 100644
--- a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_09b7fc() {
   float4 res = (0.01745329238474369049f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.glsl
index 47c6819..58f8b3c 100644
--- a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void radians_09b7fc() {
   vec4 res = vec4(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void radians_09b7fc() {
   vec4 res = vec4(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void radians_09b7fc() {
   vec4 res = vec4(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.msl b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.msl
index 9f35906..6c94485 100644
--- a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void radians_09b7fc() {
+void radians_09b7fc(device float4* const tint_symbol_1) {
   float4 res = float4(0.01745329238474369049f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_09b7fc();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  radians_09b7fc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_09b7fc();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  radians_09b7fc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_09b7fc();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  radians_09b7fc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.spvasm
index 51235ca..28c8446 100644
--- a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_09b7fc "radians_09b7fc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_0174532924 = OpConstant %float 0.0174532924
-         %14 = OpConstantComposite %v4float %float_0_0174532924 %float_0_0174532924 %float_0_0174532924 %float_0_0174532924
+         %17 = OpConstantComposite %v4float %float_0_0174532924 %float_0_0174532924 %float_0_0174532924 %float_0_0174532924
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_09b7fc = OpFunction %void None %9
-         %12 = OpLabel
+%radians_09b7fc = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %radians_09b7fc
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %radians_09b7fc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %radians_09b7fc
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %radians_09b7fc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %radians_09b7fc
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %radians_09b7fc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.wgsl
index 76a6cc8..0c94392 100644
--- a/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/radians/09b7fc.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn radians_09b7fc() {
   var res : vec4<f32> = radians(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_09b7fc();
diff --git a/test/tint/builtins/gen/literal/radians/208fd9.wgsl b/test/tint/builtins/gen/literal/radians/208fd9.wgsl
index a9c61e5..f5f740b 100644
--- a/test/tint/builtins/gen/literal/radians/208fd9.wgsl
+++ b/test/tint/builtins/gen/literal/radians/208fd9.wgsl
@@ -26,7 +26,9 @@
 // fn radians(f16) -> f16
 fn radians_208fd9() {
   var res: f16 = radians(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.dxc.hlsl
index 6f3a8c1..b7a5d75 100644
--- a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_208fd9() {
   float16_t res = float16_t(0.0174407958984375h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.fxc.hlsl
index f35ec6f..4c3e95a 100644
--- a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_208fd9() {
-  float16_t res = float16_t(0.017440796h);
+  float16_t res = float16_t(0.0174407958984375h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.glsl
index 732800a..794cc1c 100644
--- a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void radians_208fd9() {
   float16_t res = 0.0174407958984375hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void radians_208fd9() {
   float16_t res = 0.0174407958984375hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void radians_208fd9() {
   float16_t res = 0.0174407958984375hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.msl b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.msl
index 758dea9..f97abde 100644
--- a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void radians_208fd9() {
+void radians_208fd9(device half* const tint_symbol_1) {
   half res = 0.0174407958984375h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_208fd9();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  radians_208fd9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_208fd9();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  radians_208fd9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_208fd9();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  radians_208fd9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.spvasm
index 0081055..1ea63cb 100644
--- a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_208fd9 "radians_208fd9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_1dcpn6 = OpConstant %half 0x1.1dcp-6
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_208fd9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%radians_208fd9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_1dcpn6
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %radians_208fd9
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %radians_208fd9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %radians_208fd9
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %radians_208fd9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %radians_208fd9
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %radians_208fd9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.wgsl
index 24a3c0d..c964fc9 100644
--- a/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/radians/208fd9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn radians_208fd9() {
   var res : f16 = radians(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_208fd9();
diff --git a/test/tint/builtins/gen/literal/radians/379214.wgsl b/test/tint/builtins/gen/literal/radians/379214.wgsl
index 273ddee..d38cb8d0 100644
--- a/test/tint/builtins/gen/literal/radians/379214.wgsl
+++ b/test/tint/builtins/gen/literal/radians/379214.wgsl
@@ -25,7 +25,6 @@
 fn radians_379214() {
   var res = radians(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_379214();
diff --git a/test/tint/builtins/gen/literal/radians/44a9f8.wgsl b/test/tint/builtins/gen/literal/radians/44a9f8.wgsl
index cbb4f6d..f223513 100644
--- a/test/tint/builtins/gen/literal/radians/44a9f8.wgsl
+++ b/test/tint/builtins/gen/literal/radians/44a9f8.wgsl
@@ -25,7 +25,6 @@
 fn radians_44a9f8() {
   var res = radians(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_44a9f8();
diff --git a/test/tint/builtins/gen/literal/radians/44f20b.wgsl b/test/tint/builtins/gen/literal/radians/44f20b.wgsl
index b72488c..3a92c67 100644
--- a/test/tint/builtins/gen/literal/radians/44f20b.wgsl
+++ b/test/tint/builtins/gen/literal/radians/44f20b.wgsl
@@ -26,7 +26,9 @@
 // fn radians(vec<4, f16>) -> vec<4, f16>
 fn radians_44f20b() {
   var res: vec4<f16> = radians(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.dxc.hlsl
index ab8106d..462fdf7 100644
--- a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_44f20b() {
   vector<float16_t, 4> res = (float16_t(0.0174407958984375h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.fxc.hlsl
index d6f3d65..b682c5d 100644
--- a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_44f20b() {
-  vector<float16_t, 4> res = (float16_t(0.017440796h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(0.0174407958984375h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.glsl
index 37ab991..5909e7d 100644
--- a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void radians_44f20b() {
   f16vec4 res = f16vec4(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void radians_44f20b() {
   f16vec4 res = f16vec4(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void radians_44f20b() {
   f16vec4 res = f16vec4(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.msl b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.msl
index b89d20e..0b7678b 100644
--- a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void radians_44f20b() {
+void radians_44f20b(device half4* const tint_symbol_1) {
   half4 res = half4(0.0174407958984375h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_44f20b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  radians_44f20b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_44f20b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  radians_44f20b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_44f20b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  radians_44f20b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.spvasm
index 7a543a4..acd6743 100644
--- a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_44f20b "radians_44f20b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_1dcpn6 = OpConstant %half 0x1.1dcp-6
-         %16 = OpConstantComposite %v4half %half_0x1_1dcpn6 %half_0x1_1dcpn6 %half_0x1_1dcpn6 %half_0x1_1dcpn6
+         %19 = OpConstantComposite %v4half %half_0x1_1dcpn6 %half_0x1_1dcpn6 %half_0x1_1dcpn6 %half_0x1_1dcpn6
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_44f20b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%radians_44f20b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %radians_44f20b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %radians_44f20b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %radians_44f20b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %radians_44f20b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %radians_44f20b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %radians_44f20b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.wgsl
index 1f1f177..7d2ada5 100644
--- a/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/radians/44f20b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn radians_44f20b() {
   var res : vec4<f16> = radians(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_44f20b();
diff --git a/test/tint/builtins/gen/literal/radians/524a91.wgsl b/test/tint/builtins/gen/literal/radians/524a91.wgsl
index 42d2fad..51d7379 100644
--- a/test/tint/builtins/gen/literal/radians/524a91.wgsl
+++ b/test/tint/builtins/gen/literal/radians/524a91.wgsl
@@ -25,7 +25,6 @@
 fn radians_524a91() {
   var res = radians(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_524a91();
diff --git a/test/tint/builtins/gen/literal/radians/61687a.wgsl b/test/tint/builtins/gen/literal/radians/61687a.wgsl
index 5491a0d..d3f0e09 100644
--- a/test/tint/builtins/gen/literal/radians/61687a.wgsl
+++ b/test/tint/builtins/gen/literal/radians/61687a.wgsl
@@ -24,7 +24,9 @@
 // fn radians(vec<2, f32>) -> vec<2, f32>
 fn radians_61687a() {
   var res: vec2<f32> = radians(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.dxc.hlsl
index a96dd39..5373db3 100644
--- a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_61687a() {
   float2 res = (0.01745329238474369049f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.fxc.hlsl
index a96dd39..5373db3 100644
--- a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_61687a() {
   float2 res = (0.01745329238474369049f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.glsl
index 2aa6742..a643f9b 100644
--- a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void radians_61687a() {
   vec2 res = vec2(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void radians_61687a() {
   vec2 res = vec2(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void radians_61687a() {
   vec2 res = vec2(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.msl b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.msl
index 8d7cc83..8f0f68e 100644
--- a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void radians_61687a() {
+void radians_61687a(device float2* const tint_symbol_1) {
   float2 res = float2(0.01745329238474369049f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_61687a();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  radians_61687a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_61687a();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  radians_61687a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_61687a();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  radians_61687a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.spvasm
index 0dc12cf..1e57970 100644
--- a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_61687a "radians_61687a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_0174532924 = OpConstant %float 0.0174532924
-         %15 = OpConstantComposite %v2float %float_0_0174532924 %float_0_0174532924
+         %18 = OpConstantComposite %v2float %float_0_0174532924 %float_0_0174532924
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_61687a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%radians_61687a = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %radians_61687a
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %radians_61687a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %radians_61687a
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %radians_61687a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %radians_61687a
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %radians_61687a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.wgsl
index c5fe501..2e9d8a7 100644
--- a/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/radians/61687a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn radians_61687a() {
   var res : vec2<f32> = radians(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_61687a();
diff --git a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl
index 1d0d7c8..0878b46 100644
--- a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl
+++ b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl
@@ -24,7 +24,9 @@
 // fn radians(f32) -> f32
 fn radians_6b0ff2() {
   var res: f32 = radians(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.dxc.hlsl
index 7a1632f..c501466 100644
--- a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_6b0ff2() {
   float res = 0.01745329238474369049f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.fxc.hlsl
index 7a1632f..c501466 100644
--- a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_6b0ff2() {
   float res = 0.01745329238474369049f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.glsl
index 65b545c..10f8ccb 100644
--- a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void radians_6b0ff2() {
   float res = 0.01745329238474369049f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void radians_6b0ff2() {
   float res = 0.01745329238474369049f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void radians_6b0ff2() {
   float res = 0.01745329238474369049f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.msl b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.msl
index 4a419cd..25a51f2 100644
--- a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void radians_6b0ff2() {
+void radians_6b0ff2(device float* const tint_symbol_1) {
   float res = 0.01745329238474369049f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_6b0ff2();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  radians_6b0ff2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_6b0ff2();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  radians_6b0ff2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_6b0ff2();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  radians_6b0ff2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.spvasm
index f105b00..a600ba3 100644
--- a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_6b0ff2 "radians_6b0ff2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_0174532924 = OpConstant %float 0.0174532924
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_6b0ff2 = OpFunction %void None %9
-         %12 = OpLabel
+%radians_6b0ff2 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_0174532924
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %radians_6b0ff2
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %radians_6b0ff2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %radians_6b0ff2
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %radians_6b0ff2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %radians_6b0ff2
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %radians_6b0ff2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.wgsl
index 8e5f986..f0d486d 100644
--- a/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/radians/6b0ff2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn radians_6b0ff2() {
   var res : f32 = radians(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_6b0ff2();
diff --git a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl
index dfe0486..d3e7d7d 100644
--- a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl
+++ b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl
@@ -26,7 +26,9 @@
 // fn radians(vec<3, f16>) -> vec<3, f16>
 fn radians_7ea4c7() {
   var res: vec3<f16> = radians(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.dxc.hlsl
index a805d45..37f91f1 100644
--- a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_7ea4c7() {
   vector<float16_t, 3> res = (float16_t(0.0174407958984375h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.fxc.hlsl
index defdda3..38fa5d1 100644
--- a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_7ea4c7() {
-  vector<float16_t, 3> res = (float16_t(0.017440796h)).xxx;
+  vector<float16_t, 3> res = (float16_t(0.0174407958984375h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.glsl
index 21ac51c..e92aae2 100644
--- a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void radians_7ea4c7() {
   f16vec3 res = f16vec3(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void radians_7ea4c7() {
   f16vec3 res = f16vec3(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void radians_7ea4c7() {
   f16vec3 res = f16vec3(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.msl b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.msl
index 15bc4dd..6bdb972 100644
--- a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void radians_7ea4c7() {
+void radians_7ea4c7(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.0174407958984375h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_7ea4c7();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  radians_7ea4c7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_7ea4c7();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  radians_7ea4c7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_7ea4c7();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  radians_7ea4c7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.spvasm
index 0d5b8b8..083db7a 100644
--- a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_7ea4c7 "radians_7ea4c7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_1dcpn6 = OpConstant %half 0x1.1dcp-6
-         %16 = OpConstantComposite %v3half %half_0x1_1dcpn6 %half_0x1_1dcpn6 %half_0x1_1dcpn6
+         %19 = OpConstantComposite %v3half %half_0x1_1dcpn6 %half_0x1_1dcpn6 %half_0x1_1dcpn6
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_7ea4c7 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%radians_7ea4c7 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %radians_7ea4c7
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %radians_7ea4c7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %radians_7ea4c7
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %radians_7ea4c7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %radians_7ea4c7
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %radians_7ea4c7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.wgsl
index 094dfb7..1a7e844 100644
--- a/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/radians/7ea4c7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn radians_7ea4c7() {
   var res : vec3<f16> = radians(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_7ea4c7();
diff --git a/test/tint/builtins/gen/literal/radians/bff231.wgsl b/test/tint/builtins/gen/literal/radians/bff231.wgsl
index 1b2cd48..ac7132c 100644
--- a/test/tint/builtins/gen/literal/radians/bff231.wgsl
+++ b/test/tint/builtins/gen/literal/radians/bff231.wgsl
@@ -25,7 +25,6 @@
 fn radians_bff231() {
   var res = radians(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_bff231();
diff --git a/test/tint/builtins/gen/literal/radians/f96258.wgsl b/test/tint/builtins/gen/literal/radians/f96258.wgsl
index bb65233..d1bcce0 100644
--- a/test/tint/builtins/gen/literal/radians/f96258.wgsl
+++ b/test/tint/builtins/gen/literal/radians/f96258.wgsl
@@ -24,7 +24,9 @@
 // fn radians(vec<3, f32>) -> vec<3, f32>
 fn radians_f96258() {
   var res: vec3<f32> = radians(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.dxc.hlsl
index e209cbc..dbe0ef0 100644
--- a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_f96258() {
   float3 res = (0.01745329238474369049f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.fxc.hlsl
index e209cbc..dbe0ef0 100644
--- a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_f96258() {
   float3 res = (0.01745329238474369049f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.glsl b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.glsl
index e270807..a9f2a7b 100644
--- a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void radians_f96258() {
   vec3 res = vec3(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void radians_f96258() {
   vec3 res = vec3(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void radians_f96258() {
   vec3 res = vec3(0.01745329238474369049f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.msl b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.msl
index 9b61c50..afc52bc 100644
--- a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void radians_f96258() {
+void radians_f96258(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.01745329238474369049f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_f96258();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  radians_f96258(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_f96258();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  radians_f96258(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_f96258();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  radians_f96258(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.spvasm
index 0178859..cc24a4a 100644
--- a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_f96258 "radians_f96258"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_0174532924 = OpConstant %float 0.0174532924
-         %15 = OpConstantComposite %v3float %float_0_0174532924 %float_0_0174532924 %float_0_0174532924
+         %18 = OpConstantComposite %v3float %float_0_0174532924 %float_0_0174532924 %float_0_0174532924
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_f96258 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%radians_f96258 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %radians_f96258
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %radians_f96258
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %radians_f96258
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %radians_f96258
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %radians_f96258
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %radians_f96258
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.wgsl
index d0ea14e..c01e840 100644
--- a/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/radians/f96258.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn radians_f96258() {
   var res : vec3<f32> = radians(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_f96258();
diff --git a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl
index 6b45a23..553860c 100644
--- a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl
+++ b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl
@@ -26,7 +26,9 @@
 // fn radians(vec<2, f16>) -> vec<2, f16>
 fn radians_fbacf0() {
   var res: vec2<f16> = radians(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.dxc.hlsl
index a3813ae..2d50e30 100644
--- a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_fbacf0() {
   vector<float16_t, 2> res = (float16_t(0.0174407958984375h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.fxc.hlsl
index 1968efa..b6e13da 100644
--- a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_fbacf0() {
-  vector<float16_t, 2> res = (float16_t(0.017440796h)).xx;
+  vector<float16_t, 2> res = (float16_t(0.0174407958984375h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.glsl
index 80ea9f0..801f682 100644
--- a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void radians_fbacf0() {
   f16vec2 res = f16vec2(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void radians_fbacf0() {
   f16vec2 res = f16vec2(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void radians_fbacf0() {
   f16vec2 res = f16vec2(0.0174407958984375hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.msl b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.msl
index f813a60..4f52a09 100644
--- a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void radians_fbacf0() {
+void radians_fbacf0(device half2* const tint_symbol_1) {
   half2 res = half2(0.0174407958984375h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_fbacf0();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  radians_fbacf0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_fbacf0();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  radians_fbacf0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_fbacf0();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  radians_fbacf0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.spvasm
index be6dede..6a6a9c5 100644
--- a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_fbacf0 "radians_fbacf0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_1dcpn6 = OpConstant %half 0x1.1dcp-6
-         %16 = OpConstantComposite %v2half %half_0x1_1dcpn6 %half_0x1_1dcpn6
+         %19 = OpConstantComposite %v2half %half_0x1_1dcpn6 %half_0x1_1dcpn6
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_fbacf0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%radians_fbacf0 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %radians_fbacf0
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %radians_fbacf0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %radians_fbacf0
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %radians_fbacf0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %radians_fbacf0
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %radians_fbacf0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.wgsl
index 061f0a0..f1dd2dc 100644
--- a/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/radians/fbacf0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn radians_fbacf0() {
   var res : vec2<f16> = radians(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_fbacf0();
diff --git a/test/tint/builtins/gen/literal/reflect/05357e.wgsl b/test/tint/builtins/gen/literal/reflect/05357e.wgsl
index 3cd54f1..d9cf639 100644
--- a/test/tint/builtins/gen/literal/reflect/05357e.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/05357e.wgsl
@@ -24,7 +24,9 @@
 // fn reflect(vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn reflect_05357e() {
   var res: vec4<f32> = reflect(vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.dxc.hlsl
index 6f44447..38606b9 100644
--- a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_05357e() {
   float4 res = (-7.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.fxc.hlsl
index 6f44447..38606b9 100644
--- a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_05357e() {
   float4 res = (-7.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.glsl
index d0d6263..f60115e 100644
--- a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void reflect_05357e() {
   vec4 res = vec4(-7.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void reflect_05357e() {
   vec4 res = vec4(-7.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void reflect_05357e() {
   vec4 res = vec4(-7.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.msl b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.msl
index dc49023..f58ab04 100644
--- a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_05357e() {
+void reflect_05357e(device float4* const tint_symbol_1) {
   float4 res = float4(-7.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_05357e();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  reflect_05357e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_05357e();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  reflect_05357e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_05357e();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  reflect_05357e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.spvasm
index 1270752..2f66313 100644
--- a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_05357e "reflect_05357e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
    %float_n7 = OpConstant %float -7
-         %14 = OpConstantComposite %v4float %float_n7 %float_n7 %float_n7 %float_n7
+         %17 = OpConstantComposite %v4float %float_n7 %float_n7 %float_n7 %float_n7
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_05357e = OpFunction %void None %9
-         %12 = OpLabel
+%reflect_05357e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %reflect_05357e
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %reflect_05357e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %reflect_05357e
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %reflect_05357e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reflect_05357e
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reflect_05357e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.wgsl
index d9da648..802b87c 100644
--- a/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/05357e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reflect_05357e() {
   var res : vec4<f32> = reflect(vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_05357e();
diff --git a/test/tint/builtins/gen/literal/reflect/310de5.wgsl b/test/tint/builtins/gen/literal/reflect/310de5.wgsl
index 03673f7..ffd738e 100644
--- a/test/tint/builtins/gen/literal/reflect/310de5.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/310de5.wgsl
@@ -26,7 +26,9 @@
 // fn reflect(vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn reflect_310de5() {
   var res: vec4<f16> = reflect(vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.dxc.hlsl
index cec687c..baf317b 100644
--- a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_310de5() {
   vector<float16_t, 4> res = (float16_t(-7.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.fxc.hlsl
index fb92d3b..26e4172 100644
--- a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_310de5() {
   vector<float16_t, 4> res = (float16_t(-7.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.glsl
index 50d8018..2e27550 100644
--- a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void reflect_310de5() {
   f16vec4 res = f16vec4(-7.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void reflect_310de5() {
   f16vec4 res = f16vec4(-7.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void reflect_310de5() {
   f16vec4 res = f16vec4(-7.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.msl b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.msl
index ed9ddfd..43a4e9d 100644
--- a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_310de5() {
+void reflect_310de5(device half4* const tint_symbol_1) {
   half4 res = half4(-7.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_310de5();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  reflect_310de5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_310de5();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  reflect_310de5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_310de5();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  reflect_310de5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.spvasm
index 1662f54..ee2b08a 100644
--- a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_310de5 "reflect_310de5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1_cp_2 = OpConstant %half -0x1.cp+2
-         %16 = OpConstantComposite %v4half %half_n0x1_cp_2 %half_n0x1_cp_2 %half_n0x1_cp_2 %half_n0x1_cp_2
+         %19 = OpConstantComposite %v4half %half_n0x1_cp_2 %half_n0x1_cp_2 %half_n0x1_cp_2 %half_n0x1_cp_2
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_310de5 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%reflect_310de5 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reflect_310de5
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %reflect_310de5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reflect_310de5
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reflect_310de5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reflect_310de5
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reflect_310de5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.wgsl
index a726a49..86239f6 100644
--- a/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/310de5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn reflect_310de5() {
   var res : vec4<f16> = reflect(vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_310de5();
diff --git a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl
index 097b214..4cc881b 100644
--- a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl
@@ -26,7 +26,9 @@
 // fn reflect(vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn reflect_61ca21() {
   var res: vec3<f16> = reflect(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.dxc.hlsl
index 4b9e0bd..66ced73 100644
--- a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_61ca21() {
   vector<float16_t, 3> res = (float16_t(-5.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.fxc.hlsl
index adacc90..c3077d4 100644
--- a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_61ca21() {
   vector<float16_t, 3> res = (float16_t(-5.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.glsl
index 2cbd2fd..17105af 100644
--- a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void reflect_61ca21() {
   f16vec3 res = f16vec3(-5.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void reflect_61ca21() {
   f16vec3 res = f16vec3(-5.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void reflect_61ca21() {
   f16vec3 res = f16vec3(-5.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.msl b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.msl
index fa01d98..66d73be 100644
--- a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_61ca21() {
+void reflect_61ca21(device packed_half3* const tint_symbol_1) {
   half3 res = half3(-5.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_61ca21();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  reflect_61ca21(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_61ca21();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  reflect_61ca21(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_61ca21();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  reflect_61ca21(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.spvasm
index a6f0e1b..8d9f8ea 100644
--- a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_61ca21 "reflect_61ca21"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1_4p_2 = OpConstant %half -0x1.4p+2
-         %16 = OpConstantComposite %v3half %half_n0x1_4p_2 %half_n0x1_4p_2 %half_n0x1_4p_2
+         %19 = OpConstantComposite %v3half %half_n0x1_4p_2 %half_n0x1_4p_2 %half_n0x1_4p_2
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_61ca21 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%reflect_61ca21 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reflect_61ca21
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %reflect_61ca21
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reflect_61ca21
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reflect_61ca21
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reflect_61ca21
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reflect_61ca21
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.wgsl
index 194bb6b..3ef8577 100644
--- a/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/61ca21.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn reflect_61ca21() {
   var res : vec3<f16> = reflect(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_61ca21();
diff --git a/test/tint/builtins/gen/literal/reflect/a8baf2.wgsl b/test/tint/builtins/gen/literal/reflect/a8baf2.wgsl
index 5a3fd80..8435964 100644
--- a/test/tint/builtins/gen/literal/reflect/a8baf2.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/a8baf2.wgsl
@@ -25,7 +25,6 @@
 fn reflect_a8baf2() {
   var res = reflect(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_a8baf2();
diff --git a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl
index e3840c0..6cd01ac 100644
--- a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl
@@ -24,7 +24,9 @@
 // fn reflect(vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn reflect_b61e10() {
   var res: vec2<f32> = reflect(vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.dxc.hlsl
index 90b4289..acb3262 100644
--- a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_b61e10() {
   float2 res = (-3.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.fxc.hlsl
index 90b4289..acb3262 100644
--- a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_b61e10() {
   float2 res = (-3.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.glsl
index 459b2e1..53ef076 100644
--- a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void reflect_b61e10() {
   vec2 res = vec2(-3.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void reflect_b61e10() {
   vec2 res = vec2(-3.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void reflect_b61e10() {
   vec2 res = vec2(-3.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.msl b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.msl
index d039f0f..99b5ed7 100644
--- a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_b61e10() {
+void reflect_b61e10(device float2* const tint_symbol_1) {
   float2 res = float2(-3.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_b61e10();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  reflect_b61e10(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_b61e10();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  reflect_b61e10(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_b61e10();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  reflect_b61e10(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.spvasm
index 7f0741c..145d9ca 100644
--- a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_b61e10 "reflect_b61e10"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
    %float_n3 = OpConstant %float -3
-         %15 = OpConstantComposite %v2float %float_n3 %float_n3
+         %18 = OpConstantComposite %v2float %float_n3 %float_n3
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_b61e10 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%reflect_b61e10 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %reflect_b61e10
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %reflect_b61e10
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %reflect_b61e10
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %reflect_b61e10
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %reflect_b61e10
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reflect_b61e10
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.wgsl
index c717a38..534e2c2 100644
--- a/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/b61e10.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reflect_b61e10() {
   var res : vec2<f32> = reflect(vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_b61e10();
diff --git a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl
index a559dc9..d5c8804 100644
--- a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl
@@ -26,7 +26,9 @@
 // fn reflect(vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn reflect_bb15ac() {
   var res: vec2<f16> = reflect(vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.dxc.hlsl
index 196943e..8edc7b8 100644
--- a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_bb15ac() {
   vector<float16_t, 2> res = (float16_t(-3.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.fxc.hlsl
index e952633..5e26a4b 100644
--- a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_bb15ac() {
   vector<float16_t, 2> res = (float16_t(-3.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.glsl
index e9b3594..78debe2 100644
--- a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void reflect_bb15ac() {
   f16vec2 res = f16vec2(-3.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void reflect_bb15ac() {
   f16vec2 res = f16vec2(-3.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void reflect_bb15ac() {
   f16vec2 res = f16vec2(-3.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.msl b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.msl
index dc37f9e..54d5f0e 100644
--- a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_bb15ac() {
+void reflect_bb15ac(device half2* const tint_symbol_1) {
   half2 res = half2(-3.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_bb15ac();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  reflect_bb15ac(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_bb15ac();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  reflect_bb15ac(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_bb15ac();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  reflect_bb15ac(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.spvasm
index 4855d70..cefa315 100644
--- a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_bb15ac "reflect_bb15ac"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1_8p_1 = OpConstant %half -0x1.8p+1
-         %16 = OpConstantComposite %v2half %half_n0x1_8p_1 %half_n0x1_8p_1
+         %19 = OpConstantComposite %v2half %half_n0x1_8p_1 %half_n0x1_8p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_bb15ac = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%reflect_bb15ac = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reflect_bb15ac
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %reflect_bb15ac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reflect_bb15ac
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reflect_bb15ac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reflect_bb15ac
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reflect_bb15ac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.wgsl
index bb64ffa..6b84064 100644
--- a/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/bb15ac.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn reflect_bb15ac() {
   var res : vec2<f16> = reflect(vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_bb15ac();
diff --git a/test/tint/builtins/gen/literal/reflect/bba2d0.wgsl b/test/tint/builtins/gen/literal/reflect/bba2d0.wgsl
index 53cd7f7..9107112 100644
--- a/test/tint/builtins/gen/literal/reflect/bba2d0.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/bba2d0.wgsl
@@ -25,7 +25,6 @@
 fn reflect_bba2d0() {
   var res = reflect(vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_bba2d0();
diff --git a/test/tint/builtins/gen/literal/reflect/d7e210.wgsl b/test/tint/builtins/gen/literal/reflect/d7e210.wgsl
index 21dd9b3..4692ecb 100644
--- a/test/tint/builtins/gen/literal/reflect/d7e210.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/d7e210.wgsl
@@ -25,7 +25,6 @@
 fn reflect_d7e210() {
   var res = reflect(vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_d7e210();
diff --git a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl
index ed6f558..b53ce1b 100644
--- a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl
@@ -24,7 +24,9 @@
 // fn reflect(vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn reflect_f47fdb() {
   var res: vec3<f32> = reflect(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.dxc.hlsl
index 0d2e5ba..f320f08 100644
--- a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_f47fdb() {
   float3 res = (-5.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.fxc.hlsl
index 0d2e5ba..f320f08 100644
--- a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_f47fdb() {
   float3 res = (-5.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.glsl
index 4e2c08e..918f776 100644
--- a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void reflect_f47fdb() {
   vec3 res = vec3(-5.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void reflect_f47fdb() {
   vec3 res = vec3(-5.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void reflect_f47fdb() {
   vec3 res = vec3(-5.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.msl b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.msl
index 6b8595d..97ecc15 100644
--- a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_f47fdb() {
+void reflect_f47fdb(device packed_float3* const tint_symbol_1) {
   float3 res = float3(-5.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_f47fdb();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  reflect_f47fdb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_f47fdb();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  reflect_f47fdb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_f47fdb();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  reflect_f47fdb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.spvasm
index 4a1dc75..7be4503 100644
--- a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_f47fdb "reflect_f47fdb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
    %float_n5 = OpConstant %float -5
-         %15 = OpConstantComposite %v3float %float_n5 %float_n5 %float_n5
+         %18 = OpConstantComposite %v3float %float_n5 %float_n5 %float_n5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_f47fdb = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%reflect_f47fdb = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %reflect_f47fdb
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %reflect_f47fdb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %reflect_f47fdb
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %reflect_f47fdb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %reflect_f47fdb
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reflect_f47fdb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.wgsl
index c9a13ea..08da0fc 100644
--- a/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reflect/f47fdb.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reflect_f47fdb() {
   var res : vec3<f32> = reflect(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_f47fdb();
diff --git a/test/tint/builtins/gen/literal/refract/0594ba.wgsl b/test/tint/builtins/gen/literal/refract/0594ba.wgsl
index c37f22f..e553590 100644
--- a/test/tint/builtins/gen/literal/refract/0594ba.wgsl
+++ b/test/tint/builtins/gen/literal/refract/0594ba.wgsl
@@ -26,7 +26,9 @@
 // fn refract(vec<4, f16>, vec<4, f16>, f16) -> vec<4, f16>
 fn refract_0594ba() {
   var res: vec4<f16> = refract(vec4<f16>(1.h), vec4<f16>(1.h), 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.dxc.hlsl
index 036961c..6d55a55 100644
--- a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_0594ba() {
   vector<float16_t, 4> res = (float16_t(-7.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.fxc.hlsl
index c853fb0..baa2d1e 100644
--- a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_0594ba() {
   vector<float16_t, 4> res = (float16_t(-7.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.glsl b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.glsl
index 093b8e6..5dd753c 100644
--- a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void refract_0594ba() {
   f16vec4 res = f16vec4(-7.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void refract_0594ba() {
   f16vec4 res = f16vec4(-7.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void refract_0594ba() {
   f16vec4 res = f16vec4(-7.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.msl b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.msl
index b48045b..295c46f 100644
--- a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_0594ba() {
+void refract_0594ba(device half4* const tint_symbol_1) {
   half4 res = half4(-7.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_0594ba();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  refract_0594ba(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_0594ba();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  refract_0594ba(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_0594ba();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  refract_0594ba(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.spvasm
index ce2973d..03930db 100644
--- a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_0594ba "refract_0594ba"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1_cp_2 = OpConstant %half -0x1.cp+2
-         %16 = OpConstantComposite %v4half %half_n0x1_cp_2 %half_n0x1_cp_2 %half_n0x1_cp_2 %half_n0x1_cp_2
+         %19 = OpConstantComposite %v4half %half_n0x1_cp_2 %half_n0x1_cp_2 %half_n0x1_cp_2 %half_n0x1_cp_2
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_0594ba = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%refract_0594ba = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %refract_0594ba
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %refract_0594ba
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %refract_0594ba
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %refract_0594ba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %refract_0594ba
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %refract_0594ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.wgsl
index 5d932c0..ef9abc0 100644
--- a/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/refract/0594ba.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn refract_0594ba() {
   var res : vec4<f16> = refract(vec4<f16>(1.0h), vec4<f16>(1.0h), 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_0594ba();
diff --git a/test/tint/builtins/gen/literal/refract/570cb3.wgsl b/test/tint/builtins/gen/literal/refract/570cb3.wgsl
index f8f50f2..ae41d86 100644
--- a/test/tint/builtins/gen/literal/refract/570cb3.wgsl
+++ b/test/tint/builtins/gen/literal/refract/570cb3.wgsl
@@ -26,7 +26,9 @@
 // fn refract(vec<2, f16>, vec<2, f16>, f16) -> vec<2, f16>
 fn refract_570cb3() {
   var res: vec2<f16> = refract(vec2<f16>(1.h), vec2<f16>(1.h), 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.dxc.hlsl
index c1b7878..823aeb3 100644
--- a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_570cb3() {
   vector<float16_t, 2> res = (float16_t(-3.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.fxc.hlsl
index 0548825..fc21834 100644
--- a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_570cb3() {
   vector<float16_t, 2> res = (float16_t(-3.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.glsl
index 8b473a1..a0203f9 100644
--- a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void refract_570cb3() {
   f16vec2 res = f16vec2(-3.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void refract_570cb3() {
   f16vec2 res = f16vec2(-3.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void refract_570cb3() {
   f16vec2 res = f16vec2(-3.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.msl b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.msl
index 77ac3c5..47165fb 100644
--- a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_570cb3() {
+void refract_570cb3(device half2* const tint_symbol_1) {
   half2 res = half2(-3.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_570cb3();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  refract_570cb3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_570cb3();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  refract_570cb3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_570cb3();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  refract_570cb3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.spvasm
index 8b8e556..5a8e293 100644
--- a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_570cb3 "refract_570cb3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1_8p_1 = OpConstant %half -0x1.8p+1
-         %16 = OpConstantComposite %v2half %half_n0x1_8p_1 %half_n0x1_8p_1
+         %19 = OpConstantComposite %v2half %half_n0x1_8p_1 %half_n0x1_8p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_570cb3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%refract_570cb3 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %refract_570cb3
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %refract_570cb3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %refract_570cb3
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %refract_570cb3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %refract_570cb3
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %refract_570cb3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.wgsl
index 1c1d33c..f40b0a7 100644
--- a/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/refract/570cb3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn refract_570cb3() {
   var res : vec2<f16> = refract(vec2<f16>(1.0h), vec2<f16>(1.0h), 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_570cb3();
diff --git a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl
index ddb5fb9..be9e251 100644
--- a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl
+++ b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl
@@ -24,7 +24,9 @@
 // fn refract(vec<4, f32>, vec<4, f32>, f32) -> vec<4, f32>
 fn refract_7e02e6() {
   var res: vec4<f32> = refract(vec4<f32>(1.f), vec4<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.dxc.hlsl
index 9a37846..2f0a2e7 100644
--- a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_7e02e6() {
   float4 res = (-7.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.fxc.hlsl
index 9a37846..2f0a2e7 100644
--- a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_7e02e6() {
   float4 res = (-7.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.glsl
index 7c268cc..e3da22f 100644
--- a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void refract_7e02e6() {
   vec4 res = vec4(-7.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void refract_7e02e6() {
   vec4 res = vec4(-7.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void refract_7e02e6() {
   vec4 res = vec4(-7.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.msl b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.msl
index 4d49f47..6d0f053 100644
--- a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_7e02e6() {
+void refract_7e02e6(device float4* const tint_symbol_1) {
   float4 res = float4(-7.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_7e02e6();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  refract_7e02e6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_7e02e6();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  refract_7e02e6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_7e02e6();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  refract_7e02e6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.spvasm
index 8c8e3ad..b9b9a8e 100644
--- a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_7e02e6 "refract_7e02e6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
    %float_n7 = OpConstant %float -7
-         %14 = OpConstantComposite %v4float %float_n7 %float_n7 %float_n7 %float_n7
+         %17 = OpConstantComposite %v4float %float_n7 %float_n7 %float_n7 %float_n7
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_7e02e6 = OpFunction %void None %9
-         %12 = OpLabel
+%refract_7e02e6 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %refract_7e02e6
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %refract_7e02e6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %refract_7e02e6
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %refract_7e02e6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %refract_7e02e6
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %refract_7e02e6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.wgsl
index 75f3851..757d2ec 100644
--- a/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/refract/7e02e6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn refract_7e02e6() {
   var res : vec4<f32> = refract(vec4<f32>(1.0f), vec4<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_7e02e6();
diff --git a/test/tint/builtins/gen/literal/refract/8984af.wgsl b/test/tint/builtins/gen/literal/refract/8984af.wgsl
index 6e38525..a60ebb0 100644
--- a/test/tint/builtins/gen/literal/refract/8984af.wgsl
+++ b/test/tint/builtins/gen/literal/refract/8984af.wgsl
@@ -26,7 +26,9 @@
 // fn refract(vec<3, f16>, vec<3, f16>, f16) -> vec<3, f16>
 fn refract_8984af() {
   var res: vec3<f16> = refract(vec3<f16>(1.h), vec3<f16>(1.h), 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.dxc.hlsl
index 1de0940..ffbd4b9 100644
--- a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_8984af() {
   vector<float16_t, 3> res = (float16_t(-5.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.fxc.hlsl
index 72d7db4..386a536 100644
--- a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_8984af() {
   vector<float16_t, 3> res = (float16_t(-5.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.glsl b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.glsl
index 0de3f68..a087dc0 100644
--- a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void refract_8984af() {
   f16vec3 res = f16vec3(-5.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void refract_8984af() {
   f16vec3 res = f16vec3(-5.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void refract_8984af() {
   f16vec3 res = f16vec3(-5.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.msl b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.msl
index 9f75260..14f336c 100644
--- a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_8984af() {
+void refract_8984af(device packed_half3* const tint_symbol_1) {
   half3 res = half3(-5.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_8984af();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  refract_8984af(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_8984af();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  refract_8984af(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_8984af();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  refract_8984af(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.spvasm
index 48e5cfd..265aba9 100644
--- a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_8984af "refract_8984af"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_n0x1_4p_2 = OpConstant %half -0x1.4p+2
-         %16 = OpConstantComposite %v3half %half_n0x1_4p_2 %half_n0x1_4p_2 %half_n0x1_4p_2
+         %19 = OpConstantComposite %v3half %half_n0x1_4p_2 %half_n0x1_4p_2 %half_n0x1_4p_2
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_8984af = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%refract_8984af = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %refract_8984af
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %refract_8984af
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %refract_8984af
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %refract_8984af
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %refract_8984af
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %refract_8984af
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.wgsl
index 7dd0916..86c183b 100644
--- a/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/refract/8984af.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn refract_8984af() {
   var res : vec3<f16> = refract(vec3<f16>(1.0h), vec3<f16>(1.0h), 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_8984af();
diff --git a/test/tint/builtins/gen/literal/refract/8c192a.wgsl b/test/tint/builtins/gen/literal/refract/8c192a.wgsl
index bf858d6..cd3f3b1 100644
--- a/test/tint/builtins/gen/literal/refract/8c192a.wgsl
+++ b/test/tint/builtins/gen/literal/refract/8c192a.wgsl
@@ -25,7 +25,6 @@
 fn refract_8c192a() {
   var res = refract(vec4(1.), vec4(1.), 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_8c192a();
diff --git a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl
index 452568b..f0457f7 100644
--- a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl
+++ b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl
@@ -24,7 +24,9 @@
 // fn refract(vec<3, f32>, vec<3, f32>, f32) -> vec<3, f32>
 fn refract_cbc1d2() {
   var res: vec3<f32> = refract(vec3<f32>(1.f), vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.dxc.hlsl
index 66e3464..8b402a5 100644
--- a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_cbc1d2() {
   float3 res = (-5.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.fxc.hlsl
index 66e3464..8b402a5 100644
--- a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_cbc1d2() {
   float3 res = (-5.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.glsl
index 4190d98..849069c 100644
--- a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void refract_cbc1d2() {
   vec3 res = vec3(-5.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void refract_cbc1d2() {
   vec3 res = vec3(-5.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void refract_cbc1d2() {
   vec3 res = vec3(-5.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.msl b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.msl
index 70bb490..607e0a90 100644
--- a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_cbc1d2() {
+void refract_cbc1d2(device packed_float3* const tint_symbol_1) {
   float3 res = float3(-5.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_cbc1d2();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  refract_cbc1d2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_cbc1d2();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  refract_cbc1d2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_cbc1d2();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  refract_cbc1d2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.spvasm
index c57564d..e1fea4f 100644
--- a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_cbc1d2 "refract_cbc1d2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
    %float_n5 = OpConstant %float -5
-         %15 = OpConstantComposite %v3float %float_n5 %float_n5 %float_n5
+         %18 = OpConstantComposite %v3float %float_n5 %float_n5 %float_n5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_cbc1d2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%refract_cbc1d2 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %refract_cbc1d2
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %refract_cbc1d2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %refract_cbc1d2
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %refract_cbc1d2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %refract_cbc1d2
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %refract_cbc1d2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.wgsl
index 7c031e8..0ee586e 100644
--- a/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/refract/cbc1d2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn refract_cbc1d2() {
   var res : vec3<f32> = refract(vec3<f32>(1.0f), vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_cbc1d2();
diff --git a/test/tint/builtins/gen/literal/refract/cd905f.wgsl b/test/tint/builtins/gen/literal/refract/cd905f.wgsl
index 120223d..171b445 100644
--- a/test/tint/builtins/gen/literal/refract/cd905f.wgsl
+++ b/test/tint/builtins/gen/literal/refract/cd905f.wgsl
@@ -24,7 +24,9 @@
 // fn refract(vec<2, f32>, vec<2, f32>, f32) -> vec<2, f32>
 fn refract_cd905f() {
   var res: vec2<f32> = refract(vec2<f32>(1.f), vec2<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.dxc.hlsl
index 835d5c0..e23911d 100644
--- a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_cd905f() {
   float2 res = (-3.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.fxc.hlsl
index 835d5c0..e23911d 100644
--- a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_cd905f() {
   float2 res = (-3.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.glsl
index a962857..22603f7 100644
--- a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void refract_cd905f() {
   vec2 res = vec2(-3.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void refract_cd905f() {
   vec2 res = vec2(-3.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void refract_cd905f() {
   vec2 res = vec2(-3.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.msl b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.msl
index 75ac067..ff1d72d 100644
--- a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_cd905f() {
+void refract_cd905f(device float2* const tint_symbol_1) {
   float2 res = float2(-3.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_cd905f();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  refract_cd905f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_cd905f();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  refract_cd905f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_cd905f();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  refract_cd905f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.spvasm
index 845a4de..f1f8814 100644
--- a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_cd905f "refract_cd905f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
    %float_n3 = OpConstant %float -3
-         %15 = OpConstantComposite %v2float %float_n3 %float_n3
+         %18 = OpConstantComposite %v2float %float_n3 %float_n3
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_cd905f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%refract_cd905f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %refract_cd905f
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %refract_cd905f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %refract_cd905f
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %refract_cd905f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %refract_cd905f
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %refract_cd905f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.wgsl
index 0c7532b..b29c6d7 100644
--- a/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/refract/cd905f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn refract_cd905f() {
   var res : vec2<f32> = refract(vec2<f32>(1.0f), vec2<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_cd905f();
diff --git a/test/tint/builtins/gen/literal/refract/cf1629.wgsl b/test/tint/builtins/gen/literal/refract/cf1629.wgsl
index ba0362c..4a7e1ab 100644
--- a/test/tint/builtins/gen/literal/refract/cf1629.wgsl
+++ b/test/tint/builtins/gen/literal/refract/cf1629.wgsl
@@ -25,7 +25,6 @@
 fn refract_cf1629() {
   var res = refract(vec2(1.), vec2(1.), 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_cf1629();
diff --git a/test/tint/builtins/gen/literal/refract/d7569b.wgsl b/test/tint/builtins/gen/literal/refract/d7569b.wgsl
index 9a4b45a..87020ad 100644
--- a/test/tint/builtins/gen/literal/refract/d7569b.wgsl
+++ b/test/tint/builtins/gen/literal/refract/d7569b.wgsl
@@ -25,7 +25,6 @@
 fn refract_d7569b() {
   var res = refract(vec3(1.), vec3(1.), 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_d7569b();
diff --git a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl
index 13fd386..ad5cd3f 100644
--- a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl
@@ -24,7 +24,9 @@
 // fn reverseBits(vec<2, i32>) -> vec<2, i32>
 fn reverseBits_222177() {
   var res: vec2<i32> = reverseBits(vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.dxc.hlsl
index e62cccb..8d24a2f 100644
--- a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_222177() {
   int2 res = (-2147483648).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.fxc.hlsl
index e62cccb..8d24a2f 100644
--- a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_222177() {
   int2 res = (-2147483648).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.glsl
index 317a798..36ce45c 100644
--- a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void reverseBits_222177() {
   ivec2 res = ivec2(-2147483648);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void reverseBits_222177() {
   ivec2 res = ivec2(-2147483648);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void reverseBits_222177() {
   ivec2 res = ivec2(-2147483648);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.msl b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.msl
index 517d05b..0fb227c 100644
--- a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_222177() {
+void reverseBits_222177(device int2* const tint_symbol_1) {
   int2 res = int2((-2147483647 - 1));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_222177();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  reverseBits_222177(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_222177();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_222177(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_222177();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_222177(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.spvasm
index 1428353..6a33a5d 100644
--- a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_222177 "reverseBits_222177"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %int_n2147483648 = OpConstant %int -2147483648
-         %16 = OpConstantComposite %v2int %int_n2147483648 %int_n2147483648
+         %19 = OpConstantComposite %v2int %int_n2147483648 %int_n2147483648
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_222177 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+%reverseBits_222177 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reverseBits_222177
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %reverseBits_222177
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reverseBits_222177
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reverseBits_222177
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_222177
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reverseBits_222177
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.wgsl
index a9fa63d..8c94eb4 100644
--- a/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/222177.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reverseBits_222177() {
   var res : vec2<i32> = reverseBits(vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_222177();
diff --git a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl
index 1fdd845..d3ee83c 100644
--- a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl
@@ -24,7 +24,9 @@
 // fn reverseBits(vec<4, u32>) -> vec<4, u32>
 fn reverseBits_35fea9() {
   var res: vec4<u32> = reverseBits(vec4<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.dxc.hlsl
index ced6ec0..46d448e 100644
--- a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_35fea9() {
   uint4 res = (2147483648u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.fxc.hlsl
index ced6ec0..46d448e 100644
--- a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_35fea9() {
   uint4 res = (2147483648u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.glsl
index ca78653..39903ff 100644
--- a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void reverseBits_35fea9() {
   uvec4 res = uvec4(2147483648u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void reverseBits_35fea9() {
   uvec4 res = uvec4(2147483648u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void reverseBits_35fea9() {
   uvec4 res = uvec4(2147483648u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.msl b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.msl
index f8b986a..5857422 100644
--- a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_35fea9() {
+void reverseBits_35fea9(device uint4* const tint_symbol_1) {
   uint4 res = uint4(2147483648u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_35fea9();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  reverseBits_35fea9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_35fea9();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_35fea9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_35fea9();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_35fea9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.spvasm
index a9ef7e5..09bee60 100644
--- a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_35fea9 "reverseBits_35fea9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %uint_2147483648 = OpConstant %uint 2147483648
-         %16 = OpConstantComposite %v4uint %uint_2147483648 %uint_2147483648 %uint_2147483648 %uint_2147483648
+         %19 = OpConstantComposite %v4uint %uint_2147483648 %uint_2147483648 %uint_2147483648 %uint_2147483648
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_35fea9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+%reverseBits_35fea9 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reverseBits_35fea9
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %reverseBits_35fea9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reverseBits_35fea9
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %reverseBits_35fea9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_35fea9
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reverseBits_35fea9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.wgsl
index 8b09447..2f98262 100644
--- a/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/35fea9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reverseBits_35fea9() {
   var res : vec4<u32> = reverseBits(vec4<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_35fea9();
diff --git a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl
index 6db47cb..0812824 100644
--- a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl
@@ -24,7 +24,9 @@
 // fn reverseBits(vec<4, i32>) -> vec<4, i32>
 fn reverseBits_4dbd6f() {
   var res: vec4<i32> = reverseBits(vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.dxc.hlsl
index aa81049..1663ba7 100644
--- a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_4dbd6f() {
   int4 res = (-2147483648).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.fxc.hlsl
index aa81049..1663ba7 100644
--- a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_4dbd6f() {
   int4 res = (-2147483648).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.glsl
index 46772b0..10cf222 100644
--- a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void reverseBits_4dbd6f() {
   ivec4 res = ivec4(-2147483648);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void reverseBits_4dbd6f() {
   ivec4 res = ivec4(-2147483648);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void reverseBits_4dbd6f() {
   ivec4 res = ivec4(-2147483648);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.msl b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.msl
index 5a5de8b..b8bf3d5 100644
--- a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_4dbd6f() {
+void reverseBits_4dbd6f(device int4* const tint_symbol_1) {
   int4 res = int4((-2147483647 - 1));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_4dbd6f();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  reverseBits_4dbd6f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_4dbd6f();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_4dbd6f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_4dbd6f();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_4dbd6f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.spvasm
index 2e97a0b..01cbae6 100644
--- a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_4dbd6f "reverseBits_4dbd6f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %int_n2147483648 = OpConstant %int -2147483648
-         %16 = OpConstantComposite %v4int %int_n2147483648 %int_n2147483648 %int_n2147483648 %int_n2147483648
+         %19 = OpConstantComposite %v4int %int_n2147483648 %int_n2147483648 %int_n2147483648 %int_n2147483648
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_4dbd6f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+%reverseBits_4dbd6f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reverseBits_4dbd6f
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %reverseBits_4dbd6f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reverseBits_4dbd6f
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reverseBits_4dbd6f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_4dbd6f
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reverseBits_4dbd6f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.wgsl
index ed7394e..acfc6ff 100644
--- a/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/4dbd6f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reverseBits_4dbd6f() {
   var res : vec4<i32> = reverseBits(vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_4dbd6f();
diff --git a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl
index d67411a..505f472 100644
--- a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl
@@ -24,7 +24,9 @@
 // fn reverseBits(i32) -> i32
 fn reverseBits_7c4269() {
   var res: i32 = reverseBits(1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.dxc.hlsl
index 03c8356..056bbbe 100644
--- a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_7c4269() {
   int res = -2147483648;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.fxc.hlsl
index 03c8356..056bbbe 100644
--- a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_7c4269() {
   int res = -2147483648;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.glsl
index b49fd5d..d5229b8 100644
--- a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void reverseBits_7c4269() {
   int res = -2147483648;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void reverseBits_7c4269() {
   int res = -2147483648;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void reverseBits_7c4269() {
   int res = -2147483648;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.msl b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.msl
index d866776..854b061 100644
--- a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_7c4269() {
+void reverseBits_7c4269(device int* const tint_symbol_1) {
   int res = (-2147483647 - 1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_7c4269();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  reverseBits_7c4269(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_7c4269();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_7c4269(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_7c4269();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_7c4269(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.spvasm
index 099ac7e..358842e 100644
--- a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_7c4269 "reverseBits_7c4269"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %int_n2147483648 = OpConstant %int -2147483648
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_7c4269 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+%reverseBits_7c4269 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_n2147483648
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %reverseBits_7c4269
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %reverseBits_7c4269
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %reverseBits_7c4269
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %reverseBits_7c4269
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %reverseBits_7c4269
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %reverseBits_7c4269
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.wgsl
index 4571a61..3a3dea4 100644
--- a/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/7c4269.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reverseBits_7c4269() {
   var res : i32 = reverseBits(1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_7c4269();
diff --git a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl
index 7dc1ea1d..661dda7 100644
--- a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl
@@ -24,7 +24,9 @@
 // fn reverseBits(vec<3, u32>) -> vec<3, u32>
 fn reverseBits_a6ccd4() {
   var res: vec3<u32> = reverseBits(vec3<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.dxc.hlsl
index ae2987c..5b514d2 100644
--- a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_a6ccd4() {
   uint3 res = (2147483648u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.fxc.hlsl
index ae2987c..5b514d2 100644
--- a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_a6ccd4() {
   uint3 res = (2147483648u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.glsl
index ff797a6..ca287c6 100644
--- a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void reverseBits_a6ccd4() {
   uvec3 res = uvec3(2147483648u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void reverseBits_a6ccd4() {
   uvec3 res = uvec3(2147483648u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void reverseBits_a6ccd4() {
   uvec3 res = uvec3(2147483648u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.msl b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.msl
index ebc5d6f..611a5ce 100644
--- a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_a6ccd4() {
+void reverseBits_a6ccd4(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(2147483648u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_a6ccd4();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  reverseBits_a6ccd4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_a6ccd4();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_a6ccd4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_a6ccd4();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_a6ccd4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.spvasm
index 7be4545..705619c 100644
--- a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_a6ccd4 "reverseBits_a6ccd4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %uint_2147483648 = OpConstant %uint 2147483648
-         %16 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
+         %19 = OpConstantComposite %v3uint %uint_2147483648 %uint_2147483648 %uint_2147483648
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_a6ccd4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+%reverseBits_a6ccd4 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reverseBits_a6ccd4
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %reverseBits_a6ccd4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reverseBits_a6ccd4
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %reverseBits_a6ccd4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_a6ccd4
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reverseBits_a6ccd4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.wgsl
index c5425de..774db2d 100644
--- a/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/a6ccd4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reverseBits_a6ccd4() {
   var res : vec3<u32> = reverseBits(vec3<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_a6ccd4();
diff --git a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl
index 1f71ba8..99d9a2d 100644
--- a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl
@@ -24,7 +24,9 @@
 // fn reverseBits(vec<3, i32>) -> vec<3, i32>
 fn reverseBits_c21bc1() {
   var res: vec3<i32> = reverseBits(vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.dxc.hlsl
index f2aa08d..2ca212e 100644
--- a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_c21bc1() {
   int3 res = (-2147483648).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.fxc.hlsl
index f2aa08d..2ca212e 100644
--- a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_c21bc1() {
   int3 res = (-2147483648).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.glsl
index 631794a..dab6ac2 100644
--- a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void reverseBits_c21bc1() {
   ivec3 res = ivec3(-2147483648);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void reverseBits_c21bc1() {
   ivec3 res = ivec3(-2147483648);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void reverseBits_c21bc1() {
   ivec3 res = ivec3(-2147483648);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.msl b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.msl
index 0d687a9..bd72afc 100644
--- a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_c21bc1() {
+void reverseBits_c21bc1(device packed_int3* const tint_symbol_1) {
   int3 res = int3((-2147483647 - 1));
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_c21bc1();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  reverseBits_c21bc1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_c21bc1();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_c21bc1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_c21bc1();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_c21bc1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.spvasm
index 83d95fd..d2f0aef 100644
--- a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_c21bc1 "reverseBits_c21bc1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %int_n2147483648 = OpConstant %int -2147483648
-         %16 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
+         %19 = OpConstantComposite %v3int %int_n2147483648 %int_n2147483648 %int_n2147483648
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_c21bc1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+%reverseBits_c21bc1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reverseBits_c21bc1
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %reverseBits_c21bc1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reverseBits_c21bc1
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reverseBits_c21bc1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_c21bc1
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reverseBits_c21bc1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.wgsl
index ab4d12f..ae35a04 100644
--- a/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/c21bc1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reverseBits_c21bc1() {
   var res : vec3<i32> = reverseBits(vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_c21bc1();
diff --git a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl
index 10abd26..6e62b90 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl
@@ -24,7 +24,9 @@
 // fn reverseBits(vec<2, u32>) -> vec<2, u32>
 fn reverseBits_e1f4c1() {
   var res: vec2<u32> = reverseBits(vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.dxc.hlsl
index 505d08f..3ddc433 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_e1f4c1() {
   uint2 res = (2147483648u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.fxc.hlsl
index 505d08f..3ddc433 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_e1f4c1() {
   uint2 res = (2147483648u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.glsl
index 7e40794..5c9cba5 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void reverseBits_e1f4c1() {
   uvec2 res = uvec2(2147483648u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void reverseBits_e1f4c1() {
   uvec2 res = uvec2(2147483648u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void reverseBits_e1f4c1() {
   uvec2 res = uvec2(2147483648u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.msl b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.msl
index 7f28f03..3b1f5a4 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_e1f4c1() {
+void reverseBits_e1f4c1(device uint2* const tint_symbol_1) {
   uint2 res = uint2(2147483648u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_e1f4c1();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  reverseBits_e1f4c1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_e1f4c1();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_e1f4c1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_e1f4c1();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_e1f4c1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.spvasm
index 11be15f..703c5e7 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_e1f4c1 "reverseBits_e1f4c1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %uint_2147483648 = OpConstant %uint 2147483648
-         %16 = OpConstantComposite %v2uint %uint_2147483648 %uint_2147483648
+         %19 = OpConstantComposite %v2uint %uint_2147483648 %uint_2147483648
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_e1f4c1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+%reverseBits_e1f4c1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %reverseBits_e1f4c1
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %reverseBits_e1f4c1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %reverseBits_e1f4c1
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %reverseBits_e1f4c1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_e1f4c1
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reverseBits_e1f4c1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.wgsl
index d932106..5ffaeb5 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e1f4c1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reverseBits_e1f4c1() {
   var res : vec2<u32> = reverseBits(vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_e1f4c1();
diff --git a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl
index b711303..18064dd 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl
@@ -24,7 +24,9 @@
 // fn reverseBits(u32) -> u32
 fn reverseBits_e31adf() {
   var res: u32 = reverseBits(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.dxc.hlsl
index bc83744..96d2e49 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_e31adf() {
   uint res = 2147483648u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.fxc.hlsl
index bc83744..96d2e49 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_e31adf() {
   uint res = 2147483648u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.glsl
index 9702c7f..0f9c646 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void reverseBits_e31adf() {
   uint res = 2147483648u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void reverseBits_e31adf() {
   uint res = 2147483648u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void reverseBits_e31adf() {
   uint res = 2147483648u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.msl b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.msl
index de5f9e3..7ffacaf 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_e31adf() {
+void reverseBits_e31adf(device uint* const tint_symbol_1) {
   uint res = 2147483648u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_e31adf();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  reverseBits_e31adf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_e31adf();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_e31adf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_e31adf();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_e31adf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.spvasm
index 55f8128..30afce3 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_e31adf "reverseBits_e31adf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %uint_2147483648 = OpConstant %uint 2147483648
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_e31adf = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%reverseBits_e31adf = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_2147483648
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %reverseBits_e31adf
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %reverseBits_e31adf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %reverseBits_e31adf
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %reverseBits_e31adf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %reverseBits_e31adf
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reverseBits_e31adf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.wgsl
index fe271eb..f31ae3b 100644
--- a/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/reverseBits/e31adf.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn reverseBits_e31adf() {
   var res : u32 = reverseBits(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_e31adf();
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl
index e4be756..ce7170d 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl
@@ -24,7 +24,9 @@
 // fn round(vec<4, f32>) -> vec<4, f32>
 fn round_106c0b() {
   var res: vec4<f32> = round(vec4<f32>(3.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.dxc.hlsl
index 8a44079..045c78e 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_106c0b() {
   float4 res = (4.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.fxc.hlsl
index 8a44079..045c78e 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_106c0b() {
   float4 res = (4.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.glsl
index df6aaf6..0969b1e 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void round_106c0b() {
   vec4 res = vec4(4.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void round_106c0b() {
   vec4 res = vec4(4.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void round_106c0b() {
   vec4 res = vec4(4.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.msl
index 7569146..86fa33e 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_106c0b() {
+void round_106c0b(device float4* const tint_symbol_1) {
   float4 res = float4(4.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_106c0b();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  round_106c0b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_106c0b();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  round_106c0b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_106c0b();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  round_106c0b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.spvasm
index 71ffb45..8480430 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_106c0b "round_106c0b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_4 = OpConstant %float 4
-         %14 = OpConstantComposite %v4float %float_4 %float_4 %float_4 %float_4
+         %17 = OpConstantComposite %v4float %float_4 %float_4 %float_4 %float_4
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_106c0b = OpFunction %void None %9
-         %12 = OpLabel
+%round_106c0b = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %round_106c0b
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %round_106c0b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %round_106c0b
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %round_106c0b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %round_106c0b
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %round_106c0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.wgsl
index b378aa9..55a0509 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn round_106c0b() {
   var res : vec4<f32> = round(vec4<f32>(3.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_106c0b();
diff --git a/test/tint/builtins/gen/literal/round/184d5a.wgsl b/test/tint/builtins/gen/literal/round/184d5a.wgsl
index 530da3b..df242c3 100644
--- a/test/tint/builtins/gen/literal/round/184d5a.wgsl
+++ b/test/tint/builtins/gen/literal/round/184d5a.wgsl
@@ -25,7 +25,6 @@
 fn round_184d5a() {
   var res = round(vec4(3.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_184d5a();
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl
index 0a90eae..8dc6e74 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl
@@ -24,7 +24,9 @@
 // fn round(vec<3, f32>) -> vec<3, f32>
 fn round_1c7897() {
   var res: vec3<f32> = round(vec3<f32>(3.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.dxc.hlsl
index 6653501..838b8ba 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_1c7897() {
   float3 res = (4.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.fxc.hlsl
index 6653501..838b8ba 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_1c7897() {
   float3 res = (4.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.glsl
index 9bc7454..a7ecd7b 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void round_1c7897() {
   vec3 res = vec3(4.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void round_1c7897() {
   vec3 res = vec3(4.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void round_1c7897() {
   vec3 res = vec3(4.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.msl
index c4da823..cd89aaa 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_1c7897() {
+void round_1c7897(device packed_float3* const tint_symbol_1) {
   float3 res = float3(4.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_1c7897();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  round_1c7897(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_1c7897();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  round_1c7897(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_1c7897();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  round_1c7897(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.spvasm
index 81eb5a8..202eb774 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_1c7897 "round_1c7897"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_4 = OpConstant %float 4
-         %15 = OpConstantComposite %v3float %float_4 %float_4 %float_4
+         %18 = OpConstantComposite %v3float %float_4 %float_4 %float_4
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_1c7897 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%round_1c7897 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %round_1c7897
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_1c7897
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %round_1c7897
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %round_1c7897
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %round_1c7897
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %round_1c7897
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.wgsl
index 919ce17..d38c133 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn round_1c7897() {
   var res : vec3<f32> = round(vec3<f32>(3.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_1c7897();
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl
index b66178c..e4cd34a 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl
@@ -24,7 +24,9 @@
 // fn round(vec<2, f32>) -> vec<2, f32>
 fn round_52c84d() {
   var res: vec2<f32> = round(vec2<f32>(3.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.dxc.hlsl
index e1678fe..329ea02 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_52c84d() {
   float2 res = (4.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.fxc.hlsl
index e1678fe..329ea02 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_52c84d() {
   float2 res = (4.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.glsl
index 9376115..0adc7c0 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void round_52c84d() {
   vec2 res = vec2(4.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void round_52c84d() {
   vec2 res = vec2(4.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void round_52c84d() {
   vec2 res = vec2(4.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.msl
index 51f463a..8d93d2c 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_52c84d() {
+void round_52c84d(device float2* const tint_symbol_1) {
   float2 res = float2(4.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_52c84d();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  round_52c84d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_52c84d();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  round_52c84d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_52c84d();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  round_52c84d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.spvasm
index 1e63417..9a107e9 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_52c84d "round_52c84d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_4 = OpConstant %float 4
-         %15 = OpConstantComposite %v2float %float_4 %float_4
+         %18 = OpConstantComposite %v2float %float_4 %float_4
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_52c84d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%round_52c84d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %round_52c84d
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_52c84d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %round_52c84d
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %round_52c84d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %round_52c84d
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %round_52c84d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.wgsl
index d4288e4..9a9d5d3 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn round_52c84d() {
   var res : vec2<f32> = round(vec2<f32>(3.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_52c84d();
diff --git a/test/tint/builtins/gen/literal/round/773a8f.wgsl b/test/tint/builtins/gen/literal/round/773a8f.wgsl
index 28ac24e..3184a76 100644
--- a/test/tint/builtins/gen/literal/round/773a8f.wgsl
+++ b/test/tint/builtins/gen/literal/round/773a8f.wgsl
@@ -25,7 +25,6 @@
 fn round_773a8f() {
   var res = round(3.5);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_773a8f();
diff --git a/test/tint/builtins/gen/literal/round/8fdca3.wgsl b/test/tint/builtins/gen/literal/round/8fdca3.wgsl
index ff10793..b7fc9cd 100644
--- a/test/tint/builtins/gen/literal/round/8fdca3.wgsl
+++ b/test/tint/builtins/gen/literal/round/8fdca3.wgsl
@@ -25,7 +25,6 @@
 fn round_8fdca3() {
   var res = round(vec2(3.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_8fdca3();
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl
index 62b2ce5..1b8f6a8 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl
@@ -26,7 +26,9 @@
 // fn round(f16) -> f16
 fn round_9078ef() {
   var res: f16 = round(3.5h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.dxc.hlsl
index ca26e0e..ef7a3c6 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_9078ef() {
   float16_t res = float16_t(4.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.fxc.hlsl
index fe1d576..17721e0 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_9078ef() {
-  float16_t res = float16_t(3.0h);
+  float16_t res = float16_t(4.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.glsl
index a30b084..7605eef 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void round_9078ef() {
   float16_t res = 4.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void round_9078ef() {
   float16_t res = 4.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void round_9078ef() {
   float16_t res = 4.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.msl
index 1dfd603..2fa2549 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_9078ef() {
+void round_9078ef(device half* const tint_symbol_1) {
   half res = 4.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_9078ef();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  round_9078ef(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_9078ef();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  round_9078ef(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_9078ef();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  round_9078ef(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.spvasm
index 6add4c3..8eba803 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_9078ef "round_9078ef"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_2 = OpConstant %half 0x1p+2
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_9078ef = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%round_9078ef = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_2
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %round_9078ef
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_9078ef
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %round_9078ef
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %round_9078ef
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %round_9078ef
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %round_9078ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.wgsl
index 6e919be..b6f287c 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn round_9078ef() {
   var res : f16 = round(3.5h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_9078ef();
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl
index a54a0d8..5940e44 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl
@@ -24,7 +24,9 @@
 // fn round(f32) -> f32
 fn round_9edc38() {
   var res: f32 = round(3.5f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.dxc.hlsl
index e33c4f3..796943e 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_9edc38() {
   float res = 4.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.fxc.hlsl
index e33c4f3..796943e 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_9edc38() {
   float res = 4.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.glsl
index 3b6ac86..78f0c61 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void round_9edc38() {
   float res = 4.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void round_9edc38() {
   float res = 4.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void round_9edc38() {
   float res = 4.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.msl
index 21bf09c..fc0b2d6 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_9edc38() {
+void round_9edc38(device float* const tint_symbol_1) {
   float res = 4.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_9edc38();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  round_9edc38(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_9edc38();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  round_9edc38(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_9edc38();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  round_9edc38(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.spvasm
index 3639932..d14fcd4 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_9edc38 "round_9edc38"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_4 = OpConstant %float 4
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_9edc38 = OpFunction %void None %9
-         %12 = OpLabel
+%round_9edc38 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_4
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %round_9edc38
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %round_9edc38
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %round_9edc38
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %round_9edc38
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %round_9edc38
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %round_9edc38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.wgsl
index b8d95e0..8959329 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn round_9edc38() {
   var res : f32 = round(3.5f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_9edc38();
diff --git a/test/tint/builtins/gen/literal/round/a1673d.wgsl b/test/tint/builtins/gen/literal/round/a1673d.wgsl
index cbb609e..a5e43ce 100644
--- a/test/tint/builtins/gen/literal/round/a1673d.wgsl
+++ b/test/tint/builtins/gen/literal/round/a1673d.wgsl
@@ -25,7 +25,6 @@
 fn round_a1673d() {
   var res = round(vec3(3.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_a1673d();
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl
index 95ab824..173a6da9 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl
@@ -26,7 +26,9 @@
 // fn round(vec<2, f16>) -> vec<2, f16>
 fn round_d87e84() {
   var res: vec2<f16> = round(vec2<f16>(3.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.dxc.hlsl
index 9189150..76f7b07 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_d87e84() {
   vector<float16_t, 2> res = (float16_t(4.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.fxc.hlsl
index 4522af7..c5f3299 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_d87e84() {
-  vector<float16_t, 2> res = (float16_t(3.0h)).xx;
+  vector<float16_t, 2> res = (float16_t(4.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.glsl
index 5ede7fd..dbe38b1 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void round_d87e84() {
   f16vec2 res = f16vec2(4.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void round_d87e84() {
   f16vec2 res = f16vec2(4.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void round_d87e84() {
   f16vec2 res = f16vec2(4.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.msl
index 5d535eb..ca420f0 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_d87e84() {
+void round_d87e84(device half2* const tint_symbol_1) {
   half2 res = half2(4.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_d87e84();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  round_d87e84(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_d87e84();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  round_d87e84(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_d87e84();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  round_d87e84(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.spvasm
index 9c21fe9..3c8bcd0 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_d87e84 "round_d87e84"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_2 = OpConstant %half 0x1p+2
-         %16 = OpConstantComposite %v2half %half_0x1p_2 %half_0x1p_2
+         %19 = OpConstantComposite %v2half %half_0x1p_2 %half_0x1p_2
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_d87e84 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%round_d87e84 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %round_d87e84
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %round_d87e84
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %round_d87e84
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %round_d87e84
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_d87e84
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %round_d87e84
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.wgsl
index e47782b..02fe0dd 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn round_d87e84() {
   var res : vec2<f16> = round(vec2<f16>(3.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_d87e84();
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl
index cbf710a..43d1e1d 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl
@@ -26,7 +26,9 @@
 // fn round(vec<3, f16>) -> vec<3, f16>
 fn round_e1bba2() {
   var res: vec3<f16> = round(vec3<f16>(3.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.dxc.hlsl
index b5d707f..dbd5b14 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_e1bba2() {
   vector<float16_t, 3> res = (float16_t(4.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.fxc.hlsl
index 65f86a6..5c6e91b 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_e1bba2() {
-  vector<float16_t, 3> res = (float16_t(3.0h)).xxx;
+  vector<float16_t, 3> res = (float16_t(4.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.glsl
index 1a7a32a..ce4804f 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void round_e1bba2() {
   f16vec3 res = f16vec3(4.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void round_e1bba2() {
   f16vec3 res = f16vec3(4.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void round_e1bba2() {
   f16vec3 res = f16vec3(4.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.msl
index 1b0be02..4ba8dc0 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_e1bba2() {
+void round_e1bba2(device packed_half3* const tint_symbol_1) {
   half3 res = half3(4.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_e1bba2();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  round_e1bba2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_e1bba2();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  round_e1bba2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_e1bba2();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  round_e1bba2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.spvasm
index 713ac10..4a936e6 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_e1bba2 "round_e1bba2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_2 = OpConstant %half 0x1p+2
-         %16 = OpConstantComposite %v3half %half_0x1p_2 %half_0x1p_2 %half_0x1p_2
+         %19 = OpConstantComposite %v3half %half_0x1p_2 %half_0x1p_2 %half_0x1p_2
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_e1bba2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%round_e1bba2 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %round_e1bba2
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %round_e1bba2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %round_e1bba2
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %round_e1bba2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_e1bba2
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %round_e1bba2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.wgsl
index 67e742f..3f38543 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn round_e1bba2() {
   var res : vec3<f16> = round(vec3<f16>(3.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_e1bba2();
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl
index dd4fbea..e619ac0 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl
@@ -26,7 +26,9 @@
 // fn round(vec<4, f16>) -> vec<4, f16>
 fn round_f665b5() {
   var res: vec4<f16> = round(vec4<f16>(3.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.dxc.hlsl
index 9acd46a..b41b7c6 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_f665b5() {
   vector<float16_t, 4> res = (float16_t(4.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.fxc.hlsl
index 6852574..cb13cd1 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_f665b5() {
-  vector<float16_t, 4> res = (float16_t(3.0h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(4.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.glsl
index 60ff2bd..eaf5fba 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void round_f665b5() {
   f16vec4 res = f16vec4(4.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void round_f665b5() {
   f16vec4 res = f16vec4(4.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void round_f665b5() {
   f16vec4 res = f16vec4(4.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.msl
index 7d642cc..1b001af 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_f665b5() {
+void round_f665b5(device half4* const tint_symbol_1) {
   half4 res = half4(4.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_f665b5();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  round_f665b5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_f665b5();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  round_f665b5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_f665b5();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  round_f665b5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.spvasm
index 0398b56..5b869c0 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_f665b5 "round_f665b5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_2 = OpConstant %half 0x1p+2
-         %16 = OpConstantComposite %v4half %half_0x1p_2 %half_0x1p_2 %half_0x1p_2 %half_0x1p_2
+         %19 = OpConstantComposite %v4half %half_0x1p_2 %half_0x1p_2 %half_0x1p_2 %half_0x1p_2
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_f665b5 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%round_f665b5 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %round_f665b5
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %round_f665b5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %round_f665b5
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %round_f665b5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_f665b5
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %round_f665b5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.wgsl
index 30a8e63..1fec2d1 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn round_f665b5() {
   var res : vec4<f16> = round(vec4<f16>(3.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_f665b5();
diff --git a/test/tint/builtins/gen/literal/saturate/270da5.wgsl b/test/tint/builtins/gen/literal/saturate/270da5.wgsl
index 263c53d..d1c8a6c 100644
--- a/test/tint/builtins/gen/literal/saturate/270da5.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/270da5.wgsl
@@ -24,7 +24,9 @@
 // fn saturate(f32) -> f32
 fn saturate_270da5() {
   var res: f32 = saturate(2.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.dxc.hlsl
index ea2aa83..b231140 100644
--- a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_270da5() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.fxc.hlsl
index ea2aa83..b231140 100644
--- a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_270da5() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.glsl
index c0a87bf..7a967b5 100644
--- a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void saturate_270da5() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void saturate_270da5() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void saturate_270da5() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.msl b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.msl
index 5d05acc..ee2a681 100644
--- a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_270da5() {
+void saturate_270da5(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_270da5();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  saturate_270da5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_270da5();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  saturate_270da5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_270da5();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  saturate_270da5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.spvasm
index 323b571..9d29329 100644
--- a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %saturate_270da5 "saturate_270da5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%saturate_270da5 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%saturate_270da5 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %saturate_270da5
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %saturate_270da5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %saturate_270da5
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %saturate_270da5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %saturate_270da5
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %saturate_270da5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.wgsl
index 006c871..8b664b0 100644
--- a/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/270da5.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn saturate_270da5() {
   var res : f32 = saturate(2.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_270da5();
diff --git a/test/tint/builtins/gen/literal/saturate/462535.wgsl b/test/tint/builtins/gen/literal/saturate/462535.wgsl
index 14b69ba..42d0eb5 100644
--- a/test/tint/builtins/gen/literal/saturate/462535.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/462535.wgsl
@@ -26,7 +26,9 @@
 // fn saturate(vec<3, f16>) -> vec<3, f16>
 fn saturate_462535() {
   var res: vec3<f16> = saturate(vec3<f16>(2.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.dxc.hlsl
index ce230c9..d55ce37 100644
--- a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_462535() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.fxc.hlsl
index e5a20da..0bd15ae 100644
--- a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_462535() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.glsl b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.glsl
index d525902..2ee9efb 100644
--- a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void saturate_462535() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void saturate_462535() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void saturate_462535() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.msl b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.msl
index 4fab232..2bada61 100644
--- a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_462535() {
+void saturate_462535(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_462535();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  saturate_462535(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_462535();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  saturate_462535(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_462535();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  saturate_462535(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.spvasm
index 0c3162d..aacb927 100644
--- a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %saturate_462535 "saturate_462535"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%saturate_462535 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%saturate_462535 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %saturate_462535
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %saturate_462535
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %saturate_462535
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %saturate_462535
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %saturate_462535
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %saturate_462535
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.wgsl
index f4f845c..3c45527 100644
--- a/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/462535.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn saturate_462535() {
   var res : vec3<f16> = saturate(vec3<f16>(2.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_462535();
diff --git a/test/tint/builtins/gen/literal/saturate/4ed8d7.wgsl b/test/tint/builtins/gen/literal/saturate/4ed8d7.wgsl
index 81fb61d..856218d 100644
--- a/test/tint/builtins/gen/literal/saturate/4ed8d7.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/4ed8d7.wgsl
@@ -25,7 +25,6 @@
 fn saturate_4ed8d7() {
   var res = saturate(vec4(2.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_4ed8d7();
diff --git a/test/tint/builtins/gen/literal/saturate/51567f.wgsl b/test/tint/builtins/gen/literal/saturate/51567f.wgsl
index 23daad5..965813e 100644
--- a/test/tint/builtins/gen/literal/saturate/51567f.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/51567f.wgsl
@@ -24,7 +24,9 @@
 // fn saturate(vec<2, f32>) -> vec<2, f32>
 fn saturate_51567f() {
   var res: vec2<f32> = saturate(vec2<f32>(2.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.dxc.hlsl
index 8d8a7de..170aa67 100644
--- a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_51567f() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.fxc.hlsl
index 8d8a7de..170aa67 100644
--- a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_51567f() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.glsl
index a4d1fe9..f8d3783 100644
--- a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void saturate_51567f() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void saturate_51567f() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void saturate_51567f() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.msl b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.msl
index aa4854a..f8c8b03 100644
--- a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_51567f() {
+void saturate_51567f(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_51567f();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  saturate_51567f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_51567f();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  saturate_51567f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_51567f();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  saturate_51567f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.spvasm
index 0528cb2..b948bc3 100644
--- a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %saturate_51567f "saturate_51567f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%saturate_51567f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%saturate_51567f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %saturate_51567f
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %saturate_51567f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %saturate_51567f
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %saturate_51567f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %saturate_51567f
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %saturate_51567f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.wgsl
index f81f727..ccd83f2 100644
--- a/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/51567f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn saturate_51567f() {
   var res : vec2<f32> = saturate(vec2<f32>(2.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_51567f();
diff --git a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl
index da4ce4b..2afba13 100644
--- a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl
@@ -24,7 +24,9 @@
 // fn saturate(vec<3, f32>) -> vec<3, f32>
 fn saturate_6bcddf() {
   var res: vec3<f32> = saturate(vec3<f32>(2.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.dxc.hlsl
index 444b45a..44e1cae 100644
--- a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_6bcddf() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.fxc.hlsl
index 444b45a..44e1cae 100644
--- a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_6bcddf() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.glsl
index cf6681e..f3230d4 100644
--- a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void saturate_6bcddf() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void saturate_6bcddf() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void saturate_6bcddf() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.msl b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.msl
index 0cf7e3f..36fe9bb 100644
--- a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_6bcddf() {
+void saturate_6bcddf(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_6bcddf();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  saturate_6bcddf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_6bcddf();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  saturate_6bcddf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_6bcddf();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  saturate_6bcddf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.spvasm
index ea1db97..159048a 100644
--- a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %saturate_6bcddf "saturate_6bcddf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%saturate_6bcddf = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%saturate_6bcddf = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %saturate_6bcddf
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %saturate_6bcddf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %saturate_6bcddf
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %saturate_6bcddf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %saturate_6bcddf
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %saturate_6bcddf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.wgsl
index c4c3a61..b2a1235 100644
--- a/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/6bcddf.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn saturate_6bcddf() {
   var res : vec3<f32> = saturate(vec3<f32>(2.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_6bcddf();
diff --git a/test/tint/builtins/gen/literal/saturate/78b37c.wgsl b/test/tint/builtins/gen/literal/saturate/78b37c.wgsl
index 0c8a403..95345b3 100644
--- a/test/tint/builtins/gen/literal/saturate/78b37c.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/78b37c.wgsl
@@ -25,7 +25,6 @@
 fn saturate_78b37c() {
   var res = saturate(2.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_78b37c();
diff --git a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl
index 984d4cb..8ae1f3a 100644
--- a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl
@@ -24,7 +24,9 @@
 // fn saturate(vec<4, f32>) -> vec<4, f32>
 fn saturate_a5b571() {
   var res: vec4<f32> = saturate(vec4<f32>(2.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.dxc.hlsl
index 66b0b04..35571d9 100644
--- a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_a5b571() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.fxc.hlsl
index 66b0b04..35571d9 100644
--- a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_a5b571() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.glsl b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.glsl
index 6324359..6b4c44c 100644
--- a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void saturate_a5b571() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void saturate_a5b571() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void saturate_a5b571() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.msl b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.msl
index 48e0fda..0fbf10a 100644
--- a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_a5b571() {
+void saturate_a5b571(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_a5b571();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  saturate_a5b571(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_a5b571();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  saturate_a5b571(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_a5b571();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  saturate_a5b571(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.spvasm
index ce06562..4d4e180 100644
--- a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %saturate_a5b571 "saturate_a5b571"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%saturate_a5b571 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%saturate_a5b571 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %saturate_a5b571
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %saturate_a5b571
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %saturate_a5b571
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %saturate_a5b571
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %saturate_a5b571
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %saturate_a5b571
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.wgsl
index 79a7572..3a61122 100644
--- a/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/a5b571.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn saturate_a5b571() {
   var res : vec4<f32> = saturate(vec4<f32>(2.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_a5b571();
diff --git a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl
index ec40321..36a497c 100644
--- a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl
@@ -26,7 +26,9 @@
 // fn saturate(vec<2, f16>) -> vec<2, f16>
 fn saturate_cd2028() {
   var res: vec2<f16> = saturate(vec2<f16>(2.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.dxc.hlsl
index 9d77a0f..ed5b5ef 100644
--- a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_cd2028() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.fxc.hlsl
index 1c3d125..c020ac9 100644
--- a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_cd2028() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.glsl b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.glsl
index d63e3e7..d89b135 100644
--- a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void saturate_cd2028() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void saturate_cd2028() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void saturate_cd2028() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.msl b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.msl
index c941ffe..459cc8c 100644
--- a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_cd2028() {
+void saturate_cd2028(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_cd2028();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  saturate_cd2028(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_cd2028();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  saturate_cd2028(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_cd2028();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  saturate_cd2028(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.spvasm
index 2312102..7d0b5d4 100644
--- a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %saturate_cd2028 "saturate_cd2028"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%saturate_cd2028 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%saturate_cd2028 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %saturate_cd2028
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %saturate_cd2028
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %saturate_cd2028
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %saturate_cd2028
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %saturate_cd2028
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %saturate_cd2028
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.wgsl
index 47ce6c7..e513a06 100644
--- a/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/cd2028.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn saturate_cd2028() {
   var res : vec2<f16> = saturate(vec2<f16>(2.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_cd2028();
diff --git a/test/tint/builtins/gen/literal/saturate/d55822.wgsl b/test/tint/builtins/gen/literal/saturate/d55822.wgsl
index fc73316..4911612 100644
--- a/test/tint/builtins/gen/literal/saturate/d55822.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/d55822.wgsl
@@ -25,7 +25,6 @@
 fn saturate_d55822() {
   var res = saturate(vec3(2.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_d55822();
diff --git a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl
index 22dd45f..5af76f5 100644
--- a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl
@@ -26,7 +26,9 @@
 // fn saturate(vec<4, f16>) -> vec<4, f16>
 fn saturate_dcde71() {
   var res: vec4<f16> = saturate(vec4<f16>(2.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.dxc.hlsl
index 250ea3a..efc1f1c 100644
--- a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_dcde71() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.fxc.hlsl
index 6ccb510..a044fab 100644
--- a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_dcde71() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.glsl b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.glsl
index 0b80f1d..e71a638 100644
--- a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void saturate_dcde71() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void saturate_dcde71() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void saturate_dcde71() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.msl b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.msl
index 403440d..d11c1fb 100644
--- a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_dcde71() {
+void saturate_dcde71(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_dcde71();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  saturate_dcde71(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_dcde71();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  saturate_dcde71(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_dcde71();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  saturate_dcde71(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.spvasm
index 1ae8455..7cf4d8a 100644
--- a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %saturate_dcde71 "saturate_dcde71"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%saturate_dcde71 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%saturate_dcde71 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %saturate_dcde71
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %saturate_dcde71
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %saturate_dcde71
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %saturate_dcde71
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %saturate_dcde71
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %saturate_dcde71
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.wgsl
index 2c8aba9..68b6cc1 100644
--- a/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/dcde71.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn saturate_dcde71() {
   var res : vec4<f16> = saturate(vec4<f16>(2.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_dcde71();
diff --git a/test/tint/builtins/gen/literal/saturate/e40fb6.wgsl b/test/tint/builtins/gen/literal/saturate/e40fb6.wgsl
index 36003fb..ef85daf 100644
--- a/test/tint/builtins/gen/literal/saturate/e40fb6.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/e40fb6.wgsl
@@ -25,7 +25,6 @@
 fn saturate_e40fb6() {
   var res = saturate(vec2(2.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_e40fb6();
diff --git a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl
index 14ba3d6..d0e7486 100644
--- a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl
@@ -26,7 +26,9 @@
 // fn saturate(f16) -> f16
 fn saturate_e8df56() {
   var res: f16 = saturate(2.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.dxc.hlsl
index 2774be4..72738e4 100644
--- a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_e8df56() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.fxc.hlsl
index ed582aa..941b0ab 100644
--- a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_e8df56() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.glsl b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.glsl
index 7e416e1..4fdaa81 100644
--- a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void saturate_e8df56() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void saturate_e8df56() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void saturate_e8df56() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.msl b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.msl
index 6af9d37..a9572ac 100644
--- a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_e8df56() {
+void saturate_e8df56(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_e8df56();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  saturate_e8df56(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_e8df56();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  saturate_e8df56(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_e8df56();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  saturate_e8df56(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.spvasm
index 3f552d8..a155393 100644
--- a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %saturate_e8df56 "saturate_e8df56"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%saturate_e8df56 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%saturate_e8df56 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %saturate_e8df56
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %saturate_e8df56
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %saturate_e8df56
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %saturate_e8df56
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %saturate_e8df56
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %saturate_e8df56
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.wgsl
index e983300..ee3523e 100644
--- a/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/saturate/e8df56.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn saturate_e8df56() {
   var res : f16 = saturate(2.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_e8df56();
diff --git a/test/tint/builtins/gen/literal/select/00b848.wgsl b/test/tint/builtins/gen/literal/select/00b848.wgsl
index 85829b5..9964b8a 100644
--- a/test/tint/builtins/gen/literal/select/00b848.wgsl
+++ b/test/tint/builtins/gen/literal/select/00b848.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<2, i32>, vec<2, i32>, vec<2, bool>) -> vec<2, i32>
 fn select_00b848() {
   var res: vec2<i32> = select(vec2<i32>(1i), vec2<i32>(1i), vec2<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.dxc.hlsl
index b18b4ad..4f1b109 100644
--- a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_00b848() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.fxc.hlsl
index b18b4ad..4f1b109 100644
--- a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_00b848() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.glsl
index 92d62c1..6d58188 100644
--- a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_00b848() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_00b848() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_00b848() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.msl
index 505f1a0..487dc01 100644
--- a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_00b848() {
+void select_00b848(device int2* const tint_symbol_1) {
   int2 res = int2(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_00b848();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  select_00b848(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_00b848();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  select_00b848(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_00b848();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  select_00b848(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.spvasm
index 75adf7c..bd27b51 100644
--- a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_00b848 "select_00b848"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_00b848 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+%select_00b848 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_00b848
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_00b848
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_00b848
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_00b848
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_00b848
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_00b848
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.wgsl
index c43adb3..42d5470 100644
--- a/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/00b848.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_00b848() {
   var res : vec2<i32> = select(vec2<i32>(1i), vec2<i32>(1i), vec2<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_00b848();
diff --git a/test/tint/builtins/gen/literal/select/01e2cd.wgsl b/test/tint/builtins/gen/literal/select/01e2cd.wgsl
index 987dbd8..504e2ec 100644
--- a/test/tint/builtins/gen/literal/select/01e2cd.wgsl
+++ b/test/tint/builtins/gen/literal/select/01e2cd.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<3, i32>, vec<3, i32>, vec<3, bool>) -> vec<3, i32>
 fn select_01e2cd() {
   var res: vec3<i32> = select(vec3<i32>(1i), vec3<i32>(1i), vec3<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.dxc.hlsl
index 2882c7b..dee3153 100644
--- a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_01e2cd() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.fxc.hlsl
index 2882c7b..dee3153 100644
--- a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_01e2cd() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.glsl
index 29d0add..b71f1bc 100644
--- a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_01e2cd() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_01e2cd() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_01e2cd() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.msl
index 2bbdce0..8502490 100644
--- a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_01e2cd() {
+void select_01e2cd(device packed_int3* const tint_symbol_1) {
   int3 res = int3(1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_01e2cd();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  select_01e2cd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_01e2cd();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  select_01e2cd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_01e2cd();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  select_01e2cd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.spvasm
index e43b2d5..494b4b0 100644
--- a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_01e2cd "select_01e2cd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_01e2cd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+%select_01e2cd = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_01e2cd
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_01e2cd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_01e2cd
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_01e2cd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_01e2cd
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_01e2cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.wgsl
index b85c871..3d196fb 100644
--- a/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/01e2cd.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_01e2cd() {
   var res : vec3<i32> = select(vec3<i32>(1i), vec3<i32>(1i), vec3<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_01e2cd();
diff --git a/test/tint/builtins/gen/literal/select/087ea4.wgsl b/test/tint/builtins/gen/literal/select/087ea4.wgsl
index c58a6ae..a67cd85 100644
--- a/test/tint/builtins/gen/literal/select/087ea4.wgsl
+++ b/test/tint/builtins/gen/literal/select/087ea4.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<4, u32>, vec<4, u32>, bool) -> vec<4, u32>
 fn select_087ea4() {
   var res: vec4<u32> = select(vec4<u32>(1u), vec4<u32>(1u), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.dxc.hlsl
index 7212e72..8c02bd9 100644
--- a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_087ea4() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.fxc.hlsl
index 7212e72..8c02bd9 100644
--- a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_087ea4() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.glsl
index 5e58865..e1abe08 100644
--- a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_087ea4() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_087ea4() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_087ea4() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.msl
index 959b45c..39758ab 100644
--- a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_087ea4() {
+void select_087ea4(device uint4* const tint_symbol_1) {
   uint4 res = uint4(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_087ea4();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  select_087ea4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_087ea4();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  select_087ea4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_087ea4();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  select_087ea4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.spvasm
index 376d446..b63c3f9 100644
--- a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_087ea4 "select_087ea4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_087ea4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+%select_087ea4 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_087ea4
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_087ea4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_087ea4
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_087ea4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_087ea4
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %select_087ea4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.wgsl
index 2c28feb..70eecf1 100644
--- a/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/087ea4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_087ea4() {
   var res : vec4<u32> = select(vec4<u32>(1u), vec4<u32>(1u), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_087ea4();
diff --git a/test/tint/builtins/gen/literal/select/089657.wgsl b/test/tint/builtins/gen/literal/select/089657.wgsl
index 82f4758..158a12d 100644
--- a/test/tint/builtins/gen/literal/select/089657.wgsl
+++ b/test/tint/builtins/gen/literal/select/089657.wgsl
@@ -25,7 +25,6 @@
 fn select_089657() {
   var res = select(vec3(1.), vec3(1.), true);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_089657();
diff --git a/test/tint/builtins/gen/literal/select/10e73b.wgsl b/test/tint/builtins/gen/literal/select/10e73b.wgsl
index 6f12933..c3a206d 100644
--- a/test/tint/builtins/gen/literal/select/10e73b.wgsl
+++ b/test/tint/builtins/gen/literal/select/10e73b.wgsl
@@ -26,7 +26,9 @@
 // fn select(f16, f16, bool) -> f16
 fn select_10e73b() {
   var res: f16 = select(1.h, 1.h, true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.dxc.hlsl
index 3988b98..542b937 100644
--- a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_10e73b() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.fxc.hlsl
index ec9e70c..4539c94 100644
--- a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_10e73b() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.glsl
index 943a733..02618cb 100644
--- a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void select_10e73b() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void select_10e73b() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void select_10e73b() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.msl
index 009867d..ae692f3 100644
--- a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_10e73b() {
+void select_10e73b(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_10e73b();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  select_10e73b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_10e73b();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  select_10e73b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_10e73b();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  select_10e73b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.spvasm
index 1dd283e..e6bf65e 100644
--- a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_10e73b "select_10e73b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_10e73b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%select_10e73b = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %select_10e73b
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %select_10e73b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_10e73b
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %select_10e73b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %select_10e73b
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %select_10e73b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.wgsl
index 426915f..eab40db 100644
--- a/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/10e73b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn select_10e73b() {
   var res : f16 = select(1.0h, 1.0h, true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_10e73b();
diff --git a/test/tint/builtins/gen/literal/select/17441a.wgsl b/test/tint/builtins/gen/literal/select/17441a.wgsl
index 43e37e5..352828e 100644
--- a/test/tint/builtins/gen/literal/select/17441a.wgsl
+++ b/test/tint/builtins/gen/literal/select/17441a.wgsl
@@ -25,7 +25,6 @@
 fn select_17441a() {
   var res = select(vec4(1.), vec4(1.), true);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_17441a();
diff --git a/test/tint/builtins/gen/literal/select/1ada2a.wgsl b/test/tint/builtins/gen/literal/select/1ada2a.wgsl
index d7a24db..7182735 100644
--- a/test/tint/builtins/gen/literal/select/1ada2a.wgsl
+++ b/test/tint/builtins/gen/literal/select/1ada2a.wgsl
@@ -26,7 +26,9 @@
 // fn select(vec<3, f16>, vec<3, f16>, bool) -> vec<3, f16>
 fn select_1ada2a() {
   var res: vec3<f16> = select(vec3<f16>(1.h), vec3<f16>(1.h), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.dxc.hlsl
index 7d01083..dbe12f0 100644
--- a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_1ada2a() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.fxc.hlsl
index 6f603e0..830536e 100644
--- a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_1ada2a() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.glsl
index cd6989b..ff9cfb7 100644
--- a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_1ada2a() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_1ada2a() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_1ada2a() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.msl
index 5d1e6c6..c95d9fb 100644
--- a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_1ada2a() {
+void select_1ada2a(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_1ada2a();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  select_1ada2a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_1ada2a();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  select_1ada2a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_1ada2a();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  select_1ada2a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.spvasm
index 9f67b7c..8ab908f 100644
--- a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_1ada2a "select_1ada2a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_1ada2a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%select_1ada2a = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_1ada2a
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_1ada2a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_1ada2a
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_1ada2a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_1ada2a
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_1ada2a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.wgsl
index 9d30044..3e9cd9f 100644
--- a/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/1ada2a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn select_1ada2a() {
   var res : vec3<f16> = select(vec3<f16>(1.0h), vec3<f16>(1.0h), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_1ada2a();
diff --git a/test/tint/builtins/gen/literal/select/1e960b.wgsl b/test/tint/builtins/gen/literal/select/1e960b.wgsl
index 3f9d483..d85aca1 100644
--- a/test/tint/builtins/gen/literal/select/1e960b.wgsl
+++ b/test/tint/builtins/gen/literal/select/1e960b.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<2, u32>, vec<2, u32>, vec<2, bool>) -> vec<2, u32>
 fn select_1e960b() {
   var res: vec2<u32> = select(vec2<u32>(1u), vec2<u32>(1u), vec2<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.dxc.hlsl
index 4fd33a5..5424f4d 100644
--- a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_1e960b() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.fxc.hlsl
index 4fd33a5..5424f4d 100644
--- a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_1e960b() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.glsl
index 57e1001..93f6c4f 100644
--- a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_1e960b() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_1e960b() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_1e960b() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.msl
index 082d901..c079dd2 100644
--- a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_1e960b() {
+void select_1e960b(device uint2* const tint_symbol_1) {
   uint2 res = uint2(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_1e960b();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  select_1e960b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_1e960b();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  select_1e960b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_1e960b();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  select_1e960b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.spvasm
index 2b108b9..aa40731 100644
--- a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_1e960b "select_1e960b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_1e960b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+%select_1e960b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_1e960b
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_1e960b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_1e960b
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_1e960b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_1e960b
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %select_1e960b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.wgsl
index c978f2d..48cf3f1 100644
--- a/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/1e960b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_1e960b() {
   var res : vec2<u32> = select(vec2<u32>(1u), vec2<u32>(1u), vec2<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_1e960b();
diff --git a/test/tint/builtins/gen/literal/select/1f4d93.wgsl b/test/tint/builtins/gen/literal/select/1f4d93.wgsl
index 58d01ce..313a3bc 100644
--- a/test/tint/builtins/gen/literal/select/1f4d93.wgsl
+++ b/test/tint/builtins/gen/literal/select/1f4d93.wgsl
@@ -25,7 +25,6 @@
 fn select_1f4d93() {
   var res = select(vec2(1.), vec2(1.), vec2<bool>(true));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_1f4d93();
diff --git a/test/tint/builtins/gen/literal/select/266aff.wgsl b/test/tint/builtins/gen/literal/select/266aff.wgsl
index 618ec77..1846cbf 100644
--- a/test/tint/builtins/gen/literal/select/266aff.wgsl
+++ b/test/tint/builtins/gen/literal/select/266aff.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<2, f32>, vec<2, f32>, vec<2, bool>) -> vec<2, f32>
 fn select_266aff() {
   var res: vec2<f32> = select(vec2<f32>(1.f), vec2<f32>(1.f), vec2<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.dxc.hlsl
index 6503dc5..3c446bb 100644
--- a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_266aff() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.fxc.hlsl
index 6503dc5..3c446bb 100644
--- a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_266aff() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.glsl
index 8fed55e..85ae182 100644
--- a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_266aff() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_266aff() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_266aff() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.msl
index e60d44f..e230732 100644
--- a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_266aff() {
+void select_266aff(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_266aff();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  select_266aff(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_266aff();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  select_266aff(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_266aff();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  select_266aff(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.spvasm
index 7232eb8..a93341a 100644
--- a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_266aff "select_266aff"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%select_266aff = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%select_266aff = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %select_266aff
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_266aff
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_266aff
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %select_266aff
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %select_266aff
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %select_266aff
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.wgsl
index 5633491..3b7d8f4 100644
--- a/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/266aff.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_266aff() {
   var res : vec2<f32> = select(vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_266aff();
diff --git a/test/tint/builtins/gen/literal/select/28a27e.wgsl b/test/tint/builtins/gen/literal/select/28a27e.wgsl
index 083b8ca..8109721 100644
--- a/test/tint/builtins/gen/literal/select/28a27e.wgsl
+++ b/test/tint/builtins/gen/literal/select/28a27e.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<3, u32>, vec<3, u32>, vec<3, bool>) -> vec<3, u32>
 fn select_28a27e() {
   var res: vec3<u32> = select(vec3<u32>(1u), vec3<u32>(1u), vec3<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.dxc.hlsl
index c461d57..5f0108f 100644
--- a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_28a27e() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.fxc.hlsl
index c461d57..5f0108f 100644
--- a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_28a27e() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.glsl
index 741758b..0c55d3c 100644
--- a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_28a27e() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_28a27e() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_28a27e() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.msl
index bc5889d..7ef1ecd 100644
--- a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_28a27e() {
+void select_28a27e(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(1u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_28a27e();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  select_28a27e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_28a27e();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  select_28a27e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_28a27e();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  select_28a27e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.spvasm
index e6ceb98..1d22102 100644
--- a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_28a27e "select_28a27e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_28a27e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+%select_28a27e = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_28a27e
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_28a27e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_28a27e
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_28a27e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_28a27e
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %select_28a27e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.wgsl
index 1d85924..a22b1b2 100644
--- a/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/28a27e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_28a27e() {
   var res : vec3<u32> = select(vec3<u32>(1u), vec3<u32>(1u), vec3<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_28a27e();
diff --git a/test/tint/builtins/gen/literal/select/2c96d4.wgsl b/test/tint/builtins/gen/literal/select/2c96d4.wgsl
index 5094989..03a3f7e 100644
--- a/test/tint/builtins/gen/literal/select/2c96d4.wgsl
+++ b/test/tint/builtins/gen/literal/select/2c96d4.wgsl
@@ -25,7 +25,6 @@
 fn select_2c96d4() {
   var res = select(vec3(1.), vec3(1.), vec3<bool>(true));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_2c96d4();
diff --git a/test/tint/builtins/gen/literal/select/3a14be.wgsl b/test/tint/builtins/gen/literal/select/3a14be.wgsl
index 2a77bdd..2e00781 100644
--- a/test/tint/builtins/gen/literal/select/3a14be.wgsl
+++ b/test/tint/builtins/gen/literal/select/3a14be.wgsl
@@ -25,7 +25,6 @@
 fn select_3a14be() {
   var res = select(vec2(1), vec2(1), true);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_3a14be();
diff --git a/test/tint/builtins/gen/literal/select/3c25ce.wgsl b/test/tint/builtins/gen/literal/select/3c25ce.wgsl
index d5ed3a2..af99083 100644
--- a/test/tint/builtins/gen/literal/select/3c25ce.wgsl
+++ b/test/tint/builtins/gen/literal/select/3c25ce.wgsl
@@ -24,7 +24,10 @@
 // fn select(vec<3, bool>, vec<3, bool>, bool) -> vec<3, bool>
 fn select_3c25ce() {
   var res: vec3<bool> = select(vec3<bool>(true), vec3<bool>(true), true);
+  prevent_dce = select(0, 1, all(res == vec3<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.dxc.hlsl
index 698ece9..96b08da 100644
--- a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_3c25ce() {
   bool3 res = (true).xxx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.fxc.hlsl
index 698ece9..96b08da 100644
--- a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_3c25ce() {
   bool3 res = (true).xxx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.glsl
index aeecc20..a89ff99 100644
--- a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_3c25ce() {
   bvec3 res = bvec3(true);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_3c25ce() {
   bvec3 res = bvec3(true);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_3c25ce() {
   bvec3 res = bvec3(true);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.msl
index 771550e..80878d3 100644
--- a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_3c25ce() {
+void select_3c25ce(device int* const tint_symbol_1) {
   bool3 res = bool3(true);
+  *(tint_symbol_1) = select(0, 1, all((res == bool3(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_3c25ce();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_3c25ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_3c25ce();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_3c25ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_3c25ce();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_3c25ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.spvasm
index 3aab9ca..538c90e 100644
--- a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_3c25ce "select_3c25ce"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v3bool %true %true %true
+         %20 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %19 = OpConstantNull %v3bool
-         %20 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %33 = OpConstantNull %int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_3c25ce = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3bool Function %19
-               OpStore %res %16
+%select_3c25ce = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3bool Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %30 = OpLoad %v3bool %res
+         %31 = OpLogicalEqual %v3bool %30 %23
+         %29 = OpAll %bool %31
+         %28 = OpSelect %int %29 %int_1 %33
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_3c25ce
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_3c25ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_3c25ce
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_3c25ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_3c25ce
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_3c25ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.wgsl
index 7363bb6..a9e6949 100644
--- a/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/3c25ce.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_3c25ce() {
   var res : vec3<bool> = select(vec3<bool>(true), vec3<bool>(true), true);
+  prevent_dce = select(0, 1, all((res == vec3<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_3c25ce();
diff --git a/test/tint/builtins/gen/literal/select/416e14.wgsl b/test/tint/builtins/gen/literal/select/416e14.wgsl
index 41a1f1a..31750cd 100644
--- a/test/tint/builtins/gen/literal/select/416e14.wgsl
+++ b/test/tint/builtins/gen/literal/select/416e14.wgsl
@@ -24,7 +24,9 @@
 // fn select(f32, f32, bool) -> f32
 fn select_416e14() {
   var res: f32 = select(1.f, 1.f, true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.dxc.hlsl
index f5bb2ec..b7cf0ee 100644
--- a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_416e14() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.fxc.hlsl
index f5bb2ec..b7cf0ee 100644
--- a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_416e14() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.glsl
index 415d49f..7f456c0 100644
--- a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void select_416e14() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void select_416e14() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void select_416e14() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.msl
index 952392a..b1967eb 100644
--- a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_416e14() {
+void select_416e14(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_416e14();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  select_416e14(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_416e14();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  select_416e14(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_416e14();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  select_416e14(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.spvasm
index 1142a57..6f47b38 100644
--- a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_416e14 "select_416e14"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%select_416e14 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%select_416e14 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %select_416e14
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %select_416e14
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %select_416e14
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %select_416e14
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_416e14
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %select_416e14
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.wgsl
index ad0a091..7daa875 100644
--- a/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/416e14.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_416e14() {
   var res : f32 = select(1.0f, 1.0f, true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_416e14();
diff --git a/test/tint/builtins/gen/literal/select/431dfb.wgsl b/test/tint/builtins/gen/literal/select/431dfb.wgsl
index a9990e8..3ad2681 100644
--- a/test/tint/builtins/gen/literal/select/431dfb.wgsl
+++ b/test/tint/builtins/gen/literal/select/431dfb.wgsl
@@ -25,7 +25,6 @@
 fn select_431dfb() {
   var res = select(vec2(1), vec2(1), vec2<bool>(true));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_431dfb();
diff --git a/test/tint/builtins/gen/literal/select/43741e.wgsl b/test/tint/builtins/gen/literal/select/43741e.wgsl
index f6d41b8..5a0b1b9 100644
--- a/test/tint/builtins/gen/literal/select/43741e.wgsl
+++ b/test/tint/builtins/gen/literal/select/43741e.wgsl
@@ -25,7 +25,6 @@
 fn select_43741e() {
   var res = select(vec4(1.), vec4(1.), vec4<bool>(true));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_43741e();
diff --git a/test/tint/builtins/gen/literal/select/494051.wgsl b/test/tint/builtins/gen/literal/select/494051.wgsl
index 820d87e..e505ad2 100644
--- a/test/tint/builtins/gen/literal/select/494051.wgsl
+++ b/test/tint/builtins/gen/literal/select/494051.wgsl
@@ -25,7 +25,6 @@
 fn select_494051() {
   var res = select(1., 1., true);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_494051();
diff --git a/test/tint/builtins/gen/literal/select/4c4738.wgsl b/test/tint/builtins/gen/literal/select/4c4738.wgsl
index 51e053a..21ab0e0 100644
--- a/test/tint/builtins/gen/literal/select/4c4738.wgsl
+++ b/test/tint/builtins/gen/literal/select/4c4738.wgsl
@@ -25,7 +25,6 @@
 fn select_4c4738() {
   var res = select(vec4(1), vec4(1), vec4<bool>(true));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_4c4738();
diff --git a/test/tint/builtins/gen/literal/select/4e60da.wgsl b/test/tint/builtins/gen/literal/select/4e60da.wgsl
index ccc5a07..349b4c1 100644
--- a/test/tint/builtins/gen/literal/select/4e60da.wgsl
+++ b/test/tint/builtins/gen/literal/select/4e60da.wgsl
@@ -25,7 +25,6 @@
 fn select_4e60da() {
   var res = select(vec2(1.), vec2(1.), true);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_4e60da();
diff --git a/test/tint/builtins/gen/literal/select/51b047.wgsl b/test/tint/builtins/gen/literal/select/51b047.wgsl
index cffe72a..38e4ca8 100644
--- a/test/tint/builtins/gen/literal/select/51b047.wgsl
+++ b/test/tint/builtins/gen/literal/select/51b047.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<2, u32>, vec<2, u32>, bool) -> vec<2, u32>
 fn select_51b047() {
   var res: vec2<u32> = select(vec2<u32>(1u), vec2<u32>(1u), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.dxc.hlsl
index 47079d0..a14e219 100644
--- a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_51b047() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.fxc.hlsl
index 47079d0..a14e219 100644
--- a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_51b047() {
   uint2 res = (1u).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.glsl
index 00263d6..f3e014b 100644
--- a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_51b047() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_51b047() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_51b047() {
   uvec2 res = uvec2(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.msl
index 3024efc..935d64a 100644
--- a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_51b047() {
+void select_51b047(device uint2* const tint_symbol_1) {
   uint2 res = uint2(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_51b047();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  select_51b047(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_51b047();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  select_51b047(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_51b047();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  select_51b047(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.spvasm
index 3032978..93b8852 100644
--- a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_51b047 "select_51b047"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_51b047 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %res %16
+%select_51b047 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %26 = OpLoad %v2uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_51b047
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_51b047
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_51b047
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_51b047
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_51b047
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %select_51b047
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.wgsl
index 03cd388..9080a28 100644
--- a/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/51b047.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_51b047() {
   var res : vec2<u32> = select(vec2<u32>(1u), vec2<u32>(1u), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_51b047();
diff --git a/test/tint/builtins/gen/literal/select/53d518.wgsl b/test/tint/builtins/gen/literal/select/53d518.wgsl
index 037dcf9..11dd718 100644
--- a/test/tint/builtins/gen/literal/select/53d518.wgsl
+++ b/test/tint/builtins/gen/literal/select/53d518.wgsl
@@ -26,7 +26,9 @@
 // fn select(vec<3, f16>, vec<3, f16>, vec<3, bool>) -> vec<3, f16>
 fn select_53d518() {
   var res: vec3<f16> = select(vec3<f16>(1.h), vec3<f16>(1.h), vec3<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.dxc.hlsl
index 6f16f8d..a09a46e 100644
--- a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_53d518() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.fxc.hlsl
index de77fdc..e2e4374 100644
--- a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_53d518() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.glsl
index 2048423..be4612e 100644
--- a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_53d518() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_53d518() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_53d518() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.msl
index 885f80c..99e4b05 100644
--- a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_53d518() {
+void select_53d518(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_53d518();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  select_53d518(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_53d518();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  select_53d518(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_53d518();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  select_53d518(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.spvasm
index 6b0b0ef..4038cb6 100644
--- a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_53d518 "select_53d518"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_53d518 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%select_53d518 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_53d518
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_53d518
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_53d518
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_53d518
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_53d518
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_53d518
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.wgsl
index e443ffd..8362c35 100644
--- a/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/53d518.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn select_53d518() {
   var res : vec3<f16> = select(vec3<f16>(1.0h), vec3<f16>(1.0h), vec3<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_53d518();
diff --git a/test/tint/builtins/gen/literal/select/713567.wgsl b/test/tint/builtins/gen/literal/select/713567.wgsl
index 2fcc161..51da537 100644
--- a/test/tint/builtins/gen/literal/select/713567.wgsl
+++ b/test/tint/builtins/gen/literal/select/713567.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<4, f32>, vec<4, f32>, bool) -> vec<4, f32>
 fn select_713567() {
   var res: vec4<f32> = select(vec4<f32>(1.f), vec4<f32>(1.f), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.dxc.hlsl
index c7c759b..1105b4c 100644
--- a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_713567() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.fxc.hlsl
index c7c759b..1105b4c 100644
--- a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_713567() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.glsl
index 38cd12e..f1de136 100644
--- a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_713567() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_713567() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_713567() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.msl
index 5ecebb7..6e51086 100644
--- a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_713567() {
+void select_713567(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_713567();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  select_713567(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_713567();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  select_713567(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_713567();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  select_713567(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.spvasm
index 6cb438f..ecc2d50 100644
--- a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_713567 "select_713567"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%select_713567 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%select_713567 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %select_713567
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %select_713567
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %select_713567
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %select_713567
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %select_713567
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_713567
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.wgsl
index d5f975b..43886b3 100644
--- a/test/tint/builtins/gen/literal/select/713567.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/713567.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_713567() {
   var res : vec4<f32> = select(vec4<f32>(1.0f), vec4<f32>(1.0f), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_713567();
diff --git a/test/tint/builtins/gen/literal/select/78be5f.wgsl b/test/tint/builtins/gen/literal/select/78be5f.wgsl
index 30364d3..bd0e15a 100644
--- a/test/tint/builtins/gen/literal/select/78be5f.wgsl
+++ b/test/tint/builtins/gen/literal/select/78be5f.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<3, f32>, vec<3, f32>, bool) -> vec<3, f32>
 fn select_78be5f() {
   var res: vec3<f32> = select(vec3<f32>(1.f), vec3<f32>(1.f), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.dxc.hlsl
index 00c0339..6c536f6 100644
--- a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_78be5f() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.fxc.hlsl
index 00c0339..6c536f6 100644
--- a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_78be5f() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.glsl
index c7d87084..473da2a 100644
--- a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_78be5f() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_78be5f() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_78be5f() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.msl
index 1710bd4..d71539d 100644
--- a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_78be5f() {
+void select_78be5f(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_78be5f();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  select_78be5f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_78be5f();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  select_78be5f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_78be5f();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  select_78be5f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.spvasm
index b347c1c..00b986b 100644
--- a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_78be5f "select_78be5f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%select_78be5f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%select_78be5f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %select_78be5f
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_78be5f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_78be5f
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %select_78be5f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %select_78be5f
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %select_78be5f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.wgsl
index 9588527..9e689f2 100644
--- a/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/78be5f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_78be5f() {
   var res : vec3<f32> = select(vec3<f32>(1.0f), vec3<f32>(1.0f), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_78be5f();
diff --git a/test/tint/builtins/gen/literal/select/80a9a9.wgsl b/test/tint/builtins/gen/literal/select/80a9a9.wgsl
index a0f134c..b5249ec 100644
--- a/test/tint/builtins/gen/literal/select/80a9a9.wgsl
+++ b/test/tint/builtins/gen/literal/select/80a9a9.wgsl
@@ -24,7 +24,10 @@
 // fn select(vec<3, bool>, vec<3, bool>, vec<3, bool>) -> vec<3, bool>
 fn select_80a9a9() {
   var res: vec3<bool> = select(vec3<bool>(true), vec3<bool>(true), vec3<bool>(true));
+  prevent_dce = select(0, 1, all(res == vec3<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.dxc.hlsl
index 1779a6d..ef69c30 100644
--- a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_80a9a9() {
   bool3 res = (true).xxx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.fxc.hlsl
index 1779a6d..ef69c30 100644
--- a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_80a9a9() {
   bool3 res = (true).xxx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.glsl
index a8069b5..fe83c2e 100644
--- a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_80a9a9() {
   bvec3 res = bvec3(true);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_80a9a9() {
   bvec3 res = bvec3(true);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_80a9a9() {
   bvec3 res = bvec3(true);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.msl
index 11c9377..ed9176d 100644
--- a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_80a9a9() {
+void select_80a9a9(device int* const tint_symbol_1) {
   bool3 res = bool3(true);
+  *(tint_symbol_1) = select(0, 1, all((res == bool3(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_80a9a9();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_80a9a9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_80a9a9();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_80a9a9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_80a9a9();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_80a9a9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.spvasm
index d8968ab..a5584a8 100644
--- a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_80a9a9 "select_80a9a9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v3bool %true %true %true
+         %20 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %19 = OpConstantNull %v3bool
-         %20 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %33 = OpConstantNull %int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_80a9a9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3bool Function %19
-               OpStore %res %16
+%select_80a9a9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3bool Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %30 = OpLoad %v3bool %res
+         %31 = OpLogicalEqual %v3bool %30 %23
+         %29 = OpAll %bool %31
+         %28 = OpSelect %int %29 %int_1 %33
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_80a9a9
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_80a9a9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_80a9a9
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_80a9a9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_80a9a9
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_80a9a9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.wgsl
index 465edf2..ad9a5ba 100644
--- a/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/80a9a9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_80a9a9() {
   var res : vec3<bool> = select(vec3<bool>(true), vec3<bool>(true), vec3<bool>(true));
+  prevent_dce = select(0, 1, all((res == vec3<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_80a9a9();
diff --git a/test/tint/builtins/gen/literal/select/830dd9.wgsl b/test/tint/builtins/gen/literal/select/830dd9.wgsl
index 9ed0584..c5e3449 100644
--- a/test/tint/builtins/gen/literal/select/830dd9.wgsl
+++ b/test/tint/builtins/gen/literal/select/830dd9.wgsl
@@ -26,7 +26,9 @@
 // fn select(vec<4, f16>, vec<4, f16>, bool) -> vec<4, f16>
 fn select_830dd9() {
   var res: vec4<f16> = select(vec4<f16>(1.h), vec4<f16>(1.h), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.dxc.hlsl
index 49e6f4a..75b1deb 100644
--- a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_830dd9() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.fxc.hlsl
index 33106a8..219a6bc 100644
--- a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_830dd9() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.glsl
index 9d787eb..7635389 100644
--- a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_830dd9() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_830dd9() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_830dd9() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.msl
index 2663656..dc62d2b 100644
--- a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_830dd9() {
+void select_830dd9(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_830dd9();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  select_830dd9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_830dd9();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  select_830dd9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_830dd9();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  select_830dd9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.spvasm
index 889da66..2de468a 100644
--- a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_830dd9 "select_830dd9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_830dd9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%select_830dd9 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_830dd9
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_830dd9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_830dd9
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_830dd9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_830dd9
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_830dd9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.wgsl
index ddcd264..7f83f6f 100644
--- a/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/830dd9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn select_830dd9() {
   var res : vec4<f16> = select(vec4<f16>(1.0h), vec4<f16>(1.0h), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_830dd9();
diff --git a/test/tint/builtins/gen/literal/select/86f9bd.wgsl b/test/tint/builtins/gen/literal/select/86f9bd.wgsl
index 0b75a15..14093d5 100644
--- a/test/tint/builtins/gen/literal/select/86f9bd.wgsl
+++ b/test/tint/builtins/gen/literal/select/86f9bd.wgsl
@@ -26,7 +26,9 @@
 // fn select(vec<2, f16>, vec<2, f16>, bool) -> vec<2, f16>
 fn select_86f9bd() {
   var res: vec2<f16> = select(vec2<f16>(1.h), vec2<f16>(1.h), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.dxc.hlsl
index 02858f1..821b10a 100644
--- a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_86f9bd() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.fxc.hlsl
index 0e68586..6a5084f 100644
--- a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_86f9bd() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.glsl
index 1cec4b7..5d4ef53 100644
--- a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_86f9bd() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_86f9bd() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_86f9bd() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.msl
index 9503bb5..32a617c 100644
--- a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_86f9bd() {
+void select_86f9bd(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_86f9bd();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  select_86f9bd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_86f9bd();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  select_86f9bd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_86f9bd();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  select_86f9bd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.spvasm
index 68c891c..0dce97f 100644
--- a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_86f9bd "select_86f9bd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_86f9bd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%select_86f9bd = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_86f9bd
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_86f9bd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_86f9bd
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_86f9bd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_86f9bd
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_86f9bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.wgsl
index 5f3fa5c..7295f70 100644
--- a/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/86f9bd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn select_86f9bd() {
   var res : vec2<f16> = select(vec2<f16>(1.0h), vec2<f16>(1.0h), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_86f9bd();
diff --git a/test/tint/builtins/gen/literal/select/8fa62c.wgsl b/test/tint/builtins/gen/literal/select/8fa62c.wgsl
index b4b1e55..b8510c4 100644
--- a/test/tint/builtins/gen/literal/select/8fa62c.wgsl
+++ b/test/tint/builtins/gen/literal/select/8fa62c.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<3, i32>, vec<3, i32>, bool) -> vec<3, i32>
 fn select_8fa62c() {
   var res: vec3<i32> = select(vec3<i32>(1i), vec3<i32>(1i), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.dxc.hlsl
index 321717c..59fc3ee 100644
--- a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_8fa62c() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.fxc.hlsl
index 321717c..59fc3ee 100644
--- a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_8fa62c() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.glsl
index 82ce6e0..20d96ad 100644
--- a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_8fa62c() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_8fa62c() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_8fa62c() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.msl
index 788da11..34cd5ee 100644
--- a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_8fa62c() {
+void select_8fa62c(device packed_int3* const tint_symbol_1) {
   int3 res = int3(1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_8fa62c();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  select_8fa62c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_8fa62c();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  select_8fa62c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_8fa62c();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  select_8fa62c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.spvasm
index 7b40d5c..414b149 100644
--- a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_8fa62c "select_8fa62c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_8fa62c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+%select_8fa62c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_8fa62c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_8fa62c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_8fa62c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_8fa62c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_8fa62c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_8fa62c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.wgsl
index 6e54c76..f251ecc 100644
--- a/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/8fa62c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_8fa62c() {
   var res : vec3<i32> = select(vec3<i32>(1i), vec3<i32>(1i), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_8fa62c();
diff --git a/test/tint/builtins/gen/literal/select/99f883.wgsl b/test/tint/builtins/gen/literal/select/99f883.wgsl
index ff05e23..c9a2d6d 100644
--- a/test/tint/builtins/gen/literal/select/99f883.wgsl
+++ b/test/tint/builtins/gen/literal/select/99f883.wgsl
@@ -24,7 +24,9 @@
 // fn select(u32, u32, bool) -> u32
 fn select_99f883() {
   var res: u32 = select(1u, 1u, true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.dxc.hlsl
index 64d7bf3..dd1fba7 100644
--- a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_99f883() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.fxc.hlsl
index 64d7bf3..dd1fba7 100644
--- a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_99f883() {
   uint res = 1u;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.glsl
index 527c010..30ecdf1 100644
--- a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void select_99f883() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void select_99f883() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void select_99f883() {
   uint res = 1u;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.msl
index 4cfee24..4491a0c 100644
--- a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_99f883() {
+void select_99f883(device uint* const tint_symbol_1) {
   uint res = 1u;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_99f883();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  select_99f883(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_99f883();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  select_99f883(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_99f883();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  select_99f883(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.spvasm
index 5767f90..42d20dc 100644
--- a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_99f883 "select_99f883"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_99f883 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %17
+%select_99f883 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %res %uint_1
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %select_99f883
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %select_99f883
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_99f883
+%fragment_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %select_99f883
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %select_99f883
+%compute_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_99f883
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.wgsl
index 03d9394..2583d5f 100644
--- a/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/99f883.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_99f883() {
   var res : u32 = select(1u, 1u, true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_99f883();
diff --git a/test/tint/builtins/gen/literal/select/9b478d.wgsl b/test/tint/builtins/gen/literal/select/9b478d.wgsl
index e0c6d5b..902656c 100644
--- a/test/tint/builtins/gen/literal/select/9b478d.wgsl
+++ b/test/tint/builtins/gen/literal/select/9b478d.wgsl
@@ -25,7 +25,6 @@
 fn select_9b478d() {
   var res = select(1, 1, true);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_9b478d();
diff --git a/test/tint/builtins/gen/literal/select/a081f1.wgsl b/test/tint/builtins/gen/literal/select/a081f1.wgsl
index 2a16d51..4d78f35 100644
--- a/test/tint/builtins/gen/literal/select/a081f1.wgsl
+++ b/test/tint/builtins/gen/literal/select/a081f1.wgsl
@@ -26,7 +26,9 @@
 // fn select(vec<4, f16>, vec<4, f16>, vec<4, bool>) -> vec<4, f16>
 fn select_a081f1() {
   var res: vec4<f16> = select(vec4<f16>(1.h), vec4<f16>(1.h), vec4<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.dxc.hlsl
index 5cc9a61..9987a72 100644
--- a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_a081f1() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.fxc.hlsl
index 8b20ee8..6a0e16d 100644
--- a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_a081f1() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.glsl
index 73c1209..5f4dd1b 100644
--- a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_a081f1() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_a081f1() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_a081f1() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.msl
index 6b4ae38..dd3bd02 100644
--- a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_a081f1() {
+void select_a081f1(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_a081f1();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  select_a081f1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_a081f1();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  select_a081f1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_a081f1();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  select_a081f1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.spvasm
index 0f5187e..4cda9f8 100644
--- a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_a081f1 "select_a081f1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_a081f1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%select_a081f1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_a081f1
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_a081f1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_a081f1
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_a081f1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_a081f1
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_a081f1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.wgsl
index 2dcaddf..ef61720 100644
--- a/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/a081f1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn select_a081f1() {
   var res : vec4<f16> = select(vec4<f16>(1.0h), vec4<f16>(1.0h), vec4<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_a081f1();
diff --git a/test/tint/builtins/gen/literal/select/a2860e.wgsl b/test/tint/builtins/gen/literal/select/a2860e.wgsl
index 6562c70..3d9bafc 100644
--- a/test/tint/builtins/gen/literal/select/a2860e.wgsl
+++ b/test/tint/builtins/gen/literal/select/a2860e.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<4, i32>, vec<4, i32>, vec<4, bool>) -> vec<4, i32>
 fn select_a2860e() {
   var res: vec4<i32> = select(vec4<i32>(1i), vec4<i32>(1i), vec4<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.dxc.hlsl
index 31b13ae..60ad490 100644
--- a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_a2860e() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.fxc.hlsl
index 31b13ae..60ad490 100644
--- a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_a2860e() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.glsl
index 2ec8950..59cce3e 100644
--- a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_a2860e() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_a2860e() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_a2860e() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.msl
index bf66e04..fe59094 100644
--- a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_a2860e() {
+void select_a2860e(device int4* const tint_symbol_1) {
   int4 res = int4(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_a2860e();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  select_a2860e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_a2860e();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  select_a2860e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_a2860e();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  select_a2860e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.spvasm
index 151b64c..25db5bd 100644
--- a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_a2860e "select_a2860e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_a2860e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+%select_a2860e = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_a2860e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_a2860e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_a2860e
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_a2860e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_a2860e
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_a2860e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.wgsl
index 2d5331b..70b1dfc 100644
--- a/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/a2860e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_a2860e() {
   var res : vec4<i32> = select(vec4<i32>(1i), vec4<i32>(1i), vec4<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_a2860e();
diff --git a/test/tint/builtins/gen/literal/select/ab069f.wgsl b/test/tint/builtins/gen/literal/select/ab069f.wgsl
index a6ff459..546c515 100644
--- a/test/tint/builtins/gen/literal/select/ab069f.wgsl
+++ b/test/tint/builtins/gen/literal/select/ab069f.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<4, i32>, vec<4, i32>, bool) -> vec<4, i32>
 fn select_ab069f() {
   var res: vec4<i32> = select(vec4<i32>(1i), vec4<i32>(1i), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.dxc.hlsl
index 4f7879f..2e2fe17 100644
--- a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ab069f() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.fxc.hlsl
index 4f7879f..2e2fe17 100644
--- a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ab069f() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.glsl
index 402371a..7d92b7e 100644
--- a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_ab069f() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_ab069f() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_ab069f() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.msl
index e3118fa..9a15085 100644
--- a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_ab069f() {
+void select_ab069f(device int4* const tint_symbol_1) {
   int4 res = int4(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_ab069f();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  select_ab069f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_ab069f();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  select_ab069f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_ab069f();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  select_ab069f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.spvasm
index 1006752..62a1cd6 100644
--- a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_ab069f "select_ab069f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_ab069f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+%select_ab069f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_ab069f
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_ab069f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_ab069f
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_ab069f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_ab069f
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_ab069f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.wgsl
index d9f84053b..4b8d383 100644
--- a/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/ab069f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_ab069f() {
   var res : vec4<i32> = select(vec4<i32>(1i), vec4<i32>(1i), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_ab069f();
diff --git a/test/tint/builtins/gen/literal/select/b04721.wgsl b/test/tint/builtins/gen/literal/select/b04721.wgsl
index d4668a5..e97558f 100644
--- a/test/tint/builtins/gen/literal/select/b04721.wgsl
+++ b/test/tint/builtins/gen/literal/select/b04721.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<3, u32>, vec<3, u32>, bool) -> vec<3, u32>
 fn select_b04721() {
   var res: vec3<u32> = select(vec3<u32>(1u), vec3<u32>(1u), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.dxc.hlsl
index 1beac9d..925d7a4 100644
--- a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_b04721() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.fxc.hlsl
index 1beac9d..925d7a4 100644
--- a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_b04721() {
   uint3 res = (1u).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.glsl
index e1cf07c..0ac4029 100644
--- a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_b04721() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_b04721() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_b04721() {
   uvec3 res = uvec3(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.msl
index 8f4b6e0..9412065 100644
--- a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_b04721() {
+void select_b04721(device packed_uint3* const tint_symbol_1) {
   uint3 res = uint3(1u);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_b04721();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  select_b04721(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_b04721();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  select_b04721(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_b04721();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  select_b04721(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.spvasm
index bed83f8..dd8345d 100644
--- a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_b04721 "select_b04721"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_b04721 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %res %16
+%select_b04721 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %26 = OpLoad %v3uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_b04721
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_b04721
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_b04721
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_b04721
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_b04721
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %select_b04721
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.wgsl
index f44d059..d7f832c 100644
--- a/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/b04721.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_b04721() {
   var res : vec3<u32> = select(vec3<u32>(1u), vec3<u32>(1u), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_b04721();
diff --git a/test/tint/builtins/gen/literal/select/b93806.wgsl b/test/tint/builtins/gen/literal/select/b93806.wgsl
index c4808ce..e8caa74 100644
--- a/test/tint/builtins/gen/literal/select/b93806.wgsl
+++ b/test/tint/builtins/gen/literal/select/b93806.wgsl
@@ -25,7 +25,6 @@
 fn select_b93806() {
   var res = select(vec3(1), vec3(1), vec3<bool>(true));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_b93806();
diff --git a/test/tint/builtins/gen/literal/select/bb447f.wgsl b/test/tint/builtins/gen/literal/select/bb447f.wgsl
index 4a7bd14..2d09df3 100644
--- a/test/tint/builtins/gen/literal/select/bb447f.wgsl
+++ b/test/tint/builtins/gen/literal/select/bb447f.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<2, i32>, vec<2, i32>, bool) -> vec<2, i32>
 fn select_bb447f() {
   var res: vec2<i32> = select(vec2<i32>(1i), vec2<i32>(1i), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.dxc.hlsl
index d6ece17..f4924e4 100644
--- a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bb447f() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.fxc.hlsl
index d6ece17..f4924e4 100644
--- a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bb447f() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.glsl
index 00d1430..3724160 100644
--- a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_bb447f() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_bb447f() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_bb447f() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.msl
index 7dfb297..62cbcf3 100644
--- a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_bb447f() {
+void select_bb447f(device int2* const tint_symbol_1) {
   int2 res = int2(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_bb447f();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  select_bb447f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_bb447f();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  select_bb447f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_bb447f();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  select_bb447f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.spvasm
index cd93d75..0ff5678 100644
--- a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_bb447f "select_bb447f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_bb447f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+%select_bb447f = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_bb447f
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_bb447f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_bb447f
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_bb447f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_bb447f
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_bb447f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.wgsl
index e6a40d8..d582e88 100644
--- a/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/bb447f.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_bb447f() {
   var res : vec2<i32> = select(vec2<i32>(1i), vec2<i32>(1i), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_bb447f();
diff --git a/test/tint/builtins/gen/literal/select/bb8aae.wgsl b/test/tint/builtins/gen/literal/select/bb8aae.wgsl
index 29082c5..28434fa 100644
--- a/test/tint/builtins/gen/literal/select/bb8aae.wgsl
+++ b/test/tint/builtins/gen/literal/select/bb8aae.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<4, f32>, vec<4, f32>, vec<4, bool>) -> vec<4, f32>
 fn select_bb8aae() {
   var res: vec4<f32> = select(vec4<f32>(1.f), vec4<f32>(1.f), vec4<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.dxc.hlsl
index 79f1c8f..aa552eb 100644
--- a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bb8aae() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.fxc.hlsl
index 79f1c8f..aa552eb 100644
--- a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bb8aae() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.glsl
index 6f92c6b..e4eca6f 100644
--- a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_bb8aae() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_bb8aae() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_bb8aae() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.msl
index aaa8e6f..d9aa0d0 100644
--- a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_bb8aae() {
+void select_bb8aae(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_bb8aae();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  select_bb8aae(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_bb8aae();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  select_bb8aae(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_bb8aae();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  select_bb8aae(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.spvasm
index f7e4090..d62eb9a 100644
--- a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_bb8aae "select_bb8aae"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%select_bb8aae = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%select_bb8aae = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %select_bb8aae
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %select_bb8aae
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %select_bb8aae
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %select_bb8aae
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %select_bb8aae
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_bb8aae
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.wgsl
index b2f2620..00a521c 100644
--- a/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/bb8aae.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_bb8aae() {
   var res : vec4<f32> = select(vec4<f32>(1.0f), vec4<f32>(1.0f), vec4<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_bb8aae();
diff --git a/test/tint/builtins/gen/literal/select/bf3d29.wgsl b/test/tint/builtins/gen/literal/select/bf3d29.wgsl
index 10f2bf0..b617791 100644
--- a/test/tint/builtins/gen/literal/select/bf3d29.wgsl
+++ b/test/tint/builtins/gen/literal/select/bf3d29.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<2, f32>, vec<2, f32>, bool) -> vec<2, f32>
 fn select_bf3d29() {
   var res: vec2<f32> = select(vec2<f32>(1.f), vec2<f32>(1.f), true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.dxc.hlsl
index 21697bc..9131180 100644
--- a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bf3d29() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.fxc.hlsl
index 21697bc..9131180 100644
--- a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bf3d29() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.glsl
index f710165..74236f4 100644
--- a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_bf3d29() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_bf3d29() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_bf3d29() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.msl
index bb5bc30..b719434 100644
--- a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_bf3d29() {
+void select_bf3d29(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_bf3d29();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  select_bf3d29(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_bf3d29();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  select_bf3d29(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_bf3d29();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  select_bf3d29(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.spvasm
index 78234e0..22a1038 100644
--- a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_bf3d29 "select_bf3d29"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%select_bf3d29 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%select_bf3d29 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %select_bf3d29
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_bf3d29
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_bf3d29
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %select_bf3d29
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %select_bf3d29
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %select_bf3d29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.wgsl
index d6877c8..f044457 100644
--- a/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/bf3d29.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_bf3d29() {
   var res : vec2<f32> = select(vec2<f32>(1.0f), vec2<f32>(1.0f), true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_bf3d29();
diff --git a/test/tint/builtins/gen/literal/select/c31f9e.wgsl b/test/tint/builtins/gen/literal/select/c31f9e.wgsl
index d875f11..079dc9f 100644
--- a/test/tint/builtins/gen/literal/select/c31f9e.wgsl
+++ b/test/tint/builtins/gen/literal/select/c31f9e.wgsl
@@ -24,7 +24,10 @@
 // fn select(bool, bool, bool) -> bool
 fn select_c31f9e() {
   var res: bool = select(true, true, true);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.dxc.hlsl
index 5cfc5d3..978625b 100644
--- a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c31f9e() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.fxc.hlsl
index 5cfc5d3..978625b 100644
--- a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c31f9e() {
   bool res = true;
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.glsl
index 8428366..1c0d555 100644
--- a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c31f9e() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c31f9e() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c31f9e() {
   bool res = true;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.msl
index b3bcd82..415e372 100644
--- a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_c31f9e() {
+void select_c31f9e(device int* const tint_symbol_1) {
   bool res = true;
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_c31f9e();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_c31f9e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_c31f9e();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_c31f9e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_c31f9e();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_c31f9e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.spvasm
index 85f6e87..46bddeb 100644
--- a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_c31f9e "select_c31f9e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %18 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %31 = OpConstantNull %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_c31f9e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_bool Function %17
+%select_c31f9e = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %res %true
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %bool %res
+         %29 = OpLogicalEqual %bool %28 %21
+         %26 = OpSelect %int %29 %int_1 %31
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %select_c31f9e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %select_c31f9e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_c31f9e
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %select_c31f9e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %select_c31f9e
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %select_c31f9e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.wgsl
index 2632b11..11d20b2 100644
--- a/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/c31f9e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_c31f9e() {
   var res : bool = select(true, true, true);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_c31f9e();
diff --git a/test/tint/builtins/gen/literal/select/c41bd1.wgsl b/test/tint/builtins/gen/literal/select/c41bd1.wgsl
index 5ca5e1d..c6a33a2 100644
--- a/test/tint/builtins/gen/literal/select/c41bd1.wgsl
+++ b/test/tint/builtins/gen/literal/select/c41bd1.wgsl
@@ -24,7 +24,10 @@
 // fn select(vec<4, bool>, vec<4, bool>, bool) -> vec<4, bool>
 fn select_c41bd1() {
   var res: vec4<bool> = select(vec4<bool>(true), vec4<bool>(true), true);
+  prevent_dce = select(0, 1, all(res == vec4<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.dxc.hlsl
index 2c80465..eaf0e0e 100644
--- a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c41bd1() {
   bool4 res = (true).xxxx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xxxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.fxc.hlsl
index 2c80465..eaf0e0e 100644
--- a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c41bd1() {
   bool4 res = (true).xxxx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xxxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.glsl
index 8ddb6b8..51f3381 100644
--- a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c41bd1() {
   bvec4 res = bvec4(true);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c41bd1() {
   bvec4 res = bvec4(true);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c41bd1() {
   bvec4 res = bvec4(true);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.msl
index 60243cb..419f138 100644
--- a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_c41bd1() {
+void select_c41bd1(device int* const tint_symbol_1) {
   bool4 res = bool4(true);
+  *(tint_symbol_1) = select(0, 1, all((res == bool4(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_c41bd1();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_c41bd1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_c41bd1();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_c41bd1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_c41bd1();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_c41bd1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.spvasm
index 982051d..217d06f 100644
--- a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_c41bd1 "select_c41bd1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v4bool %true %true %true %true
+         %20 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %19 = OpConstantNull %v4bool
-         %20 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %33 = OpConstantNull %int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_c41bd1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4bool Function %19
-               OpStore %res %16
+%select_c41bd1 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v4bool Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %30 = OpLoad %v4bool %res
+         %31 = OpLogicalEqual %v4bool %30 %23
+         %29 = OpAll %bool %31
+         %28 = OpSelect %int %29 %int_1 %33
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_c41bd1
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_c41bd1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_c41bd1
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_c41bd1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_c41bd1
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_c41bd1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.wgsl
index 48cb1c9..b4fe9ae 100644
--- a/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/c41bd1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_c41bd1() {
   var res : vec4<bool> = select(vec4<bool>(true), vec4<bool>(true), true);
+  prevent_dce = select(0, 1, all((res == vec4<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_c41bd1();
diff --git a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl
index 212d165..2119ca6 100644
--- a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl
+++ b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<4, u32>, vec<4, u32>, vec<4, bool>) -> vec<4, u32>
 fn select_c4a4ef() {
   var res: vec4<u32> = select(vec4<u32>(1u), vec4<u32>(1u), vec4<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.dxc.hlsl
index c9d2a53..4c15580 100644
--- a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c4a4ef() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.fxc.hlsl
index c9d2a53..4c15580 100644
--- a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c4a4ef() {
   uint4 res = (1u).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.glsl
index 9be3db9..2e96996 100644
--- a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_c4a4ef() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_c4a4ef() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_c4a4ef() {
   uvec4 res = uvec4(1u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.msl
index aa7f5e8..903997b 100644
--- a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_c4a4ef() {
+void select_c4a4ef(device uint4* const tint_symbol_1) {
   uint4 res = uint4(1u);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_c4a4ef();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  select_c4a4ef(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_c4a4ef();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  select_c4a4ef(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_c4a4ef();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  select_c4a4ef(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.spvasm
index 252327e..f2f04c5 100644
--- a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_c4a4ef "select_c4a4ef"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_c4a4ef = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %res %16
+%select_c4a4ef = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %26 = OpLoad %v4uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_c4a4ef
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_c4a4ef
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_c4a4ef
+%fragment_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_c4a4ef
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_c4a4ef
+%compute_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %select_c4a4ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.wgsl
index 6ffda61..46ab347 100644
--- a/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/c4a4ef.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_c4a4ef() {
   var res : vec4<u32> = select(vec4<u32>(1u), vec4<u32>(1u), vec4<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_c4a4ef();
diff --git a/test/tint/builtins/gen/literal/select/cb9301.wgsl b/test/tint/builtins/gen/literal/select/cb9301.wgsl
index af1dfa9..411b3ba 100644
--- a/test/tint/builtins/gen/literal/select/cb9301.wgsl
+++ b/test/tint/builtins/gen/literal/select/cb9301.wgsl
@@ -24,7 +24,10 @@
 // fn select(vec<2, bool>, vec<2, bool>, vec<2, bool>) -> vec<2, bool>
 fn select_cb9301() {
   var res: vec2<bool> = select(vec2<bool>(true), vec2<bool>(true), vec2<bool>(true));
+  prevent_dce = select(0, 1, all(res == vec2<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.dxc.hlsl
index ac9a7bd..9357d03 100644
--- a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_cb9301() {
   bool2 res = (true).xx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.fxc.hlsl
index ac9a7bd..9357d03 100644
--- a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_cb9301() {
   bool2 res = (true).xx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.glsl
index df5b1e1..815a6ce 100644
--- a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_cb9301() {
   bvec2 res = bvec2(true);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_cb9301() {
   bvec2 res = bvec2(true);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_cb9301() {
   bvec2 res = bvec2(true);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.msl
index 41ce190..c037bc9 100644
--- a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_cb9301() {
+void select_cb9301(device int* const tint_symbol_1) {
   bool2 res = bool2(true);
+  *(tint_symbol_1) = select(0, 1, all((res == bool2(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_cb9301();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_cb9301(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_cb9301();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_cb9301(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_cb9301();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_cb9301(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.spvasm
index d872953..4c54126 100644
--- a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_cb9301 "select_cb9301"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v2bool %true %true
+         %20 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %19 = OpConstantNull %v2bool
-         %20 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %33 = OpConstantNull %int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_cb9301 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2bool Function %19
-               OpStore %res %16
+%select_cb9301 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2bool Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %30 = OpLoad %v2bool %res
+         %31 = OpLogicalEqual %v2bool %30 %23
+         %29 = OpAll %bool %31
+         %28 = OpSelect %int %29 %int_1 %33
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_cb9301
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_cb9301
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_cb9301
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_cb9301
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_cb9301
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_cb9301
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.wgsl
index 57a01d2..a03d21f 100644
--- a/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/cb9301.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_cb9301() {
   var res : vec2<bool> = select(vec2<bool>(true), vec2<bool>(true), vec2<bool>(true));
+  prevent_dce = select(0, 1, all((res == vec2<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_cb9301();
diff --git a/test/tint/builtins/gen/literal/select/dfab3b.wgsl b/test/tint/builtins/gen/literal/select/dfab3b.wgsl
index 6f55788..81088a3 100644
--- a/test/tint/builtins/gen/literal/select/dfab3b.wgsl
+++ b/test/tint/builtins/gen/literal/select/dfab3b.wgsl
@@ -25,7 +25,6 @@
 fn select_dfab3b() {
   var res = select(vec3(1), vec3(1), true);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_dfab3b();
diff --git a/test/tint/builtins/gen/literal/select/e381c3.wgsl b/test/tint/builtins/gen/literal/select/e381c3.wgsl
index 6f301eb..c0707f7 100644
--- a/test/tint/builtins/gen/literal/select/e381c3.wgsl
+++ b/test/tint/builtins/gen/literal/select/e381c3.wgsl
@@ -25,7 +25,6 @@
 fn select_e381c3() {
   var res = select(vec4(1), vec4(1), true);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_e381c3();
diff --git a/test/tint/builtins/gen/literal/select/e3e028.wgsl b/test/tint/builtins/gen/literal/select/e3e028.wgsl
index 9d6f92d..e540074 100644
--- a/test/tint/builtins/gen/literal/select/e3e028.wgsl
+++ b/test/tint/builtins/gen/literal/select/e3e028.wgsl
@@ -24,7 +24,10 @@
 // fn select(vec<4, bool>, vec<4, bool>, vec<4, bool>) -> vec<4, bool>
 fn select_e3e028() {
   var res: vec4<bool> = select(vec4<bool>(true), vec4<bool>(true), vec4<bool>(true));
+  prevent_dce = select(0, 1, all(res == vec4<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.dxc.hlsl
index 69fcd0f..9363b23 100644
--- a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_e3e028() {
   bool4 res = (true).xxxx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xxxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.fxc.hlsl
index 69fcd0f..9363b23 100644
--- a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_e3e028() {
   bool4 res = (true).xxxx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xxxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.glsl
index 85663ee..1e8bbc9 100644
--- a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_e3e028() {
   bvec4 res = bvec4(true);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_e3e028() {
   bvec4 res = bvec4(true);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_e3e028() {
   bvec4 res = bvec4(true);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.msl
index 23e3cf2..31522df 100644
--- a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_e3e028() {
+void select_e3e028(device int* const tint_symbol_1) {
   bool4 res = bool4(true);
+  *(tint_symbol_1) = select(0, 1, all((res == bool4(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_e3e028();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_e3e028(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_e3e028();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_e3e028(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_e3e028();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_e3e028(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.spvasm
index 5434e51..62e4573 100644
--- a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_e3e028 "select_e3e028"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v4bool %true %true %true %true
+         %20 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %19 = OpConstantNull %v4bool
-         %20 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %33 = OpConstantNull %int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_e3e028 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4bool Function %19
-               OpStore %res %16
+%select_e3e028 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v4bool Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %30 = OpLoad %v4bool %res
+         %31 = OpLogicalEqual %v4bool %30 %23
+         %29 = OpAll %bool %31
+         %28 = OpSelect %int %29 %int_1 %33
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_e3e028
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_e3e028
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_e3e028
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_e3e028
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_e3e028
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_e3e028
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.wgsl
index 1794fd6..3f2c1c9 100644
--- a/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/e3e028.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_e3e028() {
   var res : vec4<bool> = select(vec4<bool>(true), vec4<bool>(true), vec4<bool>(true));
+  prevent_dce = select(0, 1, all((res == vec4<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_e3e028();
diff --git a/test/tint/builtins/gen/literal/select/ebfea2.wgsl b/test/tint/builtins/gen/literal/select/ebfea2.wgsl
index 4424017..ae84d2c 100644
--- a/test/tint/builtins/gen/literal/select/ebfea2.wgsl
+++ b/test/tint/builtins/gen/literal/select/ebfea2.wgsl
@@ -24,7 +24,9 @@
 // fn select(vec<3, f32>, vec<3, f32>, vec<3, bool>) -> vec<3, f32>
 fn select_ebfea2() {
   var res: vec3<f32> = select(vec3<f32>(1.f), vec3<f32>(1.f), vec3<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.dxc.hlsl
index f2ca2bc..48bd848 100644
--- a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ebfea2() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.fxc.hlsl
index f2ca2bc..48bd848 100644
--- a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ebfea2() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.glsl
index 0ef3eb0..11ab7bd 100644
--- a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_ebfea2() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_ebfea2() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_ebfea2() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.msl
index c462201..9c978a7 100644
--- a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_ebfea2() {
+void select_ebfea2(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_ebfea2();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  select_ebfea2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_ebfea2();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  select_ebfea2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_ebfea2();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  select_ebfea2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.spvasm
index ce6c093..066508a 100644
--- a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_ebfea2 "select_ebfea2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%select_ebfea2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%select_ebfea2 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %select_ebfea2
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %select_ebfea2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_ebfea2
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %select_ebfea2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %select_ebfea2
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %select_ebfea2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.wgsl
index 7586aab..4c364f2 100644
--- a/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/ebfea2.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_ebfea2() {
   var res : vec3<f32> = select(vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_ebfea2();
diff --git a/test/tint/builtins/gen/literal/select/ed7c13.wgsl b/test/tint/builtins/gen/literal/select/ed7c13.wgsl
index 7f703db..57bb888 100644
--- a/test/tint/builtins/gen/literal/select/ed7c13.wgsl
+++ b/test/tint/builtins/gen/literal/select/ed7c13.wgsl
@@ -26,7 +26,9 @@
 // fn select(vec<2, f16>, vec<2, f16>, vec<2, bool>) -> vec<2, f16>
 fn select_ed7c13() {
   var res: vec2<f16> = select(vec2<f16>(1.h), vec2<f16>(1.h), vec2<bool>(true));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.dxc.hlsl
index 5ba22f5..3bce300 100644
--- a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ed7c13() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.fxc.hlsl
index 811d96e..fad58aa 100644
--- a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ed7c13() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.glsl
index 1ac6e9a..b256cb3 100644
--- a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_ed7c13() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_ed7c13() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_ed7c13() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.msl
index a73404c..64add59 100644
--- a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_ed7c13() {
+void select_ed7c13(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_ed7c13();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  select_ed7c13(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_ed7c13();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  select_ed7c13(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_ed7c13();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  select_ed7c13(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.spvasm
index 3f969ce..bfa571b 100644
--- a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_ed7c13 "select_ed7c13"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_ed7c13 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%select_ed7c13 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_ed7c13
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %select_ed7c13
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_ed7c13
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_ed7c13
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_ed7c13
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_ed7c13
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.wgsl
index 7df76f4..bda7a2e 100644
--- a/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/ed7c13.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn select_ed7c13() {
   var res : vec2<f16> = select(vec2<f16>(1.0h), vec2<f16>(1.0h), vec2<bool>(true));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_ed7c13();
diff --git a/test/tint/builtins/gen/literal/select/ed8a15.wgsl b/test/tint/builtins/gen/literal/select/ed8a15.wgsl
index e0d89d0..420ddfc 100644
--- a/test/tint/builtins/gen/literal/select/ed8a15.wgsl
+++ b/test/tint/builtins/gen/literal/select/ed8a15.wgsl
@@ -24,7 +24,9 @@
 // fn select(i32, i32, bool) -> i32
 fn select_ed8a15() {
   var res: i32 = select(1i, 1i, true);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.dxc.hlsl
index 1e27b9f..86b6b11 100644
--- a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ed8a15() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.fxc.hlsl
index 1e27b9f..86b6b11 100644
--- a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ed8a15() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.glsl
index 15adb77..12b13d3 100644
--- a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_ed8a15() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_ed8a15() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_ed8a15() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.msl
index fc9ae48..9f35168 100644
--- a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_ed8a15() {
+void select_ed8a15(device int* const tint_symbol_1) {
   int res = 1;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_ed8a15();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_ed8a15(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_ed8a15();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_ed8a15(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_ed8a15();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_ed8a15(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.spvasm
index d973550..fc933b3 100644
--- a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_ed8a15 "select_ed8a15"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_ed8a15 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+%select_ed8a15 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %select_ed8a15
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %select_ed8a15
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_ed8a15
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %select_ed8a15
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %select_ed8a15
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %select_ed8a15
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.wgsl
index 308d73a..b56c00c 100644
--- a/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/ed8a15.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_ed8a15() {
   var res : i32 = select(1i, 1i, true);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_ed8a15();
diff --git a/test/tint/builtins/gen/literal/select/fb7e53.wgsl b/test/tint/builtins/gen/literal/select/fb7e53.wgsl
index cf44f0a..0d72885 100644
--- a/test/tint/builtins/gen/literal/select/fb7e53.wgsl
+++ b/test/tint/builtins/gen/literal/select/fb7e53.wgsl
@@ -24,7 +24,10 @@
 // fn select(vec<2, bool>, vec<2, bool>, bool) -> vec<2, bool>
 fn select_fb7e53() {
   var res: vec2<bool> = select(vec2<bool>(true), vec2<bool>(true), true);
+  prevent_dce = select(0, 1, all(res == vec2<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.dxc.hlsl
index 583b0dd..e173d91 100644
--- a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_fb7e53() {
   bool2 res = (true).xx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.fxc.hlsl
index 583b0dd..e173d91 100644
--- a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_fb7e53() {
   bool2 res = (true).xx;
+  prevent_dce.Store(0u, asuint((all((res == (false).xx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.glsl b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.glsl
index 8aad385..a9d9b44 100644
--- a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_fb7e53() {
   bvec2 res = bvec2(true);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_fb7e53() {
   bvec2 res = bvec2(true);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_fb7e53() {
   bvec2 res = bvec2(true);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.msl b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.msl
index 44f98a5..89d15a4 100644
--- a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_fb7e53() {
+void select_fb7e53(device int* const tint_symbol_1) {
   bool2 res = bool2(true);
+  *(tint_symbol_1) = select(0, 1, all((res == bool2(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_fb7e53();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_fb7e53(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_fb7e53();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_fb7e53(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_fb7e53();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_fb7e53(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.spvasm
index 04cbf13..3b8d00e 100644
--- a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_fb7e53 "select_fb7e53"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v2bool %true %true
+         %20 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %19 = OpConstantNull %v2bool
-         %20 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %33 = OpConstantNull %int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_fb7e53 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2bool Function %19
-               OpStore %res %16
+%select_fb7e53 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2bool Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %30 = OpLoad %v2bool %res
+         %31 = OpLogicalEqual %v2bool %30 %23
+         %29 = OpAll %bool %31
+         %28 = OpSelect %int %29 %int_1 %33
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %select_fb7e53
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %select_fb7e53
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_fb7e53
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_fb7e53
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_fb7e53
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_fb7e53
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.wgsl
index d506148..e7c3479 100644
--- a/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/select/fb7e53.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn select_fb7e53() {
   var res : vec2<bool> = select(vec2<bool>(true), vec2<bool>(true), true);
+  prevent_dce = select(0, 1, all((res == vec2<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_fb7e53();
diff --git a/test/tint/builtins/gen/literal/sign/0799fd.wgsl b/test/tint/builtins/gen/literal/sign/0799fd.wgsl
index a632d85..7dbe9a4 100644
--- a/test/tint/builtins/gen/literal/sign/0799fd.wgsl
+++ b/test/tint/builtins/gen/literal/sign/0799fd.wgsl
@@ -25,7 +25,6 @@
 fn sign_0799fd() {
   var res = sign(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_0799fd();
diff --git a/test/tint/builtins/gen/literal/sign/159665.wgsl b/test/tint/builtins/gen/literal/sign/159665.wgsl
index 6beef49..83f4b42 100644
--- a/test/tint/builtins/gen/literal/sign/159665.wgsl
+++ b/test/tint/builtins/gen/literal/sign/159665.wgsl
@@ -24,7 +24,9 @@
 // fn sign(vec<3, f32>) -> vec<3, f32>
 fn sign_159665() {
   var res: vec3<f32> = sign(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.dxc.hlsl
index c207e8a..d3ff923 100644
--- a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_159665() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.fxc.hlsl
index c207e8a..d3ff923 100644
--- a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_159665() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.glsl
index 0bde0c3..055b8f6 100644
--- a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sign_159665() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sign_159665() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sign_159665() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.msl
index 7426daa..86bb47e 100644
--- a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_159665() {
+void sign_159665(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_159665();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  sign_159665(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_159665();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  sign_159665(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_159665();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  sign_159665(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.spvasm
index 955be00..29d613e 100644
--- a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_159665 "sign_159665"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%sign_159665 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%sign_159665 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %sign_159665
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %sign_159665
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sign_159665
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sign_159665
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sign_159665
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sign_159665
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.wgsl
index d11f696..3f98f29 100644
--- a/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/159665.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sign_159665() {
   var res : vec3<f32> = sign(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_159665();
diff --git a/test/tint/builtins/gen/literal/sign/160933.wgsl b/test/tint/builtins/gen/literal/sign/160933.wgsl
index 95c8575..44a9eb5 100644
--- a/test/tint/builtins/gen/literal/sign/160933.wgsl
+++ b/test/tint/builtins/gen/literal/sign/160933.wgsl
@@ -26,7 +26,9 @@
 // fn sign(vec<4, f16>) -> vec<4, f16>
 fn sign_160933() {
   var res: vec4<f16> = sign(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.dxc.hlsl
index dca4974..972cfab 100644
--- a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_160933() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.fxc.hlsl
index 9090d28..e21372c 100644
--- a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_160933() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.glsl
index 765c87b..bef419f 100644
--- a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sign_160933() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sign_160933() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sign_160933() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.msl
index 351bd94..9c7e14f 100644
--- a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_160933() {
+void sign_160933(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_160933();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  sign_160933(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_160933();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  sign_160933(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_160933();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  sign_160933(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.spvasm
index aa897b0..d541b8c 100644
--- a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_160933 "sign_160933"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_160933 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%sign_160933 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sign_160933
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sign_160933
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sign_160933
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sign_160933
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sign_160933
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sign_160933
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.wgsl
index 57ff301..d9c32f3 100644
--- a/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/160933.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sign_160933() {
   var res : vec4<f16> = sign(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_160933();
diff --git a/test/tint/builtins/gen/literal/sign/3233fa.wgsl b/test/tint/builtins/gen/literal/sign/3233fa.wgsl
index 50cbbb1..d13a589 100644
--- a/test/tint/builtins/gen/literal/sign/3233fa.wgsl
+++ b/test/tint/builtins/gen/literal/sign/3233fa.wgsl
@@ -24,7 +24,9 @@
 // fn sign(i32) -> i32
 fn sign_3233fa() {
   var res: i32 = sign(1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.dxc.hlsl
index 9b70e61..7dd99ec 100644
--- a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_3233fa() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.fxc.hlsl
index 9b70e61..7dd99ec 100644
--- a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_3233fa() {
   int res = 1;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.glsl
index 374fe63..2bb9ab4 100644
--- a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void sign_3233fa() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void sign_3233fa() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void sign_3233fa() {
   int res = 1;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.msl
index 4851ed8..9e85acf 100644
--- a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_3233fa() {
+void sign_3233fa(device int* const tint_symbol_1) {
   int res = 1;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_3233fa();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  sign_3233fa(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_3233fa();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  sign_3233fa(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_3233fa();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  sign_3233fa(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.spvasm
index a015eac..b7adf3e 100644
--- a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_3233fa "sign_3233fa"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_3233fa = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
+%sign_3233fa = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %res %int_1
+         %24 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %sign_3233fa
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %sign_3233fa
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sign_3233fa
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sign_3233fa
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sign_3233fa
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sign_3233fa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.wgsl
index e1797d2..52c1c1d 100644
--- a/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/3233fa.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sign_3233fa() {
   var res : i32 = sign(1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_3233fa();
diff --git a/test/tint/builtins/gen/literal/sign/3a39ac.wgsl b/test/tint/builtins/gen/literal/sign/3a39ac.wgsl
index 2806159..ac02a89 100644
--- a/test/tint/builtins/gen/literal/sign/3a39ac.wgsl
+++ b/test/tint/builtins/gen/literal/sign/3a39ac.wgsl
@@ -25,7 +25,6 @@
 fn sign_3a39ac() {
   var res = sign(1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_3a39ac();
diff --git a/test/tint/builtins/gen/literal/sign/3bdab6.wgsl b/test/tint/builtins/gen/literal/sign/3bdab6.wgsl
index ae8af16..76c5c0e 100644
--- a/test/tint/builtins/gen/literal/sign/3bdab6.wgsl
+++ b/test/tint/builtins/gen/literal/sign/3bdab6.wgsl
@@ -25,7 +25,6 @@
 fn sign_3bdab6() {
   var res = sign(vec4(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_3bdab6();
diff --git a/test/tint/builtins/gen/literal/sign/55339e.wgsl b/test/tint/builtins/gen/literal/sign/55339e.wgsl
index 91a5b6b..38dbeec 100644
--- a/test/tint/builtins/gen/literal/sign/55339e.wgsl
+++ b/test/tint/builtins/gen/literal/sign/55339e.wgsl
@@ -25,7 +25,6 @@
 fn sign_55339e() {
   var res = sign(vec3(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_55339e();
diff --git a/test/tint/builtins/gen/literal/sign/58d779.wgsl b/test/tint/builtins/gen/literal/sign/58d779.wgsl
index 0fbbff9..ae15419 100644
--- a/test/tint/builtins/gen/literal/sign/58d779.wgsl
+++ b/test/tint/builtins/gen/literal/sign/58d779.wgsl
@@ -24,7 +24,9 @@
 // fn sign(vec<4, i32>) -> vec<4, i32>
 fn sign_58d779() {
   var res: vec4<i32> = sign(vec4<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.dxc.hlsl
index 9f64452..440ce68 100644
--- a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_58d779() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.fxc.hlsl
index 9f64452..440ce68 100644
--- a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_58d779() {
   int4 res = (1).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.glsl
index 6e8c701..9c6dad0 100644
--- a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void sign_58d779() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void sign_58d779() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void sign_58d779() {
   ivec4 res = ivec4(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.msl
index 911bcf2..969831d 100644
--- a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_58d779() {
+void sign_58d779(device int4* const tint_symbol_1) {
   int4 res = int4(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_58d779();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  sign_58d779(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_58d779();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  sign_58d779(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_58d779();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  sign_58d779(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.spvasm
index 84c6c18..0d697a1 100644
--- a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_58d779 "sign_58d779"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_58d779 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %res %16
+%sign_58d779 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %27 = OpLoad %v4int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sign_58d779
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sign_58d779
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sign_58d779
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sign_58d779
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sign_58d779
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sign_58d779
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.wgsl
index 50ed479..0a0fde3 100644
--- a/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/58d779.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sign_58d779() {
   var res : vec4<i32> = sign(vec4<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_58d779();
diff --git a/test/tint/builtins/gen/literal/sign/5d283a.wgsl b/test/tint/builtins/gen/literal/sign/5d283a.wgsl
index a83e896..ba5f331 100644
--- a/test/tint/builtins/gen/literal/sign/5d283a.wgsl
+++ b/test/tint/builtins/gen/literal/sign/5d283a.wgsl
@@ -26,7 +26,9 @@
 // fn sign(vec<3, f16>) -> vec<3, f16>
 fn sign_5d283a() {
   var res: vec3<f16> = sign(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.dxc.hlsl
index ffe5893..fcd7bc3 100644
--- a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_5d283a() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.fxc.hlsl
index 987a1bd..e6179e3 100644
--- a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_5d283a() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.glsl
index e7fcb15..ccf89dc 100644
--- a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sign_5d283a() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sign_5d283a() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sign_5d283a() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.msl
index 7628c40..3bf7b79 100644
--- a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_5d283a() {
+void sign_5d283a(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_5d283a();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  sign_5d283a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_5d283a();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  sign_5d283a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_5d283a();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  sign_5d283a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.spvasm
index 78e2a9e..e6aa398 100644
--- a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_5d283a "sign_5d283a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_5d283a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%sign_5d283a = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sign_5d283a
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sign_5d283a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sign_5d283a
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sign_5d283a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sign_5d283a
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sign_5d283a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.wgsl
index 53ec054..728cc76 100644
--- a/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/5d283a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sign_5d283a() {
   var res : vec3<f16> = sign(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_5d283a();
diff --git a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl
index bac048d..558c56c 100644
--- a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl
+++ b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl
@@ -26,7 +26,9 @@
 // fn sign(f16) -> f16
 fn sign_7c85ea() {
   var res: f16 = sign(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.dxc.hlsl
index 9402192..928f141 100644
--- a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_7c85ea() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.fxc.hlsl
index 4dcd37d..350776b 100644
--- a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_7c85ea() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.glsl
index 6c2f3c0..7e72af4 100644
--- a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sign_7c85ea() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sign_7c85ea() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sign_7c85ea() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.msl
index 7b130e7..8215198 100644
--- a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_7c85ea() {
+void sign_7c85ea(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_7c85ea();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  sign_7c85ea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_7c85ea();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  sign_7c85ea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_7c85ea();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  sign_7c85ea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.spvasm
index 990f3af..d1101ae 100644
--- a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_7c85ea "sign_7c85ea"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_7c85ea = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%sign_7c85ea = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %sign_7c85ea
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %sign_7c85ea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sign_7c85ea
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sign_7c85ea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sign_7c85ea
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sign_7c85ea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.wgsl
index 01a4db6..71849f9 100644
--- a/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/7c85ea.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sign_7c85ea() {
   var res : f16 = sign(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_7c85ea();
diff --git a/test/tint/builtins/gen/literal/sign/926015.wgsl b/test/tint/builtins/gen/literal/sign/926015.wgsl
index 6729f21..192b000 100644
--- a/test/tint/builtins/gen/literal/sign/926015.wgsl
+++ b/test/tint/builtins/gen/literal/sign/926015.wgsl
@@ -24,7 +24,9 @@
 // fn sign(vec<2, i32>) -> vec<2, i32>
 fn sign_926015() {
   var res: vec2<i32> = sign(vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.dxc.hlsl
index fd20888..0a87404 100644
--- a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_926015() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.fxc.hlsl
index fd20888..0a87404 100644
--- a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_926015() {
   int2 res = (1).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.glsl
index 0a4af08..d4e1fc8 100644
--- a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void sign_926015() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void sign_926015() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void sign_926015() {
   ivec2 res = ivec2(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.msl
index bc1f638..6209575 100644
--- a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_926015() {
+void sign_926015(device int2* const tint_symbol_1) {
   int2 res = int2(1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_926015();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  sign_926015(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_926015();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  sign_926015(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_926015();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  sign_926015(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.spvasm
index afd6e12..53528c2 100644
--- a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_926015 "sign_926015"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_926015 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %res %16
+%sign_926015 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %27 = OpLoad %v2int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sign_926015
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sign_926015
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sign_926015
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sign_926015
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sign_926015
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sign_926015
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.wgsl
index 02be318..afa7e92 100644
--- a/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/926015.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sign_926015() {
   var res : vec2<i32> = sign(vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_926015();
diff --git a/test/tint/builtins/gen/literal/sign/943b2e.wgsl b/test/tint/builtins/gen/literal/sign/943b2e.wgsl
index dfe1a4c..71d093c 100644
--- a/test/tint/builtins/gen/literal/sign/943b2e.wgsl
+++ b/test/tint/builtins/gen/literal/sign/943b2e.wgsl
@@ -25,7 +25,6 @@
 fn sign_943b2e() {
   var res = sign(vec2(1));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_943b2e();
diff --git a/test/tint/builtins/gen/literal/sign/9603b1.wgsl b/test/tint/builtins/gen/literal/sign/9603b1.wgsl
index 1a0f13b..424d29e 100644
--- a/test/tint/builtins/gen/literal/sign/9603b1.wgsl
+++ b/test/tint/builtins/gen/literal/sign/9603b1.wgsl
@@ -24,7 +24,9 @@
 // fn sign(vec<3, i32>) -> vec<3, i32>
 fn sign_9603b1() {
   var res: vec3<i32> = sign(vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.dxc.hlsl
index 903ce0f..6ebffdd 100644
--- a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_9603b1() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.fxc.hlsl
index 903ce0f..6ebffdd 100644
--- a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_9603b1() {
   int3 res = (1).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.glsl
index fa1b8a4..30a9a4d 100644
--- a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void sign_9603b1() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void sign_9603b1() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void sign_9603b1() {
   ivec3 res = ivec3(1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.msl
index 18fe1dd..707d69b 100644
--- a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_9603b1() {
+void sign_9603b1(device packed_int3* const tint_symbol_1) {
   int3 res = int3(1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_9603b1();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  sign_9603b1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_9603b1();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  sign_9603b1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_9603b1();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  sign_9603b1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.spvasm
index 5a9de71..b7b5ced 100644
--- a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_9603b1 "sign_9603b1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +35,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_9603b1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %res %16
+%sign_9603b1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %27 = OpLoad %v3int %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sign_9603b1
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sign_9603b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sign_9603b1
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sign_9603b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sign_9603b1
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sign_9603b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.wgsl
index 2f9031d..5d66e2f 100644
--- a/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/9603b1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sign_9603b1() {
   var res : vec3<i32> = sign(vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_9603b1();
diff --git a/test/tint/builtins/gen/literal/sign/ab6301.wgsl b/test/tint/builtins/gen/literal/sign/ab6301.wgsl
index 7f86ac8..a501d00 100644
--- a/test/tint/builtins/gen/literal/sign/ab6301.wgsl
+++ b/test/tint/builtins/gen/literal/sign/ab6301.wgsl
@@ -25,7 +25,6 @@
 fn sign_ab6301() {
   var res = sign(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_ab6301();
diff --git a/test/tint/builtins/gen/literal/sign/b8f634.wgsl b/test/tint/builtins/gen/literal/sign/b8f634.wgsl
index db2d348..c8eda62 100644
--- a/test/tint/builtins/gen/literal/sign/b8f634.wgsl
+++ b/test/tint/builtins/gen/literal/sign/b8f634.wgsl
@@ -24,7 +24,9 @@
 // fn sign(vec<4, f32>) -> vec<4, f32>
 fn sign_b8f634() {
   var res: vec4<f32> = sign(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.dxc.hlsl
index dc47787..5aca515 100644
--- a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_b8f634() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.fxc.hlsl
index dc47787..5aca515 100644
--- a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_b8f634() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.glsl
index e0fe7e7..27299a7 100644
--- a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sign_b8f634() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sign_b8f634() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sign_b8f634() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.msl
index 510713a..6d4d8e3 100644
--- a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_b8f634() {
+void sign_b8f634(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_b8f634();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  sign_b8f634(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_b8f634();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  sign_b8f634(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_b8f634();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  sign_b8f634(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.spvasm
index c8459ad..e40126a 100644
--- a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_b8f634 "sign_b8f634"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%sign_b8f634 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%sign_b8f634 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %sign_b8f634
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %sign_b8f634
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sign_b8f634
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sign_b8f634
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sign_b8f634
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sign_b8f634
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.wgsl
index 9945085..4b8aca3 100644
--- a/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/b8f634.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sign_b8f634() {
   var res : vec4<f32> = sign(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_b8f634();
diff --git a/test/tint/builtins/gen/literal/sign/c8289c.wgsl b/test/tint/builtins/gen/literal/sign/c8289c.wgsl
index 8cd59e1..efe61e2 100644
--- a/test/tint/builtins/gen/literal/sign/c8289c.wgsl
+++ b/test/tint/builtins/gen/literal/sign/c8289c.wgsl
@@ -25,7 +25,6 @@
 fn sign_c8289c() {
   var res = sign(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_c8289c();
diff --git a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl
index 0937bae..bcecae9 100644
--- a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl
+++ b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl
@@ -26,7 +26,9 @@
 // fn sign(vec<2, f16>) -> vec<2, f16>
 fn sign_ccdb3c() {
   var res: vec2<f16> = sign(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.dxc.hlsl
index 90267ec..c0bf50b 100644
--- a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_ccdb3c() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.fxc.hlsl
index 817a0ad..cda37448 100644
--- a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_ccdb3c() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.glsl
index 58f6dc7..6d07cb8 100644
--- a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sign_ccdb3c() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sign_ccdb3c() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sign_ccdb3c() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.msl
index 9d4ea41..cbb8bda 100644
--- a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_ccdb3c() {
+void sign_ccdb3c(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_ccdb3c();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  sign_ccdb3c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_ccdb3c();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  sign_ccdb3c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_ccdb3c();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  sign_ccdb3c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.spvasm
index e667af5..ecd06a7 100644
--- a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_ccdb3c "sign_ccdb3c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_ccdb3c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%sign_ccdb3c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sign_ccdb3c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sign_ccdb3c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sign_ccdb3c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sign_ccdb3c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sign_ccdb3c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sign_ccdb3c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.wgsl
index 2c9acae..9360671 100644
--- a/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/ccdb3c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sign_ccdb3c() {
   var res : vec2<f16> = sign(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_ccdb3c();
diff --git a/test/tint/builtins/gen/literal/sign/d065d8.wgsl b/test/tint/builtins/gen/literal/sign/d065d8.wgsl
index fa7e535..235e694 100644
--- a/test/tint/builtins/gen/literal/sign/d065d8.wgsl
+++ b/test/tint/builtins/gen/literal/sign/d065d8.wgsl
@@ -24,7 +24,9 @@
 // fn sign(vec<2, f32>) -> vec<2, f32>
 fn sign_d065d8() {
   var res: vec2<f32> = sign(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.dxc.hlsl
index 3b9404c..7051eed 100644
--- a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_d065d8() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.fxc.hlsl
index 3b9404c..7051eed 100644
--- a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_d065d8() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.glsl
index fdcae5e..813bad7 100644
--- a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sign_d065d8() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sign_d065d8() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sign_d065d8() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.msl
index 3acf27f..e743773 100644
--- a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_d065d8() {
+void sign_d065d8(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_d065d8();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  sign_d065d8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_d065d8();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  sign_d065d8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_d065d8();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  sign_d065d8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.spvasm
index 8cc157f..49ce736 100644
--- a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_d065d8 "sign_d065d8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%sign_d065d8 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%sign_d065d8 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %sign_d065d8
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %sign_d065d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sign_d065d8
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sign_d065d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sign_d065d8
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sign_d065d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.wgsl
index bd5bb83..565d9d3 100644
--- a/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/d065d8.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sign_d065d8() {
   var res : vec2<f32> = sign(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_d065d8();
diff --git a/test/tint/builtins/gen/literal/sign/dd790e.wgsl b/test/tint/builtins/gen/literal/sign/dd790e.wgsl
index 3de097a..e5fb311 100644
--- a/test/tint/builtins/gen/literal/sign/dd790e.wgsl
+++ b/test/tint/builtins/gen/literal/sign/dd790e.wgsl
@@ -24,7 +24,9 @@
 // fn sign(f32) -> f32
 fn sign_dd790e() {
   var res: f32 = sign(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.dxc.hlsl
index 7bb7ad4..576c54c 100644
--- a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_dd790e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.fxc.hlsl
index 7bb7ad4..576c54c 100644
--- a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_dd790e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.glsl
index c922c46..2e924df 100644
--- a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sign_dd790e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sign_dd790e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sign_dd790e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.msl b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.msl
index 8fab506..1fd0f89 100644
--- a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_dd790e() {
+void sign_dd790e(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_dd790e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  sign_dd790e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_dd790e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  sign_dd790e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_dd790e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  sign_dd790e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.spvasm
index 600afaa..aa1d512 100644
--- a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_dd790e "sign_dd790e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%sign_dd790e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%sign_dd790e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %sign_dd790e
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %sign_dd790e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %sign_dd790e
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %sign_dd790e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sign_dd790e
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sign_dd790e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.wgsl
index 8a2bc6b..f877b92 100644
--- a/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sign/dd790e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sign_dd790e() {
   var res : f32 = sign(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_dd790e();
diff --git a/test/tint/builtins/gen/literal/sign/f5da6a.wgsl b/test/tint/builtins/gen/literal/sign/f5da6a.wgsl
index 3b5c1d7..d649865 100644
--- a/test/tint/builtins/gen/literal/sign/f5da6a.wgsl
+++ b/test/tint/builtins/gen/literal/sign/f5da6a.wgsl
@@ -25,7 +25,6 @@
 fn sign_f5da6a() {
   var res = sign(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_f5da6a();
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl b/test/tint/builtins/gen/literal/sin/01f241.wgsl
index 3b6816f..f1a5002 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl
@@ -24,7 +24,9 @@
 // fn sin(vec<3, f32>) -> vec<3, f32>
 fn sin_01f241() {
   var res: vec3<f32> = sin(vec3<f32>(1.57079632679f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.dxc.hlsl
index d5f4b44..b18d157 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_01f241() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.fxc.hlsl
index d5f4b44..b18d157 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_01f241() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.glsl
index fc446ee..a184d89 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sin_01f241() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sin_01f241() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sin_01f241() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.msl
index 762d763..40b6923 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_01f241() {
+void sin_01f241(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_01f241();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  sin_01f241(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_01f241();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  sin_01f241(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_01f241();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  sin_01f241(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.spvasm
index eb8f71e..41534b6 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_01f241 "sin_01f241"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
- %sin_01f241 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+ %sin_01f241 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %sin_01f241
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %sin_01f241
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sin_01f241
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sin_01f241
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sin_01f241
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sin_01f241
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.wgsl
index cfd6a05..84f39d5 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sin_01f241() {
   var res : vec3<f32> = sin(vec3<f32>(1.57079637050628662109f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_01f241();
diff --git a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl
index eee9561..4eb1210 100644
--- a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl
+++ b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl
@@ -25,7 +25,6 @@
 fn sin_15b2c6() {
   var res = sin(vec4(1.57079632679));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_15b2c6();
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl
index 88a85dc..1447728 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl
@@ -26,7 +26,9 @@
 // fn sin(vec<3, f16>) -> vec<3, f16>
 fn sin_2c903b() {
   var res: vec3<f16> = sin(vec3<f16>(1.57079632679h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.dxc.hlsl
index 3a502b0..585e4ef 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_2c903b() {
   vector<float16_t, 3> res = (float16_t(0.99951171875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.fxc.hlsl
index 655fb25..abbd064 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_2c903b() {
-  vector<float16_t, 3> res = (float16_t(0.999511719h)).xxx;
+  vector<float16_t, 3> res = (float16_t(0.99951171875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.glsl
index 1deffeb..a58a332 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sin_2c903b() {
   f16vec3 res = f16vec3(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sin_2c903b() {
   f16vec3 res = f16vec3(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sin_2c903b() {
   f16vec3 res = f16vec3(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.msl
index 7ad80c1..f958654 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_2c903b() {
+void sin_2c903b(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.99951171875h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_2c903b();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  sin_2c903b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_2c903b();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  sin_2c903b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_2c903b();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  sin_2c903b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.spvasm
index e88aa02..97bdc33 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_2c903b "sin_2c903b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn1 = OpConstant %half 0x1.ffcp-1
-         %16 = OpConstantComposite %v3half %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1
+         %19 = OpConstantComposite %v3half %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_2c903b = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %sin_2c903b = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sin_2c903b
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sin_2c903b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sin_2c903b
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sin_2c903b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sin_2c903b
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sin_2c903b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.wgsl
index 77e5c4a..6e75812 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sin_2c903b() {
   var res : vec3<f16> = sin(vec3<f16>(1.5703125h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_2c903b();
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl
index 7c83bbc..a2236b1 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl
@@ -26,7 +26,9 @@
 // fn sin(vec<2, f16>) -> vec<2, f16>
 fn sin_3cca11() {
   var res: vec2<f16> = sin(vec2<f16>(1.57079632679h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.dxc.hlsl
index fd5dbc4..452372c 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_3cca11() {
   vector<float16_t, 2> res = (float16_t(0.99951171875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.fxc.hlsl
index 28407b0..a811fae 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_3cca11() {
-  vector<float16_t, 2> res = (float16_t(0.999511719h)).xx;
+  vector<float16_t, 2> res = (float16_t(0.99951171875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.glsl
index 3b74546..4b690c5 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sin_3cca11() {
   f16vec2 res = f16vec2(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sin_3cca11() {
   f16vec2 res = f16vec2(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sin_3cca11() {
   f16vec2 res = f16vec2(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.msl
index 9073313..7d087fa 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_3cca11() {
+void sin_3cca11(device half2* const tint_symbol_1) {
   half2 res = half2(0.99951171875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_3cca11();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  sin_3cca11(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_3cca11();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  sin_3cca11(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_3cca11();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  sin_3cca11(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.spvasm
index 6fd2e30..0dc511a 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_3cca11 "sin_3cca11"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn1 = OpConstant %half 0x1.ffcp-1
-         %16 = OpConstantComposite %v2half %half_0x1_ffcpn1 %half_0x1_ffcpn1
+         %19 = OpConstantComposite %v2half %half_0x1_ffcpn1 %half_0x1_ffcpn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_3cca11 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %sin_3cca11 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sin_3cca11
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sin_3cca11
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sin_3cca11
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sin_3cca11
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sin_3cca11
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sin_3cca11
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.wgsl
index 053b198..76ea5bc 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sin_3cca11() {
   var res : vec2<f16> = sin(vec2<f16>(1.5703125h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_3cca11();
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl
index 3ec5efb..d9f9bcb 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl
@@ -24,7 +24,9 @@
 // fn sin(vec<4, f32>) -> vec<4, f32>
 fn sin_4e3979() {
   var res: vec4<f32> = sin(vec4<f32>(1.57079632679f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.dxc.hlsl
index 0212c7c..5799e65 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_4e3979() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.fxc.hlsl
index 0212c7c..5799e65 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_4e3979() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.glsl
index 34173b0..f61132c 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sin_4e3979() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sin_4e3979() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sin_4e3979() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.msl
index c95d9a7..5c8a18a 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_4e3979() {
+void sin_4e3979(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_4e3979();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  sin_4e3979(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_4e3979();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  sin_4e3979(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_4e3979();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  sin_4e3979(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.spvasm
index c8791d9..8d95dfa 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_4e3979 "sin_4e3979"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
- %sin_4e3979 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+ %sin_4e3979 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %sin_4e3979
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %sin_4e3979
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sin_4e3979
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sin_4e3979
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sin_4e3979
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sin_4e3979
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.wgsl
index c41ee07..f50e616 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sin_4e3979() {
   var res : vec4<f32> = sin(vec4<f32>(1.57079637050628662109f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_4e3979();
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl
index 63b0abc..c1c098d 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl
@@ -26,7 +26,9 @@
 // fn sin(vec<4, f16>) -> vec<4, f16>
 fn sin_5c0712() {
   var res: vec4<f16> = sin(vec4<f16>(1.57079632679h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.dxc.hlsl
index 0df743d..3663955 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_5c0712() {
   vector<float16_t, 4> res = (float16_t(0.99951171875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.fxc.hlsl
index f9f0ea6..128cdc6 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_5c0712() {
-  vector<float16_t, 4> res = (float16_t(0.999511719h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(0.99951171875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.glsl
index 51d37c9..b5d0b66 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sin_5c0712() {
   f16vec4 res = f16vec4(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sin_5c0712() {
   f16vec4 res = f16vec4(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sin_5c0712() {
   f16vec4 res = f16vec4(0.99951171875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.msl
index eb4455c..62c196e 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_5c0712() {
+void sin_5c0712(device half4* const tint_symbol_1) {
   half4 res = half4(0.99951171875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_5c0712();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  sin_5c0712(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_5c0712();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  sin_5c0712(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_5c0712();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  sin_5c0712(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.spvasm
index 98d07ed..fec6312 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_5c0712 "sin_5c0712"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_ffcpn1 = OpConstant %half 0x1.ffcp-1
-         %16 = OpConstantComposite %v4half %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1
+         %19 = OpConstantComposite %v4half %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1 %half_0x1_ffcpn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_5c0712 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %sin_5c0712 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sin_5c0712
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sin_5c0712
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sin_5c0712
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sin_5c0712
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sin_5c0712
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sin_5c0712
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.wgsl
index 5f1ec6f..1e4b7c8 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sin_5c0712() {
   var res : vec4<f16> = sin(vec4<f16>(1.5703125h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_5c0712();
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl
index 3e3af8a..db9c6e7 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl
@@ -26,7 +26,9 @@
 // fn sin(f16) -> f16
 fn sin_66a59f() {
   var res: f16 = sin(1.57079632679h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.dxc.hlsl
index 99fbd85..cc1775e 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_66a59f() {
   float16_t res = float16_t(0.99951171875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.fxc.hlsl
index be9bfe4..36c79c8 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_66a59f() {
-  float16_t res = float16_t(0.999511719h);
+  float16_t res = float16_t(0.99951171875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.glsl
index cf886ea..04cd7d5 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sin_66a59f() {
   float16_t res = 0.99951171875hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sin_66a59f() {
   float16_t res = 0.99951171875hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sin_66a59f() {
   float16_t res = 0.99951171875hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.msl
index 1bd61c0..0f88d89 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_66a59f() {
+void sin_66a59f(device half* const tint_symbol_1) {
   half res = 0.99951171875h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_66a59f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  sin_66a59f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_66a59f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  sin_66a59f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_66a59f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  sin_66a59f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.spvasm
index 5b659b5..96f3b7a 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_66a59f "sin_66a59f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_ffcpn1 = OpConstant %half 0x1.ffcp-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_66a59f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %sin_66a59f = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_ffcpn1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %sin_66a59f
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %sin_66a59f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sin_66a59f
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sin_66a59f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sin_66a59f
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sin_66a59f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.wgsl
index c3681d9..43c46ae 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sin_66a59f() {
   var res : f16 = sin(1.5703125h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_66a59f();
diff --git a/test/tint/builtins/gen/literal/sin/67b03c.wgsl b/test/tint/builtins/gen/literal/sin/67b03c.wgsl
index a576cad..1598c2d 100644
--- a/test/tint/builtins/gen/literal/sin/67b03c.wgsl
+++ b/test/tint/builtins/gen/literal/sin/67b03c.wgsl
@@ -25,7 +25,6 @@
 fn sin_67b03c() {
   var res = sin(vec3(1.57079632679));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_67b03c();
diff --git a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl
index d99efea..ea80779 100644
--- a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl
+++ b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl
@@ -25,7 +25,6 @@
 fn sin_68d3ab() {
   var res = sin(vec2(1.57079632679));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_68d3ab();
diff --git a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl
index ae6110a..3ecd2ff 100644
--- a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl
+++ b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl
@@ -25,7 +25,6 @@
 fn sin_a9ab19() {
   var res = sin(1.57079632679);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_a9ab19();
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl
index e14a7c4..6b59695 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl
@@ -24,7 +24,9 @@
 // fn sin(f32) -> f32
 fn sin_b78c91() {
   var res: f32 = sin(1.57079632679f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.dxc.hlsl
index fd1ee0d..2de1a5c 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_b78c91() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.fxc.hlsl
index fd1ee0d..2de1a5c 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_b78c91() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.glsl
index 21a146c..5e8710e 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sin_b78c91() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sin_b78c91() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sin_b78c91() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.msl
index 502aa67..0f14aa4 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_b78c91() {
+void sin_b78c91(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_b78c91();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  sin_b78c91(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_b78c91();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  sin_b78c91(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_b78c91();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  sin_b78c91(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.spvasm
index 09685b2..bd19360 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_b78c91 "sin_b78c91"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
- %sin_b78c91 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+ %sin_b78c91 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %sin_b78c91
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %sin_b78c91
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %sin_b78c91
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %sin_b78c91
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sin_b78c91
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sin_b78c91
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.wgsl
index c8cecdf..b070f77 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sin_b78c91() {
   var res : f32 = sin(1.57079637050628662109f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_b78c91();
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl
index 4f40970..33c5955 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl
@@ -24,7 +24,9 @@
 // fn sin(vec<2, f32>) -> vec<2, f32>
 fn sin_fc8bc4() {
   var res: vec2<f32> = sin(vec2<f32>(1.57079632679f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.dxc.hlsl
index a3f5f5e..ed14cb2 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_fc8bc4() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.fxc.hlsl
index a3f5f5e..ed14cb2 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_fc8bc4() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.glsl
index ea6ce7a..07234ec 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sin_fc8bc4() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sin_fc8bc4() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sin_fc8bc4() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.msl
index 3e6d8b6..f8f6cde 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_fc8bc4() {
+void sin_fc8bc4(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_fc8bc4();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  sin_fc8bc4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_fc8bc4();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  sin_fc8bc4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_fc8bc4();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  sin_fc8bc4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.spvasm
index d4d1dd0..e1dc246 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_fc8bc4 "sin_fc8bc4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
- %sin_fc8bc4 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+ %sin_fc8bc4 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %sin_fc8bc4
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %sin_fc8bc4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sin_fc8bc4
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sin_fc8bc4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sin_fc8bc4
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sin_fc8bc4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.wgsl
index 63a10ac..079b42e 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sin_fc8bc4() {
   var res : vec2<f32> = sin(vec2<f32>(1.57079637050628662109f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_fc8bc4();
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl
index 576523b..26a6b08 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl
@@ -26,7 +26,9 @@
 // fn sinh(vec<3, f16>) -> vec<3, f16>
 fn sinh_0908c1() {
   var res: vec3<f16> = sinh(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.dxc.hlsl
index 6eacac1..7ba7e52 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_0908c1() {
   vector<float16_t, 3> res = (float16_t(1.1748046875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.fxc.hlsl
index 93714ff..9ea2818 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_0908c1() {
-  vector<float16_t, 3> res = (float16_t(1.174804688h)).xxx;
+  vector<float16_t, 3> res = (float16_t(1.1748046875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.glsl
index 9a5ff4e..d38af76 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sinh_0908c1() {
   f16vec3 res = f16vec3(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sinh_0908c1() {
   f16vec3 res = f16vec3(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sinh_0908c1() {
   f16vec3 res = f16vec3(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.msl
index df2390e..dbc9031 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_0908c1() {
+void sinh_0908c1(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.1748046875h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_0908c1();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  sinh_0908c1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_0908c1();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  sinh_0908c1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_0908c1();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  sinh_0908c1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.spvasm
index c50a8ff..071370a 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_0908c1 "sinh_0908c1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_2ccp_0 = OpConstant %half 0x1.2ccp+0
-         %16 = OpConstantComposite %v3half %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0
+         %19 = OpConstantComposite %v3half %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_0908c1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%sinh_0908c1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sinh_0908c1
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sinh_0908c1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sinh_0908c1
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sinh_0908c1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sinh_0908c1
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sinh_0908c1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.wgsl
index 1da348b..381bb84 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sinh_0908c1() {
   var res : vec3<f16> = sinh(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_0908c1();
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl
index 0157aab..b2f4307 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl
@@ -24,7 +24,9 @@
 // fn sinh(vec<4, f32>) -> vec<4, f32>
 fn sinh_445e33() {
   var res: vec4<f32> = sinh(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.dxc.hlsl
index b9d5df0..0f68e1b 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_445e33() {
   float4 res = (1.17520117759704589844f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.fxc.hlsl
index b9d5df0..0f68e1b 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_445e33() {
   float4 res = (1.17520117759704589844f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.glsl
index 0b7b8c2..4af4e37 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sinh_445e33() {
   vec4 res = vec4(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sinh_445e33() {
   vec4 res = vec4(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sinh_445e33() {
   vec4 res = vec4(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.msl
index 6c11d97..0a7194c 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_445e33() {
+void sinh_445e33(device float4* const tint_symbol_1) {
   float4 res = float4(1.17520117759704589844f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_445e33();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  sinh_445e33(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_445e33();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  sinh_445e33(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_445e33();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  sinh_445e33(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.spvasm
index bd640f7..3c507d2 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_445e33 "sinh_445e33"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_1_17520118 = OpConstant %float 1.17520118
-         %14 = OpConstantComposite %v4float %float_1_17520118 %float_1_17520118 %float_1_17520118 %float_1_17520118
+         %17 = OpConstantComposite %v4float %float_1_17520118 %float_1_17520118 %float_1_17520118 %float_1_17520118
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_445e33 = OpFunction %void None %9
-         %12 = OpLabel
+%sinh_445e33 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %sinh_445e33
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %sinh_445e33
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sinh_445e33
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sinh_445e33
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sinh_445e33
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sinh_445e33
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.wgsl
index 4cc3527..7d6d7d0 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sinh_445e33() {
   var res : vec4<f32> = sinh(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_445e33();
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl
index 2b22eed..4c62aa6 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl
@@ -26,7 +26,9 @@
 // fn sinh(f16) -> f16
 fn sinh_69cce2() {
   var res: f16 = sinh(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.dxc.hlsl
index 024f936..de98eff 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_69cce2() {
   float16_t res = float16_t(1.1748046875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.fxc.hlsl
index 0949246..1f20488 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_69cce2() {
-  float16_t res = float16_t(1.174804688h);
+  float16_t res = float16_t(1.1748046875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.glsl
index 73167f0..753bb5d 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sinh_69cce2() {
   float16_t res = 1.1748046875hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sinh_69cce2() {
   float16_t res = 1.1748046875hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sinh_69cce2() {
   float16_t res = 1.1748046875hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.msl
index dab30e3..9099889 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_69cce2() {
+void sinh_69cce2(device half* const tint_symbol_1) {
   half res = 1.1748046875h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_69cce2();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  sinh_69cce2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_69cce2();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  sinh_69cce2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_69cce2();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  sinh_69cce2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.spvasm
index 27ce56b..a1b6e93 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_69cce2 "sinh_69cce2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_2ccp_0 = OpConstant %half 0x1.2ccp+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_69cce2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%sinh_69cce2 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_2ccp_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %sinh_69cce2
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %sinh_69cce2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sinh_69cce2
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sinh_69cce2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sinh_69cce2
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sinh_69cce2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.wgsl
index 1f7cd9a..e48e1d0 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sinh_69cce2() {
   var res : f16 = sinh(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_69cce2();
diff --git a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl
index 2d938bb..c7be581 100644
--- a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl
@@ -25,7 +25,6 @@
 fn sinh_77a2a3() {
   var res = sinh(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_77a2a3();
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl
index 8bf7fa8..4feb5ca 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl
@@ -24,7 +24,9 @@
 // fn sinh(f32) -> f32
 fn sinh_7bb598() {
   var res: f32 = sinh(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.dxc.hlsl
index f0601ba..dd7d233 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_7bb598() {
   float res = 1.17520117759704589844f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.fxc.hlsl
index f0601ba..dd7d233 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_7bb598() {
   float res = 1.17520117759704589844f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.glsl
index eb31eba..d65d8e1 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sinh_7bb598() {
   float res = 1.17520117759704589844f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sinh_7bb598() {
   float res = 1.17520117759704589844f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sinh_7bb598() {
   float res = 1.17520117759704589844f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.msl
index c777012..8175a85 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_7bb598() {
+void sinh_7bb598(device float* const tint_symbol_1) {
   float res = 1.17520117759704589844f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_7bb598();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  sinh_7bb598(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_7bb598();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  sinh_7bb598(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_7bb598();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  sinh_7bb598(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.spvasm
index f9828f1..bf63ac1 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_7bb598 "sinh_7bb598"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_1_17520118 = OpConstant %float 1.17520118
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_7bb598 = OpFunction %void None %9
-         %12 = OpLabel
+%sinh_7bb598 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1_17520118
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %sinh_7bb598
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %sinh_7bb598
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sinh_7bb598
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sinh_7bb598
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sinh_7bb598
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sinh_7bb598
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.wgsl
index 8b00cfb..8e4469a 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sinh_7bb598() {
   var res : f32 = sinh(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_7bb598();
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl
index 7c5a290..6bdc834 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl
@@ -26,7 +26,9 @@
 // fn sinh(vec<2, f16>) -> vec<2, f16>
 fn sinh_924f19() {
   var res: vec2<f16> = sinh(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.dxc.hlsl
index 6a7fb59..9ba6489 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_924f19() {
   vector<float16_t, 2> res = (float16_t(1.1748046875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.fxc.hlsl
index 89947c4..5775ba3 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_924f19() {
-  vector<float16_t, 2> res = (float16_t(1.174804688h)).xx;
+  vector<float16_t, 2> res = (float16_t(1.1748046875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.glsl
index a0d98d8..dbd51f8 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sinh_924f19() {
   f16vec2 res = f16vec2(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sinh_924f19() {
   f16vec2 res = f16vec2(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sinh_924f19() {
   f16vec2 res = f16vec2(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.msl
index 69521ba..914510e 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_924f19() {
+void sinh_924f19(device half2* const tint_symbol_1) {
   half2 res = half2(1.1748046875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_924f19();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  sinh_924f19(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_924f19();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  sinh_924f19(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_924f19();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  sinh_924f19(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.spvasm
index d57f22e..7d3b4d9 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_924f19 "sinh_924f19"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_2ccp_0 = OpConstant %half 0x1.2ccp+0
-         %16 = OpConstantComposite %v2half %half_0x1_2ccp_0 %half_0x1_2ccp_0
+         %19 = OpConstantComposite %v2half %half_0x1_2ccp_0 %half_0x1_2ccp_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_924f19 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%sinh_924f19 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sinh_924f19
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sinh_924f19
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sinh_924f19
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sinh_924f19
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sinh_924f19
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sinh_924f19
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.wgsl
index 7ebb07c..3fb0506 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sinh_924f19() {
   var res : vec2<f16> = sinh(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_924f19();
diff --git a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl
index 26faf82..12040e1 100644
--- a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl
@@ -25,7 +25,6 @@
 fn sinh_9c1092() {
   var res = sinh(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_9c1092();
diff --git a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl
index 20558b8..c018ec1 100644
--- a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl
@@ -25,7 +25,6 @@
 fn sinh_a3da7c() {
   var res = sinh(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_a3da7c();
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl
index c9422a8..c3fca22 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl
@@ -24,7 +24,9 @@
 // fn sinh(vec<2, f32>) -> vec<2, f32>
 fn sinh_b9860e() {
   var res: vec2<f32> = sinh(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.dxc.hlsl
index c4c5eef..7d5d7d8 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_b9860e() {
   float2 res = (1.17520117759704589844f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.fxc.hlsl
index c4c5eef..7d5d7d8 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_b9860e() {
   float2 res = (1.17520117759704589844f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.glsl
index 521ef12..1219146 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sinh_b9860e() {
   vec2 res = vec2(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sinh_b9860e() {
   vec2 res = vec2(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sinh_b9860e() {
   vec2 res = vec2(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.msl
index 6a4db89..78eff1c 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_b9860e() {
+void sinh_b9860e(device float2* const tint_symbol_1) {
   float2 res = float2(1.17520117759704589844f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_b9860e();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  sinh_b9860e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_b9860e();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  sinh_b9860e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_b9860e();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  sinh_b9860e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.spvasm
index d8a3618..a0ce454 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_b9860e "sinh_b9860e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_1_17520118 = OpConstant %float 1.17520118
-         %15 = OpConstantComposite %v2float %float_1_17520118 %float_1_17520118
+         %18 = OpConstantComposite %v2float %float_1_17520118 %float_1_17520118
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_b9860e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%sinh_b9860e = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %sinh_b9860e
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %sinh_b9860e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sinh_b9860e
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sinh_b9860e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sinh_b9860e
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sinh_b9860e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.wgsl
index 6a6454f..67cbe28 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sinh_b9860e() {
   var res : vec2<f32> = sinh(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_b9860e();
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl
index c73702f..5199217 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl
@@ -26,7 +26,9 @@
 // fn sinh(vec<4, f16>) -> vec<4, f16>
 fn sinh_ba7e25() {
   var res: vec4<f16> = sinh(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.dxc.hlsl
index 9686bbe..adbeb09 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_ba7e25() {
   vector<float16_t, 4> res = (float16_t(1.1748046875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.fxc.hlsl
index 1910db6..744c9c3 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_ba7e25() {
-  vector<float16_t, 4> res = (float16_t(1.174804688h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(1.1748046875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.glsl
index acddf06..72f04db 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sinh_ba7e25() {
   f16vec4 res = f16vec4(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sinh_ba7e25() {
   f16vec4 res = f16vec4(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sinh_ba7e25() {
   f16vec4 res = f16vec4(1.1748046875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.msl
index 92d4cdc..c6edda6 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_ba7e25() {
+void sinh_ba7e25(device half4* const tint_symbol_1) {
   half4 res = half4(1.1748046875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_ba7e25();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  sinh_ba7e25(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_ba7e25();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  sinh_ba7e25(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_ba7e25();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  sinh_ba7e25(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.spvasm
index 647555d..682767c 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_ba7e25 "sinh_ba7e25"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_2ccp_0 = OpConstant %half 0x1.2ccp+0
-         %16 = OpConstantComposite %v4half %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0
+         %19 = OpConstantComposite %v4half %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_ba7e25 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%sinh_ba7e25 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sinh_ba7e25
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sinh_ba7e25
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sinh_ba7e25
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sinh_ba7e25
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sinh_ba7e25
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sinh_ba7e25
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.wgsl
index d05628a..b78a766 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sinh_ba7e25() {
   var res : vec4<f16> = sinh(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_ba7e25();
diff --git a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl
index c91c0d6..640b15b 100644
--- a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl
@@ -25,7 +25,6 @@
 fn sinh_c4df74() {
   var res = sinh(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_c4df74();
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl
index 1a42a2b..7a9b361 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl
@@ -24,7 +24,9 @@
 // fn sinh(vec<3, f32>) -> vec<3, f32>
 fn sinh_c9a5eb() {
   var res: vec3<f32> = sinh(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.dxc.hlsl
index 96f66c9..08c829f 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_c9a5eb() {
   float3 res = (1.17520117759704589844f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.fxc.hlsl
index 96f66c9..08c829f 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_c9a5eb() {
   float3 res = (1.17520117759704589844f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.glsl
index 845e739..f6cc268 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sinh_c9a5eb() {
   vec3 res = vec3(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sinh_c9a5eb() {
   vec3 res = vec3(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sinh_c9a5eb() {
   vec3 res = vec3(1.17520117759704589844f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.msl
index 9649266..a533745 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_c9a5eb() {
+void sinh_c9a5eb(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.17520117759704589844f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_c9a5eb();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  sinh_c9a5eb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_c9a5eb();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  sinh_c9a5eb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_c9a5eb();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  sinh_c9a5eb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.spvasm
index bf1af9e..bb0a46a 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_c9a5eb "sinh_c9a5eb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_1_17520118 = OpConstant %float 1.17520118
-         %15 = OpConstantComposite %v3float %float_1_17520118 %float_1_17520118 %float_1_17520118
+         %18 = OpConstantComposite %v3float %float_1_17520118 %float_1_17520118 %float_1_17520118
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_c9a5eb = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%sinh_c9a5eb = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %sinh_c9a5eb
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %sinh_c9a5eb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sinh_c9a5eb
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sinh_c9a5eb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sinh_c9a5eb
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sinh_c9a5eb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.wgsl
index 67df10e..c309086 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sinh_c9a5eb() {
   var res : vec3<f32> = sinh(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_c9a5eb();
diff --git a/test/tint/builtins/gen/literal/smoothstep/0c481b.wgsl b/test/tint/builtins/gen/literal/smoothstep/0c481b.wgsl
index 8b36e50..202ea9a 100644
--- a/test/tint/builtins/gen/literal/smoothstep/0c481b.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/0c481b.wgsl
@@ -25,7 +25,6 @@
 fn smoothstep_0c481b() {
   var res = smoothstep(vec2(2.), vec2(4.), vec2(3.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_0c481b();
diff --git a/test/tint/builtins/gen/literal/smoothstep/0c4ffc.wgsl b/test/tint/builtins/gen/literal/smoothstep/0c4ffc.wgsl
index ad30ae3..a450a08 100644
--- a/test/tint/builtins/gen/literal/smoothstep/0c4ffc.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/0c4ffc.wgsl
@@ -25,7 +25,6 @@
 fn smoothstep_0c4ffc() {
   var res = smoothstep(vec4(2.), vec4(4.), vec4(3.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_0c4ffc();
diff --git a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl
index 1187f47..76d5283 100644
--- a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl
@@ -26,7 +26,9 @@
 // fn smoothstep(vec<2, f16>, vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn smoothstep_12c031() {
   var res: vec2<f16> = smoothstep(vec2<f16>(2.h), vec2<f16>(4.h), vec2<f16>(3.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.dxc.hlsl
index 9ac89b6..5d21885 100644
--- a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_12c031() {
   vector<float16_t, 2> res = (float16_t(0.5h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.fxc.hlsl
index b40313b..015d358 100644
--- a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_12c031() {
   vector<float16_t, 2> res = (float16_t(0.5h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.glsl b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.glsl
index 6c8d1e7..a371f65 100644
--- a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void smoothstep_12c031() {
   f16vec2 res = f16vec2(0.5hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void smoothstep_12c031() {
   f16vec2 res = f16vec2(0.5hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void smoothstep_12c031() {
   f16vec2 res = f16vec2(0.5hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.msl b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.msl
index 240a3b1..4855147 100644
--- a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_12c031() {
+void smoothstep_12c031(device half2* const tint_symbol_1) {
   half2 res = half2(0.5h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_12c031();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  smoothstep_12c031(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_12c031();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_12c031(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_12c031();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_12c031(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.spvasm
index 12f6c20..9fe5e0d 100644
--- a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_12c031 "smoothstep_12c031"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
-         %16 = OpConstantComposite %v2half %half_0x1pn1 %half_0x1pn1
+         %19 = OpConstantComposite %v2half %half_0x1pn1 %half_0x1pn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_12c031 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%smoothstep_12c031 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %smoothstep_12c031
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %smoothstep_12c031
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %smoothstep_12c031
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %smoothstep_12c031
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %smoothstep_12c031
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %smoothstep_12c031
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.wgsl
index 1aa07fc..5ccfc20 100644
--- a/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/12c031.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn smoothstep_12c031() {
   var res : vec2<f16> = smoothstep(vec2<f16>(2.0h), vec2<f16>(4.0h), vec2<f16>(3.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_12c031();
diff --git a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl
index cb3ec04..963c6ab 100644
--- a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl
@@ -24,7 +24,9 @@
 // fn smoothstep(vec<2, f32>, vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn smoothstep_392c19() {
   var res: vec2<f32> = smoothstep(vec2<f32>(2.f), vec2<f32>(4.f), vec2<f32>(3.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.dxc.hlsl
index d3d9d98..677bcae 100644
--- a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_392c19() {
   float2 res = (0.5f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.fxc.hlsl
index d3d9d98..677bcae 100644
--- a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_392c19() {
   float2 res = (0.5f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.glsl b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.glsl
index 9ac8a8d..3c90ce9 100644
--- a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void smoothstep_392c19() {
   vec2 res = vec2(0.5f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void smoothstep_392c19() {
   vec2 res = vec2(0.5f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void smoothstep_392c19() {
   vec2 res = vec2(0.5f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.msl b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.msl
index 8518f36..807a897 100644
--- a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_392c19() {
+void smoothstep_392c19(device float2* const tint_symbol_1) {
   float2 res = float2(0.5f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_392c19();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  smoothstep_392c19(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_392c19();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_392c19(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_392c19();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_392c19(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.spvasm
index 1b8fc9e..89d83e0 100644
--- a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_392c19 "smoothstep_392c19"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %15 = OpConstantComposite %v2float %float_0_5 %float_0_5
+         %18 = OpConstantComposite %v2float %float_0_5 %float_0_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_392c19 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%smoothstep_392c19 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %smoothstep_392c19
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %smoothstep_392c19
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %smoothstep_392c19
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %smoothstep_392c19
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %smoothstep_392c19
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %smoothstep_392c19
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.wgsl
index 4a1c190..171fd12 100644
--- a/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/392c19.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn smoothstep_392c19() {
   var res : vec2<f32> = smoothstep(vec2<f32>(2.0f), vec2<f32>(4.0f), vec2<f32>(3.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_392c19();
diff --git a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl
index 42ff1c0..b9101c6 100644
--- a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl
@@ -24,7 +24,9 @@
 // fn smoothstep(vec<4, f32>, vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn smoothstep_40864c() {
   var res: vec4<f32> = smoothstep(vec4<f32>(2.f), vec4<f32>(4.f), vec4<f32>(3.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.dxc.hlsl
index 9e6afca..6b82674 100644
--- a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_40864c() {
   float4 res = (0.5f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.fxc.hlsl
index 9e6afca..6b82674 100644
--- a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_40864c() {
   float4 res = (0.5f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.glsl
index 42337e5..d61a842 100644
--- a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void smoothstep_40864c() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void smoothstep_40864c() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void smoothstep_40864c() {
   vec4 res = vec4(0.5f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.msl b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.msl
index 3be99a9..f746e97 100644
--- a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_40864c() {
+void smoothstep_40864c(device float4* const tint_symbol_1) {
   float4 res = float4(0.5f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_40864c();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  smoothstep_40864c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_40864c();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_40864c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_40864c();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_40864c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.spvasm
index 5ebf4aa..16f54e1 100644
--- a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_40864c "smoothstep_40864c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %14 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+         %17 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_40864c = OpFunction %void None %9
-         %12 = OpLabel
+%smoothstep_40864c = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %smoothstep_40864c
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %smoothstep_40864c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %smoothstep_40864c
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %smoothstep_40864c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %smoothstep_40864c
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %smoothstep_40864c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.wgsl
index 1c9e281..3befccc 100644
--- a/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/40864c.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn smoothstep_40864c() {
   var res : vec4<f32> = smoothstep(vec4<f32>(2.0f), vec4<f32>(4.0f), vec4<f32>(3.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_40864c();
diff --git a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl
index b84f8f9..95a28ce 100644
--- a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl
@@ -26,7 +26,9 @@
 // fn smoothstep(f16, f16, f16) -> f16
 fn smoothstep_586e12() {
   var res: f16 = smoothstep(2.h, 4.h, 3.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.dxc.hlsl
index 8050e65..589717a 100644
--- a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_586e12() {
   float16_t res = float16_t(0.5h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.fxc.hlsl
index 5a81970..d7b7641 100644
--- a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_586e12() {
   float16_t res = float16_t(0.5h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.glsl b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.glsl
index cc204e2..46eeccb 100644
--- a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void smoothstep_586e12() {
   float16_t res = 0.5hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void smoothstep_586e12() {
   float16_t res = 0.5hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void smoothstep_586e12() {
   float16_t res = 0.5hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.msl b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.msl
index 1415e41..bb48d4b 100644
--- a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_586e12() {
+void smoothstep_586e12(device half* const tint_symbol_1) {
   half res = 0.5h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_586e12();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  smoothstep_586e12(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_586e12();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_586e12(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_586e12();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_586e12(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.spvasm
index f63bdd1..1cb916a 100644
--- a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_586e12 "smoothstep_586e12"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_586e12 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%smoothstep_586e12 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1pn1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %smoothstep_586e12
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %smoothstep_586e12
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %smoothstep_586e12
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %smoothstep_586e12
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %smoothstep_586e12
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %smoothstep_586e12
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.wgsl
index 9927570..8d7e1a1 100644
--- a/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/586e12.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn smoothstep_586e12() {
   var res : f16 = smoothstep(2.0h, 4.0h, 3.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_586e12();
diff --git a/test/tint/builtins/gen/literal/smoothstep/66e4bd.wgsl b/test/tint/builtins/gen/literal/smoothstep/66e4bd.wgsl
index 3de91d5..fe73666 100644
--- a/test/tint/builtins/gen/literal/smoothstep/66e4bd.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/66e4bd.wgsl
@@ -25,7 +25,6 @@
 fn smoothstep_66e4bd() {
   var res = smoothstep(vec3(2.), vec3(4.), vec3(3.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_66e4bd();
diff --git a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl
index a779f23..400a24a 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl
@@ -24,7 +24,9 @@
 // fn smoothstep(f32, f32, f32) -> f32
 fn smoothstep_6c4975() {
   var res: f32 = smoothstep(2.f, 4.f, 3.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.dxc.hlsl
index 76df66c..758589d 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_6c4975() {
   float res = 0.5f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.fxc.hlsl
index 76df66c..758589d 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_6c4975() {
   float res = 0.5f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.glsl b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.glsl
index ecc4075..f2495b7 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void smoothstep_6c4975() {
   float res = 0.5f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void smoothstep_6c4975() {
   float res = 0.5f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void smoothstep_6c4975() {
   float res = 0.5f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.msl b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.msl
index 48f4bb8..d7da1ae 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_6c4975() {
+void smoothstep_6c4975(device float* const tint_symbol_1) {
   float res = 0.5f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_6c4975();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  smoothstep_6c4975(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_6c4975();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_6c4975(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_6c4975();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_6c4975(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.spvasm
index 28cb231..3b731fa 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_6c4975 "smoothstep_6c4975"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_6c4975 = OpFunction %void None %9
-         %12 = OpLabel
+%smoothstep_6c4975 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_5
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %smoothstep_6c4975
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %smoothstep_6c4975
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %smoothstep_6c4975
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %smoothstep_6c4975
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %smoothstep_6c4975
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %smoothstep_6c4975
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.wgsl
index 2f281df..fbf59f6 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6c4975.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn smoothstep_6c4975() {
   var res : f32 = smoothstep(2.0f, 4.0f, 3.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_6c4975();
diff --git a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl
index fd42703..592d6cb 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl
@@ -26,7 +26,9 @@
 // fn smoothstep(vec<3, f16>, vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn smoothstep_6e7a74() {
   var res: vec3<f16> = smoothstep(vec3<f16>(2.h), vec3<f16>(4.h), vec3<f16>(3.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.dxc.hlsl
index 101fa07..8f8f467 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_6e7a74() {
   vector<float16_t, 3> res = (float16_t(0.5h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.fxc.hlsl
index c20829b..2101de3 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_6e7a74() {
   vector<float16_t, 3> res = (float16_t(0.5h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.glsl
index fdad495..a56da11 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void smoothstep_6e7a74() {
   f16vec3 res = f16vec3(0.5hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void smoothstep_6e7a74() {
   f16vec3 res = f16vec3(0.5hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void smoothstep_6e7a74() {
   f16vec3 res = f16vec3(0.5hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.msl b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.msl
index aafc826..1806fc7 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_6e7a74() {
+void smoothstep_6e7a74(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.5h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_6e7a74();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  smoothstep_6e7a74(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_6e7a74();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_6e7a74(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_6e7a74();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_6e7a74(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.spvasm
index e7c414d..30ab844 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_6e7a74 "smoothstep_6e7a74"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
-         %16 = OpConstantComposite %v3half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
+         %19 = OpConstantComposite %v3half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_6e7a74 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%smoothstep_6e7a74 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %smoothstep_6e7a74
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %smoothstep_6e7a74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %smoothstep_6e7a74
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %smoothstep_6e7a74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %smoothstep_6e7a74
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %smoothstep_6e7a74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.wgsl
index cab3340..021eb26 100644
--- a/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/6e7a74.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn smoothstep_6e7a74() {
   var res : vec3<f16> = smoothstep(vec3<f16>(2.0h), vec3<f16>(4.0h), vec3<f16>(3.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_6e7a74();
diff --git a/test/tint/builtins/gen/literal/smoothstep/a80fff.wgsl b/test/tint/builtins/gen/literal/smoothstep/a80fff.wgsl
index c1a83bd..2b37fe6 100644
--- a/test/tint/builtins/gen/literal/smoothstep/a80fff.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/a80fff.wgsl
@@ -25,7 +25,6 @@
 fn smoothstep_a80fff() {
   var res = smoothstep(2., 4., 3.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_a80fff();
diff --git a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl
index 72e95a8..b18e01a 100644
--- a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl
@@ -24,7 +24,9 @@
 // fn smoothstep(vec<3, f32>, vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn smoothstep_aad1db() {
   var res: vec3<f32> = smoothstep(vec3<f32>(2.f), vec3<f32>(4.f), vec3<f32>(3.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.dxc.hlsl
index 151a631..99385b7 100644
--- a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_aad1db() {
   float3 res = (0.5f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.fxc.hlsl
index 151a631..99385b7 100644
--- a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_aad1db() {
   float3 res = (0.5f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.glsl b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.glsl
index 9a2f4d3..6f365fc 100644
--- a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void smoothstep_aad1db() {
   vec3 res = vec3(0.5f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void smoothstep_aad1db() {
   vec3 res = vec3(0.5f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void smoothstep_aad1db() {
   vec3 res = vec3(0.5f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.msl b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.msl
index 021033e..b066519 100644
--- a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_aad1db() {
+void smoothstep_aad1db(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.5f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_aad1db();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  smoothstep_aad1db(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_aad1db();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_aad1db(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_aad1db();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_aad1db(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.spvasm
index bfd3979..225593f 100644
--- a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_aad1db "smoothstep_aad1db"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %15 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+         %18 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_aad1db = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%smoothstep_aad1db = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %smoothstep_aad1db
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %smoothstep_aad1db
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %smoothstep_aad1db
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %smoothstep_aad1db
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %smoothstep_aad1db
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %smoothstep_aad1db
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.wgsl
index 11bb354..7a1a9d6 100644
--- a/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/aad1db.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn smoothstep_aad1db() {
   var res : vec3<f32> = smoothstep(vec3<f32>(2.0f), vec3<f32>(4.0f), vec3<f32>(3.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_aad1db();
diff --git a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl
index d2d9b70..300796e 100644
--- a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl
@@ -26,7 +26,9 @@
 // fn smoothstep(vec<4, f16>, vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn smoothstep_c43ebd() {
   var res: vec4<f16> = smoothstep(vec4<f16>(2.h), vec4<f16>(4.h), vec4<f16>(3.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.dxc.hlsl
index 866e139..57283fc 100644
--- a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_c43ebd() {
   vector<float16_t, 4> res = (float16_t(0.5h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.fxc.hlsl
index 24997eb..b40f4dc 100644
--- a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_c43ebd() {
   vector<float16_t, 4> res = (float16_t(0.5h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.glsl
index 1a57918..53a9f21 100644
--- a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void smoothstep_c43ebd() {
   f16vec4 res = f16vec4(0.5hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void smoothstep_c43ebd() {
   f16vec4 res = f16vec4(0.5hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void smoothstep_c43ebd() {
   f16vec4 res = f16vec4(0.5hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.msl b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.msl
index b64d9be..a8edff3 100644
--- a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_c43ebd() {
+void smoothstep_c43ebd(device half4* const tint_symbol_1) {
   half4 res = half4(0.5h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_c43ebd();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  smoothstep_c43ebd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_c43ebd();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_c43ebd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_c43ebd();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_c43ebd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.spvasm
index 34ea008..3d9f9ec 100644
--- a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_c43ebd "smoothstep_c43ebd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
-         %16 = OpConstantComposite %v4half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
+         %19 = OpConstantComposite %v4half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_c43ebd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%smoothstep_c43ebd = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %smoothstep_c43ebd
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %smoothstep_c43ebd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %smoothstep_c43ebd
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %smoothstep_c43ebd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %smoothstep_c43ebd
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %smoothstep_c43ebd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.wgsl
index c3ec48c..21f7694 100644
--- a/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/smoothstep/c43ebd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn smoothstep_c43ebd() {
   var res : vec4<f16> = smoothstep(vec4<f16>(2.0h), vec4<f16>(4.0h), vec4<f16>(3.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_c43ebd();
diff --git a/test/tint/builtins/gen/literal/sqrt/072192.wgsl b/test/tint/builtins/gen/literal/sqrt/072192.wgsl
index 7943f01..a7ab3eb 100644
--- a/test/tint/builtins/gen/literal/sqrt/072192.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/072192.wgsl
@@ -25,7 +25,6 @@
 fn sqrt_072192() {
   var res = sqrt(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_072192();
diff --git a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl
index 9e6d6e1..0d2e2e3 100644
--- a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl
@@ -24,7 +24,9 @@
 // fn sqrt(f32) -> f32
 fn sqrt_20c74e() {
   var res: f32 = sqrt(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.dxc.hlsl
index f50210d..60829fc 100644
--- a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_20c74e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.fxc.hlsl
index f50210d..60829fc 100644
--- a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_20c74e() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.glsl
index 2d9a577..9c2bd9f 100644
--- a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sqrt_20c74e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sqrt_20c74e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sqrt_20c74e() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.msl b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.msl
index 02d8ac3..f417a3d 100644
--- a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_20c74e() {
+void sqrt_20c74e(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_20c74e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  sqrt_20c74e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_20c74e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_20c74e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_20c74e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_20c74e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.spvasm
index 11cec2f..b22b1e6 100644
--- a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_20c74e "sqrt_20c74e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%sqrt_20c74e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%sqrt_20c74e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %sqrt_20c74e
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %sqrt_20c74e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %sqrt_20c74e
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %sqrt_20c74e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sqrt_20c74e
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sqrt_20c74e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.wgsl
index cde62ac..25bff96 100644
--- a/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/20c74e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sqrt_20c74e() {
   var res : f32 = sqrt(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_20c74e();
diff --git a/test/tint/builtins/gen/literal/sqrt/4ac2c5.wgsl b/test/tint/builtins/gen/literal/sqrt/4ac2c5.wgsl
index 52b9585..325d68a 100644
--- a/test/tint/builtins/gen/literal/sqrt/4ac2c5.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/4ac2c5.wgsl
@@ -25,7 +25,6 @@
 fn sqrt_4ac2c5() {
   var res = sqrt(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_4ac2c5();
diff --git a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl
index 7a9166a..c49bd90 100644
--- a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl
@@ -26,7 +26,9 @@
 // fn sqrt(vec<4, f16>) -> vec<4, f16>
 fn sqrt_803d1c() {
   var res: vec4<f16> = sqrt(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.dxc.hlsl
index c046655..49f38b0 100644
--- a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_803d1c() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.fxc.hlsl
index d41250b..0beb17d 100644
--- a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_803d1c() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.glsl
index 7b5ed1b..e2196c0 100644
--- a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sqrt_803d1c() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sqrt_803d1c() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sqrt_803d1c() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.msl b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.msl
index c784c32..8b95efc 100644
--- a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_803d1c() {
+void sqrt_803d1c(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_803d1c();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  sqrt_803d1c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_803d1c();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_803d1c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_803d1c();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_803d1c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.spvasm
index 907832f..099c3e0 100644
--- a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_803d1c "sqrt_803d1c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sqrt_803d1c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%sqrt_803d1c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sqrt_803d1c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sqrt_803d1c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sqrt_803d1c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sqrt_803d1c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sqrt_803d1c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sqrt_803d1c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.wgsl
index 52cba12..a47a985 100644
--- a/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/803d1c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sqrt_803d1c() {
   var res : vec4<f16> = sqrt(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_803d1c();
diff --git a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl
index 7145d1a..bfd1957 100644
--- a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl
@@ -26,7 +26,9 @@
 // fn sqrt(vec<3, f16>) -> vec<3, f16>
 fn sqrt_895a0c() {
   var res: vec3<f16> = sqrt(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.dxc.hlsl
index aaaaa0b..19ced04 100644
--- a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_895a0c() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.fxc.hlsl
index 25a3bcd..dbb1eec 100644
--- a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_895a0c() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.glsl
index aae6300..e41ecff 100644
--- a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sqrt_895a0c() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sqrt_895a0c() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sqrt_895a0c() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.msl b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.msl
index dce831f..ac1736c 100644
--- a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_895a0c() {
+void sqrt_895a0c(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_895a0c();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  sqrt_895a0c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_895a0c();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_895a0c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_895a0c();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_895a0c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.spvasm
index d525d58..e3afcce 100644
--- a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_895a0c "sqrt_895a0c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sqrt_895a0c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%sqrt_895a0c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sqrt_895a0c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sqrt_895a0c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sqrt_895a0c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sqrt_895a0c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sqrt_895a0c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sqrt_895a0c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.wgsl
index b853037..77f90f5 100644
--- a/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/895a0c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sqrt_895a0c() {
   var res : vec3<f16> = sqrt(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_895a0c();
diff --git a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl
index 3e1ee74..20a8bc2 100644
--- a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl
@@ -24,7 +24,9 @@
 // fn sqrt(vec<2, f32>) -> vec<2, f32>
 fn sqrt_8c7024() {
   var res: vec2<f32> = sqrt(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.dxc.hlsl
index f7ee2ec..057e843 100644
--- a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_8c7024() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.fxc.hlsl
index f7ee2ec..057e843 100644
--- a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_8c7024() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.glsl
index e6cfb44..2c5a45e 100644
--- a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sqrt_8c7024() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sqrt_8c7024() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sqrt_8c7024() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.msl b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.msl
index 16a4d33..f17ed92 100644
--- a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_8c7024() {
+void sqrt_8c7024(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_8c7024();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  sqrt_8c7024(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_8c7024();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_8c7024(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_8c7024();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_8c7024(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.spvasm
index 5c1c9fa..17d2159 100644
--- a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_8c7024 "sqrt_8c7024"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%sqrt_8c7024 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%sqrt_8c7024 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %sqrt_8c7024
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %sqrt_8c7024
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sqrt_8c7024
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sqrt_8c7024
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sqrt_8c7024
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sqrt_8c7024
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.wgsl
index 4f32c71..a733089 100644
--- a/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/8c7024.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sqrt_8c7024() {
   var res : vec2<f32> = sqrt(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_8c7024();
diff --git a/test/tint/builtins/gen/literal/sqrt/8da177.wgsl b/test/tint/builtins/gen/literal/sqrt/8da177.wgsl
index 857eae5..f47261e 100644
--- a/test/tint/builtins/gen/literal/sqrt/8da177.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/8da177.wgsl
@@ -25,7 +25,6 @@
 fn sqrt_8da177() {
   var res = sqrt(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_8da177();
diff --git a/test/tint/builtins/gen/literal/sqrt/9c5cbe.wgsl b/test/tint/builtins/gen/literal/sqrt/9c5cbe.wgsl
index c45b389..1ef1b56 100644
--- a/test/tint/builtins/gen/literal/sqrt/9c5cbe.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/9c5cbe.wgsl
@@ -25,7 +25,6 @@
 fn sqrt_9c5cbe() {
   var res = sqrt(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_9c5cbe();
diff --git a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl
index 78f1401..60c4e63 100644
--- a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl
@@ -24,7 +24,9 @@
 // fn sqrt(vec<4, f32>) -> vec<4, f32>
 fn sqrt_aa0d7a() {
   var res: vec4<f32> = sqrt(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.dxc.hlsl
index e4d8702..957c2d8 100644
--- a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_aa0d7a() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.fxc.hlsl
index e4d8702..957c2d8 100644
--- a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_aa0d7a() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.glsl
index dad6999..10fe5e3 100644
--- a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sqrt_aa0d7a() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sqrt_aa0d7a() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sqrt_aa0d7a() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.msl b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.msl
index da314c5..6146f46 100644
--- a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_aa0d7a() {
+void sqrt_aa0d7a(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_aa0d7a();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  sqrt_aa0d7a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_aa0d7a();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_aa0d7a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_aa0d7a();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_aa0d7a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.spvasm
index bb14df4..6036822 100644
--- a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_aa0d7a "sqrt_aa0d7a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%sqrt_aa0d7a = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%sqrt_aa0d7a = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %sqrt_aa0d7a
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %sqrt_aa0d7a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sqrt_aa0d7a
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sqrt_aa0d7a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sqrt_aa0d7a
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sqrt_aa0d7a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.wgsl
index 0a2f114..4eadb5b 100644
--- a/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/aa0d7a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sqrt_aa0d7a() {
   var res : vec4<f32> = sqrt(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_aa0d7a();
diff --git a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl
index 3f47df0..955b778 100644
--- a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl
@@ -26,7 +26,9 @@
 // fn sqrt(vec<2, f16>) -> vec<2, f16>
 fn sqrt_d9ab4d() {
   var res: vec2<f16> = sqrt(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.dxc.hlsl
index c1609d5..e9d280e 100644
--- a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_d9ab4d() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.fxc.hlsl
index b553f3e..6d865d9 100644
--- a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_d9ab4d() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.glsl
index 963379e..eff1b74 100644
--- a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sqrt_d9ab4d() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sqrt_d9ab4d() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sqrt_d9ab4d() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.msl b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.msl
index 4e15166..f857c63 100644
--- a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_d9ab4d() {
+void sqrt_d9ab4d(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_d9ab4d();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  sqrt_d9ab4d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_d9ab4d();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_d9ab4d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_d9ab4d();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_d9ab4d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.spvasm
index ff075ce..d97263a 100644
--- a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_d9ab4d "sqrt_d9ab4d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sqrt_d9ab4d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%sqrt_d9ab4d = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sqrt_d9ab4d
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sqrt_d9ab4d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sqrt_d9ab4d
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sqrt_d9ab4d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sqrt_d9ab4d
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sqrt_d9ab4d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.wgsl
index 6b1d995..51f1a89 100644
--- a/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/d9ab4d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sqrt_d9ab4d() {
   var res : vec2<f16> = sqrt(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_d9ab4d();
diff --git a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl
index ab7ca7e..3b4c4f5 100644
--- a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl
@@ -26,7 +26,9 @@
 // fn sqrt(f16) -> f16
 fn sqrt_ec33e9() {
   var res: f16 = sqrt(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.dxc.hlsl
index 23939d5..7c7217e 100644
--- a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_ec33e9() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.fxc.hlsl
index de08f81..75845d0 100644
--- a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_ec33e9() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.glsl
index 4245551..7f33e73 100644
--- a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sqrt_ec33e9() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sqrt_ec33e9() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sqrt_ec33e9() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.msl b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.msl
index a3d8e32..e653c6f 100644
--- a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_ec33e9() {
+void sqrt_ec33e9(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_ec33e9();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  sqrt_ec33e9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_ec33e9();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_ec33e9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_ec33e9();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_ec33e9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.spvasm
index 9bf7a91..585f174 100644
--- a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_ec33e9 "sqrt_ec33e9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sqrt_ec33e9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%sqrt_ec33e9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %sqrt_ec33e9
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %sqrt_ec33e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sqrt_ec33e9
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sqrt_ec33e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sqrt_ec33e9
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sqrt_ec33e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.wgsl
index 50880e5..536aa6b 100644
--- a/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/ec33e9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn sqrt_ec33e9() {
   var res : f16 = sqrt(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_ec33e9();
diff --git a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl
index 9ce3b68..5564c04 100644
--- a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl
@@ -24,7 +24,9 @@
 // fn sqrt(vec<3, f32>) -> vec<3, f32>
 fn sqrt_f8c59a() {
   var res: vec3<f32> = sqrt(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.dxc.hlsl
index a572ca5..bb80e4a 100644
--- a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_f8c59a() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.fxc.hlsl
index a572ca5..bb80e4a 100644
--- a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_f8c59a() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.glsl
index fa397f3..5e8b27a 100644
--- a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sqrt_f8c59a() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sqrt_f8c59a() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sqrt_f8c59a() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.msl b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.msl
index 1e77ab0..57a58ab 100644
--- a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_f8c59a() {
+void sqrt_f8c59a(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_f8c59a();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  sqrt_f8c59a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_f8c59a();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_f8c59a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_f8c59a();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_f8c59a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.spvasm
index 448b3f6..ef4c615 100644
--- a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_f8c59a "sqrt_f8c59a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%sqrt_f8c59a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%sqrt_f8c59a = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %sqrt_f8c59a
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %sqrt_f8c59a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %sqrt_f8c59a
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %sqrt_f8c59a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sqrt_f8c59a
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sqrt_f8c59a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.wgsl
index 119dca4..a0fb0c4 100644
--- a/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/sqrt/f8c59a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn sqrt_f8c59a() {
   var res : vec3<f32> = sqrt(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_f8c59a();
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl b/test/tint/builtins/gen/literal/step/07cb06.wgsl
index 47da6bf..c9eb9b5 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl
@@ -26,7 +26,9 @@
 // fn step(vec<2, f16>, vec<2, f16>) -> vec<2, f16>
 fn step_07cb06() {
   var res: vec2<f16> = step(vec2<f16>(1.h), vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.dxc.hlsl
index e1fa37e..b1be683 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_07cb06() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.fxc.hlsl
index 4435d94..d712816 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_07cb06() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.glsl
index de4bf1a..516e8b4 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void step_07cb06() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void step_07cb06() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void step_07cb06() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.msl
index 8445f6f..816af32 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_07cb06() {
+void step_07cb06(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_07cb06();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  step_07cb06(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_07cb06();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  step_07cb06(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_07cb06();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  step_07cb06(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.spvasm
index e4bc4cc..27a8bb1 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_07cb06 "step_07cb06"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%step_07cb06 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%step_07cb06 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %step_07cb06
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_07cb06
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %step_07cb06
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %step_07cb06
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %step_07cb06
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %step_07cb06
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.wgsl
index 31dbd2d..c8fa595 100644
--- a/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/step/07cb06.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn step_07cb06() {
   var res : vec2<f16> = step(vec2<f16>(1.0h), vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_07cb06();
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl b/test/tint/builtins/gen/literal/step/0b073b.wgsl
index 589e5e7..9f18f79 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl
@@ -24,7 +24,9 @@
 // fn step(f32, f32) -> f32
 fn step_0b073b() {
   var res: f32 = step(1.f, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.dxc.hlsl
index 2d5a692..6e90cee 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_0b073b() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.fxc.hlsl
index 2d5a692..6e90cee 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_0b073b() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.glsl
index bdf7c88..eba7706 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void step_0b073b() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void step_0b073b() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void step_0b073b() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.msl
index 021c79f..f5c36e2 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_0b073b() {
+void step_0b073b(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_0b073b();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  step_0b073b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_0b073b();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  step_0b073b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_0b073b();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  step_0b073b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.spvasm
index c6cadfe..d1fd844 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_0b073b "step_0b073b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%step_0b073b = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%step_0b073b = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %step_0b073b
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %step_0b073b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %step_0b073b
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %step_0b073b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %step_0b073b
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %step_0b073b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.wgsl
index 4564309..502c43a0 100644
--- a/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/step/0b073b.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn step_0b073b() {
   var res : f32 = step(1.0f, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_0b073b();
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl b/test/tint/builtins/gen/literal/step/19accd.wgsl
index ebae567..1d05431 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl
@@ -24,7 +24,9 @@
 // fn step(vec<2, f32>, vec<2, f32>) -> vec<2, f32>
 fn step_19accd() {
   var res: vec2<f32> = step(vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.dxc.hlsl
index 443da20..481ef14 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_19accd() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.fxc.hlsl
index 443da20..481ef14 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_19accd() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.glsl
index c82ca8d..11a3c7a 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void step_19accd() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void step_19accd() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void step_19accd() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.msl
index d774b45..4cc18be 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_19accd() {
+void step_19accd(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_19accd();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  step_19accd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_19accd();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  step_19accd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_19accd();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  step_19accd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.spvasm
index 006fc96..fb94feb 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_19accd "step_19accd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%step_19accd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%step_19accd = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %step_19accd
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %step_19accd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %step_19accd
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %step_19accd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %step_19accd
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %step_19accd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.wgsl
index 53a37af..bcd0ece 100644
--- a/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/step/19accd.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn step_19accd() {
   var res : vec2<f32> = step(vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_19accd();
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl b/test/tint/builtins/gen/literal/step/334303.wgsl
index 9aa6605..29eb01b 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl
@@ -24,7 +24,9 @@
 // fn step(vec<3, f32>, vec<3, f32>) -> vec<3, f32>
 fn step_334303() {
   var res: vec3<f32> = step(vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.dxc.hlsl
index df39735..7fcf62c 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_334303() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.fxc.hlsl
index df39735..7fcf62c 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_334303() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.glsl
index 6ed30dd..130fcbf 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void step_334303() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void step_334303() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void step_334303() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.msl
index 6a48828..0e35b43 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_334303() {
+void step_334303(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_334303();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  step_334303(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_334303();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  step_334303(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_334303();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  step_334303(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.spvasm
index 895de97..75c5014 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_334303 "step_334303"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%step_334303 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%step_334303 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %step_334303
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %step_334303
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %step_334303
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %step_334303
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %step_334303
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %step_334303
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.wgsl
index ded0d81..751d631 100644
--- a/test/tint/builtins/gen/literal/step/334303.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/step/334303.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn step_334303() {
   var res : vec3<f32> = step(vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_334303();
diff --git a/test/tint/builtins/gen/literal/step/38cd79.wgsl b/test/tint/builtins/gen/literal/step/38cd79.wgsl
index 2663d42..6f5530a 100644
--- a/test/tint/builtins/gen/literal/step/38cd79.wgsl
+++ b/test/tint/builtins/gen/literal/step/38cd79.wgsl
@@ -25,7 +25,6 @@
 fn step_38cd79() {
   var res = step(vec4(1.), vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_38cd79();
diff --git a/test/tint/builtins/gen/literal/step/415879.wgsl b/test/tint/builtins/gen/literal/step/415879.wgsl
index 98c73a6..188e7fb 100644
--- a/test/tint/builtins/gen/literal/step/415879.wgsl
+++ b/test/tint/builtins/gen/literal/step/415879.wgsl
@@ -25,7 +25,6 @@
 fn step_415879() {
   var res = step(vec3(1.), vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_415879();
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl b/test/tint/builtins/gen/literal/step/630d07.wgsl
index b7fe024..b8d71e6 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl
@@ -26,7 +26,9 @@
 // fn step(f16, f16) -> f16
 fn step_630d07() {
   var res: f16 = step(1.h, 1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.dxc.hlsl
index c7fbf20..82df71b 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_630d07() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.fxc.hlsl
index 8b054fb..9e00ddc 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_630d07() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.glsl
index 3d9d9b6..9694197 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void step_630d07() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void step_630d07() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void step_630d07() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.msl
index 2286127..3882bf3 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_630d07() {
+void step_630d07(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_630d07();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  step_630d07(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_630d07();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  step_630d07(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_630d07();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  step_630d07(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.spvasm
index cc87db9..8437311 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_630d07 "step_630d07"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%step_630d07 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%step_630d07 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %step_630d07
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %step_630d07
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %step_630d07
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %step_630d07
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %step_630d07
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %step_630d07
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.wgsl
index 666cdf0..32b594c 100644
--- a/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/step/630d07.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn step_630d07() {
   var res : f16 = step(1.0h, 1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_630d07();
diff --git a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl
index ec22df6..578977c 100644
--- a/test/tint/builtins/gen/literal/step/7c7e5c.wgsl
+++ b/test/tint/builtins/gen/literal/step/7c7e5c.wgsl
@@ -25,7 +25,6 @@
 fn step_7c7e5c() {
   var res = step(vec2(1.), vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_7c7e5c();
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl b/test/tint/builtins/gen/literal/step/baa320.wgsl
index f30ef35..d743b97 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl
@@ -26,7 +26,9 @@
 // fn step(vec<4, f16>, vec<4, f16>) -> vec<4, f16>
 fn step_baa320() {
   var res: vec4<f16> = step(vec4<f16>(1.h), vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.dxc.hlsl
index b441cea..71863b7 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_baa320() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.fxc.hlsl
index e06c986..304999a 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_baa320() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.glsl
index a255127..39c747b 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void step_baa320() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void step_baa320() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void step_baa320() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.msl
index ef04a5d..35af6ce 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_baa320() {
+void step_baa320(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_baa320();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  step_baa320(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_baa320();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  step_baa320(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_baa320();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  step_baa320(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.spvasm
index fe1262f..ea26f6a 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_baa320 "step_baa320"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%step_baa320 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%step_baa320 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %step_baa320
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_baa320
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %step_baa320
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %step_baa320
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %step_baa320
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %step_baa320
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.wgsl
index 5199ffc..2eaa218 100644
--- a/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/step/baa320.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn step_baa320() {
   var res : vec4<f16> = step(vec4<f16>(1.0h), vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_baa320();
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl
index d4064c5..46dc411 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl
@@ -26,7 +26,9 @@
 // fn step(vec<3, f16>, vec<3, f16>) -> vec<3, f16>
 fn step_cc6b61() {
   var res: vec3<f16> = step(vec3<f16>(1.h), vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.dxc.hlsl
index 6a9b0cf..64fd3a3 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_cc6b61() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.fxc.hlsl
index 4ed99d4..eceb22b 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_cc6b61() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.glsl
index 13727a2..f54dbbc 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void step_cc6b61() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void step_cc6b61() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void step_cc6b61() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.msl
index 8916aa5..380b8c2 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_cc6b61() {
+void step_cc6b61(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_cc6b61();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  step_cc6b61(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_cc6b61();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  step_cc6b61(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_cc6b61();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  step_cc6b61(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.spvasm
index 85451a0..362a0a0 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_cc6b61 "step_cc6b61"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%step_cc6b61 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%step_cc6b61 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %step_cc6b61
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %step_cc6b61
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %step_cc6b61
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %step_cc6b61
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %step_cc6b61
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %step_cc6b61
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.wgsl
index a68542a..46a1893 100644
--- a/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/step/cc6b61.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn step_cc6b61() {
   var res : vec3<f16> = step(vec3<f16>(1.0h), vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_cc6b61();
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl b/test/tint/builtins/gen/literal/step/e2b337.wgsl
index c0c9624..db109e7 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl
@@ -24,7 +24,9 @@
 // fn step(vec<4, f32>, vec<4, f32>) -> vec<4, f32>
 fn step_e2b337() {
   var res: vec4<f32> = step(vec4<f32>(1.f), vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.dxc.hlsl
index 64ad9a1..41846fa 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_e2b337() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.fxc.hlsl
index 64ad9a1..41846fa 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_e2b337() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.glsl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.glsl
index 0349224..28b55f7 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void step_e2b337() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void step_e2b337() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void step_e2b337() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.msl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.msl
index 7be704f..6c0ab1a 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_e2b337() {
+void step_e2b337(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_e2b337();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  step_e2b337(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_e2b337();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  step_e2b337(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_e2b337();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  step_e2b337(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.spvasm
index b70e650..81197f5 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_e2b337 "step_e2b337"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%step_e2b337 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%step_e2b337 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %step_e2b337
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %step_e2b337
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %step_e2b337
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %step_e2b337
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %step_e2b337
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %step_e2b337
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.wgsl
index ca00e44..1843d0a 100644
--- a/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/step/e2b337.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn step_e2b337() {
   var res : vec4<f32> = step(vec4<f32>(1.0f), vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_e2b337();
diff --git a/test/tint/builtins/gen/literal/step/f9b70c.wgsl b/test/tint/builtins/gen/literal/step/f9b70c.wgsl
index 50c33a1..fb10994 100644
--- a/test/tint/builtins/gen/literal/step/f9b70c.wgsl
+++ b/test/tint/builtins/gen/literal/step/f9b70c.wgsl
@@ -25,7 +25,6 @@
 fn step_f9b70c() {
   var res = step(1., 1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_f9b70c();
diff --git a/test/tint/builtins/gen/literal/storageBarrier/d87211.wgsl b/test/tint/builtins/gen/literal/storageBarrier/d87211.wgsl
index 19f8982..f5a56da 100644
--- a/test/tint/builtins/gen/literal/storageBarrier/d87211.wgsl
+++ b/test/tint/builtins/gen/literal/storageBarrier/d87211.wgsl
@@ -25,7 +25,6 @@
 fn storageBarrier_d87211() {
   storageBarrier();
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   storageBarrier_d87211();
diff --git a/test/tint/builtins/gen/literal/tan/244e2a.wgsl b/test/tint/builtins/gen/literal/tan/244e2a.wgsl
index da82991..26fce14 100644
--- a/test/tint/builtins/gen/literal/tan/244e2a.wgsl
+++ b/test/tint/builtins/gen/literal/tan/244e2a.wgsl
@@ -24,7 +24,9 @@
 // fn tan(vec<4, f32>) -> vec<4, f32>
 fn tan_244e2a() {
   var res: vec4<f32> = tan(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.dxc.hlsl
index de05419..20f7a44 100644
--- a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_244e2a() {
   float4 res = (1.55740773677825927734f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.fxc.hlsl
index de05419..20f7a44 100644
--- a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_244e2a() {
   float4 res = (1.55740773677825927734f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.glsl
index 065546b..9ad3e37 100644
--- a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tan_244e2a() {
   vec4 res = vec4(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tan_244e2a() {
   vec4 res = vec4(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tan_244e2a() {
   vec4 res = vec4(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.msl b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.msl
index 72269f4..61d8dd2 100644
--- a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_244e2a() {
+void tan_244e2a(device float4* const tint_symbol_1) {
   float4 res = float4(1.55740773677825927734f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_244e2a();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  tan_244e2a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_244e2a();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  tan_244e2a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_244e2a();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  tan_244e2a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.spvasm
index c22058c..9b24728 100644
--- a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_244e2a "tan_244e2a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_1_55740774 = OpConstant %float 1.55740774
-         %14 = OpConstantComposite %v4float %float_1_55740774 %float_1_55740774 %float_1_55740774 %float_1_55740774
+         %17 = OpConstantComposite %v4float %float_1_55740774 %float_1_55740774 %float_1_55740774 %float_1_55740774
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_244e2a = OpFunction %void None %9
-         %12 = OpLabel
+ %tan_244e2a = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %tan_244e2a
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %tan_244e2a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %tan_244e2a
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %tan_244e2a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tan_244e2a
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tan_244e2a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.wgsl
index afbf82d..554ba16 100644
--- a/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tan/244e2a.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn tan_244e2a() {
   var res : vec4<f32> = tan(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_244e2a();
diff --git a/test/tint/builtins/gen/literal/tan/2f030e.wgsl b/test/tint/builtins/gen/literal/tan/2f030e.wgsl
index c419bfe..726fd5a 100644
--- a/test/tint/builtins/gen/literal/tan/2f030e.wgsl
+++ b/test/tint/builtins/gen/literal/tan/2f030e.wgsl
@@ -24,7 +24,9 @@
 // fn tan(f32) -> f32
 fn tan_2f030e() {
   var res: f32 = tan(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.dxc.hlsl
index 38e7ef5..3dc7acd 100644
--- a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_2f030e() {
   float res = 1.55740773677825927734f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.fxc.hlsl
index 38e7ef5..3dc7acd 100644
--- a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_2f030e() {
   float res = 1.55740773677825927734f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.glsl
index d427fec..ec25ac7 100644
--- a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tan_2f030e() {
   float res = 1.55740773677825927734f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tan_2f030e() {
   float res = 1.55740773677825927734f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tan_2f030e() {
   float res = 1.55740773677825927734f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.msl b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.msl
index 44e8f92..2eec7e1 100644
--- a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_2f030e() {
+void tan_2f030e(device float* const tint_symbol_1) {
   float res = 1.55740773677825927734f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_2f030e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  tan_2f030e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_2f030e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  tan_2f030e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_2f030e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  tan_2f030e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.spvasm
index 22ae6e0..9d959fb 100644
--- a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_2f030e "tan_2f030e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_1_55740774 = OpConstant %float 1.55740774
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_2f030e = OpFunction %void None %9
-         %12 = OpLabel
+ %tan_2f030e = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1_55740774
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %tan_2f030e
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %tan_2f030e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %tan_2f030e
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %tan_2f030e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %tan_2f030e
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %tan_2f030e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.wgsl
index dddd6df..ec1127e 100644
--- a/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tan/2f030e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn tan_2f030e() {
   var res : f32 = tan(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_2f030e();
diff --git a/test/tint/builtins/gen/literal/tan/311400.wgsl b/test/tint/builtins/gen/literal/tan/311400.wgsl
index ccc803b..306cfaf 100644
--- a/test/tint/builtins/gen/literal/tan/311400.wgsl
+++ b/test/tint/builtins/gen/literal/tan/311400.wgsl
@@ -25,7 +25,6 @@
 fn tan_311400() {
   var res = tan(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_311400();
diff --git a/test/tint/builtins/gen/literal/tan/539e54.wgsl b/test/tint/builtins/gen/literal/tan/539e54.wgsl
index ce8f09b..8c9c262 100644
--- a/test/tint/builtins/gen/literal/tan/539e54.wgsl
+++ b/test/tint/builtins/gen/literal/tan/539e54.wgsl
@@ -26,7 +26,9 @@
 // fn tan(vec<4, f16>) -> vec<4, f16>
 fn tan_539e54() {
   var res: vec4<f16> = tan(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.dxc.hlsl
index 805462d..4c654de 100644
--- a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_539e54() {
   vector<float16_t, 4> res = (float16_t(1.556640625h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.fxc.hlsl
index 89aee62..240f5ad 100644
--- a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_539e54() {
   vector<float16_t, 4> res = (float16_t(1.556640625h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.glsl
index 6124538..4342e50 100644
--- a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tan_539e54() {
   f16vec4 res = f16vec4(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tan_539e54() {
   f16vec4 res = f16vec4(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tan_539e54() {
   f16vec4 res = f16vec4(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.msl b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.msl
index 421f63b..62af54c 100644
--- a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_539e54() {
+void tan_539e54(device half4* const tint_symbol_1) {
   half4 res = half4(1.556640625h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_539e54();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  tan_539e54(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_539e54();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  tan_539e54(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_539e54();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  tan_539e54(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.spvasm
index f4b37a0..81a845f 100644
--- a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_539e54 "tan_539e54"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8e8p_0 = OpConstant %half 0x1.8e8p+0
-         %16 = OpConstantComposite %v4half %half_0x1_8e8p_0 %half_0x1_8e8p_0 %half_0x1_8e8p_0 %half_0x1_8e8p_0
+         %19 = OpConstantComposite %v4half %half_0x1_8e8p_0 %half_0x1_8e8p_0 %half_0x1_8e8p_0 %half_0x1_8e8p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_539e54 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+ %tan_539e54 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %tan_539e54
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %tan_539e54
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tan_539e54
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tan_539e54
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %tan_539e54
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %tan_539e54
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.wgsl
index 7554cbe..782d2cc 100644
--- a/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tan/539e54.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn tan_539e54() {
   var res : vec4<f16> = tan(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_539e54();
diff --git a/test/tint/builtins/gen/literal/tan/7be368.wgsl b/test/tint/builtins/gen/literal/tan/7be368.wgsl
index 3fde5d1..c09cb1b 100644
--- a/test/tint/builtins/gen/literal/tan/7be368.wgsl
+++ b/test/tint/builtins/gen/literal/tan/7be368.wgsl
@@ -25,7 +25,6 @@
 fn tan_7be368() {
   var res = tan(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_7be368();
diff --git a/test/tint/builtins/gen/literal/tan/7ea104.wgsl b/test/tint/builtins/gen/literal/tan/7ea104.wgsl
index 33512ca..2494dad 100644
--- a/test/tint/builtins/gen/literal/tan/7ea104.wgsl
+++ b/test/tint/builtins/gen/literal/tan/7ea104.wgsl
@@ -24,7 +24,9 @@
 // fn tan(vec<3, f32>) -> vec<3, f32>
 fn tan_7ea104() {
   var res: vec3<f32> = tan(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.dxc.hlsl
index 80c489c..9aa871f 100644
--- a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_7ea104() {
   float3 res = (1.55740773677825927734f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.fxc.hlsl
index 80c489c..9aa871f 100644
--- a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_7ea104() {
   float3 res = (1.55740773677825927734f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.glsl
index bddb74b..44c145d 100644
--- a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tan_7ea104() {
   vec3 res = vec3(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tan_7ea104() {
   vec3 res = vec3(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tan_7ea104() {
   vec3 res = vec3(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.msl b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.msl
index 3de5a44..a7fdc19 100644
--- a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_7ea104() {
+void tan_7ea104(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.55740773677825927734f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_7ea104();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  tan_7ea104(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_7ea104();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  tan_7ea104(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_7ea104();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  tan_7ea104(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.spvasm
index 35d875b..d55c61c 100644
--- a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_7ea104 "tan_7ea104"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_1_55740774 = OpConstant %float 1.55740774
-         %15 = OpConstantComposite %v3float %float_1_55740774 %float_1_55740774 %float_1_55740774
+         %18 = OpConstantComposite %v3float %float_1_55740774 %float_1_55740774 %float_1_55740774
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_7ea104 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+ %tan_7ea104 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %tan_7ea104
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %tan_7ea104
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %tan_7ea104
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %tan_7ea104
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tan_7ea104
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tan_7ea104
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.wgsl
index c062843..5ef54b7 100644
--- a/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tan/7ea104.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn tan_7ea104() {
   var res : vec3<f32> = tan(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_7ea104();
diff --git a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl
index 6ee1522..1b2d2e2b 100644
--- a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl
+++ b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl
@@ -24,7 +24,9 @@
 // fn tan(vec<2, f32>) -> vec<2, f32>
 fn tan_8ce3e9() {
   var res: vec2<f32> = tan(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.dxc.hlsl
index 1697a91..14d72fc 100644
--- a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_8ce3e9() {
   float2 res = (1.55740773677825927734f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.fxc.hlsl
index 1697a91..14d72fc 100644
--- a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_8ce3e9() {
   float2 res = (1.55740773677825927734f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.glsl
index eede9b1..262f03a 100644
--- a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tan_8ce3e9() {
   vec2 res = vec2(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tan_8ce3e9() {
   vec2 res = vec2(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tan_8ce3e9() {
   vec2 res = vec2(1.55740773677825927734f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.msl b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.msl
index 6847444..1575e71 100644
--- a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_8ce3e9() {
+void tan_8ce3e9(device float2* const tint_symbol_1) {
   float2 res = float2(1.55740773677825927734f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_8ce3e9();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  tan_8ce3e9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_8ce3e9();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  tan_8ce3e9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_8ce3e9();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  tan_8ce3e9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.spvasm
index beaa457..c32f637 100644
--- a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_8ce3e9 "tan_8ce3e9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_1_55740774 = OpConstant %float 1.55740774
-         %15 = OpConstantComposite %v2float %float_1_55740774 %float_1_55740774
+         %18 = OpConstantComposite %v2float %float_1_55740774 %float_1_55740774
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_8ce3e9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+ %tan_8ce3e9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %tan_8ce3e9
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %tan_8ce3e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %tan_8ce3e9
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %tan_8ce3e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tan_8ce3e9
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tan_8ce3e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.wgsl
index b0d2159..1ed3c69 100644
--- a/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tan/8ce3e9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn tan_8ce3e9() {
   var res : vec2<f32> = tan(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_8ce3e9();
diff --git a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl
index a222cb8..748790f 100644
--- a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl
+++ b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl
@@ -26,7 +26,9 @@
 // fn tan(vec<2, f16>) -> vec<2, f16>
 fn tan_9f7c9c() {
   var res: vec2<f16> = tan(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.dxc.hlsl
index d4214b6..a851a32 100644
--- a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_9f7c9c() {
   vector<float16_t, 2> res = (float16_t(1.556640625h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.fxc.hlsl
index 943ef23..5680ec6 100644
--- a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_9f7c9c() {
   vector<float16_t, 2> res = (float16_t(1.556640625h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.glsl
index 8535660..40f9545 100644
--- a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tan_9f7c9c() {
   f16vec2 res = f16vec2(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tan_9f7c9c() {
   f16vec2 res = f16vec2(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tan_9f7c9c() {
   f16vec2 res = f16vec2(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.msl b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.msl
index c34a6af..a830aa5 100644
--- a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_9f7c9c() {
+void tan_9f7c9c(device half2* const tint_symbol_1) {
   half2 res = half2(1.556640625h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_9f7c9c();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  tan_9f7c9c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_9f7c9c();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  tan_9f7c9c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_9f7c9c();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  tan_9f7c9c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.spvasm
index 498bb06..b2a0d98 100644
--- a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_9f7c9c "tan_9f7c9c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8e8p_0 = OpConstant %half 0x1.8e8p+0
-         %16 = OpConstantComposite %v2half %half_0x1_8e8p_0 %half_0x1_8e8p_0
+         %19 = OpConstantComposite %v2half %half_0x1_8e8p_0 %half_0x1_8e8p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_9f7c9c = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+ %tan_9f7c9c = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %tan_9f7c9c
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %tan_9f7c9c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tan_9f7c9c
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tan_9f7c9c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %tan_9f7c9c
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %tan_9f7c9c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.wgsl
index f06c471..83aa837 100644
--- a/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tan/9f7c9c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn tan_9f7c9c() {
   var res : vec2<f16> = tan(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_9f7c9c();
diff --git a/test/tint/builtins/gen/literal/tan/a0966f.wgsl b/test/tint/builtins/gen/literal/tan/a0966f.wgsl
index 2074ffa..eace36c 100644
--- a/test/tint/builtins/gen/literal/tan/a0966f.wgsl
+++ b/test/tint/builtins/gen/literal/tan/a0966f.wgsl
@@ -25,7 +25,6 @@
 fn tan_a0966f() {
   var res = tan(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_a0966f();
diff --git a/test/tint/builtins/gen/literal/tan/ae26ae.wgsl b/test/tint/builtins/gen/literal/tan/ae26ae.wgsl
index a658402..29c4215 100644
--- a/test/tint/builtins/gen/literal/tan/ae26ae.wgsl
+++ b/test/tint/builtins/gen/literal/tan/ae26ae.wgsl
@@ -25,7 +25,6 @@
 fn tan_ae26ae() {
   var res = tan(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_ae26ae();
diff --git a/test/tint/builtins/gen/literal/tan/d4d491.wgsl b/test/tint/builtins/gen/literal/tan/d4d491.wgsl
index 9b0cd1d..b9d69bc 100644
--- a/test/tint/builtins/gen/literal/tan/d4d491.wgsl
+++ b/test/tint/builtins/gen/literal/tan/d4d491.wgsl
@@ -26,7 +26,9 @@
 // fn tan(f16) -> f16
 fn tan_d4d491() {
   var res: f16 = tan(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.dxc.hlsl
index c3bfdc0..f7e7bd1 100644
--- a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_d4d491() {
   float16_t res = float16_t(1.556640625h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.fxc.hlsl
index a71bb3b..fb2c732 100644
--- a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_d4d491() {
   float16_t res = float16_t(1.556640625h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.glsl
index 8c4e402..59446f0 100644
--- a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tan_d4d491() {
   float16_t res = 1.556640625hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tan_d4d491() {
   float16_t res = 1.556640625hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tan_d4d491() {
   float16_t res = 1.556640625hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.msl b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.msl
index f5fb65e..ebffe35 100644
--- a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_d4d491() {
+void tan_d4d491(device half* const tint_symbol_1) {
   half res = 1.556640625h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_d4d491();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  tan_d4d491(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_d4d491();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  tan_d4d491(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_d4d491();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  tan_d4d491(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.spvasm
index 1c6617b..992fc14 100644
--- a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_d4d491 "tan_d4d491"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_8e8p_0 = OpConstant %half 0x1.8e8p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_d4d491 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+ %tan_d4d491 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_8e8p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %tan_d4d491
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %tan_d4d491
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %tan_d4d491
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %tan_d4d491
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %tan_d4d491
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %tan_d4d491
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.wgsl
index 2c01808..19f5b90 100644
--- a/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tan/d4d491.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn tan_d4d491() {
   var res : f16 = tan(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_d4d491();
diff --git a/test/tint/builtins/gen/literal/tan/db0456.wgsl b/test/tint/builtins/gen/literal/tan/db0456.wgsl
index 2afdfa6..5a28d22 100644
--- a/test/tint/builtins/gen/literal/tan/db0456.wgsl
+++ b/test/tint/builtins/gen/literal/tan/db0456.wgsl
@@ -26,7 +26,9 @@
 // fn tan(vec<3, f16>) -> vec<3, f16>
 fn tan_db0456() {
   var res: vec3<f16> = tan(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.dxc.hlsl
index aeb13ad..9151a9c 100644
--- a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_db0456() {
   vector<float16_t, 3> res = (float16_t(1.556640625h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.fxc.hlsl
index 28f3405..ac1c01a 100644
--- a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_db0456() {
   vector<float16_t, 3> res = (float16_t(1.556640625h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.glsl
index 73fa5a0..004d93f 100644
--- a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tan_db0456() {
   f16vec3 res = f16vec3(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tan_db0456() {
   f16vec3 res = f16vec3(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tan_db0456() {
   f16vec3 res = f16vec3(1.556640625hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.msl b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.msl
index 22a16b8..e20956c 100644
--- a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_db0456() {
+void tan_db0456(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.556640625h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_db0456();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  tan_db0456(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_db0456();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  tan_db0456(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_db0456();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  tan_db0456(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.spvasm
index 5452123..e347626 100644
--- a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_db0456 "tan_db0456"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8e8p_0 = OpConstant %half 0x1.8e8p+0
-         %16 = OpConstantComposite %v3half %half_0x1_8e8p_0 %half_0x1_8e8p_0 %half_0x1_8e8p_0
+         %19 = OpConstantComposite %v3half %half_0x1_8e8p_0 %half_0x1_8e8p_0 %half_0x1_8e8p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_db0456 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+ %tan_db0456 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %tan_db0456
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %tan_db0456
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tan_db0456
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tan_db0456
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %tan_db0456
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %tan_db0456
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.wgsl
index 13a6134..b472978 100644
--- a/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tan/db0456.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn tan_db0456() {
   var res : vec3<f16> = tan(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_db0456();
diff --git a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl
index 8a52a4d..3c9cbc2 100644
--- a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl
@@ -26,7 +26,9 @@
 // fn tanh(vec<3, f16>) -> vec<3, f16>
 fn tanh_06a4fe() {
   var res: vec3<f16> = tanh(vec3<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.dxc.hlsl
index 80169a4..1b2dd26 100644
--- a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_06a4fe() {
   vector<float16_t, 3> res = (float16_t(0.76123046875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.fxc.hlsl
index bed8226..986fcf6 100644
--- a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_06a4fe() {
-  vector<float16_t, 3> res = (float16_t(0.761230469h)).xxx;
+  vector<float16_t, 3> res = (float16_t(0.76123046875h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.glsl
index ab71629..0fba5f3 100644
--- a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tanh_06a4fe() {
   f16vec3 res = f16vec3(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tanh_06a4fe() {
   f16vec3 res = f16vec3(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tanh_06a4fe() {
   f16vec3 res = f16vec3(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.msl b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.msl
index 39f6cc3..06362c8 100644
--- a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_06a4fe() {
+void tanh_06a4fe(device packed_half3* const tint_symbol_1) {
   half3 res = half3(0.76123046875h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_06a4fe();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  tanh_06a4fe(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_06a4fe();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  tanh_06a4fe(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_06a4fe();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  tanh_06a4fe(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.spvasm
index 315d386..f2f165f 100644
--- a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_06a4fe "tanh_06a4fe"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_85cpn1 = OpConstant %half 0x1.85cp-1
-         %16 = OpConstantComposite %v3half %half_0x1_85cpn1 %half_0x1_85cpn1 %half_0x1_85cpn1
+         %19 = OpConstantComposite %v3half %half_0x1_85cpn1 %half_0x1_85cpn1 %half_0x1_85cpn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_06a4fe = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%tanh_06a4fe = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %tanh_06a4fe
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %tanh_06a4fe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tanh_06a4fe
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tanh_06a4fe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %tanh_06a4fe
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %tanh_06a4fe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.wgsl
index ecbc835..e2a46f6 100644
--- a/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/06a4fe.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn tanh_06a4fe() {
   var res : vec3<f16> = tanh(vec3<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_06a4fe();
diff --git a/test/tint/builtins/gen/literal/tanh/313aa1.wgsl b/test/tint/builtins/gen/literal/tanh/313aa1.wgsl
index fd8d927..15a6d87 100644
--- a/test/tint/builtins/gen/literal/tanh/313aa1.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/313aa1.wgsl
@@ -25,7 +25,6 @@
 fn tanh_313aa1() {
   var res = tanh(1.);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_313aa1();
diff --git a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl
index 4bbd36a..66d64f3 100644
--- a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl
@@ -24,7 +24,9 @@
 // fn tanh(vec<4, f32>) -> vec<4, f32>
 fn tanh_5663c5() {
   var res: vec4<f32> = tanh(vec4<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.dxc.hlsl
index aa453c1..622670e 100644
--- a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5663c5() {
   float4 res = (0.76159417629241943359f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.fxc.hlsl
index aa453c1..622670e 100644
--- a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5663c5() {
   float4 res = (0.76159417629241943359f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.glsl
index 8adbf50..06285f7 100644
--- a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tanh_5663c5() {
   vec4 res = vec4(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tanh_5663c5() {
   vec4 res = vec4(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tanh_5663c5() {
   vec4 res = vec4(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.msl b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.msl
index 4b57e77..c45b209 100644
--- a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_5663c5() {
+void tanh_5663c5(device float4* const tint_symbol_1) {
   float4 res = float4(0.76159417629241943359f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_5663c5();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  tanh_5663c5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_5663c5();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  tanh_5663c5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_5663c5();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  tanh_5663c5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.spvasm
index 395840f..7c173a6 100644
--- a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_5663c5 "tanh_5663c5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_761594176 = OpConstant %float 0.761594176
-         %14 = OpConstantComposite %v4float %float_0_761594176 %float_0_761594176 %float_0_761594176 %float_0_761594176
+         %17 = OpConstantComposite %v4float %float_0_761594176 %float_0_761594176 %float_0_761594176 %float_0_761594176
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_5663c5 = OpFunction %void None %9
-         %12 = OpLabel
+%tanh_5663c5 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %tanh_5663c5
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %tanh_5663c5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %tanh_5663c5
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %tanh_5663c5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tanh_5663c5
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tanh_5663c5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.wgsl
index aff1207..198f7c2 100644
--- a/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/5663c5.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn tanh_5663c5() {
   var res : vec4<f32> = tanh(vec4<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_5663c5();
diff --git a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl
index a937558..53fd962 100644
--- a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl
@@ -24,7 +24,9 @@
 // fn tanh(vec<2, f32>) -> vec<2, f32>
 fn tanh_5724b3() {
   var res: vec2<f32> = tanh(vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.dxc.hlsl
index b83cf25..e395adb 100644
--- a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5724b3() {
   float2 res = (0.76159417629241943359f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.fxc.hlsl
index b83cf25..e395adb 100644
--- a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5724b3() {
   float2 res = (0.76159417629241943359f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.glsl
index 506ecf9..2afea7d 100644
--- a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tanh_5724b3() {
   vec2 res = vec2(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tanh_5724b3() {
   vec2 res = vec2(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tanh_5724b3() {
   vec2 res = vec2(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.msl b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.msl
index bebf870..6f2299e 100644
--- a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_5724b3() {
+void tanh_5724b3(device float2* const tint_symbol_1) {
   float2 res = float2(0.76159417629241943359f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_5724b3();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  tanh_5724b3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_5724b3();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  tanh_5724b3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_5724b3();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  tanh_5724b3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.spvasm
index 3159ae3..0270d1a 100644
--- a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_5724b3 "tanh_5724b3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_761594176 = OpConstant %float 0.761594176
-         %15 = OpConstantComposite %v2float %float_0_761594176 %float_0_761594176
+         %18 = OpConstantComposite %v2float %float_0_761594176 %float_0_761594176
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_5724b3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%tanh_5724b3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %tanh_5724b3
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %tanh_5724b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %tanh_5724b3
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %tanh_5724b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tanh_5724b3
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tanh_5724b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.wgsl
index 9866965..acd524b 100644
--- a/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/5724b3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn tanh_5724b3() {
   var res : vec2<f32> = tanh(vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_5724b3();
diff --git a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl
index 59d2edc..d061cb8 100644
--- a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl
@@ -26,7 +26,9 @@
 // fn tanh(f16) -> f16
 fn tanh_5b19af() {
   var res: f16 = tanh(1.h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.dxc.hlsl
index 7572be8..2ab44cc 100644
--- a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5b19af() {
   float16_t res = float16_t(0.76123046875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.fxc.hlsl
index 18abfe3..3642a2d 100644
--- a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5b19af() {
-  float16_t res = float16_t(0.761230469h);
+  float16_t res = float16_t(0.76123046875h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.glsl
index 1aff59f..79da781 100644
--- a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tanh_5b19af() {
   float16_t res = 0.76123046875hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tanh_5b19af() {
   float16_t res = 0.76123046875hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tanh_5b19af() {
   float16_t res = 0.76123046875hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.msl b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.msl
index 62d8460..9ab6680 100644
--- a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_5b19af() {
+void tanh_5b19af(device half* const tint_symbol_1) {
   half res = 0.76123046875h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_5b19af();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  tanh_5b19af(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_5b19af();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  tanh_5b19af(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_5b19af();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  tanh_5b19af(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.spvasm
index 3dc57f3..300547a 100644
--- a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_5b19af "tanh_5b19af"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_85cpn1 = OpConstant %half 0x1.85cp-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_5b19af = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%tanh_5b19af = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1_85cpn1
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %tanh_5b19af
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %tanh_5b19af
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %tanh_5b19af
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %tanh_5b19af
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %tanh_5b19af
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %tanh_5b19af
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.wgsl
index 01e06f4..fbcaf92 100644
--- a/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/5b19af.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn tanh_5b19af() {
   var res : f16 = tanh(1.0h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_5b19af();
diff --git a/test/tint/builtins/gen/literal/tanh/6289fd.wgsl b/test/tint/builtins/gen/literal/tanh/6289fd.wgsl
index 9eccf5b..27ebdd1 100644
--- a/test/tint/builtins/gen/literal/tanh/6289fd.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/6289fd.wgsl
@@ -25,7 +25,6 @@
 fn tanh_6289fd() {
   var res = tanh(vec3(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_6289fd();
diff --git a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl
index c489af8..dc8edd6 100644
--- a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl
@@ -26,7 +26,9 @@
 // fn tanh(vec<2, f16>) -> vec<2, f16>
 fn tanh_6d105a() {
   var res: vec2<f16> = tanh(vec2<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.dxc.hlsl
index 07100ef..154c480 100644
--- a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_6d105a() {
   vector<float16_t, 2> res = (float16_t(0.76123046875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.fxc.hlsl
index 4efdf6b..4f48c56 100644
--- a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_6d105a() {
-  vector<float16_t, 2> res = (float16_t(0.761230469h)).xx;
+  vector<float16_t, 2> res = (float16_t(0.76123046875h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.glsl
index 17e12eb..9a412f2 100644
--- a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tanh_6d105a() {
   f16vec2 res = f16vec2(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tanh_6d105a() {
   f16vec2 res = f16vec2(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tanh_6d105a() {
   f16vec2 res = f16vec2(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.msl b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.msl
index 3a14e28..7d06350 100644
--- a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_6d105a() {
+void tanh_6d105a(device half2* const tint_symbol_1) {
   half2 res = half2(0.76123046875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_6d105a();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  tanh_6d105a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_6d105a();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  tanh_6d105a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_6d105a();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  tanh_6d105a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.spvasm
index 29cb3d3..d439b71 100644
--- a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_6d105a "tanh_6d105a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_85cpn1 = OpConstant %half 0x1.85cp-1
-         %16 = OpConstantComposite %v2half %half_0x1_85cpn1 %half_0x1_85cpn1
+         %19 = OpConstantComposite %v2half %half_0x1_85cpn1 %half_0x1_85cpn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_6d105a = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%tanh_6d105a = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %tanh_6d105a
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %tanh_6d105a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tanh_6d105a
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tanh_6d105a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %tanh_6d105a
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %tanh_6d105a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.wgsl
index 1c6722d..867fdd6 100644
--- a/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/6d105a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn tanh_6d105a() {
   var res : vec2<f16> = tanh(vec2<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_6d105a();
diff --git a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl
index f4712f4..148eb29 100644
--- a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl
@@ -24,7 +24,9 @@
 // fn tanh(vec<3, f32>) -> vec<3, f32>
 fn tanh_9f9fb9() {
   var res: vec3<f32> = tanh(vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.dxc.hlsl
index 36f827b..66e895a 100644
--- a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_9f9fb9() {
   float3 res = (0.76159417629241943359f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.fxc.hlsl
index 36f827b..66e895a 100644
--- a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_9f9fb9() {
   float3 res = (0.76159417629241943359f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.glsl
index 33e666e..4e2aa5b 100644
--- a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tanh_9f9fb9() {
   vec3 res = vec3(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tanh_9f9fb9() {
   vec3 res = vec3(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tanh_9f9fb9() {
   vec3 res = vec3(0.76159417629241943359f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.msl b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.msl
index 0023996..095c60d 100644
--- a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_9f9fb9() {
+void tanh_9f9fb9(device packed_float3* const tint_symbol_1) {
   float3 res = float3(0.76159417629241943359f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_9f9fb9();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  tanh_9f9fb9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_9f9fb9();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  tanh_9f9fb9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_9f9fb9();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  tanh_9f9fb9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.spvasm
index 07dcea7..d8c0a1d 100644
--- a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_9f9fb9 "tanh_9f9fb9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_761594176 = OpConstant %float 0.761594176
-         %15 = OpConstantComposite %v3float %float_0_761594176 %float_0_761594176 %float_0_761594176
+         %18 = OpConstantComposite %v3float %float_0_761594176 %float_0_761594176 %float_0_761594176
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_9f9fb9 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+%tanh_9f9fb9 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %tanh_9f9fb9
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %tanh_9f9fb9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %tanh_9f9fb9
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %tanh_9f9fb9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tanh_9f9fb9
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tanh_9f9fb9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.wgsl
index 29041ab..10923ad 100644
--- a/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/9f9fb9.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn tanh_9f9fb9() {
   var res : vec3<f32> = tanh(vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_9f9fb9();
diff --git a/test/tint/builtins/gen/literal/tanh/ac5d33.wgsl b/test/tint/builtins/gen/literal/tanh/ac5d33.wgsl
index c7a601e..a4e1d99 100644
--- a/test/tint/builtins/gen/literal/tanh/ac5d33.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/ac5d33.wgsl
@@ -25,7 +25,6 @@
 fn tanh_ac5d33() {
   var res = tanh(vec4(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_ac5d33();
diff --git a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl
index 679797f..992aaab 100644
--- a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl
@@ -24,7 +24,9 @@
 // fn tanh(f32) -> f32
 fn tanh_c15fdb() {
   var res: f32 = tanh(1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.dxc.hlsl
index 47810e7..268904f 100644
--- a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_c15fdb() {
   float res = 0.76159417629241943359f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.fxc.hlsl
index 47810e7..268904f 100644
--- a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_c15fdb() {
   float res = 0.76159417629241943359f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.glsl
index 8255524..bc26059 100644
--- a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tanh_c15fdb() {
   float res = 0.76159417629241943359f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tanh_c15fdb() {
   float res = 0.76159417629241943359f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tanh_c15fdb() {
   float res = 0.76159417629241943359f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.msl b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.msl
index 1666182..f63cb3e 100644
--- a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_c15fdb() {
+void tanh_c15fdb(device float* const tint_symbol_1) {
   float res = 0.76159417629241943359f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_c15fdb();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  tanh_c15fdb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_c15fdb();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  tanh_c15fdb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_c15fdb();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  tanh_c15fdb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.spvasm
index 4f9122c..1c36c3d 100644
--- a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_c15fdb "tanh_c15fdb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_761594176 = OpConstant %float 0.761594176
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_c15fdb = OpFunction %void None %9
-         %12 = OpLabel
+%tanh_c15fdb = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_0_761594176
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %tanh_c15fdb
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %tanh_c15fdb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %tanh_c15fdb
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %tanh_c15fdb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %tanh_c15fdb
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %tanh_c15fdb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.wgsl
index 799e177..79da3b6 100644
--- a/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/c15fdb.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn tanh_c15fdb() {
   var res : f32 = tanh(1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_c15fdb();
diff --git a/test/tint/builtins/gen/literal/tanh/c48aa6.wgsl b/test/tint/builtins/gen/literal/tanh/c48aa6.wgsl
index 7d9c13f..33eb34a 100644
--- a/test/tint/builtins/gen/literal/tanh/c48aa6.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/c48aa6.wgsl
@@ -25,7 +25,6 @@
 fn tanh_c48aa6() {
   var res = tanh(vec2(1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_c48aa6();
diff --git a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl
index dbb6721..f67f364 100644
--- a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl
@@ -26,7 +26,9 @@
 // fn tanh(vec<4, f16>) -> vec<4, f16>
 fn tanh_e8efb3() {
   var res: vec4<f16> = tanh(vec4<f16>(1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.dxc.hlsl
index 9272ad6..9fd61a4 100644
--- a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_e8efb3() {
   vector<float16_t, 4> res = (float16_t(0.76123046875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.fxc.hlsl
index 2b754b1..343c988 100644
--- a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_e8efb3() {
-  vector<float16_t, 4> res = (float16_t(0.761230469h)).xxxx;
+  vector<float16_t, 4> res = (float16_t(0.76123046875h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.glsl
index c144c38..5fe6d33 100644
--- a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tanh_e8efb3() {
   f16vec4 res = f16vec4(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tanh_e8efb3() {
   f16vec4 res = f16vec4(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tanh_e8efb3() {
   f16vec4 res = f16vec4(0.76123046875hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.msl b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.msl
index abae79e..6b79240 100644
--- a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_e8efb3() {
+void tanh_e8efb3(device half4* const tint_symbol_1) {
   half4 res = half4(0.76123046875h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_e8efb3();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  tanh_e8efb3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_e8efb3();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  tanh_e8efb3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_e8efb3();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  tanh_e8efb3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.spvasm
index 07995e6..534adf1 100644
--- a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_e8efb3 "tanh_e8efb3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_85cpn1 = OpConstant %half 0x1.85cp-1
-         %16 = OpConstantComposite %v4half %half_0x1_85cpn1 %half_0x1_85cpn1 %half_0x1_85cpn1 %half_0x1_85cpn1
+         %19 = OpConstantComposite %v4half %half_0x1_85cpn1 %half_0x1_85cpn1 %half_0x1_85cpn1 %half_0x1_85cpn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_e8efb3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%tanh_e8efb3 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %tanh_e8efb3
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %tanh_e8efb3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tanh_e8efb3
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tanh_e8efb3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %tanh_e8efb3
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %tanh_e8efb3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.wgsl
index 72600d8..230f3c0 100644
--- a/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/tanh/e8efb3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn tanh_e8efb3() {
   var res : vec4<f16> = tanh(vec4<f16>(1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_e8efb3();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl
index 2079209..17ede45 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_multisampled_2d<i32>) -> vec2<u32>
 fn textureDimensions_00348c() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.dxc.hlsl
index e613aa1..855ccf0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_00348c() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.fxc.hlsl
index e613aa1..855ccf0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_00348c() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.glsl
index dd2e0ef..7860031 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_00348c() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_00348c() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_00348c() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.msl
index cf3f493..a1204f5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_00348c(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureDimensions_00348c(texture2d_ms<int, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureDimensions_00348c(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_00348c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_00348c(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_00348c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_00348c(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_00348c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.spvasm
index 5045f2d..6a14db2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_00348c "textureDimensions_00348c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_00348c = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_00348c = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_00348c
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_00348c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_00348c
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_00348c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_00348c
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_00348c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.wgsl
index 17daeec..7ec345a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_00348c() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_00348c();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl
index 3ba9b07..4c3a175 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<i32>, level: u32) -> u32
 fn textureDimensions_022903() {
   var res: u32 = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.dxc.hlsl
index 0b1b94c..ff6f1d3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_022903() {
   int2 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.fxc.hlsl
index 0b1b94c..ff6f1d3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_022903() {
   int2 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.glsl
index 8b4126c..77ee3ef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_022903() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_022903() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_022903() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.msl
index 3f1e8e8..e56ed05 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_022903(texture1d<int, access::sample> tint_symbol_1) {
+void textureDimensions_022903(texture1d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureDimensions_022903(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_022903(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_022903(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_022903(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_022903(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_022903(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.spvasm
index f8430af..775ebef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_022903 "textureDimensions_022903"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_022903 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %uint %19 %uint_1
-               OpStore %res %17
+%textureDimensions_022903 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_022903
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_022903
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_022903
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_022903
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_022903
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_022903
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.wgsl
index c03afca..9190b14 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_022903() {
   var res : u32 = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_022903();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl
index b5607ec..2522675 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<f32>, level: u32) -> vec3<u32>
 fn textureDimensions_0890c6() {
   var res: vec3<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
index 074fc44..91d2ebf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0890c6() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
index 074fc44..91d2ebf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0890c6() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.glsl
index 0f895c4..20c7bb2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_0890c6() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_0890c6() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_0890c6() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.msl
index 2be4142..534d694 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_0890c6(texture3d<float, access::sample> tint_symbol_1) {
+void textureDimensions_0890c6(texture3d<float, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureDimensions_0890c6(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_0890c6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_0890c6(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_0890c6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_0890c6(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_0890c6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.spvasm
index 4688852..3a90f0f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_0890c6 "textureDimensions_0890c6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,42 +42,50 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_0890c6 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v3uint %19 %uint_1
-               OpStore %res %16
+%textureDimensions_0890c6 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_0890c6
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_0890c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_0890c6
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_0890c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_0890c6
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_0890c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.wgsl
index ab91a24..164de1e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_0890c6() {
   var res : vec3<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_0890c6();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl
index 6a49738..6458d84 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba32uint, write>) -> u32
 fn textureDimensions_09140b() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.dxc.hlsl
index f718b0a..952acac 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_09140b() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.fxc.hlsl
index f718b0a..952acac 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_09140b() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.glsl
index 24162f1..824dfcf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_09140b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_09140b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_09140b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.msl
index 5294978..5811c2f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_09140b(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_09140b(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_09140b(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_09140b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_09140b(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_09140b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_09140b(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_09140b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.spvasm
index f5cdeef..1db4e59 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_09140b "textureDimensions_09140b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,39 +45,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_09140b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_09140b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_09140b
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_09140b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_09140b
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_09140b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_09140b
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_09140b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.wgsl
index a07543a..19513a6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_09140b() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_09140b();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl
index c3117f5..4c8cb77 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<r32float, write>) -> vec2<u32>
 fn textureDimensions_0baa0d() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
index b1a4736..3348dc8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0baa0d() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
index b1a4736..3348dc8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0baa0d() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.glsl
index 52bbc21..2586d8f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_0baa0d() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_0baa0d() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_0baa0d() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.msl
index 3776c05..165cb68 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_0baa0d(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_0baa0d(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_0baa0d(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_0baa0d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_0baa0d(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_0baa0d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_0baa0d(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_0baa0d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.spvasm
index f1c67a7..2dee716 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_0baa0d "textureDimensions_0baa0d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_0baa0d = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_0baa0d = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_0baa0d
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_0baa0d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_0baa0d
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_0baa0d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_0baa0d
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_0baa0d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.wgsl
index 8099e09..35d4e6e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_0baa0d() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_0baa0d();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl
index 79bc102..52c419e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba16float, write>) -> u32
 fn textureDimensions_0c0b0c() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
index 5fb29dc..5782c8b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0c0b0c() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
index 5fb29dc..5782c8b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0c0b0c() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.glsl
index 21af8e8..5dc6e8a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_0c0b0c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_0c0b0c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_0c0b0c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.msl
index c100b1a..51203b8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_0c0b0c(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_0c0b0c(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_0c0b0c(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_0c0b0c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_0c0b0c(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_0c0b0c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_0c0b0c(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_0c0b0c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.spvasm
index 8ae986f..2a0cc16 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_0c0b0c "textureDimensions_0c0b0c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_0c0b0c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_0c0b0c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_0c0b0c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_0c0b0c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_0c0b0c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_0c0b0c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_0c0b0c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_0c0b0c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.wgsl
index c7aab96..2849ca8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_0c0b0c() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_0c0b0c();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl
index ad676cf..91e06d9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2<u32>
 fn textureDimensions_0ff9a4() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
index b875a29..e5d136c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0ff9a4() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
index b875a29..e5d136c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0ff9a4() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.msl
index b0dbfa8..fee9661 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_0ff9a4(depthcube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_0ff9a4(depthcube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_0ff9a4(tint_symbol_2);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_0ff9a4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_0ff9a4(tint_symbol_4);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_0ff9a4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_0ff9a4(tint_symbol_5);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_0ff9a4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.spvasm
index fde44a0..66fec87 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_0ff9a4 "textureDimensions_0ff9a4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,45 +43,53 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_0ff9a4 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_1
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_0ff9a4 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_0ff9a4
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_0ff9a4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_0ff9a4
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_0ff9a4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_0ff9a4
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_0ff9a4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.wgsl
index db58ccd..8848ac5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_0ff9a4() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_0ff9a4();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl
index 7a6d2dd..d477656 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<f32>, level: u32) -> vec2<u32>
 fn textureDimensions_13f8db() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
index 45be9cb..77489a8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_13f8db() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
index 45be9cb..77489a8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_13f8db() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.glsl
index 71b1703..7f291bc5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_13f8db() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_13f8db() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_13f8db() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.msl
index cdb8b6a..a30ebc3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_13f8db(texture2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_13f8db(texture2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_13f8db(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_13f8db(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_13f8db(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_13f8db(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_13f8db(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_13f8db(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.spvasm
index 912c616..30f2a68 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_13f8db "textureDimensions_13f8db"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,42 +42,50 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_13f8db = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %uint_1
-               OpStore %res %16
+%textureDimensions_13f8db = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_13f8db
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_13f8db
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_13f8db
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_13f8db
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_13f8db
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_13f8db
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.wgsl
index 95f880c..a41ef6e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_13f8db() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_13f8db();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl
index baeaac6..eeddc11 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba16sint, write>) -> vec2<u32>
 fn textureDimensions_1417dd() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
index 9b7349f..dfe4130 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1417dd() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
index 9b7349f..dfe4130 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1417dd() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.glsl
index 6b2d3bb..7b85b79 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1417dd() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1417dd() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1417dd() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.msl
index 297b49a..8300973 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_1417dd(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_1417dd(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_1417dd(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_1417dd(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_1417dd(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_1417dd(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_1417dd(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_1417dd(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.spvasm
index c7a3eae..f7a2035 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_1417dd "textureDimensions_1417dd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_1417dd = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_1417dd = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_1417dd
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_1417dd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_1417dd
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_1417dd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_1417dd
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_1417dd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.wgsl
index 430451d..d4cc637 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_1417dd() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_1417dd();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl
index 953249a..49fd55f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba32sint, write>) -> vec3<u32>
 fn textureDimensions_15aa17() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
index 06e4e9c..1dacd60 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_15aa17() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
index 06e4e9c..1dacd60 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_15aa17() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.glsl
index da990e4..fbaf29e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_15aa17() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_15aa17() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_15aa17() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.msl
index 147cf4e..48288f6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_15aa17(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_15aa17(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_15aa17(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_15aa17(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_15aa17(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_15aa17(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_15aa17(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_15aa17(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.spvasm
index 4201163..94c7bd8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_15aa17 "textureDimensions_15aa17"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_15aa17 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_15aa17 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_15aa17
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_15aa17
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_15aa17
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_15aa17
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_15aa17
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_15aa17
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.wgsl
index 2f28d1f..151d25a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_15aa17() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_15aa17();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl
index ffd1378..3c7062b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<u32>, level: i32) -> vec2<u32>
 fn textureDimensions_15b577() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.dxc.hlsl
index fc8b923..02393a4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_15b577() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.fxc.hlsl
index fc8b923..02393a4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_15b577() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.glsl
index 3156467..b0b845e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_15b577() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_15b577() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_15b577() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.msl
index 4283f9b..a61eb4d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_15b577(texture2d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_15b577(texture2d<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_15b577(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_15b577(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_15b577(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_15b577(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_15b577(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_15b577(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.spvasm
index 5eeed16..d9aaa06 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_15b577 "textureDimensions_15b577"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_15b577 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %19 %int_1
-               OpStore %res %17
+%textureDimensions_15b577 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_15b577
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_15b577
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_15b577
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_15b577
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_15b577
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_15b577
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.wgsl
index ea67f39..4f932dc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_15b577() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_15b577();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl
index 88a2b21..8da75d6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<i32>) -> vec3<u32>
 fn textureDimensions_1a2be7() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
index 091179b..da22afe 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1a2be7() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
index 091179b..da22afe 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1a2be7() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.glsl
index 70c2d4c..62f0f66 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1a2be7() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1a2be7() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1a2be7() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.msl
index 94c6aef..15b42d5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_1a2be7(texture3d<int, access::sample> tint_symbol_1) {
+void textureDimensions_1a2be7(texture3d<int, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureDimensions_1a2be7(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_1a2be7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_1a2be7(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_1a2be7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_1a2be7(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_1a2be7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.spvasm
index 4c04ebf..a973947 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_1a2be7 "textureDimensions_1a2be7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_0 = OpConstant %int 0
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_1a2be7 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v3uint %20 %int_0
-               OpStore %res %17
+%textureDimensions_1a2be7 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %23 %int_0
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_1a2be7
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_1a2be7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_1a2be7
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_1a2be7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_1a2be7
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_1a2be7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.wgsl
index 6a5396a..0121d1e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_1a2be7() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_1a2be7();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl
index b38e463..42b52eb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<f32>, level: i32) -> vec3<u32>
 fn textureDimensions_1bc428() {
   var res: vec3<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
index a50ab85..67d98e5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1bc428() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
index a50ab85..67d98e5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1bc428() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.glsl
index 9936f9b..c414ba8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1bc428() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1bc428() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1bc428() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.msl
index 17aa025..aa215a8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_1bc428(texture3d<float, access::sample> tint_symbol_1) {
+void textureDimensions_1bc428(texture3d<float, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureDimensions_1bc428(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_1bc428(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_1bc428(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_1bc428(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_1bc428(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_1bc428(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.spvasm
index db6f0f9..df3dbaf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_1bc428 "textureDimensions_1bc428"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_1bc428 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v3uint %19 %int_1
-               OpStore %res %16
+%textureDimensions_1bc428 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %22 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_1bc428
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_1bc428
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_1bc428
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_1bc428
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_1bc428
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_1bc428
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.wgsl
index 5f85f95..9c8c7cd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_1bc428() {
   var res : vec3<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_1bc428();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl
index 68b54ae..b6cc2f1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<f32>, level: i32) -> vec2<u32>
 fn textureDimensions_1bd78c() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
index e1d8fd4..7b50f8e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1bd78c() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
index e1d8fd4..7b50f8e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1bd78c() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.glsl
index 394c9ef..ad41e34 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1bd78c() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1bd78c() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1bd78c() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.msl
index eb59208..9c3e584 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_1bd78c(texture2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_1bd78c(texture2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_1bd78c(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_1bd78c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_1bd78c(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_1bd78c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_1bd78c(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_1bd78c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.spvasm
index b8bc3ce..d6bf96d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_1bd78c "textureDimensions_1bd78c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_1bd78c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_1
-               OpStore %res %16
+%textureDimensions_1bd78c = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_1bd78c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_1bd78c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_1bd78c
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_1bd78c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_1bd78c
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_1bd78c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.wgsl
index 7bad57c..9927b9b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_1bd78c() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_1bd78c();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl
index 95d6010..40a18c3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba8unorm, write>) -> vec2<u32>
 fn textureDimensions_224113() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.dxc.hlsl
index 2af1026..09dda04 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_224113() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.fxc.hlsl
index 2af1026..09dda04 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_224113() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.glsl
index 569cec5..ba31e75 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_224113() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_224113() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_224113() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.msl
index a0f1191..494fc83 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_224113(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_224113(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_224113(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_224113(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_224113(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_224113(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_224113(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_224113(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.spvasm
index b9d1190..abe175b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_224113 "textureDimensions_224113"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_224113 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_224113 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_224113
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_224113
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_224113
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_224113
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_224113
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_224113
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.wgsl
index c16b613..a9ae5c4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_224113() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_224113();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl
index 7140918..4e164ea 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<u32>, level: i32) -> vec2<u32>
 fn textureDimensions_22b5b6() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
index 28b2361..62539d3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_22b5b6() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
index 28b2361..62539d3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_22b5b6() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.msl
index b253911..cdefb7c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_22b5b6(texturecube_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_22b5b6(texturecube_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_22b5b6(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_22b5b6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_22b5b6(tint_symbol_4);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_22b5b6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_22b5b6(tint_symbol_5);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_22b5b6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.spvasm
index abc00c1..4534334 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_22b5b6 "textureDimensions_22b5b6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,44 +44,52 @@
          %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_22b5b6 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_1
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_22b5b6 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_22b5b6
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_22b5b6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_22b5b6
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_22b5b6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_22b5b6
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_22b5b6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.wgsl
index 7710c30..dd3797c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_22b5b6() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_22b5b6();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl
index feef6f2..618860b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<f32>) -> vec2<u32>
 fn textureDimensions_24db07() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.dxc.hlsl
index d27a502..3c7a779 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_24db07() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.fxc.hlsl
index d27a502..3c7a779 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_24db07() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.glsl
index b48ef53..ffc3690 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_24db07() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_24db07() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_24db07() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.msl
index 1575e42..7e2ded5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_24db07(texture2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_24db07(texture2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_24db07(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_24db07(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_24db07(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_24db07(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_24db07(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_24db07(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.spvasm
index 855ef0b..163ff10 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_24db07 "textureDimensions_24db07"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_24db07 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_24db07 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_24db07
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_24db07
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_24db07
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_24db07
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_24db07
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_24db07
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.wgsl
index 28f4077..9e72532 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_24db07() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_24db07();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl
index 95cac6e..72f0927 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rg32uint, write>) -> vec2<u32>
 fn textureDimensions_2674d8() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
index b619638..936d0d1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2674d8() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
index b619638..936d0d1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2674d8() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.msl
index b367114..18ce3d7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_2674d8(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_2674d8(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_2674d8(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_2674d8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_2674d8(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_2674d8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_2674d8(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_2674d8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.spvasm
index 3b8b2fe..1cb5bed 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_2674d8 "textureDimensions_2674d8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,42 +45,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_2674d8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_2674d8 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_2674d8
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_2674d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_2674d8
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_2674d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_2674d8
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_2674d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.wgsl
index 2ece5a6..01373b9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_2674d8() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_2674d8();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl
index 56b19de..46df95b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<f32>) -> u32
 fn textureDimensions_26d6bf() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
index 3de8d27..8786629 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_26d6bf() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
index 3de8d27..8786629 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_26d6bf() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.glsl
index fe3f7ba..d1c34e3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_26d6bf() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_26d6bf() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_26d6bf() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.msl
index d8130b4..e77f8e6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_26d6bf(texture1d<float, access::sample> tint_symbol_1) {
+void textureDimensions_26d6bf(texture1d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureDimensions_26d6bf(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_26d6bf(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_26d6bf(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_26d6bf(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_26d6bf(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_26d6bf(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.spvasm
index 47116b8..a6909e8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_26d6bf "textureDimensions_26d6bf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_26d6bf = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %uint %18 %int_0
-               OpStore %res %16
+%textureDimensions_26d6bf = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySizeLod %uint %21 %int_0
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_26d6bf
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_26d6bf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_26d6bf
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_26d6bf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_26d6bf
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_26d6bf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.wgsl
index ba2a96a..7711feb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_26d6bf() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_26d6bf();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl
index 8457bc5..198fa2c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<i32>, level: i32) -> vec2<u32>
 fn textureDimensions_2e443d() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
index 9760281..b3f97bd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2e443d() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
index 9760281..b3f97bd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2e443d() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.glsl
index f85f6a7..1ae32a1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2e443d() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2e443d() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2e443d() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.msl
index 5ae0332..8268ab7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_2e443d(texture2d<int, access::sample> tint_symbol_1) {
+void textureDimensions_2e443d(texture2d<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureDimensions_2e443d(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_2e443d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_2e443d(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_2e443d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_2e443d(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_2e443d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.spvasm
index 7bef763..9c19615 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_2e443d "textureDimensions_2e443d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_2e443d = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %20 %int_1
-               OpStore %res %17
+%textureDimensions_2e443d = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v2uint %23 %int_1
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_2e443d
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_2e443d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_2e443d
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_2e443d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_2e443d
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_2e443d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.wgsl
index 50d05a9..3cde3c6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_2e443d() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_2e443d();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl
index 2b7fc26..65a3f12 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<f32>, level: i32) -> vec2<u32>
 fn textureDimensions_2fd2a4() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
index 00bd752..f1aa2f0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2fd2a4() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
index 00bd752..f1aa2f0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2fd2a4() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.glsl
index 10ce5b5..ffee698 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2fd2a4() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2fd2a4() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2fd2a4() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.msl
index c6c33ec..10788b6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_2fd2a4(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_2fd2a4(texture2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_2fd2a4(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_2fd2a4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_2fd2a4(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_2fd2a4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_2fd2a4(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_2fd2a4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.spvasm
index b64c7b2..e16275e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_2fd2a4 "textureDimensions_2fd2a4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_2fd2a4 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_1
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_2fd2a4 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_2fd2a4
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_2fd2a4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_2fd2a4
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_2fd2a4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_2fd2a4
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_2fd2a4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.wgsl
index 873be75..847a9f0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_2fd2a4() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_2fd2a4();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl
index ac10c7f..393d422 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<r32uint, write>) -> vec3<u32>
 fn textureDimensions_31799c() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.dxc.hlsl
index 35f842f..e3e5922 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_31799c() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.fxc.hlsl
index 35f842f..e3e5922 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_31799c() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.glsl
index f9e44f9..5a96619 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_31799c() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_31799c() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_31799c() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.msl
index 2636a9f..25b88c9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_31799c(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_31799c(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_31799c(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_31799c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_31799c(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_31799c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_31799c(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_31799c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.spvasm
index 95189a1..186b288 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_31799c "textureDimensions_31799c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_31799c = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_31799c = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_31799c
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_31799c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_31799c
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_31799c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_31799c
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_31799c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.wgsl
index 9fdcfa9..5c8505b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_31799c() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_31799c();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl
index aac258e..2df76a5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<u32>, level: u32) -> vec2<u32>
 fn textureDimensions_346fee() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.dxc.hlsl
index 9013e3c..ecae695d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_346fee() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.fxc.hlsl
index 9013e3c..ecae695d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_346fee() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.msl
index 535a3ce..8b3a674 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_346fee(texturecube_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_346fee(texturecube_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_346fee(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_346fee(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_346fee(tint_symbol_4);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_346fee(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_346fee(tint_symbol_5);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_346fee(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.spvasm
index aa9789f..077493d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_346fee "textureDimensions_346fee"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_346fee = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_346fee = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %uint_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_346fee
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_346fee
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_346fee
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_346fee
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_346fee
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_346fee
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.wgsl
index e8e7746..2906684 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_346fee() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_346fee();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl
index 23512e5..0220042 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba16uint, write>) -> vec3<u32>
 fn textureDimensions_35a7e5() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
index 89ff223..605aec4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_35a7e5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
index 89ff223..605aec4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_35a7e5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.glsl
index 02d2d30..dbbeaeef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_35a7e5() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_35a7e5() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_35a7e5() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.msl
index 5e7177a..5b89c7d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_35a7e5(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_35a7e5(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_35a7e5(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_35a7e5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_35a7e5(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_35a7e5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_35a7e5(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_35a7e5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.spvasm
index 9c6fd1b..6eebebf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_35a7e5 "textureDimensions_35a7e5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_35a7e5 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_35a7e5 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_35a7e5
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_35a7e5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_35a7e5
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_35a7e5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_35a7e5
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_35a7e5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.wgsl
index bea8f76..c0733f8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_35a7e5() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_35a7e5();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl
index b63e75f..1b79473 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rg32uint, write>) -> vec3<u32>
 fn textureDimensions_35ee69() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
index 9880c32..60a836b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_35ee69() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
index 9880c32..60a836b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_35ee69() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.msl
index de21a7c..14b224f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_35ee69(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_35ee69(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_35ee69(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_35ee69(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_35ee69(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_35ee69(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_35ee69(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_35ee69(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.spvasm
index 492a8e3..8fbfc75 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_35ee69 "textureDimensions_35ee69"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_35ee69 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_35ee69 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_35ee69
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_35ee69
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_35ee69
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_35ee69
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_35ee69
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_35ee69
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.wgsl
index 3a1050d..1734c8e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_35ee69() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_35ee69();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl
index b0ce2cc..fc40cdf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba8sint, write>) -> vec2<u32>
 fn textureDimensions_378a65() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.dxc.hlsl
index 1782677..ae34c64 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_378a65() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.fxc.hlsl
index 1782677..ae34c64 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_378a65() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.glsl
index 54d2060..443adeb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_378a65() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_378a65() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_378a65() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.msl
index 8db7c6e..850ec83 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_378a65(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_378a65(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_378a65(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_378a65(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_378a65(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_378a65(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_378a65(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_378a65(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.spvasm
index e2429ce..f302b75 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_378a65 "textureDimensions_378a65"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_378a65 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_378a65 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_378a65
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_378a65
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_378a65
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_378a65
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_378a65
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_378a65
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.wgsl
index 0400b2f..b40dee3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_378a65() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_378a65();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl
index ded6da2..1702046 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<f32>, level: u32) -> vec2<u32>
 fn textureDimensions_382b16() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.dxc.hlsl
index 05d0f91..345d5e3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_382b16() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.fxc.hlsl
index 05d0f91..345d5e3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_382b16() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.glsl
index 0504b8f..3f0107c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_382b16() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_382b16() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_382b16() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.msl
index b3b12bf..353e829 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_382b16(texturecube<float, access::sample> tint_symbol_1) {
+void textureDimensions_382b16(texturecube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
-  textureDimensions_382b16(tint_symbol_2);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_382b16(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_382b16(tint_symbol_4);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_382b16(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_382b16(tint_symbol_5);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_382b16(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.spvasm
index 122abf6..5d38440 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_382b16 "textureDimensions_382b16"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,42 +42,50 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_382b16 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %uint_1
-               OpStore %res %16
+%textureDimensions_382b16 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_382b16
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_382b16
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_382b16
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_382b16
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_382b16
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_382b16
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.wgsl
index 28c3a2c..67fbdde 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_382b16() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_382b16();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl
index cbd3c9d..8b6a2c7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<i32>, level: u32) -> vec2<u32>
 fn textureDimensions_3963d0() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
index 25b47dc..db86ea3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3963d0() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
index 25b47dc..db86ea3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3963d0() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.msl
index a4aa7f7..cf31058 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3963d0(texturecube_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_3963d0(texturecube_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_3963d0(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3963d0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3963d0(tint_symbol_4);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3963d0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3963d0(tint_symbol_5);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3963d0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.spvasm
index 1bb43d6..38f161f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3963d0 "textureDimensions_3963d0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,44 +44,52 @@
          %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3963d0 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySizeLod %v3uint %22 %uint_1
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_3963d0 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySizeLod %v3uint %25 %uint_1
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_3963d0
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_3963d0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_3963d0
+%fragment_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_3963d0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_3963d0
+%compute_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_3963d0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.wgsl
index 4c24f17..a62b576 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3963d0() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3963d0();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl
index 941dd1f..aa8f816 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba32float, write>) -> vec3<u32>
 fn textureDimensions_3a5bb1() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
index 634df9f..9c61cb5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3a5bb1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
index 634df9f..9c61cb5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3a5bb1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.glsl
index ca53343..2ee9f6d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_3a5bb1() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_3a5bb1() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_3a5bb1() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.msl
index 0b128b7..cf5d00a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3a5bb1(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_3a5bb1(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_3a5bb1(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_3a5bb1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3a5bb1(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3a5bb1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3a5bb1(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3a5bb1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.spvasm
index c804df1..bc431a6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3a5bb1 "textureDimensions_3a5bb1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3a5bb1 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_3a5bb1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_3a5bb1
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_3a5bb1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_3a5bb1
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_3a5bb1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_3a5bb1
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_3a5bb1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.wgsl
index 16c8913..0542029 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3a5bb1() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3a5bb1();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl
index ad105d4..876943d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba8unorm, write>) -> vec2<u32>
 fn textureDimensions_3a7b69() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
index c967a1f..f0d9399 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3a7b69() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
index c967a1f..f0d9399 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3a7b69() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.glsl
index b9b2a19..6137b7c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3a7b69() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3a7b69() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3a7b69() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.msl
index 113dca5..952bf08 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3a7b69(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_3a7b69(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_3a7b69(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3a7b69(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3a7b69(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3a7b69(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3a7b69(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3a7b69(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.spvasm
index 8dbeda7..ae8c17a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3a7b69 "textureDimensions_3a7b69"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3a7b69 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_3a7b69 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_3a7b69
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_3a7b69
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_3a7b69
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_3a7b69
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_3a7b69
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_3a7b69
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.wgsl
index 7267529..1f59f9f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3a7b69() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3a7b69();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl
index 3b115bd..c999d1b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba8unorm, write>) -> u32
 fn textureDimensions_3af3e7() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
index fd65762..07dc5bf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3af3e7() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
index fd65762..07dc5bf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3af3e7() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.glsl
index 5d059f4..c77a899 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_3af3e7() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_3af3e7() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_3af3e7() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.msl
index 3623ce7..9078302 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3af3e7(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_3af3e7(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_3af3e7(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_3af3e7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3af3e7(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3af3e7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3af3e7(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3af3e7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.spvasm
index 5ab0115..862c830 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3af3e7 "textureDimensions_3af3e7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3af3e7 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_3af3e7 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_3af3e7
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_3af3e7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_3af3e7
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_3af3e7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_3af3e7
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_3af3e7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.wgsl
index 35da220..e499dc2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3af3e7() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3af3e7();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl
index bafaabe..b043233 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_2d) -> vec2<u32>
 fn textureDimensions_3b38f6() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
index 4d33804..d57f3cc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3b38f6() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
index 4d33804..d57f3cc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3b38f6() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.glsl
index 129932f..c7c38ee 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3b38f6() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3b38f6() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3b38f6() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.msl
index 4e768f8..c9baf45 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3b38f6(depth2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_3b38f6(depth2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_3b38f6(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3b38f6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3b38f6(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3b38f6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3b38f6(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3b38f6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.spvasm
index cc00d06..7883a06 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3b38f6 "textureDimensions_3b38f6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3b38f6 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_3b38f6 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_3b38f6
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_3b38f6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_3b38f6
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_3b38f6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_3b38f6
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_3b38f6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.wgsl
index f217d69..11c120d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3b38f6() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3b38f6();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl
index a8563c8..1ed6549a4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba8uint, write>) -> vec2<u32>
 fn textureDimensions_3baab5() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
index 09829f6..3c98fab 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3baab5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
index 09829f6..3c98fab 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3baab5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.glsl
index e5fd931..d2c7609 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3baab5() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3baab5() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3baab5() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.msl
index fabb265..0d775da 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3baab5(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_3baab5(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_3baab5(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3baab5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3baab5(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3baab5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3baab5(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3baab5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.spvasm
index f11c499..36abe71 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3baab5 "textureDimensions_3baab5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3baab5 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_3baab5 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_3baab5
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_3baab5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_3baab5
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_3baab5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_3baab5
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_3baab5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.wgsl
index 35891f4..3cb17ad 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3baab5() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3baab5();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl
index 31fc310..64aa57b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<i32>, level: i32) -> vec2<u32>
 fn textureDimensions_3c66f0() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
index d542da1..822b301 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3c66f0() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
index d542da1..822b301 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3c66f0() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.msl
index 97e45a6..d2b05da 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3c66f0(texturecube_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_3c66f0(texturecube_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_3c66f0(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3c66f0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3c66f0(tint_symbol_4);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3c66f0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3c66f0(tint_symbol_5);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3c66f0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.spvasm
index 8aa3f8d..130006f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3c66f0 "textureDimensions_3c66f0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,44 +44,52 @@
          %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3c66f0 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySizeLod %v3uint %22 %int_1
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_3c66f0 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySizeLod %v3uint %25 %int_1
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_3c66f0
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_3c66f0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_3c66f0
+%fragment_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_3c66f0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_3c66f0
+%compute_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_3c66f0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.wgsl
index 7b1e56e..103fce0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3c66f0() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3c66f0();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl
index 4762ddd..e738da5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_multisampled_2d<f32>) -> vec2<u32>
 fn textureDimensions_3f3474() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
index 588227e..c760629 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3f3474() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
index 588227e..c760629 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3f3474() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.glsl
index 91d50d3..3fdde2d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3f3474() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3f3474() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3f3474() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.msl
index 1ab3e70..8de6e4d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3f3474(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureDimensions_3f3474(texture2d_ms<float, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureDimensions_3f3474(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3f3474(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3f3474(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3f3474(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3f3474(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3f3474(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.spvasm
index b9f1b47..8c8a1ca 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3f3474 "textureDimensions_3f3474"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,41 +42,49 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3f3474 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_3f3474 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_3f3474
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_3f3474
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_3f3474
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_3f3474
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_3f3474
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_3f3474
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.wgsl
index d1db5f0..f8459c2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3f3474() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3f3474();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl
index eb8dba1..dd63f30 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<f32>, level: u32) -> vec2<u32>
 fn textureDimensions_3fc3dc() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
index f553980..197585c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3fc3dc() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
index f553980..197585c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3fc3dc() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.glsl
index 05b93eb..6494939 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3fc3dc() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3fc3dc() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3fc3dc() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.msl
index cdb5b1a..90a70fa 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3fc3dc(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_3fc3dc(texture2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_3fc3dc(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3fc3dc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3fc3dc(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3fc3dc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3fc3dc(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3fc3dc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.spvasm
index 9becd97..41c4412 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3fc3dc "textureDimensions_3fc3dc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3fc3dc = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_3fc3dc = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %uint_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_3fc3dc
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_3fc3dc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_3fc3dc
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_3fc3dc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_3fc3dc
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_3fc3dc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.wgsl
index 0d7707e..af1d911 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3fc3dc() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3fc3dc();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl
index 8611ca5..7d3ef2a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba8sint, write>) -> vec3<u32>
 fn textureDimensions_40c671() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.dxc.hlsl
index 74aa4ef..a7b6577 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_40c671() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.fxc.hlsl
index 74aa4ef..a7b6577 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_40c671() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.glsl
index 6494fd0..388ebf9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_40c671() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_40c671() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_40c671() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.msl
index d737668..de2c135 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_40c671(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_40c671(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_40c671(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_40c671(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_40c671(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_40c671(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_40c671(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_40c671(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.spvasm
index c1c8494..86a4c1e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_40c671 "textureDimensions_40c671"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_40c671 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_40c671 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_40c671
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_40c671
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_40c671
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_40c671
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_40c671
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_40c671
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.wgsl
index 3e38a8b..43e9284 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_40c671() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_40c671();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl
index 4b387f5..b791502 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba16uint, write>) -> vec2<u32>
 fn textureDimensions_40ecf4() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
index 76e4032..92a33d2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_40ecf4() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
index 76e4032..92a33d2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_40ecf4() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.glsl
index 8eab55c..6317e7f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_40ecf4() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_40ecf4() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_40ecf4() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.msl
index 1ee450a..0c8d982 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_40ecf4(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_40ecf4(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_40ecf4(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_40ecf4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_40ecf4(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_40ecf4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_40ecf4(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_40ecf4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.spvasm
index ea8ee52..f81134c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_40ecf4 "textureDimensions_40ecf4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_40ecf4 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_40ecf4 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_40ecf4
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_40ecf4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_40ecf4
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_40ecf4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_40ecf4
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_40ecf4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.wgsl
index 5732ee2..f53f416 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_40ecf4() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_40ecf4();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl
index cc79e7c..da4d663 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<r32uint, write>) -> vec2<u32>
 fn textureDimensions_41545f() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.dxc.hlsl
index 6352cad..29c7b39 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_41545f() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.fxc.hlsl
index 6352cad..29c7b39 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_41545f() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.glsl
index 542e625..4eb7836 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_41545f() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_41545f() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_41545f() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.msl
index 6d66d30..f4a8ece 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_41545f(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_41545f(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_41545f(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_41545f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_41545f(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_41545f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_41545f(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_41545f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.spvasm
index e5a2d6d..98e2b28 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_41545f "textureDimensions_41545f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_41545f = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_41545f = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_41545f
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_41545f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_41545f
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_41545f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_41545f
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_41545f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.wgsl
index 119c226..9fff36d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_41545f() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_41545f();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl
index 42b6803..f18c8b4c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rg32sint, write>) -> vec2<u32>
 fn textureDimensions_439651() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.dxc.hlsl
index 5a450e7..0791df3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_439651() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.fxc.hlsl
index 5a450e7..0791df3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_439651() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.msl
index 6c456ef..e0f663e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_439651(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_439651(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_439651(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_439651(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_439651(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_439651(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_439651(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_439651(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.spvasm
index d5f13da..68957a9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_439651 "textureDimensions_439651"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,41 +45,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_439651 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_439651 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_439651
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_439651
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_439651
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_439651
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_439651
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_439651
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.wgsl
index d99bc45..7711de7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_439651() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_439651();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl
index ed4441c..8a726c4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<u32>) -> vec2<u32>
 fn textureDimensions_445376() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.dxc.hlsl
index 1c60935..faac13c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_445376() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.fxc.hlsl
index 1c60935..faac13c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_445376() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.glsl
index 9854fcf..3b24b6b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_445376() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_445376() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_445376() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.msl
index de6d82a..959df4d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_445376(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_445376(texture2d_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_445376(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_445376(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_445376(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_445376(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_445376(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_445376(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.spvasm
index f9cf186..2b24cf5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_445376 "textureDimensions_445376"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_445376 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_445376 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_445376
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_445376
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_445376
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_445376
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_445376
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_445376
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.wgsl
index 9b3d28b..f26606e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_445376() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_445376();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl
index 505488f..d2ec267 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba32uint, write>) -> vec3<u32>
 fn textureDimensions_44b358() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.dxc.hlsl
index 28733d4..15ac4e0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_44b358() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.fxc.hlsl
index 28733d4..15ac4e0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_44b358() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.glsl
index b8140ec..868adcb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_44b358() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_44b358() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_44b358() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.msl
index 3fdd338..ea4c716 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_44b358(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_44b358(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_44b358(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_44b358(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_44b358(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_44b358(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_44b358(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_44b358(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.spvasm
index d3cbbcd..0f50a8e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_44b358 "textureDimensions_44b358"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_44b358 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_44b358 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_44b358
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_44b358
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_44b358
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_44b358
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_44b358
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_44b358
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.wgsl
index de45407..1e9d5da 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_44b358() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_44b358();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl
index a156207..cfd3e23 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba32uint, write>) -> vec2<u32>
 fn textureDimensions_452fc1() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
index 1a21c49..c8fb5c4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_452fc1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
index 1a21c49..c8fb5c4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_452fc1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.glsl
index 7588f6a..4c6f856 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_452fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_452fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_452fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.msl
index 291394f..5497059 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_452fc1(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_452fc1(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_452fc1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_452fc1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_452fc1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_452fc1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_452fc1(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_452fc1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.spvasm
index 4fd3aa9..9f35db0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_452fc1 "textureDimensions_452fc1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_452fc1 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_452fc1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_452fc1
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_452fc1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_452fc1
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_452fc1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_452fc1
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_452fc1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.wgsl
index 5f78af1..a110af1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_452fc1() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_452fc1();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl
index 4fe62b8..89017b0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<f32>) -> vec2<u32>
 fn textureDimensions_46f0fc() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
index f82b087..01626be 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_46f0fc() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
index f82b087..01626be 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_46f0fc() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.glsl
index 8ca5717..fd530f5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_46f0fc() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_46f0fc() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_46f0fc() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.msl
index d085a9b..30095ed 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_46f0fc(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_46f0fc(texture2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_46f0fc(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_46f0fc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_46f0fc(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_46f0fc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_46f0fc(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_46f0fc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.spvasm
index 5847f93..d57b8aa 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_46f0fc "textureDimensions_46f0fc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_46f0fc = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_46f0fc = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_46f0fc
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_46f0fc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_46f0fc
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_46f0fc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_46f0fc
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_46f0fc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.wgsl
index f968df1..2339095 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_46f0fc() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_46f0fc();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl
index cd46de9..8fb8d6e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<f32>, level: i32) -> vec2<u32>
 fn textureDimensions_49a067() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.dxc.hlsl
index 120351c..18e4e05 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_49a067() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.fxc.hlsl
index 120351c..18e4e05 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_49a067() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.glsl
index e9eb025..481072d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_49a067() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_49a067() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_49a067() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.msl
index 9ab7902..44fda42 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_49a067(texturecube<float, access::sample> tint_symbol_1) {
+void textureDimensions_49a067(texturecube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
-  textureDimensions_49a067(tint_symbol_2);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_49a067(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_49a067(tint_symbol_4);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_49a067(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_49a067(tint_symbol_5);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_49a067(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.spvasm
index 52f197e..93d2cef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_49a067 "textureDimensions_49a067"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_49a067 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_1
-               OpStore %res %16
+%textureDimensions_49a067 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_49a067
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_49a067
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_49a067
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_49a067
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_49a067
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_49a067
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.wgsl
index 517c8c3..9287459 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_49a067() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_49a067();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl
index a11f1c8..349c3d3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rg32float, write>) -> vec2<u32>
 fn textureDimensions_4acec7() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
index fcad56d..892ce52 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4acec7() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
index fcad56d..892ce52 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4acec7() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.msl
index 1647a14..04b59fd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_4acec7(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_4acec7(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_4acec7(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_4acec7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_4acec7(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_4acec7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_4acec7(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_4acec7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.spvasm
index de0e0ab..8b93b99 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_4acec7 "textureDimensions_4acec7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_4acec7 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_4acec7 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_4acec7
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_4acec7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_4acec7
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_4acec7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_4acec7
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_4acec7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.wgsl
index 38343eb..1df8546 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_4acec7() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_4acec7();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl
index 5dcc74b..2844dad 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba8unorm, write>) -> vec3<u32>
 fn textureDimensions_4b26ef() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
index 5e783ce..3259dbf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4b26ef() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
index 5e783ce..3259dbf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4b26ef() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.glsl
index e7491ce..b7b0de1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_4b26ef() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_4b26ef() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_4b26ef() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.msl
index 5efcbfa..d7ba783 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_4b26ef(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_4b26ef(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_4b26ef(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_4b26ef(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_4b26ef(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_4b26ef(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_4b26ef(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_4b26ef(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.spvasm
index ab7781f..849045a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_4b26ef "textureDimensions_4b26ef"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_4b26ef = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_4b26ef = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_4b26ef
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_4b26ef
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_4b26ef
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_4b26ef
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_4b26ef
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_4b26ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.wgsl
index c12b60c..edcea5d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_4b26ef() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_4b26ef();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl
index 49432db..27e2033 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<u32>) -> vec2<u32>
 fn textureDimensions_4be71b() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
index bf593db..841ffce 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4be71b() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
index bf593db..841ffce 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4be71b() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.glsl
index 13a1e30..48ba467a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_4be71b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_4be71b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_4be71b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.msl
index 7bbfb11..96a9ea1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_4be71b(texture2d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_4be71b(texture2d<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_4be71b(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_4be71b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_4be71b(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_4be71b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_4be71b(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_4be71b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.spvasm
index 0bbbd21..dbfc315 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_4be71b "textureDimensions_4be71b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_4be71b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %17
+%textureDimensions_4be71b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_4be71b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_4be71b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_4be71b
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_4be71b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_4be71b
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_4be71b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.wgsl
index cea7772..8782231 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_4be71b() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_4be71b();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl
index d40875d..75a1424 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<u32>, level: u32) -> vec2<u32>
 fn textureDimensions_528c0e() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
index bd33bb3..40bb972 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_528c0e() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
index bd33bb3..40bb972 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_528c0e() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.glsl
index 830b87d..4fffbbc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_528c0e() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_528c0e() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_528c0e() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.msl
index d09c8c4..21c5628 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_528c0e(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_528c0e(texture2d_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_528c0e(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_528c0e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_528c0e(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_528c0e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_528c0e(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_528c0e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.spvasm
index bceb8a0..1d6b695 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_528c0e "textureDimensions_528c0e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_528c0e = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_528c0e = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %uint_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_528c0e
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_528c0e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_528c0e
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_528c0e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_528c0e
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_528c0e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.wgsl
index 504ea2f..cb71047 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_528c0e() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_528c0e();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl
index e3e1557..2e35c54 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba16uint, write>) -> u32
 fn textureDimensions_58a82d() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
index 80b2c98..2ed6397 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_58a82d() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
index 80b2c98..2ed6397 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_58a82d() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.glsl
index 735e74e..18d8f1b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_58a82d() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_58a82d() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_58a82d() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.msl
index 34b38cc..08142b4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_58a82d(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_58a82d(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_58a82d(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_58a82d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_58a82d(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_58a82d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_58a82d(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_58a82d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.spvasm
index cc519c7..5aa4216 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_58a82d "textureDimensions_58a82d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,39 +45,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_58a82d = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_58a82d = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_58a82d
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_58a82d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_58a82d
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_58a82d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_58a82d
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_58a82d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.wgsl
index f61f64b..89ffb84 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_58a82d() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_58a82d();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl
index 062e5ad..7748a17 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba16sint, write>) -> vec3<u32>
 fn textureDimensions_591981() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.dxc.hlsl
index 4f3144c..7dfc27c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_591981() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.fxc.hlsl
index 4f3144c..7dfc27c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_591981() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.glsl
index 03a38d7..d9c6003 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_591981() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_591981() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_591981() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.msl
index b80abf1..ff794c9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_591981(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_591981(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_591981(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_591981(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_591981(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_591981(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_591981(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_591981(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.spvasm
index f66c1ef..ad8cddc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_591981 "textureDimensions_591981"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_591981 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_591981 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_591981
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_591981
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_591981
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_591981
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_591981
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_591981
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.wgsl
index 9f1b90b..f54d7e8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_591981() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_591981();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl
index 25708ba..7f8121d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba16float, write>) -> vec2<u32>
 fn textureDimensions_599ab5() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
index 161321e..40179f0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_599ab5() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
index 161321e..40179f0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_599ab5() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.glsl
index e4e61d5..7f5fe21 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_599ab5() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_599ab5() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_599ab5() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.msl
index 9d36a4b..eed79dd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_599ab5(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_599ab5(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_599ab5(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_599ab5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_599ab5(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_599ab5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_599ab5(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_599ab5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.spvasm
index 6a2e7c1..dd4dfe1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_599ab5 "textureDimensions_599ab5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_599ab5 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_599ab5 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_599ab5
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_599ab5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_599ab5
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_599ab5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_599ab5
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_599ab5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.wgsl
index 0607926..ccc869b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_599ab5() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_599ab5();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl
index 59ef53a..7582049 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<bgra8unorm, write>) -> vec3<u32>
 fn textureDimensions_5b4b10() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.dxc.hlsl
index 0222f8e..5c7a574 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_5b4b10() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.fxc.hlsl
index 0222f8e..5c7a574 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_5b4b10() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.glsl
index a572851..bc304ff 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_5b4b10() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_5b4b10() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_5b4b10() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.msl
index 46f9349..3a3a59e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_5b4b10(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_5b4b10(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_5b4b10(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_5b4b10(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_5b4b10(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_5b4b10(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_5b4b10(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_5b4b10(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.spvasm
index 5b813bd..7c7b98c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_5b4b10 "textureDimensions_5b4b10"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_5b4b10 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_5b4b10 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_5b4b10
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_5b4b10
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_5b4b10
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_5b4b10
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_5b4b10
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_5b4b10
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.wgsl
index 6805bbe..afde0ac 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5b4b10.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_5b4b10() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_5b4b10();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl
index b89ffbb..b064a8b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<i32>) -> u32
 fn textureDimensions_5df042() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.dxc.hlsl
index 25b206a..f596ae7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_5df042() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.fxc.hlsl
index 25b206a..f596ae7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_5df042() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.glsl
index 95c45a2..53d46d7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_5df042() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_5df042() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_5df042() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.msl
index c3d1fc2..a3deed2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_5df042(texture1d<int, access::sample> tint_symbol_1) {
+void textureDimensions_5df042(texture1d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureDimensions_5df042(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_5df042(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_5df042(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_5df042(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_5df042(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_5df042(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.spvasm
index 7205a05..8681b78 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_5df042 "textureDimensions_5df042"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_5df042 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %uint %19 %int_0
-               OpStore %res %17
+%textureDimensions_5df042 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %uint %22 %int_0
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_5df042
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_5df042
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_5df042
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_5df042
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_5df042
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_5df042
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.wgsl
index 8e083a2..f71690f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_5df042() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_5df042();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl
index f03cde1..f298d62 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<r32sint, write>) -> u32
 fn textureDimensions_607979() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.dxc.hlsl
index 8fbf889..b95cf0f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_607979() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.fxc.hlsl
index 8fbf889..b95cf0f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_607979() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.glsl
index 2033c18..01d6c50 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_607979() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_607979() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_607979() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.msl
index 360b5a3..b0ebee4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_607979(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_607979(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_607979(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_607979(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_607979(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_607979(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_607979(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_607979(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.spvasm
index d8c6402..afb30ec 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_607979 "textureDimensions_607979"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_607979 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_607979 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_607979
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_607979
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_607979
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_607979
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_607979
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_607979
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.wgsl
index d54a65b..86ad89f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_607979() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_607979();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl
index 7d34ccd..e492cdd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<i32>) -> vec2<u32>
 fn textureDimensions_62cb5a() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
index 9ce8aa4..5804de5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_62cb5a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
index 9ce8aa4..5804de5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_62cb5a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.glsl
index 421af5e..384f794 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_62cb5a() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_62cb5a() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_62cb5a() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.msl
index 8702a25..830f885 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_62cb5a(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_62cb5a(texture2d_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_62cb5a(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_62cb5a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_62cb5a(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_62cb5a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_62cb5a(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_62cb5a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.spvasm
index 622c055..b95e531 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_62cb5a "textureDimensions_62cb5a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_62cb5a = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySizeLod %v3uint %22 %int_0
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_62cb5a = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySizeLod %v3uint %25 %int_0
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_62cb5a
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_62cb5a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_62cb5a
+%fragment_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_62cb5a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_62cb5a
+%compute_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_62cb5a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.wgsl
index 4fd56a7..8280fe3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_62cb5a() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_62cb5a();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl
index 2204379..86aa4d9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<i32>, level: u32) -> vec2<u32>
 fn textureDimensions_64dc74() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
index 9be06d2..f468770 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_64dc74() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
index 9be06d2..f468770 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_64dc74() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.glsl
index 7408687..cbd6bae 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_64dc74() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_64dc74() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_64dc74() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.msl
index 5fa3713..d3aaa73 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_64dc74(texturecube<int, access::sample> tint_symbol_1) {
+void textureDimensions_64dc74(texturecube<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
-  textureDimensions_64dc74(tint_symbol_2);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_64dc74(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_64dc74(tint_symbol_4);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_64dc74(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_64dc74(tint_symbol_5);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_64dc74(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.spvasm
index 6caad5e..6078713 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_64dc74 "textureDimensions_64dc74"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_64dc74 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %20 %uint_1
-               OpStore %res %17
+%textureDimensions_64dc74 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v2uint %23 %uint_1
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_64dc74
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_64dc74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_64dc74
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_64dc74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_64dc74
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_64dc74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.wgsl
index 745bc42..f919302 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_64dc74() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_64dc74();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl
index 5e964b3..89b01f6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<r32sint, write>) -> vec2<u32>
 fn textureDimensions_674058() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.dxc.hlsl
index 9369bd2..83533a7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_674058() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.fxc.hlsl
index 9369bd2..83533a7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_674058() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.glsl
index 7e3dc84..b48d280 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_674058() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_674058() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_674058() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.msl
index 6c86158..02af1ed 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_674058(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_674058(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_674058(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_674058(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_674058(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_674058(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_674058(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_674058(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.spvasm
index b312fbf..6cc571b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_674058 "textureDimensions_674058"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_674058 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_674058 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_674058
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_674058
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_674058
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_674058
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_674058
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_674058
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.wgsl
index 207af65..5000f73 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_674058() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_674058();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl
index 2b66f08..d604d2d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<u32>, level: u32) -> vec3<u32>
 fn textureDimensions_6e6c7a() {
   var res: vec3<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
index 774a29c..189d1cf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_6e6c7a() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
index 774a29c..189d1cf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_6e6c7a() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.glsl
index 410e633..66bc26a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_6e6c7a() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_6e6c7a() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_6e6c7a() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.msl
index a27b937..9c1edab 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_6e6c7a(texture3d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_6e6c7a(texture3d<uint, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_6e6c7a(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_6e6c7a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_6e6c7a(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_6e6c7a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_6e6c7a(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_6e6c7a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.spvasm
index c52215e..2a99a0e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_6e6c7a "textureDimensions_6e6c7a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_6e6c7a = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v3uint %19 %uint_1
-               OpStore %res %17
+%textureDimensions_6e6c7a = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_6e6c7a
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_6e6c7a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_6e6c7a
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_6e6c7a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_6e6c7a
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_6e6c7a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.wgsl
index 1e91b8f..cc2cc81 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_6e6c7a() {
   var res : vec3<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_6e6c7a();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl
index 2743674..c50691b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_2d, level: i32) -> vec2<u32>
 fn textureDimensions_6f1b5d() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
index 2cd49f6..2dc2f80 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_6f1b5d() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
index 2cd49f6..2dc2f80 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_6f1b5d() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.glsl
index 26e95ef..2d58cdc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_6f1b5d() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_6f1b5d() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_6f1b5d() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.msl
index b30d32d..7b69a3e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_6f1b5d(depth2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_6f1b5d(depth2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_6f1b5d(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_6f1b5d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_6f1b5d(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_6f1b5d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_6f1b5d(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_6f1b5d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.spvasm
index bd7a5ed..b9caff7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_6f1b5d "textureDimensions_6f1b5d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_6f1b5d = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_1
-               OpStore %res %16
+%textureDimensions_6f1b5d = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_6f1b5d
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_6f1b5d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_6f1b5d
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_6f1b5d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_6f1b5d
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_6f1b5d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.wgsl
index 78394ba..5e50187 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_6f1b5d() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_6f1b5d();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl
index 48176cf..f3983fe 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<r32uint, write>) -> u32
 fn textureDimensions_7228de() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.dxc.hlsl
index 79216e6..3a11a45 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7228de() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.fxc.hlsl
index 79216e6..3a11a45 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7228de() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.glsl
index 196bd3a..0f21a9a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_7228de() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_7228de() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_7228de() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.msl
index d5d9363..bcac19c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_7228de(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_7228de(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_7228de(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_7228de(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_7228de(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_7228de(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_7228de(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_7228de(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.spvasm
index defd7fb..6381839 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_7228de "textureDimensions_7228de"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,39 +45,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_7228de = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_7228de = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_7228de
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_7228de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_7228de
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_7228de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_7228de
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_7228de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.wgsl
index 6f791d8..258d65b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_7228de() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_7228de();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl
index 921966e..fc87212 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<i32>, level: i32) -> vec3<u32>
 fn textureDimensions_756031() {
   var res: vec3<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.dxc.hlsl
index 28f6ccd..46e387f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_756031() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.fxc.hlsl
index 28f6ccd..46e387f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_756031() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.glsl
index a30d806..43cb364 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_756031() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_756031() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_756031() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.msl
index 15a7d51..5654910 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_756031(texture3d<int, access::sample> tint_symbol_1) {
+void textureDimensions_756031(texture3d<int, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureDimensions_756031(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_756031(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_756031(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_756031(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_756031(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_756031(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.spvasm
index b675dfa..e1d8a9b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_756031 "textureDimensions_756031"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_756031 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v3uint %20 %int_1
-               OpStore %res %17
+%textureDimensions_756031 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %23 %int_1
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_756031
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_756031
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_756031
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_756031
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_756031
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_756031
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.wgsl
index 478da6d..9bd7668 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_756031() {
   var res : vec3<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_756031();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl
index d06fb96..31e411c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<r32float, write>) -> vec2<u32>
 fn textureDimensions_756304() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.dxc.hlsl
index 70b5dc9..204f352 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_756304() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.fxc.hlsl
index 70b5dc9..204f352 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_756304() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.glsl
index a1d9085..17f9f2f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_756304() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_756304() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_756304() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.msl
index 21be296f..19beb5b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_756304(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_756304(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_756304(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_756304(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_756304(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_756304(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_756304(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_756304(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.spvasm
index 2c2eeb3..5acbfc0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_756304 "textureDimensions_756304"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_756304 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_756304 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_756304
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_756304
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_756304
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_756304
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_756304
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_756304
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.wgsl
index 16fcc5c..b87a0d0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_756304() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_756304();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl
index ca43d3c..8229ea4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec2<u32>
 fn textureDimensions_79d168() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.dxc.hlsl
index 864fb0a..df4ec89 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_79d168() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.fxc.hlsl
index 864fb0a..df4ec89 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_79d168() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.glsl
index 31f86e6..7dcdfd9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_79d168() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_79d168() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_79d168() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.msl
index 80c59c5..18b8142 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_79d168(depthcube<float, access::sample> tint_symbol_1) {
+void textureDimensions_79d168(depthcube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
-  textureDimensions_79d168(tint_symbol_2);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_79d168(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_79d168(tint_symbol_4);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_79d168(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_79d168(tint_symbol_5);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_79d168(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.spvasm
index 7cc8c06..ef809da 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_79d168 "textureDimensions_79d168"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_79d168 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_1
-               OpStore %res %16
+%textureDimensions_79d168 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_79d168
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_79d168
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_79d168
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_79d168
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_79d168
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_79d168
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.wgsl
index 1400b0f..e2a8d54 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_79d168() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_79d168();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl
index 30e8a51..3a3cbed 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<u32>) -> vec3<u32>
 fn textureDimensions_7a3890() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
index 3a01cb7..c8937c5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7a3890() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
index 3a01cb7..c8937c5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7a3890() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.glsl
index 533a4f8..13a7636 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_7a3890() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_7a3890() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_7a3890() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.msl
index 3118213..46e8389 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_7a3890(texture3d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_7a3890(texture3d<uint, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_7a3890(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_7a3890(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_7a3890(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_7a3890(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_7a3890(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_7a3890(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.spvasm
index 43921a9..3e16f4d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_7a3890 "textureDimensions_7a3890"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_7a3890 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v3uint %19 %int_0
-               OpStore %res %17
+%textureDimensions_7a3890 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_7a3890
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_7a3890
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_7a3890
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_7a3890
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_7a3890
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_7a3890
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.wgsl
index 82213cc..0538678 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_7a3890() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_7a3890();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl
index 9d1f0b9..d43aee9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<u32>) -> vec2<u32>
 fn textureDimensions_7a9e30() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
index 12d975c..3699610 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7a9e30() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
index 12d975c..3699610 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7a9e30() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.glsl
index c7e9efa..f972f63 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_7a9e30() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_7a9e30() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_7a9e30() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.msl
index 4456cad..8244dd9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_7a9e30(texturecube<uint, access::sample> tint_symbol_1) {
+void textureDimensions_7a9e30(texturecube<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
-  textureDimensions_7a9e30(tint_symbol_2);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_7a9e30(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_7a9e30(tint_symbol_4);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_7a9e30(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_7a9e30(tint_symbol_5);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_7a9e30(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.spvasm
index b036bf4..c544c20 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_7a9e30 "textureDimensions_7a9e30"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_7a9e30 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %17
+%textureDimensions_7a9e30 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_7a9e30
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_7a9e30
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_7a9e30
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_7a9e30
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_7a9e30
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_7a9e30
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.wgsl
index bd784d3..d29020c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_7a9e30() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_7a9e30();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl
index fbc9301..6e78077 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<bgra8unorm, write>) -> u32
 fn textureDimensions_84f363() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.dxc.hlsl
index 17257f9..9d8e922 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_84f363() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.fxc.hlsl
index 17257f9..9d8e922 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_84f363() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.glsl
index f5d3ecd..d3889a9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_84f363() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_84f363() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_84f363() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.msl
index 86c6e02..c6f246a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_84f363(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_84f363(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_84f363(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_84f363(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_84f363(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_84f363(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_84f363(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_84f363(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.spvasm
index 3252410..0b4c1cd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_84f363 "textureDimensions_84f363"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_84f363 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_84f363 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_84f363
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_84f363
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_84f363
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_84f363
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_84f363
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_84f363
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.wgsl
index 5967fd6..8a3fd51 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/84f363.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_84f363() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_84f363();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl
index 2a6540f..02cca02 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba8snorm, write>) -> vec2<u32>
 fn textureDimensions_867ead() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.dxc.hlsl
index c3db085..c2a6d6f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_867ead() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.fxc.hlsl
index c3db085..c2a6d6f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_867ead() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.glsl
index ed270a8..dbeb579 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_867ead() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_867ead() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_867ead() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.msl
index 7985b52..53c9ef9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_867ead(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_867ead(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_867ead(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_867ead(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_867ead(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_867ead(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_867ead(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_867ead(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.spvasm
index d0dac2c..d7f86ed 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_867ead "textureDimensions_867ead"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_867ead = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_867ead = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_867ead
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_867ead
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_867ead
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_867ead
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_867ead
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_867ead
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.wgsl
index 50f701a..aa25992 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_867ead() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_867ead();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl
index c3f7003..28e72b9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<f32>) -> vec2<u32>
 fn textureDimensions_879b73() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.dxc.hlsl
index 8e2f821..31c0232 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_879b73() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.fxc.hlsl
index 8e2f821..31c0232 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_879b73() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.msl
index f452786..99cb052 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_879b73(texturecube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_879b73(texturecube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_879b73(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_879b73(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_879b73(tint_symbol_4);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_879b73(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_879b73(tint_symbol_5);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_879b73(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.spvasm
index f5199b0..f6f7d49 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_879b73 "textureDimensions_879b73"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,45 +43,53 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_879b73 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_879b73 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_879b73
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_879b73
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_879b73
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_879b73
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_879b73
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_879b73
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.wgsl
index 6078916..1f03510 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_879b73() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_879b73();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl
index 349d4aa..d5e6c67 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rg32float, write>) -> vec2<u32>
 fn textureDimensions_8a35f9() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
index cb72f96..2f33d98 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_8a35f9() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
index cb72f96..2f33d98 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_8a35f9() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.msl
index f3c2d7c..6742474 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_8a35f9(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_8a35f9(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_8a35f9(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_8a35f9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_8a35f9(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_8a35f9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_8a35f9(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_8a35f9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.spvasm
index f3a454b..2175604 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_8a35f9 "textureDimensions_8a35f9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_8a35f9 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_8a35f9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_8a35f9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_8a35f9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_8a35f9
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_8a35f9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_8a35f9
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_8a35f9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.wgsl
index 04585f3..ac32635 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_8a35f9() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_8a35f9();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl
index e4931ec..c863676 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba32sint, write>) -> u32
 fn textureDimensions_8efd47() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
index 0ec2359..94483c9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_8efd47() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
index 0ec2359..94483c9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_8efd47() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.glsl
index ae6f7eb..2749b281 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_8efd47() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_8efd47() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_8efd47() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.msl
index 1aa9fa8..2db510c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_8efd47(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_8efd47(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_8efd47(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_8efd47(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_8efd47(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_8efd47(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_8efd47(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_8efd47(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.spvasm
index cb6145d..4e710ec 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_8efd47 "textureDimensions_8efd47"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_8efd47 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_8efd47 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_8efd47
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_8efd47
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_8efd47
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_8efd47
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_8efd47
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_8efd47
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.wgsl
index 791a3af..4d79064 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_8efd47() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_8efd47();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl
index 3a8b15e..828334f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<r32float, write>) -> vec3<u32>
 fn textureDimensions_902179() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.dxc.hlsl
index 1c84269..6b6d788 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_902179() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.fxc.hlsl
index 1c84269..6b6d788 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_902179() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.glsl
index 24eeebf..dd46ad6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_902179() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_902179() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_902179() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.msl
index ff7f11b..5810dfc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_902179(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_902179(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_902179(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_902179(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_902179(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_902179(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_902179(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_902179(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.spvasm
index cdb6d12..431b4dc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_902179 "textureDimensions_902179"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_902179 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_902179 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_902179
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_902179
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_902179
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_902179
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_902179
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_902179
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.wgsl
index 81da1cc..96e9ba7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_902179() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_902179();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl
index fde73cb..42b5e5b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba16sint, write>) -> vec2<u32>
 fn textureDimensions_90dd74() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
index 6e10196..8837cdc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_90dd74() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
index 6e10196..8837cdc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_90dd74() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.glsl
index 4e0747d..0411303 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_90dd74() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_90dd74() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_90dd74() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.msl
index 8439e12..81147f3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_90dd74(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_90dd74(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_90dd74(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_90dd74(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_90dd74(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_90dd74(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_90dd74(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_90dd74(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.spvasm
index 0fe6302..e5b3923 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_90dd74 "textureDimensions_90dd74"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_90dd74 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_90dd74 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_90dd74
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_90dd74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_90dd74
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_90dd74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_90dd74
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_90dd74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.wgsl
index d5471c2..acb40dd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_90dd74() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_90dd74();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl
index b303bac..984e4f4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<u32>, level: i32) -> u32
 fn textureDimensions_920006() {
   var res: u32 = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.dxc.hlsl
index 0260041..86e139c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_920006() {
   int2 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.fxc.hlsl
index 0260041..86e139c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_920006() {
   int2 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.glsl
index 4859264..2682b7e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_920006() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_920006() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_920006() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.msl
index e3fd99f..09bee12 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_920006(texture1d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_920006(texture1d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_920006(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_920006(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_920006(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_920006(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_920006(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_920006(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.spvasm
index b98b0f6..0019399 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_920006 "textureDimensions_920006"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_920006 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %uint %18 %int_1
-               OpStore %res %17
+%textureDimensions_920006 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySizeLod %uint %21 %int_1
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_920006
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_920006
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_920006
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_920006
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_920006
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_920006
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.wgsl
index b709469..58d5077 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_920006() {
   var res : u32 = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_920006();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl
index d4677e2..ef70d53 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba8sint, write>) -> u32
 fn textureDimensions_92552e() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.dxc.hlsl
index 6afab39..9dc17c8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_92552e() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.fxc.hlsl
index 6afab39..9dc17c8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_92552e() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.glsl
index c14a7b6..a5fefdc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_92552e() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_92552e() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_92552e() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.msl
index b291fc2..73e3e9e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_92552e(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_92552e(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_92552e(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_92552e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_92552e(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_92552e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_92552e(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_92552e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.spvasm
index 900be97..a003355 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_92552e "textureDimensions_92552e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_92552e = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_92552e = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_92552e
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_92552e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_92552e
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_92552e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_92552e
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_92552e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.wgsl
index d970314..ee96d82 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_92552e() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_92552e();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl
index 917ddec..b5c44d2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rg32uint, write>) -> vec2<u32>
 fn textureDimensions_9573f3() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
index 4d8998d..da0578f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9573f3() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
index 4d8998d..da0578f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9573f3() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.msl
index f0fa2a7..fbbfdb4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9573f3(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_9573f3(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_9573f3(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9573f3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9573f3(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9573f3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9573f3(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9573f3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.spvasm
index b1f6cc3..35533d1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9573f3 "textureDimensions_9573f3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9573f3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_9573f3 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_9573f3
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_9573f3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_9573f3
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_9573f3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_9573f3
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_9573f3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.wgsl
index de5167b..db6f380 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9573f3() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9573f3();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl
index a09022b..088c823 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<u32>) -> u32
 fn textureDimensions_965645() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.dxc.hlsl
index 285b9f8..02f369c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_965645() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.fxc.hlsl
index 285b9f8..02f369c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_965645() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.glsl
index e5540d6..4d0484e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_965645() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_965645() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_965645() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.msl
index 6d38430..0a2e55d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_965645(texture1d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_965645(texture1d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_965645(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_965645(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_965645(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_965645(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_965645(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_965645(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.spvasm
index 9e8f9a4..af4716b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_965645 "textureDimensions_965645"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_965645 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %uint %18 %int_0
-               OpStore %res %17
+%textureDimensions_965645 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySizeLod %uint %21 %int_0
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_965645
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_965645
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_965645
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_965645
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_965645
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_965645
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.wgsl
index 45ddf97..c05ae26 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_965645() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_965645();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl
index 0f82afb..9d70ceb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<i32>) -> vec2<u32>
 fn textureDimensions_98b2d3() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
index 70d774f..23a73ef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_98b2d3() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
index 70d774f..23a73ef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_98b2d3() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.msl
index dc4a496..0f9c39b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_98b2d3(texturecube_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_98b2d3(texturecube_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_98b2d3(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_98b2d3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_98b2d3(tint_symbol_4);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_98b2d3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_98b2d3(tint_symbol_5);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_98b2d3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.spvasm
index d511aaa..968a038 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_98b2d3 "textureDimensions_98b2d3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,44 +44,52 @@
          %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_98b2d3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySizeLod %v3uint %22 %int_0
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_98b2d3 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySizeLod %v3uint %25 %int_0
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_98b2d3
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_98b2d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_98b2d3
+%fragment_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_98b2d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_98b2d3
+%compute_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_98b2d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.wgsl
index 8609f45..c6ef29b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_98b2d3() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_98b2d3();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl
index aa05e7b..373acea 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_2d, level: u32) -> vec2<u32>
 fn textureDimensions_991ea9() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
index 76b6996..f81cddd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_991ea9() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
index 76b6996..f81cddd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_991ea9() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.glsl
index c100c91..41641c4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_991ea9() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_991ea9() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_991ea9() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.msl
index 7da42db..ff61b46 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_991ea9(depth2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_991ea9(depth2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_991ea9(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_991ea9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_991ea9(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_991ea9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_991ea9(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_991ea9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.spvasm
index a82a839..bddf8f8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_991ea9 "textureDimensions_991ea9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,42 +42,50 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_991ea9 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %uint_1
-               OpStore %res %16
+%textureDimensions_991ea9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_991ea9
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_991ea9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_991ea9
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_991ea9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_991ea9
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_991ea9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.wgsl
index d54d29a..15e7e83 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_991ea9() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_991ea9();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl
index 25108ad..e4d57da 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<f32>) -> vec2<u32>
 fn textureDimensions_9b223b() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
index 50846b9..010ea15 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9b223b() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
index 50846b9..010ea15 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9b223b() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.glsl
index c748051..1bc995d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9b223b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9b223b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9b223b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.msl
index ce95387..37f5771 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9b223b(texturecube<float, access::sample> tint_symbol_1) {
+void textureDimensions_9b223b(texturecube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
-  textureDimensions_9b223b(tint_symbol_2);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9b223b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9b223b(tint_symbol_4);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9b223b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9b223b(tint_symbol_5);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9b223b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.spvasm
index b7a28e0..61b083f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9b223b "textureDimensions_9b223b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9b223b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_9b223b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_9b223b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_9b223b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_9b223b
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_9b223b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_9b223b
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_9b223b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.wgsl
index 72fbba9..c74b7e7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9b223b() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9b223b();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl
index 66c6751..d286115 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<u32>, level: u32) -> vec2<u32>
 fn textureDimensions_9baf27() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
index 1c70561..9df5640 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9baf27() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
index 1c70561..9df5640 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9baf27() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.glsl
index 08ce12a..0b38985 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9baf27() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9baf27() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9baf27() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.msl
index 188376e..2f66211 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9baf27(texturecube<uint, access::sample> tint_symbol_1) {
+void textureDimensions_9baf27(texturecube<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
-  textureDimensions_9baf27(tint_symbol_2);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9baf27(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9baf27(tint_symbol_4);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9baf27(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9baf27(tint_symbol_5);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9baf27(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.spvasm
index 230931d..04cb2c7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9baf27 "textureDimensions_9baf27"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9baf27 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %19 %uint_1
-               OpStore %res %17
+%textureDimensions_9baf27 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_9baf27
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_9baf27
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_9baf27
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_9baf27
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_9baf27
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_9baf27
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.wgsl
index 6a4141f..9e88d93 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9baf27() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9baf27();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl
index bc5e36a..1ae0d3f6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<u32>, level: u32) -> u32
 fn textureDimensions_9c7a00() {
   var res: u32 = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
index d1c1db0..b3df338 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9c7a00() {
   int2 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
index d1c1db0..b3df338 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9c7a00() {
   int2 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.glsl
index 6f68a02..ddd34e1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_9c7a00() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_9c7a00() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_9c7a00() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.msl
index 6e193d3..ca8bb1b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9c7a00(texture1d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_9c7a00(texture1d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_9c7a00(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_9c7a00(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9c7a00(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9c7a00(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9c7a00(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9c7a00(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.spvasm
index c5bfdaa..714967b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9c7a00 "textureDimensions_9c7a00"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9c7a00 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %uint %18 %uint_1
-               OpStore %res %17
+%textureDimensions_9c7a00 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySizeLod %uint %21 %uint_1
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_9c7a00
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_9c7a00
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %16
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_9c7a00
+%fragment_main = OpFunction %void None %16
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_9c7a00
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_9c7a00
+%compute_main = OpFunction %void None %16
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_9c7a00
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.wgsl
index 22c9233..5c1ed1a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9c7a00() {
   var res : u32 = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9c7a00();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl
index 35d5bbb..5697087 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<u32>, level: i32) -> vec2<u32>
 fn textureDimensions_9cd4ca() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
index bae851e..1595906 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9cd4ca() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
index bae851e..1595906 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9cd4ca() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.glsl
index b6be761..1c7252f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9cd4ca() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9cd4ca() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9cd4ca() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.msl
index 3181b6a..fd93096 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9cd4ca(texturecube<uint, access::sample> tint_symbol_1) {
+void textureDimensions_9cd4ca(texturecube<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
-  textureDimensions_9cd4ca(tint_symbol_2);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9cd4ca(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9cd4ca(tint_symbol_4);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9cd4ca(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9cd4ca(tint_symbol_5);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9cd4ca(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.spvasm
index 0dba168..f9106f0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9cd4ca "textureDimensions_9cd4ca"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9cd4ca = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %19 %int_1
-               OpStore %res %17
+%textureDimensions_9cd4ca = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_9cd4ca
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_9cd4ca
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_9cd4ca
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_9cd4ca
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_9cd4ca
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_9cd4ca
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.wgsl
index f5297df..dd0282d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9cd4ca() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9cd4ca();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl
index 309ffe2..6de0753 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rg32float, write>) -> vec3<u32>
 fn textureDimensions_9cd8ad() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
index 15a1e11..c6ac61a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9cd8ad() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
index 15a1e11..c6ac61a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9cd8ad() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.msl
index 23fcbf6..11a7158 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9cd8ad(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_9cd8ad(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_9cd8ad(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_9cd8ad(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9cd8ad(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9cd8ad(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9cd8ad(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9cd8ad(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.spvasm
index 0155eb4..73218ee 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9cd8ad "textureDimensions_9cd8ad"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9cd8ad = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_9cd8ad = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_9cd8ad
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_9cd8ad
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_9cd8ad
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_9cd8ad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_9cd8ad
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_9cd8ad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.wgsl
index 7ac9caf..42490bf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9cd8ad() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9cd8ad();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl
index ebef3e2..371fcdf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<u32>, level: i32) -> vec2<u32>
 fn textureDimensions_9e0794() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
index 5de37e8..a47e53b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9e0794() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
index 5de37e8..a47e53b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9e0794() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.glsl
index 784f8be..abdf55b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9e0794() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9e0794() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9e0794() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.msl
index 1afc85d..7897a43 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9e0794(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_9e0794(texture2d_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_9e0794(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9e0794(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9e0794(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9e0794(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9e0794(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9e0794(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.spvasm
index 13de1c1..559d5a6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9e0794 "textureDimensions_9e0794"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9e0794 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_1
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_9e0794 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_9e0794
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_9e0794
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_9e0794
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_9e0794
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_9e0794
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_9e0794
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.wgsl
index 1de4efe..43ae2c5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9e0794() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9e0794();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl
index 9f69ac6..e2e194b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_cube_array) -> vec2<u32>
 fn textureDimensions_9fcc3b() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
index 5252d8b..b86e550 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9fcc3b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
index 5252d8b..b86e550 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9fcc3b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.msl
index ddabf3b..83fc78d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9fcc3b(depthcube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_9fcc3b(depthcube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_9fcc3b(tint_symbol_2);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9fcc3b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9fcc3b(tint_symbol_4);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9fcc3b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9fcc3b(tint_symbol_5);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9fcc3b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.spvasm
index a57305e..e7bb90b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9fcc3b "textureDimensions_9fcc3b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,45 +43,53 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9fcc3b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_9fcc3b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_9fcc3b
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_9fcc3b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_9fcc3b
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_9fcc3b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_9fcc3b
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_9fcc3b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.wgsl
index 14dbcf2..bfcab8a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9fcc3b() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9fcc3b();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl
index 76171f5..808028a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<u32>) -> vec2<u32>
 fn textureDimensions_a1598a() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
index ed94e77..1c85709 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a1598a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
index ed94e77..1c85709 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a1598a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.msl
index f8e8256..d32e662 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_a1598a(texturecube_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_a1598a(texturecube_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_a1598a(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_a1598a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_a1598a(tint_symbol_4);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_a1598a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_a1598a(tint_symbol_5);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_a1598a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.spvasm
index a28204c..9aba6f2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_a1598a "textureDimensions_a1598a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,44 +44,52 @@
          %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_a1598a = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_a1598a = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_a1598a
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_a1598a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_a1598a
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_a1598a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_a1598a
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_a1598a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.wgsl
index f6f7047..94245b7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_a1598a() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_a1598a();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl
index 618688c..3dc364a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<i32>, level: i32) -> vec2<u32>
 fn textureDimensions_a2ba5e() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
index 05e2e02..1259fc2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a2ba5e() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
index 05e2e02..1259fc2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a2ba5e() {
   int3 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.glsl
index f398ada..ad10ea5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a2ba5e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a2ba5e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a2ba5e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.msl
index 2cc988d..140fb6d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_a2ba5e(texturecube<int, access::sample> tint_symbol_1) {
+void textureDimensions_a2ba5e(texturecube<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
-  textureDimensions_a2ba5e(tint_symbol_2);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_a2ba5e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_a2ba5e(tint_symbol_4);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_a2ba5e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_a2ba5e(tint_symbol_5);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_a2ba5e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.spvasm
index a6ffae2..aa7a461 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_a2ba5e "textureDimensions_a2ba5e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_a2ba5e = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %20 %int_1
-               OpStore %res %17
+%textureDimensions_a2ba5e = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v2uint %23 %int_1
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_a2ba5e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_a2ba5e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_a2ba5e
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_a2ba5e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_a2ba5e
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_a2ba5e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.wgsl
index 49e2b88..b6afb58 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_a2ba5e() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_a2ba5e();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl
index 42075ef..020a21f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<i32>, level: u32) -> vec2<u32>
 fn textureDimensions_a48049() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.dxc.hlsl
index ccfed60..209e739 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a48049() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.fxc.hlsl
index ccfed60..209e739 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a48049() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.glsl
index f77b8da..905d28d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a48049() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a48049() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a48049() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.msl
index 46202c3..a635239 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_a48049(texture2d<int, access::sample> tint_symbol_1) {
+void textureDimensions_a48049(texture2d<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureDimensions_a48049(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_a48049(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_a48049(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_a48049(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_a48049(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_a48049(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.spvasm
index 089a9ed..a960778 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_a48049 "textureDimensions_a48049"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_a48049 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %20 %uint_1
-               OpStore %res %17
+%textureDimensions_a48049 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v2uint %23 %uint_1
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_a48049
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_a48049
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_a48049
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_a48049
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_a48049
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_a48049
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.wgsl
index 077ac17..85bfdc9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_a48049() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_a48049();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl
index 5628cd5..74d8b78 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_2d_array) -> vec2<u32>
 fn textureDimensions_a4cd56() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
index f8f2b16..085c160 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a4cd56() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
index f8f2b16..085c160 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a4cd56() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.glsl
index 759cda6..b94c4df 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a4cd56() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a4cd56() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a4cd56() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.msl
index 9022f6d..8d4b437 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_a4cd56(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_a4cd56(depth2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_a4cd56(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_a4cd56(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_a4cd56(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_a4cd56(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_a4cd56(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_a4cd56(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.spvasm
index d7caf97..5c981bd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_a4cd56 "textureDimensions_a4cd56"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_a4cd56 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_a4cd56 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_a4cd56
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_a4cd56
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_a4cd56
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_a4cd56
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_a4cd56
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_a4cd56
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.wgsl
index 50f2c77..e59960e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_a4cd56() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_a4cd56();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl
index 8b47484..37dc891 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba32sint, write>) -> vec2<u32>
 fn textureDimensions_aa4353() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
index 3d24ddb..dabce86 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_aa4353() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
index 3d24ddb..dabce86 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_aa4353() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.glsl
index 4a25902..9476a5e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_aa4353() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_aa4353() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_aa4353() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.msl
index 7845df7..10c4286 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_aa4353(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_aa4353(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_aa4353(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_aa4353(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_aa4353(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_aa4353(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_aa4353(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_aa4353(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.spvasm
index 3a9900d..950004e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_aa4353 "textureDimensions_aa4353"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_aa4353 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_aa4353 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_aa4353
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_aa4353
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_aa4353
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_aa4353
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_aa4353
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_aa4353
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.wgsl
index 7aa80e1..3d4a4fc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_aa4353() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_aa4353();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl
index 981d7ca..2b9555f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<f32>, level: u32) -> u32
 fn textureDimensions_aac604() {
   var res: u32 = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.dxc.hlsl
index 4bd5d9d..e282eae 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_aac604() {
   int2 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.fxc.hlsl
index 4bd5d9d..e282eae 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_aac604() {
   int2 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.glsl
index c3a49ff..f41247b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_aac604() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_aac604() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_aac604() {
   uint res = uvec2(textureSize(arg_0_1, int(1u))).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.msl
index 6e94f2d..264d9ed 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_aac604(texture1d<float, access::sample> tint_symbol_1) {
+void textureDimensions_aac604(texture1d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureDimensions_aac604(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_aac604(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_aac604(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_aac604(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_aac604(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_aac604(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.spvasm
index 3e60083..568abb9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_aac604 "textureDimensions_aac604"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_aac604 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %uint %18 %uint_1
-               OpStore %res %16
+%textureDimensions_aac604 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySizeLod %uint %21 %uint_1
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_aac604
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_aac604
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %16
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_aac604
+%fragment_main = OpFunction %void None %16
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_aac604
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_aac604
+%compute_main = OpFunction %void None %16
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_aac604
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.wgsl
index cb19c1c..7c6eef2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_aac604() {
   var res : u32 = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_aac604();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl
index 39b6f4a..67f13ee 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba8uint, write>) -> u32
 fn textureDimensions_ad7d3b() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
index c052ebe..09ea033 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ad7d3b() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
index c052ebe..09ea033 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ad7d3b() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.glsl
index c88b88e..069e1c5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ad7d3b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ad7d3b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ad7d3b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.msl
index 5ebfda2..496ffa5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_ad7d3b(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_ad7d3b(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_ad7d3b(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_ad7d3b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_ad7d3b(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_ad7d3b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_ad7d3b(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_ad7d3b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.spvasm
index f349ad4..971ee8a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_ad7d3b "textureDimensions_ad7d3b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,39 +45,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_ad7d3b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_ad7d3b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_ad7d3b
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_ad7d3b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_ad7d3b
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_ad7d3b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_ad7d3b
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_ad7d3b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.wgsl
index f3d84ab..4e887c3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_ad7d3b() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_ad7d3b();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl
index ab3e076..715c21f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rg32sint, write>) -> vec2<u32>
 fn textureDimensions_af46ab() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
index 7b91231..5dc5b3c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_af46ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
index 7b91231..5dc5b3c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_af46ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.msl
index bea9ef2..98dd440 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_af46ab(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_af46ab(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_af46ab(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_af46ab(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_af46ab(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_af46ab(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_af46ab(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_af46ab(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.spvasm
index fa916ed..253712e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_af46ab "textureDimensions_af46ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,43 +45,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_af46ab = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_af46ab = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_af46ab
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_af46ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_af46ab
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_af46ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_af46ab
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_af46ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.wgsl
index 33b86af..b01989a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_af46ab() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_af46ab();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl
index a7b36f4..794f533 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<f32>, level: i32) -> vec2<u32>
 fn textureDimensions_b3ab5e() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
index 66e0fd5..20b522c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b3ab5e() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
index 66e0fd5..20b522c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b3ab5e() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.msl
index 02aa62f..d64398a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_b3ab5e(texturecube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_b3ab5e(texturecube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_b3ab5e(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_b3ab5e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_b3ab5e(tint_symbol_4);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_b3ab5e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_b3ab5e(tint_symbol_5);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_b3ab5e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.spvasm
index 0fd15b3..1286a72 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_b3ab5e "textureDimensions_b3ab5e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,45 +43,53 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_b3ab5e = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_1
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_b3ab5e = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_b3ab5e
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_b3ab5e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_b3ab5e
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_b3ab5e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_b3ab5e
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_b3ab5e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.wgsl
index 1869fbb..cb5b50b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_b3ab5e() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_b3ab5e();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl
index 6f1c9aa..3d2d44b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<i32>, level: i32) -> u32
 fn textureDimensions_b46d97() {
   var res: u32 = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
index a9e0aee..848ff83 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b46d97() {
   int2 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
index a9e0aee..848ff83 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b46d97() {
   int2 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.glsl
index 267ef8d..253cfd8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_b46d97() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_b46d97() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_b46d97() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.msl
index d13508c..08acd34 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_b46d97(texture1d<int, access::sample> tint_symbol_1) {
+void textureDimensions_b46d97(texture1d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureDimensions_b46d97(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_b46d97(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_b46d97(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_b46d97(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_b46d97(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_b46d97(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.spvasm
index 474bb46..69d22bb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_b46d97 "textureDimensions_b46d97"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_b46d97 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %uint %19 %int_1
-               OpStore %res %17
+%textureDimensions_b46d97 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %uint %22 %int_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_b46d97
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_b46d97
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_b46d97
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_b46d97
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_b46d97
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_b46d97
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.wgsl
index 696cbe9..8eeef6d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_b46d97() {
   var res : u32 = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_b46d97();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl
index 705df0b..f113cfb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rg32float, write>) -> u32
 fn textureDimensions_b51345() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.dxc.hlsl
index 83abb62..fd3b25d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b51345() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.fxc.hlsl
index 83abb62..fd3b25d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b51345() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.msl
index d1ee550..2fe576c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_b51345(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_b51345(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_b51345(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_b51345(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_b51345(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_b51345(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_b51345(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_b51345(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.spvasm
index ba366c8..8776968 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -16,6 +16,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_b51345 "textureDimensions_b51345"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_b51345 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_b51345 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_b51345
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_b51345
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_b51345
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_b51345
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_b51345
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_b51345
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.wgsl
index 4da1873..7eab351 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_b51345() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_b51345();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl
index c30f0fa..bf7fca6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<f32>) -> vec3<u32>
 fn textureDimensions_bb95d9() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
index abb88d4..a778a68 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bb95d9() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
index abb88d4..a778a68 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bb95d9() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.glsl
index 2222166..e826968 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_bb95d9() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_bb95d9() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_bb95d9() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.msl
index 7319205..a39c356 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_bb95d9(texture3d<float, access::sample> tint_symbol_1) {
+void textureDimensions_bb95d9(texture3d<float, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureDimensions_bb95d9(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_bb95d9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_bb95d9(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_bb95d9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_bb95d9(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_bb95d9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.spvasm
index 4529549..2f322c4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_bb95d9 "textureDimensions_bb95d9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_bb95d9 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v3uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_bb95d9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_bb95d9
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_bb95d9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_bb95d9
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_bb95d9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_bb95d9
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_bb95d9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.wgsl
index 24fab7a..24f70f1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_bb95d9() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_bb95d9();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl
index 14e3679..fd60ba9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba8sint, write>) -> vec2<u32>
 fn textureDimensions_bbe285() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
index bc18dde..47573e3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bbe285() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
index bc18dde..47573e3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bbe285() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.glsl
index 2464082..2316be5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_bbe285() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_bbe285() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_bbe285() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.msl
index 35cf418..28efec6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_bbe285(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_bbe285(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_bbe285(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_bbe285(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_bbe285(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_bbe285(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_bbe285(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_bbe285(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.spvasm
index 5613469..104e650 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_bbe285 "textureDimensions_bbe285"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_bbe285 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_bbe285 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_bbe285
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_bbe285
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_bbe285
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_bbe285
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_bbe285
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_bbe285
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.wgsl
index b74acdf..e36a21b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_bbe285() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_bbe285();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl
index 4a6d705..ca5d012 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_cube_array, level: u32) -> vec2<u32>
 fn textureDimensions_bd94c8() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
index 39364bf..0ecd802 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bd94c8() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
index 39364bf..0ecd802 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bd94c8() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.msl
index 5663ac1..a8bf4cc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_bd94c8(depthcube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_bd94c8(depthcube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_bd94c8(tint_symbol_2);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_bd94c8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_bd94c8(tint_symbol_4);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_bd94c8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_bd94c8(tint_symbol_5);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_bd94c8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.spvasm
index bdaa00d..45d5165 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_bd94c8 "textureDimensions_bd94c8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_bd94c8 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_bd94c8 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %uint_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_bd94c8
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_bd94c8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_bd94c8
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_bd94c8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_bd94c8
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_bd94c8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.wgsl
index abfd6d2..228359c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_bd94c8() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_bd94c8();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl
index 3c783c2..4d21c6c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba8uint, write>) -> vec2<u32>
 fn textureDimensions_c1dbf6() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
index ec06df9..2dfe016 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c1dbf6() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
index ec06df9..2dfe016 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c1dbf6() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.glsl
index 4c2ee10..4acf890 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c1dbf6() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c1dbf6() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c1dbf6() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.msl
index 04722f5..6aaebf5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c1dbf6(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_c1dbf6(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_c1dbf6(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_c1dbf6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c1dbf6(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c1dbf6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c1dbf6(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c1dbf6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.spvasm
index ae9f484..8b74255 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c1dbf6 "textureDimensions_c1dbf6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c1dbf6 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_c1dbf6 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_c1dbf6
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_c1dbf6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_c1dbf6
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_c1dbf6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_c1dbf6
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_c1dbf6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.wgsl
index 590817f..fd010a3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c1dbf6() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c1dbf6();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl
index 6feb2e2..5556b0e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32>
 fn textureDimensions_c2cdd3() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
index 45db8ba..4ccb110 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c2cdd3() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
index 45db8ba..4ccb110 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c2cdd3() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.glsl
index ef3ef24..3e656b4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c2cdd3() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c2cdd3() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c2cdd3() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.msl
index 53a8299..10160db 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c2cdd3(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureDimensions_c2cdd3(depth2d_ms<float, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureDimensions_c2cdd3(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_c2cdd3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c2cdd3(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c2cdd3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c2cdd3(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c2cdd3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.spvasm
index c107a82..48a456f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c2cdd3 "textureDimensions_c2cdd3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,41 +42,49 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c2cdd3 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_c2cdd3 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_c2cdd3
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_c2cdd3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_c2cdd3
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_c2cdd3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_c2cdd3
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_c2cdd3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.wgsl
index 503bc4d..264ca2c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c2cdd3() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c2cdd3();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl
index 51445e0..08b532e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba32sint, write>) -> vec2<u32>
 fn textureDimensions_c44fc1() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
index 26b09c0..e1378ab 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c44fc1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
index 26b09c0..e1378ab 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c44fc1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.glsl
index 65da687..b578f04 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c44fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c44fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c44fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.msl
index bf13ca8..71e0c37 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c44fc1(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_c44fc1(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_c44fc1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_c44fc1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c44fc1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c44fc1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c44fc1(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c44fc1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.spvasm
index de28a79..f20713f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c44fc1 "textureDimensions_c44fc1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c44fc1 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_c44fc1 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_c44fc1
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_c44fc1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_c44fc1
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_c44fc1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_c44fc1
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_c44fc1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.wgsl
index 3e9f662..6078ed8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c44fc1() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c44fc1();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl
index 61e4f3b..9dfe105 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_cube) -> vec2<u32>
 fn textureDimensions_c5a36e() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
index 2bfa274..eafd25f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c5a36e() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
index 2bfa274..eafd25f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c5a36e() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.glsl
index 8927ad3..f35d537 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c5a36e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c5a36e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c5a36e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.msl
index 9d92d1f..80d9aa2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c5a36e(depthcube<float, access::sample> tint_symbol_1) {
+void textureDimensions_c5a36e(depthcube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
-  textureDimensions_c5a36e(tint_symbol_2);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_c5a36e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c5a36e(tint_symbol_4);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c5a36e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c5a36e(tint_symbol_5);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c5a36e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.spvasm
index 0992548..1c34fe9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c5a36e "textureDimensions_c5a36e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c5a36e = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_c5a36e = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_c5a36e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_c5a36e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_c5a36e
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_c5a36e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_c5a36e
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_c5a36e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.wgsl
index 1f9256a..570a9bd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c5a36e() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c5a36e();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl
index 64ae6c7..1e6f1da 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<i32>, level: u32) -> vec3<u32>
 fn textureDimensions_c871f3() {
   var res: vec3<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
index 01d51cb..7300f83 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c871f3() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
index 01d51cb..7300f83 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c871f3() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.glsl
index 1a1fc92..8cc9c5e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_c871f3() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_c871f3() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_c871f3() {
   uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.msl
index 2b1fdfc..fed5b95 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c871f3(texture3d<int, access::sample> tint_symbol_1) {
+void textureDimensions_c871f3(texture3d<int, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureDimensions_c871f3(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_c871f3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c871f3(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c871f3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c871f3(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c871f3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.spvasm
index f6e86c4..540282a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c871f3 "textureDimensions_c871f3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c871f3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v3uint %20 %uint_1
-               OpStore %res %17
+%textureDimensions_c871f3 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %23 %uint_1
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_c871f3
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_c871f3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_c871f3
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_c871f3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_c871f3
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_c871f3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.wgsl
index 627bb3b..15600b3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c871f3() {
   var res : vec3<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c871f3();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl
index 0f4624c..41f7e5a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<r32sint, write>) -> vec2<u32>
 fn textureDimensions_cad3b7() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
index b26a056..7f40ae4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cad3b7() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
index b26a056..7f40ae4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cad3b7() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.glsl
index f133039..6963154 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cad3b7() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cad3b7() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cad3b7() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.msl
index 1fcfb3f..2242261 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_cad3b7(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_cad3b7(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_cad3b7(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_cad3b7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_cad3b7(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_cad3b7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_cad3b7(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_cad3b7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.spvasm
index 0f7dfc3..a4eb0f0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_cad3b7 "textureDimensions_cad3b7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_cad3b7 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_cad3b7 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_cad3b7
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_cad3b7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_cad3b7
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_cad3b7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_cad3b7
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_cad3b7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.wgsl
index 24b1443..c73c1ca 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_cad3b7() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_cad3b7();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl
index 391a94c..88b331c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba8snorm, write>) -> vec3<u32>
 fn textureDimensions_cc947b() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
index a29d944..6f83758 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cc947b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
index a29d944..6f83758 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cc947b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.glsl
index 3340606..f3b5c23 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_cc947b() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_cc947b() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_cc947b() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.msl
index 4d1cb5d..f811166 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_cc947b(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_cc947b(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_cc947b(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_cc947b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_cc947b(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_cc947b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_cc947b(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_cc947b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.spvasm
index a51f315..80a4f88 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_cc947b "textureDimensions_cc947b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_cc947b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_cc947b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_cc947b
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_cc947b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_cc947b
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_cc947b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_cc947b
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_cc947b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.wgsl
index c5ca2ec..98d645a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_cc947b() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_cc947b();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl
index 3fc78f5..6a5e975 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_external) -> vec2<u32>
 fn textureDimensions_cdc6c9() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
index 70c59b9..e85dfad 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
@@ -3,11 +3,13 @@
   uint4 ext_tex_params[13];
 };
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cdc6c9() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
index 70c59b9..e85dfad 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
@@ -3,11 +3,13 @@
   uint4 ext_tex_params[13];
 };
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cdc6c9() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
index 8747181..b86cb50 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
@@ -46,8 +46,13 @@
 } ext_tex_params;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cdc6c9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -112,8 +117,13 @@
 } ext_tex_params;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cdc6c9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -172,8 +182,13 @@
 } ext_tex_params;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cdc6c9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl
index 61a10dc..28949f0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl
@@ -49,33 +49,34 @@
   float3x2 coordTransformationMatrix;
 };
 
-void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_cdc6c9(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_cdc6c9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_cdc6c9(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_cdc6c9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_cdc6c9(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_cdc6c9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm
index 920b2b5..1a0d067 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -37,6 +37,9 @@
                OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
                OpName %ext_tex_params "ext_tex_params"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_cdc6c9 "textureDimensions_cdc6c9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -75,6 +78,10 @@
                OpDecorate %ext_tex_params Binding 2
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -97,42 +104,50 @@
 %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
 %ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %23 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %27 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %34 = OpConstantNull %v2uint
-         %35 = OpTypeFunction %v4float
+         %37 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_cdc6c9 = OpFunction %void None %23
-         %26 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %34
-         %29 = OpLoad %11 %arg_0
-         %27 = OpImageQuerySizeLod %v2uint %29 %int_0
-               OpStore %res %27
+%textureDimensions_cdc6c9 = OpFunction %void None %27
+         %30 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %37
+         %32 = OpLoad %11 %arg_0
+         %31 = OpImageQuerySizeLod %v2uint %32 %int_0
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %41 = OpLoad %v2uint %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_cdc6c9
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_cdc6c9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %23
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %27
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %23
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureDimensions_cdc6c9
+%fragment_main = OpFunction %void None %27
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureDimensions_cdc6c9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %23
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureDimensions_cdc6c9
+%compute_main = OpFunction %void None %27
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureDimensions_cdc6c9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.wgsl
index f4ef228..fddb5e2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_cdc6c9() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_cdc6c9();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl
index 70f5149..e450c47 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<f32>, level: u32) -> vec2<u32>
 fn textureDimensions_cf2b50() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
index 78fe8b0..2fa305d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cf2b50() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
index 78fe8b0..2fa305d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cf2b50() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.msl
index 24eabd3..5af698f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_cf2b50(texturecube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_cf2b50(texturecube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_cf2b50(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_cf2b50(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_cf2b50(tint_symbol_4);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_cf2b50(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_cf2b50(tint_symbol_5);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_cf2b50(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.spvasm
index ac27386..f480caf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_cf2b50 "textureDimensions_cf2b50"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_cf2b50 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_cf2b50 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %uint_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_cf2b50
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_cf2b50
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_cf2b50
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_cf2b50
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_cf2b50
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_cf2b50
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.wgsl
index 1caa120..1ea2f42 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_cf2b50() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_cf2b50();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl
index 70e0536..904785e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba16sint, write>) -> u32
 fn textureDimensions_d08a94() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
index 033da1ff..6f219a8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d08a94() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
index 033da1ff..6f219a8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d08a94() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.glsl
index b4a0c70..a876ea7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_d08a94() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_d08a94() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_d08a94() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.msl
index c416401..82f0a35 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d08a94(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_d08a94(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_d08a94(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_d08a94(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d08a94(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d08a94(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d08a94(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d08a94(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.spvasm
index cffbbe5..6093d3d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d08a94 "textureDimensions_d08a94"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d08a94 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_d08a94 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_d08a94
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_d08a94
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_d08a94
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_d08a94
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_d08a94
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_d08a94
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.wgsl
index 8a49fb8..0cac636 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d08a94() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d08a94();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl
index c0213af..614a04f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<bgra8unorm, write>) -> vec2<u32>
 fn textureDimensions_d1b882() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.dxc.hlsl
index bbf8691..42884be 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d1b882() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.fxc.hlsl
index bbf8691..42884be 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d1b882() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.glsl
index 98a46253..37a302d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d1b882() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d1b882() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d1b882() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.msl
index 845a283..b1c60ce 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d1b882(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_d1b882(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_d1b882(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_d1b882(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d1b882(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d1b882(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d1b882(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d1b882(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.spvasm
index a2797a9..2bd4feb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d1b882 "textureDimensions_d1b882"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d1b882 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_d1b882 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_d1b882
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_d1b882
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_d1b882
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_d1b882
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_d1b882
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_d1b882
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.wgsl
index aace866..12ace7e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d1b882.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d1b882() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d1b882();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl
index 7c7607e..49dc9c6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_cube, level: u32) -> vec2<u32>
 fn textureDimensions_d3accd() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
index ed7a614..32c5321 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d3accd() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
index ed7a614..32c5321 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d3accd() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.glsl
index 5e121ce..75976dd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d3accd() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d3accd() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d3accd() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.msl
index 2b150ef..992c29c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d3accd(depthcube<float, access::sample> tint_symbol_1) {
+void textureDimensions_d3accd(depthcube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
-  textureDimensions_d3accd(tint_symbol_2);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_d3accd(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d3accd(tint_symbol_4);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d3accd(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d3accd(tint_symbol_5);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d3accd(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.spvasm
index db36476..96d7e48 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d3accd "textureDimensions_d3accd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,42 +42,50 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d3accd = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %uint_1
-               OpStore %res %16
+%textureDimensions_d3accd = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_d3accd
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_d3accd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_d3accd
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_d3accd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_d3accd
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_d3accd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.wgsl
index 66f05f0..e80bd92 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d3accd() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d3accd();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl
index 0188d69..8be364e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba32float, write>) -> vec2<u32>
 fn textureDimensions_d63c28() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
index e004506..2ef3dad 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d63c28() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
index e004506..2ef3dad 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d63c28() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.glsl
index e4679a4..bbd174e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d63c28() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d63c28() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d63c28() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.msl
index 9afba4a..c224f98 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d63c28(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_d63c28(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_d63c28(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_d63c28(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d63c28(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d63c28(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d63c28(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d63c28(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.spvasm
index 72b6139..b8bafbb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d63c28 "textureDimensions_d63c28"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d63c28 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_d63c28 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_d63c28
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_d63c28
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_d63c28
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_d63c28
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_d63c28
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_d63c28
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.wgsl
index 5e08214..591ab9c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d63c28() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d63c28();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl
index 291f651..8c5b6c8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba32uint, write>) -> vec2<u32>
 fn textureDimensions_d8ba68() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
index 81ffa6c..da923bb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d8ba68() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
index 81ffa6c..da923bb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d8ba68() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.glsl
index fd4d413..d9d5a8f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d8ba68() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d8ba68() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d8ba68() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.msl
index 933e158..f2039a8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d8ba68(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_d8ba68(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_d8ba68(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_d8ba68(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d8ba68(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d8ba68(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d8ba68(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d8ba68(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.spvasm
index 9c846eb..afb1900 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d8ba68 "textureDimensions_d8ba68"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d8ba68 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_d8ba68 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_d8ba68
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_d8ba68
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_d8ba68
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_d8ba68
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_d8ba68
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_d8ba68
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.wgsl
index c0908ff..dbd0a97 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d8ba68() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d8ba68();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl
index 9c7bc22..70694a6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba8uint, write>) -> vec3<u32>
 fn textureDimensions_d8f887() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
index 917113f..c9a5d13 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d8f887() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
index 917113f..c9a5d13 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d8f887() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.glsl
index c175bda..5c3606f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_d8f887() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_d8f887() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_d8f887() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.msl
index 8210fd2..59e81b7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d8f887(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_d8f887(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_d8f887(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_d8f887(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d8f887(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d8f887(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d8f887(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d8f887(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.spvasm
index a7f40d6..2ad5ae1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d8f887 "textureDimensions_d8f887"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d8f887 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_d8f887 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_d8f887
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_d8f887
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_d8f887
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_d8f887
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_d8f887
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_d8f887
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.wgsl
index 3b0a6fd..e4b5681 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d8f887() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d8f887();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl
index 72b05e2..bab578b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba32float, write>) -> u32
 fn textureDimensions_da30d2() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
index db53401..e44b491 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_da30d2() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
index db53401..e44b491 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_da30d2() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.glsl
index 4a3d01d..6585696 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_da30d2() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_da30d2() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_da30d2() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.msl
index 46c48ac..038402e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_da30d2(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_da30d2(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_da30d2(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_da30d2(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_da30d2(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_da30d2(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_da30d2(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_da30d2(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.spvasm
index e7b2b01..723c3be 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_da30d2 "textureDimensions_da30d2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_da30d2 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_da30d2 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_da30d2
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_da30d2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_da30d2
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_da30d2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_da30d2
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_da30d2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.wgsl
index fb066ac..1e14937 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_da30d2() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_da30d2();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl
index 9f76364..5703580 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<r32uint, write>) -> vec2<u32>
 fn textureDimensions_dc83ce() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
index 8f9d770..f68d917 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dc83ce() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
index 8f9d770..f68d917 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dc83ce() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.glsl
index 81558b4..dd892e1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dc83ce() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dc83ce() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dc83ce() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.msl
index f65454f..b1b28d9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_dc83ce(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_dc83ce(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_dc83ce(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_dc83ce(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_dc83ce(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_dc83ce(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_dc83ce(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_dc83ce(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.spvasm
index 77a8eae..0312cb1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_dc83ce "textureDimensions_dc83ce"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_dc83ce = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_dc83ce = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_dc83ce
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_dc83ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_dc83ce
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_dc83ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_dc83ce
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_dc83ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.wgsl
index 696ed4f..1de7869 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_dc83ce() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_dc83ce();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl
index bdb1c2b..9b91360 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba8snorm, write>) -> vec2<u32>
 fn textureDimensions_dee461() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.dxc.hlsl
index a745fb1..d92e6a4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dee461() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.fxc.hlsl
index a745fb1..d92e6a4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dee461() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.glsl
index d608c49..1ffc53c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dee461() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dee461() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dee461() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.msl
index ed5309b..a454b79 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_dee461(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_dee461(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_dee461(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_dee461(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_dee461(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_dee461(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_dee461(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_dee461(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.spvasm
index 5a31cb4..455ffbb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_dee461 "textureDimensions_dee461"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_dee461 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_dee461 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_dee461
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_dee461
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_dee461
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_dee461
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_dee461
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_dee461
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.wgsl
index 52b68e4..31785c9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_dee461() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_dee461();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl
index 954f430..d517117 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2<u32>
 fn textureDimensions_dfdc32() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
index 9ca9867..ecf5030 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dfdc32() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
index 9ca9867..ecf5030 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dfdc32() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.glsl
index 57cf5c6..4df686d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dfdc32() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dfdc32() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dfdc32() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.msl
index d1bcb69..1263001 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_dfdc32(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_dfdc32(depth2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_dfdc32(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_dfdc32(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_dfdc32(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_dfdc32(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_dfdc32(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_dfdc32(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.spvasm
index 2ecbfe2..387a4c5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_dfdc32 "textureDimensions_dfdc32"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_dfdc32 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_1
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_dfdc32 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_dfdc32
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_dfdc32
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_dfdc32
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_dfdc32
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_dfdc32
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_dfdc32
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.wgsl
index 41332c3..e60c44e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_dfdc32() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_dfdc32();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl
index e09efc0..236b5ba 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba8snorm, write>) -> u32
 fn textureDimensions_e122fe() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
index 051139d..d7d15fe 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e122fe() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
index 051139d..d7d15fe 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e122fe() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.glsl
index d4febc0..38d1b36 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_e122fe() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_e122fe() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_e122fe() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.msl
index a069344..05dd1ad 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e122fe(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_e122fe(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_e122fe(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_e122fe(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e122fe(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e122fe(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e122fe(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e122fe(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.spvasm
index a2f8217..b04e33a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e122fe "textureDimensions_e122fe"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e122fe = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_e122fe = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_e122fe
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_e122fe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_e122fe
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_e122fe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_e122fe
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_e122fe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.wgsl
index 7c63426..bc6ffa1 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e122fe() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e122fe();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl
index 17d67b4..46d8e02 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<u32>, level: u32) -> vec2<u32>
 fn textureDimensions_e18a8b() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
index 98ef751..0dbfe33 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e18a8b() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
index 98ef751..0dbfe33 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e18a8b() {
   int3 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.glsl
index 8e89734..522965a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e18a8b() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e18a8b() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e18a8b() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.msl
index 90a66c3..1014fef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e18a8b(texture2d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_e18a8b(texture2d<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_e18a8b(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_e18a8b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e18a8b(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e18a8b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e18a8b(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e18a8b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.spvasm
index 62e58b8..ed30aca 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e18a8b "textureDimensions_e18a8b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e18a8b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %19 %uint_1
-               OpStore %res %17
+%textureDimensions_e18a8b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_e18a8b
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_e18a8b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_e18a8b
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_e18a8b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_e18a8b
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_e18a8b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.wgsl
index b2ff2ee..4292b04 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e18a8b() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e18a8b();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl
index 551b92b..c65273b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_multisampled_2d<u32>) -> vec2<u32>
 fn textureDimensions_e4bfd2() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
index a3ba5e9..f7a2d79 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e4bfd2() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
index a3ba5e9..f7a2d79 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e4bfd2() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.glsl
index 7e8bd57..5bfee51 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4bfd2() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4bfd2() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4bfd2() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.msl
index a80135e..5221d3f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e4bfd2(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureDimensions_e4bfd2(texture2d_ms<uint, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureDimensions_e4bfd2(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_e4bfd2(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e4bfd2(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e4bfd2(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e4bfd2(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e4bfd2(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.spvasm
index 8f34ad1..0ea8c85 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e4bfd2 "textureDimensions_e4bfd2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e4bfd2 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_e4bfd2 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_e4bfd2
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_e4bfd2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_e4bfd2
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_e4bfd2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_e4bfd2
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_e4bfd2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.wgsl
index 5d5b8bc..8e7e5ef 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e4bfd2() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e4bfd2();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl
index 9d3a840..61eb100 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<i32>, level: u32) -> vec2<u32>
 fn textureDimensions_e4e310() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
index 4ba4ed9..d4756ac 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e4e310() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
index 4ba4ed9..d4756ac 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e4e310() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.glsl
index 2b3a9e6..6d20b28 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4e310() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4e310() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4e310() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.msl
index bf3b201..c8002de 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e4e310(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_e4e310(texture2d_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_e4e310(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_e4e310(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e4e310(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e4e310(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e4e310(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e4e310(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.spvasm
index f30d4e1..5ba7998 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e4e310 "textureDimensions_e4e310"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e4e310 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySizeLod %v3uint %22 %uint_1
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_e4e310 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySizeLod %v3uint %25 %uint_1
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_e4e310
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_e4e310
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_e4e310
+%fragment_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_e4e310
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_e4e310
+%compute_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_e4e310
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.wgsl
index 459e57f..f5d267d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e4e310() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e4e310();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl
index 06043a3..3b1070f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<u32>, level: i32) -> vec3<u32>
 fn textureDimensions_e5a203() {
   var res: vec3<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
index fdaee20..4d5ec48 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e5a203() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
index fdaee20..4d5ec48 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e5a203() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.glsl
index 5123678..5961333 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_e5a203() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_e5a203() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_e5a203() {
   uvec3 res = uvec3(textureSize(arg_0_1, 1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.msl
index d985a40..42a638a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e5a203(texture3d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_e5a203(texture3d<uint, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_e5a203(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_e5a203(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e5a203(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e5a203(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e5a203(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e5a203(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.spvasm
index 502d5be..a21ec9b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e5a203 "textureDimensions_e5a203"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e5a203 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v3uint %19 %int_1
-               OpStore %res %17
+%textureDimensions_e5a203 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %22 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_e5a203
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_e5a203
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_e5a203
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_e5a203
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_e5a203
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_e5a203
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.wgsl
index e1a7631..ad3d550 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e5a203() {
   var res : vec3<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e5a203();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl
index e60e2db..06a624f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rg32sint, write>) -> vec3<u32>
 fn textureDimensions_e738f4() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
index 32c9a19..8838504 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e738f4() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
index 32c9a19..8838504 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e738f4() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.msl
index 4f00a61..0bd7f39 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e738f4(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_e738f4(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_e738f4(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_e738f4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e738f4(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e738f4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e738f4(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e738f4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.spvasm
index f47fb82..2c62d26 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e738f4 "textureDimensions_e738f4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,41 +45,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e738f4 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_e738f4 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_e738f4
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_e738f4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_e738f4
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_e738f4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_e738f4
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_e738f4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.wgsl
index d6b582c..e3fc8d3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e738f4() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e738f4();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl
index e5025f0..1ed7571 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba16uint, write>) -> vec2<u32>
 fn textureDimensions_e99308() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.dxc.hlsl
index 2085764..7e11ef7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e99308() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.fxc.hlsl
index 2085764..7e11ef7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e99308() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.glsl
index 51d74f1..a9726ab 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e99308() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e99308() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e99308() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.msl
index e74a4e7..9a21c05 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e99308(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_e99308(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_e99308(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_e99308(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e99308(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e99308(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e99308(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e99308(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.spvasm
index 212b7e2..2406512 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e99308 "textureDimensions_e99308"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e99308 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_e99308 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_e99308
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_e99308
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_e99308
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_e99308
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_e99308
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_e99308
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.wgsl
index b3346dc..14d0af3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e99308() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e99308();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl
index ec3f376..e80a2ea 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<r32float, write>) -> u32
 fn textureDimensions_ea066c() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
index 5e0b777..d637b21 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ea066c() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
index 5e0b777..d637b21 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ea066c() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.glsl
index ea156b2..5547462 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ea066c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ea066c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ea066c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.msl
index 9da6c0d..e763dc2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_ea066c(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_ea066c(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_ea066c(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_ea066c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_ea066c(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_ea066c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_ea066c(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_ea066c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.spvasm
index 7644858..de79c1d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_ea066c "textureDimensions_ea066c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_ea066c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_ea066c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_ea066c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_ea066c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_ea066c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_ea066c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_ea066c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_ea066c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.wgsl
index dd5fb14..e0a8258 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_ea066c() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_ea066c();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl
index ffb3521..ff116c2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rg32uint, write>) -> u32
 fn textureDimensions_ea25bc() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
index 11fbba9..e24f03a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ea25bc() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
index 11fbba9..e24f03a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ea25bc() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.msl
index 884b655..3a33ce8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_ea25bc(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_ea25bc(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_ea25bc(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_ea25bc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_ea25bc(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_ea25bc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_ea25bc(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_ea25bc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.spvasm
index 04dabbf..79c856c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -16,6 +16,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_ea25bc "textureDimensions_ea25bc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -39,39 +46,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_ea25bc = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_ea25bc = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_ea25bc
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_ea25bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_ea25bc
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_ea25bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_ea25bc
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_ea25bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.wgsl
index 0c96ea0..37a6a55 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_ea25bc() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_ea25bc();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl
index 1713f9b..01ac01c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_2d_array, level: u32) -> vec2<u32>
 fn textureDimensions_eafe19() {
   var res: vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
index 1a85539..3fcffe5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_eafe19() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
index 1a85539..3fcffe5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_eafe19() {
   int4 tint_tmp;
   arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.glsl
index 6155e58..b9b0a35 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eafe19() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eafe19() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eafe19() {
   uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.msl
index e6df145..1e7eb74 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_eafe19(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_eafe19(depth2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_eafe19(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_eafe19(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_eafe19(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_eafe19(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_eafe19(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_eafe19(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.spvasm
index f43b927..f595eb2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_eafe19 "textureDimensions_eafe19"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_eafe19 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_eafe19 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %uint_1
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_eafe19
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_eafe19
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_eafe19
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_eafe19
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_eafe19
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_eafe19
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.wgsl
index 592b61f..e3b65fb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_eafe19() {
   var res : vec2<u32> = textureDimensions(arg_0, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_eafe19();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl
index 05adc5b..7d9c45b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba16float, write>) -> vec2<u32>
 fn textureDimensions_eb03b1() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
index cbab187..18c0859 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_eb03b1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
index cbab187..18c0859 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_eb03b1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.glsl
index dfc6512..b26825c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eb03b1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eb03b1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eb03b1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.msl
index 4cfae71..886467f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_eb03b1(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_eb03b1(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_eb03b1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_eb03b1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_eb03b1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_eb03b1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_eb03b1(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_eb03b1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.spvasm
index 1685567..4bfa443 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_eb03b1 "textureDimensions_eb03b1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_eb03b1 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_eb03b1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_eb03b1
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_eb03b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_eb03b1
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_eb03b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_eb03b1
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_eb03b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.wgsl
index 3eefe24..732d9bc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_eb03b1() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_eb03b1();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl
index 8dec9e5..95abb27 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<r32sint, write>) -> vec3<u32>
 fn textureDimensions_ef2e58() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
index 574ab12..89d7a1e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ef2e58() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
index 574ab12..89d7a1e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ef2e58() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.glsl
index 15d4aaf..1ff0462 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_ef2e58() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_ef2e58() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_ef2e58() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.msl
index d52234e..09677c6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_ef2e58(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_ef2e58(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_ef2e58(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_ef2e58(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_ef2e58(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_ef2e58(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_ef2e58(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_ef2e58(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.spvasm
index 70ed829..e69946b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_ef2e58 "textureDimensions_ef2e58"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_ef2e58 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_ef2e58 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_ef2e58
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_ef2e58
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_ef2e58
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_ef2e58
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_ef2e58
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_ef2e58
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.wgsl
index 0a1bbc4..a7b24c8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_ef2e58() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_ef2e58();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl
index 061300a..2720a66 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<f32>, level: i32) -> u32
 fn textureDimensions_f17acd() {
   var res: u32 = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
index 8242f9c..40aba7c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f17acd() {
   int2 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
index 8242f9c..40aba7c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f17acd() {
   int2 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.glsl
index 79a674a..1297637 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_f17acd() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_f17acd() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_f17acd() {
   uint res = uvec2(textureSize(arg_0_1, 1)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.msl
index 6b12c74..f2095d6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f17acd(texture1d<float, access::sample> tint_symbol_1) {
+void textureDimensions_f17acd(texture1d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureDimensions_f17acd(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_f17acd(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f17acd(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f17acd(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f17acd(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f17acd(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.spvasm
index 2c18cb7..db6951a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f17acd "textureDimensions_f17acd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f17acd = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %uint %18 %int_1
-               OpStore %res %16
+%textureDimensions_f17acd = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySizeLod %uint %21 %int_1
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_f17acd
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_f17acd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_f17acd
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_f17acd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_f17acd
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_f17acd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.wgsl
index 640de3d..d0bdf22 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f17acd() {
   var res : u32 = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f17acd();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl
index 25f67e4..d778c45 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rg32sint, write>) -> u32
 fn textureDimensions_f264a3() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
index bed8fd8..dff7fb5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f264a3() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
index bed8fd8..dff7fb5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f264a3() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.msl
index 5feaa3c7..66395ba 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f264a3(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_f264a3(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_f264a3(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_f264a3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f264a3(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f264a3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f264a3(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f264a3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.spvasm
index b148981..d21be41 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -16,6 +16,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f264a3 "textureDimensions_f264a3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -39,40 +46,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f264a3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_f264a3 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_f264a3
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_f264a3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_f264a3
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_f264a3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_f264a3
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_f264a3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.wgsl
index 06c76194..efdfa1a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f264a3() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f264a3();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl
index 8c973e9..bb126c6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba16float, write>) -> vec3<u32>
 fn textureDimensions_f3a2ac() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
index 13201fc..8090856 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f3a2ac() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
index 13201fc..8090856 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f3a2ac() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.glsl
index 3d3366f..1b19e45 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_f3a2ac() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_f3a2ac() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_f3a2ac() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.msl
index 1550808..ddf78bf 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f3a2ac(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_f3a2ac(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_f3a2ac(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_f3a2ac(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f3a2ac(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f3a2ac(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f3a2ac(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f3a2ac(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.spvasm
index 17304eb..6fd2002 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f3a2ac "textureDimensions_f3a2ac"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f3a2ac = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_f3a2ac = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_f3a2ac
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_f3a2ac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_f3a2ac
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_f3a2ac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_f3a2ac
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_f3a2ac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.wgsl
index 4173903..f0ff0e5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f3a2ac() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f3a2ac();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl
index 7ea7cbb..72632d9 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba32float, write>) -> vec2<u32>
 fn textureDimensions_f4e469() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
index ae5bd7a..361588c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f4e469() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
index ae5bd7a..361588c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f4e469() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.glsl
index 07ed54b..6b6261f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f4e469() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f4e469() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f4e469() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.msl
index 9fba981..2e79cec 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f4e469(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_f4e469(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_f4e469(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_f4e469(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f4e469(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f4e469(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f4e469(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f4e469(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.spvasm
index dbf3eb3..e5009f6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f4e469 "textureDimensions_f4e469"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f4e469 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_f4e469 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_f4e469
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_f4e469
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_f4e469
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_f4e469
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_f4e469
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_f4e469
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.wgsl
index fb9261d..c1d15a0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f4e469() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f4e469();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl
index 8c49681..695ed87 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<i32>) -> vec2<u32>
 fn textureDimensions_f626b3() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
index 9c15fdd..a428815 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f626b3() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
index 9c15fdd..a428815 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f626b3() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.glsl
index 9e55087..c4ade33 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f626b3() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f626b3() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f626b3() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.msl
index 3c7807b..fd4a2d3 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f626b3(texturecube<int, access::sample> tint_symbol_1) {
+void textureDimensions_f626b3(texturecube<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
-  textureDimensions_f626b3(tint_symbol_2);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_f626b3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f626b3(tint_symbol_4);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f626b3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f626b3(tint_symbol_5);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f626b3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.spvasm
index cb0bca3..cc01fdd 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f626b3 "textureDimensions_f626b3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f626b3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %20 %int_0
-               OpStore %res %17
+%textureDimensions_f626b3 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v2uint %23 %int_0
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_f626b3
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_f626b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_f626b3
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_f626b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_f626b3
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_f626b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.wgsl
index 25acd3f..b0a3fae 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f626b3() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f626b3();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl
index a80d3ec..6a025d7 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<i32>) -> vec2<u32>
 fn textureDimensions_f8522e() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
index c6710be..67b1a26 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f8522e() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
index c6710be..67b1a26 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f8522e() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.glsl
index ae80518..a5532bc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f8522e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f8522e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f8522e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.msl
index 8a65be1..30cefbb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f8522e(texture2d<int, access::sample> tint_symbol_1) {
+void textureDimensions_f8522e(texture2d<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureDimensions_f8522e(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_f8522e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f8522e(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f8522e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f8522e(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f8522e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.spvasm
index f912b4a..b7c21ee 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f8522e "textureDimensions_f8522e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f8522e = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %20 %int_0
-               OpStore %res %17
+%textureDimensions_f8522e = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v2uint %23 %int_0
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_f8522e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_f8522e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_f8522e
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_f8522e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_f8522e
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_f8522e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.wgsl
index a9491d4..bc0a02f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f8522e() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f8522e();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl
index 3094b6a..62f5cf0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<bgra8unorm, write>) -> vec2<u32>
 fn textureDimensions_fbb15a() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.dxc.hlsl
index 4de727e..afc4457 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_fbb15a() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.fxc.hlsl
index 4de727e..afc4457 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_fbb15a() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.glsl
index 5eeec24..611c55a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fbb15a() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fbb15a() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fbb15a() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.msl
index ae23db0..1767300 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_fbb15a(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_fbb15a(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_fbb15a(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_fbb15a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_fbb15a(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_fbb15a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_fbb15a(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_fbb15a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.spvasm
index 3715140..c642386 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_fbb15a "textureDimensions_fbb15a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_fbb15a = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_fbb15a = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_fbb15a
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_fbb15a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_fbb15a
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_fbb15a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_fbb15a
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_fbb15a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.wgsl
index 36b0d9e..038ae07 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fbb15a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_fbb15a() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_fbb15a();
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl
index 2b4cc4c..5b80aa8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<i32>, level: i32) -> vec2<u32>
 fn textureDimensions_fdf6e9() {
   var res: vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
index 0308538..69f4e3f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_fdf6e9() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
index 0308538..69f4e3f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_fdf6e9() {
   int4 tint_tmp;
   arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.glsl
index 4a03d8b..7411a2e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fdf6e9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fdf6e9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fdf6e9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.msl
index e6a4cf8..8fe3224 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_fdf6e9(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_fdf6e9(texture2d_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_fdf6e9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_fdf6e9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_fdf6e9(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_fdf6e9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_fdf6e9(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_fdf6e9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.spvasm
index f61ed6f..60a308c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_fdf6e9 "textureDimensions_fdf6e9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
       %int_1 = OpConstant %int 1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_fdf6e9 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySizeLod %v3uint %22 %int_1
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_fdf6e9 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySizeLod %v3uint %25 %int_1
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_fdf6e9
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_fdf6e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_fdf6e9
+%fragment_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_fdf6e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_fdf6e9
+%compute_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_fdf6e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.wgsl
index 0af7ec9..3f40747 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_fdf6e9() {
   var res : vec2<u32> = textureDimensions(arg_0, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_fdf6e9();
diff --git a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl
index 3641e75..a98e109 100644
--- a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube<i32>, sampler: sampler, coords: vec3<f32>) -> vec4<i32>
 fn textureGather_0166ec() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.dxc.hlsl
index 6d68bcb..08f308d 100644
--- a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_0166ec() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.fxc.hlsl
index 6d68bcb..08f308d 100644
--- a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_0166ec() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.glsl
index 51c3ece..b58e73c 100644
--- a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_0166ec() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_0166ec() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_0166ec() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.msl
index 1c68ab7..70ba951 100644
--- a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_0166ec(texturecube<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_0166ec(texturecube<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_0166ec(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_0166ec(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_0166ec(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_0166ec(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_0166ec(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_0166ec(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.spvasm
index 783c096..aa9df04 100644
--- a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_0166ec "textureGather_0166ec"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,47 +48,55 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %33 = OpConstantNull %v4int
-         %34 = OpTypeFunction %v4float
-%textureGather_0166ec = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %33
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4int %25 %28 %uint_1
-               OpStore %res %20
+         %36 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %41 = OpTypeFunction %v4float
+%textureGather_0166ec = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %36
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4int %28 %31 %uint_1
+               OpStore %res %24
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %40 = OpLoad %v4int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureGather_0166ec
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureGather_0166ec
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %20
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_0166ec
+%fragment_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_0166ec
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_0166ec
+%compute_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_0166ec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.wgsl
index 8e2b64c..92321e6 100644
--- a/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/0166ec.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_0166ec() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_0166ec();
diff --git a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl
index ed3f46c..556fb45 100644
--- a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube_array<i32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<i32>
 fn textureGather_04fa78() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.dxc.hlsl
index 74e06a3..3561243 100644
--- a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_04fa78() {
   int4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.fxc.hlsl
index 74e06a3..3561243 100644
--- a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_04fa78() {
   int4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.msl
index e2de24c..cc04ef6 100644
--- a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_04fa78(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_04fa78(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1u, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_04fa78(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_04fa78(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_04fa78(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_04fa78(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_04fa78(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_04fa78(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.spvasm
index e22ebf7..cd311c5 100644
--- a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_04fa78 "textureGather_04fa78"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %38 = OpConstantNull %v4int
-         %39 = OpTypeFunction %v4float
-%textureGather_04fa78 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %38
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpCompositeExtract %float %28 2
-         %32 = OpConvertUToF %float %uint_1
-         %35 = OpCompositeConstruct %v4float %29 %30 %31 %32
-         %20 = OpImageGather %v4int %25 %35 %uint_1
-               OpStore %res %20
+         %41 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %46 = OpTypeFunction %v4float
+%textureGather_04fa78 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %41
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpCompositeExtract %float %31 2
+         %35 = OpConvertUToF %float %uint_1
+         %38 = OpCompositeConstruct %v4float %32 %33 %34 %35
+         %24 = OpImageGather %v4int %28 %38 %uint_1
+               OpStore %res %24
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %45 = OpLoad %v4int %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_04fa78
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_04fa78
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_04fa78
+%fragment_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_04fa78
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_04fa78
+%compute_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_04fa78
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.wgsl
index 0e53955..913397f 100644
--- a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_04fa78() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_04fa78();
diff --git a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl
index d913365..094d296 100644
--- a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>) -> vec4<f32>
 fn textureGather_10c554() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.dxc.hlsl
index 961fbcd..c5e8b19 100644
--- a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_10c554() {
   float4 res = arg_0.Gather(arg_1, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.fxc.hlsl
index 961fbcd..c5e8b19 100644
--- a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_10c554() {
   float4 res = arg_0.Gather(arg_1, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.glsl
index 8efbbef..a01cc37 100644
--- a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_10c554() {
   vec4 res = textureGather(arg_0_arg_1, vec3(1.0f), 0.0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_10c554() {
   vec4 res = textureGather(arg_0_arg_1, vec3(1.0f), 0.0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_10c554() {
   vec4 res = textureGather(arg_0_arg_1, vec3(1.0f), 0.0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.msl
index 1c70a63..3bcd170 100644
--- a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_10c554(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_10c554(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_10c554(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_10c554(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_10c554(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_10c554(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_10c554(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_10c554(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.spvasm
index 1054b44..c8974c0 100644
--- a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_10c554 "textureGather_10c554"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,45 +47,54 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
-%textureGather_10c554 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
+%textureGather_10c554 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %int_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %int_0
+               OpStore %res %22
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureGather_10c554
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureGather_10c554
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_10c554
+%fragment_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_10c554
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_10c554
+%compute_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_10c554
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.wgsl
index b4c068d..2a9f453 100644
--- a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_10c554() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_10c554();
diff --git a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl
index 27c181d..6cfb3a0 100644
--- a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32>
 fn textureGather_11b2db() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.dxc.hlsl
index 7f5a764..b46b287 100644
--- a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_11b2db() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.fxc.hlsl
index 7f5a764..b46b287 100644
--- a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_11b2db() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.glsl
index a3ee0b8..e263e66 100644
--- a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_11b2db() {
   vec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_11b2db() {
   vec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_11b2db() {
   vec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.msl
index 900c473..ad96c22 100644
--- a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_11b2db(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_11b2db(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_11b2db(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_11b2db(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_11b2db(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_11b2db(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_11b2db(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_11b2db(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.spvasm
index d86eceb..d3d7167 100644
--- a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_11b2db "textureGather_11b2db"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,45 +47,53 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
-%textureGather_11b2db = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %38 = OpTypeFunction %v4float
+%textureGather_11b2db = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %uint_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %uint_1
+               OpStore %res %22
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureGather_11b2db
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureGather_11b2db
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_11b2db
+%fragment_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGather_11b2db
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_11b2db
+%compute_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_11b2db
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.wgsl
index 4598046..a0344b6 100644
--- a/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/11b2db.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_11b2db() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_11b2db();
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl
index b98fda0..4049136 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<f32>
 fn textureGather_17baac() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.dxc.hlsl
index 686fcae..6eee30b 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_17baac() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.fxc.hlsl
index 686fcae..6eee30b 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_17baac() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.glsl
index 1546cc1..5e50ac6 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_17baac() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_17baac() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_17baac() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.msl
index bf7e8af..f976a05 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_17baac(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_17baac(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_17baac(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_17baac(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_17baac(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_17baac(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_17baac(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_17baac(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.spvasm
index b909cdb..61be1e8 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_17baac "textureGather_17baac"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGather_17baac = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_17baac = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_1
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_17baac
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_17baac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_17baac
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_17baac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_17baac
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_17baac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.wgsl
index a50cddd..896da5f 100644
--- a/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/17baac.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_17baac() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_17baac();
diff --git a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl
index 6c58f77..0d5fa0b 100644
--- a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<u32>
 fn textureGather_1bf0ab() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.dxc.hlsl
index e5ae6c4..ea40413 100644
--- a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_1bf0ab() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.fxc.hlsl
index e5ae6c4..ea40413 100644
--- a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_1bf0ab() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.glsl
index bd3941d..2bfa786b 100644
--- a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_1bf0ab() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_1bf0ab() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_1bf0ab() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.msl
index b498c16..ba0d0f3 100644
--- a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_1bf0ab(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_1bf0ab(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_1bf0ab(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_1bf0ab(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_1bf0ab(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_1bf0ab(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_1bf0ab(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_1bf0ab(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.spvasm
index bf4b03f..1f8daad 100644
--- a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_1bf0ab "textureGather_1bf0ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,51 +48,59 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %37 = OpConstantNull %v4uint
-         %38 = OpTypeFunction %v4float
-%textureGather_1bf0ab = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %37
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %34 %uint_1
-               OpStore %res %20
+         %40 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %45 = OpTypeFunction %v4float
+%textureGather_1bf0ab = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %40
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %37 %uint_1
+               OpStore %res %24
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %44 = OpLoad %v4uint %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_1bf0ab
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_1bf0ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %20
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_1bf0ab
+%fragment_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_1bf0ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_1bf0ab
+%compute_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_1bf0ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.wgsl
index 1f2011a..958b59a 100644
--- a/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/1bf0ab.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_1bf0ab() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_1bf0ab();
diff --git a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl
index 1a5f70d..e444e7f 100644
--- a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_1f7f6b() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.dxc.hlsl
index 6ca6ff8..ac07f94 100644
--- a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_1f7f6b() {
   float4 res = arg_0.Gather(arg_1, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_1f7f6b();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.fxc.hlsl
index 6ca6ff8..210efb7 100644
--- a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_1f7f6b() {
   float4 res = arg_0.Gather(arg_1, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.glsl
index 3ca8a15..fa11e5b 100644
--- a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_1f7f6b() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec2(1.0f), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_1f7f6b() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec2(1.0f), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_1f7f6b() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec2(1.0f), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.msl
index 0ad58f0..9d99e6c 100644
--- a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_1f7f6b(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_1f7f6b(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_1f7f6b(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_1f7f6b(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_1f7f6b(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_1f7f6b(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_1f7f6b(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_1f7f6b(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.spvasm
index 874d548..7a5bf29 100644
--- a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_1f7f6b "textureGather_1f7f6b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,48 +47,57 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %31 = OpConstantComposite %v2int %int_1 %int_1
+         %34 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpTypeFunction %v4float
-%textureGather_1f7f6b = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %42 = OpTypeFunction %v4float
+%textureGather_1f7f6b = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %int_0 ConstOffset %31
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %int_0 ConstOffset %34
+               OpStore %res %22
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %41 = OpLoad %v4float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureGather_1f7f6b
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureGather_1f7f6b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_1f7f6b
+%fragment_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_1f7f6b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_1f7f6b
+%compute_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_1f7f6b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.wgsl
index 3a3e2cf..8444847 100644
--- a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_1f7f6b() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_1f7f6b();
diff --git a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl
index 0e2c97a..c6d4eb2 100644
--- a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<f32>
 fn textureGather_22e930() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.dxc.hlsl
index dadcc9e..aff33dd 100644
--- a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_22e930() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.fxc.hlsl
index dadcc9e..aff33dd 100644
--- a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_22e930() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.glsl
index 56ebbfc..a220e14f 100644
--- a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_22e930() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_22e930() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_22e930() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.msl
index 11278d6..20a059c 100644
--- a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_22e930(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_22e930(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_22e930(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_22e930(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_22e930(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_22e930(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_22e930(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_22e930(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.spvasm
index 4e541a1..dc576c4 100644
--- a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_22e930 "textureGather_22e930"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,50 +47,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGather_22e930 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureGather_22e930 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_1
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGather_22e930
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGather_22e930
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_22e930
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_22e930
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_22e930
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_22e930
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.wgsl
index 6e8f47d..5266200 100644
--- a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_22e930() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_22e930();
diff --git a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl
index bdfac2c..d7aeaf3 100644
--- a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_238ec4() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.dxc.hlsl
index e3fe82c..0fa2166 100644
--- a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_238ec4() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_238ec4();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.fxc.hlsl
index e3fe82c..751e262 100644
--- a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_238ec4() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.glsl
index b45b48a..898c7c0 100644
--- a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_238ec4() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_238ec4() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_238ec4() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.msl
index b1026d2..5c00dd1 100644
--- a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_238ec4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_238ec4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_238ec4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_238ec4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_238ec4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_238ec4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_238ec4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_238ec4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.spvasm
index f2bc0de..abb61fe 100644
--- a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_238ec4 "textureGather_238ec4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureGather_238ec4 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %47 = OpTypeFunction %v4float
+%textureGather_238ec4 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %uint_1 ConstOffset %37
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %uint_1 ConstOffset %40
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_238ec4
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_238ec4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_238ec4
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_238ec4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_238ec4
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_238ec4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.wgsl
index e985158..413a9ee 100644
--- a/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/238ec4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_238ec4() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_238ec4();
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl
index f922b9c..37fd1b1 100644
--- a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<f32>
 fn textureGather_24b0bd() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.dxc.hlsl
index c543616..b41164a 100644
--- a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_24b0bd() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.fxc.hlsl
index c543616..b41164a 100644
--- a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_24b0bd() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.glsl
index 3c0d2c4..e0c4586 100644
--- a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_24b0bd() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_24b0bd() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_24b0bd() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.msl
index 17bd3dd..137c35d 100644
--- a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_24b0bd(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_24b0bd(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_24b0bd(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_24b0bd(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_24b0bd(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_24b0bd(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_24b0bd(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_24b0bd(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.spvasm
index 2e9a562..8c9da60 100644
--- a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_24b0bd "textureGather_24b0bd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGather_24b0bd = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_24b0bd = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %uint_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %uint_1
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_24b0bd
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_24b0bd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_24b0bd
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_24b0bd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_24b0bd
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_24b0bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.wgsl
index 2c74356..9e3fb16 100644
--- a/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/24b0bd.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_24b0bd() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_24b0bd();
diff --git a/test/tint/builtins/gen/literal/textureGather/269250.wgsl b/test/tint/builtins/gen/literal/textureGather/269250.wgsl
index 430edb8..4a8105f 100644
--- a/test/tint/builtins/gen/literal/textureGather/269250.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/269250.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<i32>
 fn textureGather_269250() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.dxc.hlsl
index 65a7bcc..8d05364 100644
--- a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_269250() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.fxc.hlsl
index 65a7bcc..8d05364 100644
--- a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_269250() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.glsl
index b22da1b..085823c 100644
--- a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_269250() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_269250() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_269250() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.msl
index 61afc23..db0d9e2 100644
--- a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_269250(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_269250(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_269250(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_269250(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_269250(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_269250(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_269250(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_269250(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.spvasm
index 38906b3..f30db37 100644
--- a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_269250 "textureGather_269250"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,52 +48,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %38 = OpConstantNull %v4int
-         %39 = OpTypeFunction %v4float
-%textureGather_269250 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %38
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertUToF %float %uint_1
-         %35 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4int %25 %35 %uint_1
-               OpStore %res %20
+         %41 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %46 = OpTypeFunction %v4float
+%textureGather_269250 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %41
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertUToF %float %uint_1
+         %38 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4int %28 %38 %uint_1
+               OpStore %res %24
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %45 = OpLoad %v4int %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_269250
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_269250
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_269250
+%fragment_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_269250
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_269250
+%compute_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_269250
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.wgsl
index c1431e4..2f96a3a 100644
--- a/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/269250.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_269250() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_269250();
diff --git a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl
index f678a5b..3c0b2f5 100644
--- a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<f32>
 fn textureGather_2a4f40() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.dxc.hlsl
index 9db6f8f..78523f1 100644
--- a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2a4f40() {
   float4 res = arg_0.Gather(arg_1, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.fxc.hlsl
index 9db6f8f..78523f1 100644
--- a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2a4f40() {
   float4 res = arg_0.Gather(arg_1, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.glsl
index 84872c9..13cab31 100644
--- a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2a4f40() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 0.0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2a4f40() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 0.0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2a4f40() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 0.0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.msl
index a647316..1c26001 100644
--- a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_2a4f40(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_2a4f40(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_2a4f40(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_2a4f40(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_2a4f40(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_2a4f40(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_2a4f40(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_2a4f40(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.spvasm
index ffc18d5..82b009b 100644
--- a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_2a4f40 "textureGather_2a4f40"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGather_2a4f40 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_2a4f40 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_0
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_2a4f40
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_2a4f40
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_2a4f40
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_2a4f40
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_2a4f40
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_2a4f40
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.wgsl
index bc6a8c0..b78dabf 100644
--- a/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/2a4f40.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_2a4f40() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_2a4f40();
diff --git a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl
index afa270a..1b22db0 100644
--- a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<u32>
 fn textureGather_2cc066() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.dxc.hlsl
index 01eef68..27f92ff 100644
--- a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2cc066() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.fxc.hlsl
index 01eef68..27f92ff 100644
--- a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2cc066() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.glsl
index 906dd13..1e9a73c 100644
--- a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_2cc066() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_2cc066() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_2cc066() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.msl
index 9c27e69..e1c94e9 100644
--- a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_2cc066(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_2cc066(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_2cc066(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_2cc066(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_2cc066(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_2cc066(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_2cc066(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_2cc066(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.spvasm
index b8f5938..58f5009 100644
--- a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_2cc066 "textureGather_2cc066"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,52 +48,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %38 = OpConstantNull %v4uint
-         %39 = OpTypeFunction %v4float
-%textureGather_2cc066 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %38
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertSToF %float %int_1
-         %35 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %35 %int_1
-               OpStore %res %20
+         %41 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %46 = OpTypeFunction %v4float
+%textureGather_2cc066 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %41
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertSToF %float %int_1
+         %38 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %38 %int_1
+               OpStore %res %24
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %45 = OpLoad %v4uint %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_2cc066
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_2cc066
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_2cc066
+%fragment_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_2cc066
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_2cc066
+%compute_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_2cc066
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.wgsl
index 9f71bf4..c3d5d58 100644
--- a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_2cc066() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_2cc066();
diff --git a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl
index 410adfd..bfbb05b 100644
--- a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
 fn textureGather_2e0ed5() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.dxc.hlsl
index 1da303c..f1def26 100644
--- a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2e0ed5() {
   float4 res = arg_0.Gather(arg_1, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.fxc.hlsl
index 1da303c..f1def26 100644
--- a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2e0ed5() {
   float4 res = arg_0.Gather(arg_1, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.glsl
index c4b7932..07838e2 100644
--- a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2e0ed5() {
   vec4 res = textureGather(arg_0_arg_1, vec2(1.0f), 0.0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2e0ed5() {
   vec4 res = textureGather(arg_0_arg_1, vec2(1.0f), 0.0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2e0ed5() {
   vec4 res = textureGather(arg_0_arg_1, vec2(1.0f), 0.0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.msl
index 646efa0..2778880 100644
--- a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_2e0ed5(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_2e0ed5(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_2e0ed5(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_2e0ed5(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_2e0ed5(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_2e0ed5(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_2e0ed5(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_2e0ed5(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.spvasm
index f787563..f149a35 100644
--- a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_2e0ed5 "textureGather_2e0ed5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,45 +47,54 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
-%textureGather_2e0ed5 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
+%textureGather_2e0ed5 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %int_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %int_0
+               OpStore %res %22
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureGather_2e0ed5
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureGather_2e0ed5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_2e0ed5
+%fragment_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_2e0ed5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_2e0ed5
+%compute_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_2e0ed5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.wgsl
index 94df481..dccdb7a 100644
--- a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_2e0ed5() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_2e0ed5();
diff --git a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl
index de80564..3cf76d3 100644
--- a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32>
 fn textureGather_32c4e8() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.dxc.hlsl
index ce85f35..36d8d8a 100644
--- a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_32c4e8() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.fxc.hlsl
index ce85f35..36d8d8a 100644
--- a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_32c4e8() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.glsl
index bf84c6c..aea29f5 100644
--- a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_32c4e8() {
   vec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_32c4e8() {
   vec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_32c4e8() {
   vec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.msl
index 7a9044f..2fc3b7e 100644
--- a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_32c4e8(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_32c4e8(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_32c4e8(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_32c4e8(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_32c4e8(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_32c4e8(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_32c4e8(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_32c4e8(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.spvasm
index 080c3f8..b9a1e4a 100644
--- a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_32c4e8 "textureGather_32c4e8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,45 +47,54 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
-%textureGather_32c4e8 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
+%textureGather_32c4e8 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %int_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %int_1
+               OpStore %res %22
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureGather_32c4e8
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureGather_32c4e8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_32c4e8
+%fragment_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_32c4e8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_32c4e8
+%compute_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_32c4e8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.wgsl
index f32d23b..8fcd988 100644
--- a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_32c4e8() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_32c4e8();
diff --git a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl
index a03abf8..d9a6bd4 100644
--- a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube<u32>, sampler: sampler, coords: vec3<f32>) -> vec4<u32>
 fn textureGather_3b32cc() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.dxc.hlsl
index b018cb7..a35ac4e 100644
--- a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_3b32cc() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.fxc.hlsl
index b018cb7..a35ac4e 100644
--- a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_3b32cc() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.glsl
index 4860102..938b371 100644
--- a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_3b32cc() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_3b32cc() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_3b32cc() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.msl
index 5f4d892..bfbe53f 100644
--- a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_3b32cc(texturecube<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_3b32cc(texturecube<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_3b32cc(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_3b32cc(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_3b32cc(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_3b32cc(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_3b32cc(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_3b32cc(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.spvasm
index 7144ab2..7abdb18 100644
--- a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_3b32cc "textureGather_3b32cc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,47 +48,55 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %33 = OpConstantNull %v4uint
-         %34 = OpTypeFunction %v4float
-%textureGather_3b32cc = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %33
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4uint %25 %28 %int_1
-               OpStore %res %20
+         %36 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %41 = OpTypeFunction %v4float
+%textureGather_3b32cc = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %36
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4uint %28 %31 %int_1
+               OpStore %res %24
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %40 = OpLoad %v4uint %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureGather_3b32cc
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureGather_3b32cc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %20
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_3b32cc
+%fragment_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_3b32cc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_3b32cc
+%compute_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_3b32cc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.wgsl
index bcee7c0..82160ce 100644
--- a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_3b32cc() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_3b32cc();
diff --git a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl
index 23b0ac9..17be134 100644
--- a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<f32>
 fn textureGather_43025d() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.dxc.hlsl
index e38f9d9..40a82d1 100644
--- a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_43025d() {
   float4 res = arg_0.Gather(arg_1, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.fxc.hlsl
index e38f9d9..40a82d1 100644
--- a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_43025d() {
   float4 res = arg_0.Gather(arg_1, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.msl
index 0ecacb7..9db8de6 100644
--- a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_43025d(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_43025d(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_43025d(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_43025d(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_43025d(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_43025d(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_43025d(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_43025d(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.spvasm
index d72e46f..fdf97df 100644
--- a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_43025d "textureGather_43025d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,51 +48,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %37 = OpTypeFunction %v4float
-%textureGather_43025d = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_43025d = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_0
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_43025d
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_43025d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_43025d
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_43025d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_43025d
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_43025d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.wgsl
index d249e2d..16dc823 100644
--- a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_43025d() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_43025d();
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl
index e8637bf..9c66ad9 100644
--- a/test/tint/builtins/gen/literal/textureGather/445793.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<i32>
 fn textureGather_445793() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.dxc.hlsl
index d88812f..fa37e35 100644
--- a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_445793() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.fxc.hlsl
index d88812f..fa37e35 100644
--- a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_445793() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.glsl
index 5e342a1..136e647 100644
--- a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_445793() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_445793() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_445793() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.msl
index 234f3f1..6fb4a5f 100644
--- a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_445793(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_445793(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_445793(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_445793(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_445793(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_445793(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_445793(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_445793(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.spvasm
index 5166bb9..a780e5e 100644
--- a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_445793 "textureGather_445793"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,53 +48,61 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %39 = OpConstantNull %v4int
-         %40 = OpTypeFunction %v4float
-%textureGather_445793 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4int %25 %34 %uint_1
-               OpStore %res %20
+         %42 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %47 = OpTypeFunction %v4float
+%textureGather_445793 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4int %28 %37 %uint_1
+               OpStore %res %24
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %46 = OpLoad %v4int %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_445793
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_445793
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_445793
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_445793
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_445793
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_445793
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.wgsl
index c677b36..e173190 100644
--- a/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/445793.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_445793() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_445793();
diff --git a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl
index 56731ba..afc419c 100644
--- a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d<u32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<u32>
 fn textureGather_49b07f() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.dxc.hlsl
index e0d34b9..c3f7f5f 100644
--- a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_49b07f() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_49b07f();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.fxc.hlsl
index e0d34b9..ac21f15 100644
--- a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_49b07f() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.glsl
index 2c332d1..4734bf0 100644
--- a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_49b07f() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_49b07f() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_49b07f() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.msl
index 771a89a..ea786cd 100644
--- a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_49b07f(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_49b07f(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_49b07f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_49b07f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_49b07f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_49b07f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_49b07f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_49b07f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.spvasm
index f0b9b75..3c9609c 100644
--- a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_49b07f "textureGather_49b07f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,49 +48,57 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %32 = OpConstantComposite %v2int %int_1 %int_1
+         %35 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %35 = OpConstantNull %v4uint
-         %36 = OpTypeFunction %v4float
-%textureGather_49b07f = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %35
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4uint %25 %28 %int_1 ConstOffset %32
-               OpStore %res %20
+         %38 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
+%textureGather_49b07f = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %38
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4uint %28 %31 %int_1 ConstOffset %35
+               OpStore %res %24
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGather_49b07f
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGather_49b07f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %20
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_49b07f
+%fragment_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_49b07f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_49b07f
+%compute_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_49b07f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.wgsl
index 929e797..17a9cfb 100644
--- a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_49b07f() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_49b07f();
diff --git a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl
index cbde492..8773738 100644
--- a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_4b8103() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.dxc.hlsl
index 8baf1a6..0b9ceb7 100644
--- a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_4b8103() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_4b8103();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.fxc.hlsl
index 8baf1a6..f8e2867 100644
--- a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_4b8103() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.glsl
index 36dd831..15923e5 100644
--- a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_4b8103() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_4b8103() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_4b8103() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.msl
index 55dd24f..5c87274 100644
--- a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_4b8103(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_4b8103(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_4b8103(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_4b8103(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_4b8103(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_4b8103(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_4b8103(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_4b8103(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.spvasm
index 6c4365d..4c4b231 100644
--- a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_4b8103 "textureGather_4b8103"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %35 = OpConstantComposite %v2int %int_1 %int_1
+         %38 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGather_4b8103 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %46 = OpTypeFunction %v4float
+%textureGather_4b8103 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_1 ConstOffset %35
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_1 ConstOffset %38
+               OpStore %res %22
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_4b8103
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_4b8103
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_4b8103
+%fragment_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_4b8103
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_4b8103
+%compute_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_4b8103
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.wgsl
index 9c9e1be..d5fa8ae 100644
--- a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_4b8103() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_4b8103();
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl
index 135d996..186cd54 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<i32>
 fn textureGather_4e8ac5() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.dxc.hlsl
index 432c441..56a4430 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_4e8ac5() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.fxc.hlsl
index 432c441..56a4430 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_4e8ac5() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.glsl
index c655ed3..f61d83a 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_4e8ac5() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_4e8ac5() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_4e8ac5() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.msl
index 897cfde..5fee988 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_4e8ac5(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_4e8ac5(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_4e8ac5(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_4e8ac5(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_4e8ac5(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_4e8ac5(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_4e8ac5(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_4e8ac5(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.spvasm
index 8f9858a..d00c15d 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_4e8ac5 "textureGather_4e8ac5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,53 +48,61 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %39 = OpConstantNull %v4int
-         %40 = OpTypeFunction %v4float
-%textureGather_4e8ac5 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertUToF %float %uint_1
-         %35 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4int %25 %35 %int_1
-               OpStore %res %20
+         %42 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %47 = OpTypeFunction %v4float
+%textureGather_4e8ac5 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertUToF %float %uint_1
+         %38 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4int %28 %38 %int_1
+               OpStore %res %24
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %46 = OpLoad %v4int %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_4e8ac5
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_4e8ac5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_4e8ac5
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_4e8ac5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_4e8ac5
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_4e8ac5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.wgsl
index 2743c6b..41bfa71 100644
--- a/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/4e8ac5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_4e8ac5() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_4e8ac5();
diff --git a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl
index 1de19ec..3eafc7d 100644
--- a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
 fn textureGather_5266da() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.dxc.hlsl
index 751ee8f..763d054 100644
--- a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5266da() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.fxc.hlsl
index 751ee8f..763d054 100644
--- a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5266da() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.glsl
index a9d6fe2..e0e074d 100644
--- a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_5266da() {
   vec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_5266da() {
   vec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_5266da() {
   vec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.msl
index 82d7886..fd80139 100644
--- a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_5266da(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_5266da(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_5266da(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_5266da(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_5266da(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_5266da(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_5266da(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_5266da(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.spvasm
index 9679774..90e2be9 100644
--- a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_5266da "textureGather_5266da"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,45 +47,54 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
-%textureGather_5266da = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
+%textureGather_5266da = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %int_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %int_1
+               OpStore %res %22
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureGather_5266da
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureGather_5266da
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_5266da
+%fragment_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_5266da
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_5266da
+%compute_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_5266da
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.wgsl
index e9724b2..365223e 100644
--- a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_5266da() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_5266da();
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl
index 8c5306c..c9f798a 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_59372a() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.dxc.hlsl
index 2670088..a529866 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_59372a() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_59372a();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.fxc.hlsl
index 2670088..909ed13 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_59372a() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.glsl
index dd7eeae..15cdfa2 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_59372a() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_59372a() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_59372a() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.msl
index b0498a8..0affedc 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_59372a(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_59372a(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_59372a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_59372a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_59372a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_59372a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_59372a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_59372a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.spvasm
index 2e92199..ea486ee 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_59372a "textureGather_59372a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureGather_59372a = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %47 = OpTypeFunction %v4float
+%textureGather_59372a = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_1 ConstOffset %37
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_1 ConstOffset %40
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_59372a
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_59372a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_59372a
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_59372a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_59372a
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_59372a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.wgsl
index bf9b38b..5884c2c 100644
--- a/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/59372a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_59372a() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_59372a();
diff --git a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl
index 006429c..62859d5 100644
--- a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube<i32>, sampler: sampler, coords: vec3<f32>) -> vec4<i32>
 fn textureGather_5ba85f() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.dxc.hlsl
index 26e6bd9..f663605 100644
--- a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5ba85f() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.fxc.hlsl
index 26e6bd9..f663605 100644
--- a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5ba85f() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.glsl
index 87ae300..5efbb38 100644
--- a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_5ba85f() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_5ba85f() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_5ba85f() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.msl
index 3f92154..ba064a6 100644
--- a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_5ba85f(texturecube<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_5ba85f(texturecube<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_5ba85f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_5ba85f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_5ba85f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_5ba85f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_5ba85f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_5ba85f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.spvasm
index 6b26297..8c8af8f 100644
--- a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_5ba85f "textureGather_5ba85f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,46 +48,55 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %32 = OpConstantNull %v4int
-         %33 = OpTypeFunction %v4float
-%textureGather_5ba85f = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %32
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4int %25 %28 %int_1
-               OpStore %res %20
+         %35 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %41 = OpTypeFunction %v4float
+%textureGather_5ba85f = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %35
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4int %28 %31 %int_1
+               OpStore %res %24
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %40 = OpLoad %v4int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureGather_5ba85f
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureGather_5ba85f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %20
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_5ba85f
+%fragment_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_5ba85f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_5ba85f
+%compute_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_5ba85f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.wgsl
index 8a37d05..006d77a 100644
--- a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_5ba85f() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_5ba85f();
diff --git a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl
index ccf4204..512d5f9 100644
--- a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d<u32>, sampler: sampler, coords: vec2<f32>) -> vec4<u32>
 fn textureGather_5bd491() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.dxc.hlsl
index 701563d..a401d7b 100644
--- a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5bd491() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.fxc.hlsl
index 701563d..a401d7b 100644
--- a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5bd491() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.glsl
index 81b595d..c5d9cd3 100644
--- a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_5bd491() {
   uvec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_5bd491() {
   uvec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_5bd491() {
   uvec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.msl
index 00e6bf5..0555b66 100644
--- a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_5bd491(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_5bd491(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_5bd491(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_5bd491(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_5bd491(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_5bd491(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_5bd491(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_5bd491(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.spvasm
index 311512a..3cd27c4 100644
--- a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_5bd491 "textureGather_5bd491"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,47 +48,55 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %33 = OpConstantNull %v4uint
-         %34 = OpTypeFunction %v4float
-%textureGather_5bd491 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %33
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4uint %25 %28 %int_1
-               OpStore %res %20
+         %36 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %41 = OpTypeFunction %v4float
+%textureGather_5bd491 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %36
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4uint %28 %31 %int_1
+               OpStore %res %24
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %40 = OpLoad %v4uint %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureGather_5bd491
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureGather_5bd491
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %20
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_5bd491
+%fragment_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_5bd491
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_5bd491
+%compute_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_5bd491
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.wgsl
index e29865d..89c93c2 100644
--- a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_5bd491() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_5bd491();
diff --git a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl
index 4bdd2e8..6aa9ee0 100644
--- a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<u32>
 fn textureGather_6b7b74() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.dxc.hlsl
index e304da8..fe497a0 100644
--- a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_6b7b74() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_6b7b74();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.fxc.hlsl
index e304da8..919f792 100644
--- a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_6b7b74() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.glsl
index 96fabc0..dd81216 100644
--- a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_6b7b74() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_6b7b74() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_6b7b74() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.msl
index 2de79ed..f0372ed 100644
--- a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_6b7b74(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_6b7b74(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_6b7b74(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_6b7b74(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_6b7b74(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_6b7b74(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_6b7b74(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_6b7b74(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.spvasm
index 6e2a399..a3cfc49 100644
--- a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_6b7b74 "textureGather_6b7b74"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,55 +48,63 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %41 = OpConstantNull %v4uint
-         %42 = OpTypeFunction %v4float
-%textureGather_6b7b74 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %41
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %34 %uint_1 ConstOffset %38
-               OpStore %res %20
+         %44 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %49 = OpTypeFunction %v4float
+%textureGather_6b7b74 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %44
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %37 %uint_1 ConstOffset %41
+               OpStore %res %24
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %48 = OpLoad %v4uint %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_6b7b74
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_6b7b74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_6b7b74
+%fragment_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_6b7b74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGather_6b7b74
+%compute_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGather_6b7b74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.wgsl
index 92e7d14..ad1bfed 100644
--- a/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/6b7b74.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_6b7b74() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_6b7b74();
diff --git a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl
index 3d5cc89..5cd8f5e 100644
--- a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<f32>
 fn textureGather_751f8a() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.dxc.hlsl
index 07496e0..8885fa5 100644
--- a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_751f8a() {
   float4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.fxc.hlsl
index 07496e0..8885fa5 100644
--- a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_751f8a() {
   float4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.msl
index 2837f2e..2145a90 100644
--- a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_751f8a(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_751f8a(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_751f8a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_751f8a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_751f8a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_751f8a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_751f8a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_751f8a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.spvasm
index 787d887..dff3bb2 100644
--- a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_751f8a "textureGather_751f8a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGather_751f8a = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureGather_751f8a = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_1
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGather_751f8a
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGather_751f8a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_751f8a
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_751f8a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_751f8a
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_751f8a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.wgsl
index 9e29ed7..b549962 100644
--- a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_751f8a() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_751f8a();
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl
index 819e6fa..dd0f943 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube_array<i32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<i32>
 fn textureGather_788010() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.dxc.hlsl
index f7d95cb..d9ae5db 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_788010() {
   int4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.fxc.hlsl
index f7d95cb..d9ae5db 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_788010() {
   int4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.msl
index ec066cf..4af999d 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_788010(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_788010(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1u, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_788010(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_788010(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_788010(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_788010(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_788010(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_788010(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.spvasm
index 7540d0c..4e7fbbe 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_788010 "textureGather_788010"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,53 +49,61 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %39 = OpConstantNull %v4int
-         %40 = OpTypeFunction %v4float
-%textureGather_788010 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpCompositeExtract %float %28 2
-         %32 = OpConvertUToF %float %uint_1
-         %35 = OpCompositeConstruct %v4float %29 %30 %31 %32
-         %20 = OpImageGather %v4int %25 %35 %int_1
-               OpStore %res %20
+         %42 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %47 = OpTypeFunction %v4float
+%textureGather_788010 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpCompositeExtract %float %31 2
+         %35 = OpConvertUToF %float %uint_1
+         %38 = OpCompositeConstruct %v4float %32 %33 %34 %35
+         %24 = OpImageGather %v4int %28 %38 %int_1
+               OpStore %res %24
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %46 = OpLoad %v4int %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_788010
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_788010
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_788010
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_788010
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_788010
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_788010
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.wgsl
index 2f6772e..fe3664b 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_788010() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_788010();
diff --git a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl
index 942ae7e..6fd1f95 100644
--- a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d<i32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<i32>
 fn textureGather_7c3828() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.dxc.hlsl
index 928f915..bf4542c 100644
--- a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_7c3828() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_7c3828();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.fxc.hlsl
index 928f915..8efc76c 100644
--- a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_7c3828() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.glsl
index 1f826f7..3df6710 100644
--- a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_7c3828() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_7c3828() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_7c3828() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.msl
index 3b709ae..092e9d0 100644
--- a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_7c3828(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_7c3828(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_7c3828(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_7c3828(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_7c3828(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_7c3828(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_7c3828(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_7c3828(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.spvasm
index bb909ba..165929c 100644
--- a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_7c3828 "textureGather_7c3828"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,48 +48,57 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %31 = OpConstantComposite %v2int %int_1 %int_1
+         %34 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %34 = OpConstantNull %v4int
-         %35 = OpTypeFunction %v4float
-%textureGather_7c3828 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %34
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4int %25 %28 %int_1 ConstOffset %31
-               OpStore %res %20
+         %37 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %43 = OpTypeFunction %v4float
+%textureGather_7c3828 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %37
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4int %28 %31 %int_1 ConstOffset %34
+               OpStore %res %24
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %42 = OpLoad %v4int %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGather_7c3828
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGather_7c3828
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %20
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_7c3828
+%fragment_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_7c3828
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_7c3828
+%compute_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_7c3828
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.wgsl
index 05b6166..37e63e1 100644
--- a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_7c3828() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_7c3828();
diff --git a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl
index 575556c..823bc6b 100644
--- a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<f32>
 fn textureGather_7dd226() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.dxc.hlsl
index 29a4129..9a2137f 100644
--- a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_7dd226() {
   float4 res = arg_0.Gather(arg_1, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.fxc.hlsl
index 29a4129..9a2137f 100644
--- a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_7dd226() {
   float4 res = arg_0.Gather(arg_1, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.msl
index ab93c24..23d3b4f 100644
--- a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_7dd226(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_7dd226(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1u);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_7dd226(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_7dd226(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_7dd226(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_7dd226(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_7dd226(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_7dd226(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.spvasm
index 0c4fda9..36bac70 100644
--- a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_7dd226 "textureGather_7dd226"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,52 +48,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGather_7dd226 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_7dd226 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_0
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_7dd226
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_7dd226
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_7dd226
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_7dd226
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_7dd226
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_7dd226
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.wgsl
index e178ec2..1327f2d 100644
--- a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_7dd226() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_7dd226();
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl
index 1dfa2df..c548810 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<f32>
 fn textureGather_829357() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.dxc.hlsl
index 0fae1e0..910f4ce 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_829357() {
   float4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.fxc.hlsl
index 0fae1e0..910f4ce 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_829357() {
   float4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.msl
index b76776c..70f1e65 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_829357(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_829357(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1u, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_829357(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_829357(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_829357(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_829357(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_829357(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_829357(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.spvasm
index c7ffbfb..4016365 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_829357 "textureGather_829357"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,52 +48,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGather_829357 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_829357 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_1
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_829357
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_829357
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_829357
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_829357
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_829357
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_829357
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.wgsl
index 713468b..6b184f9 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_829357() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_829357();
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl
index 2e26228..8b3196f 100644
--- a/test/tint/builtins/gen/literal/textureGather/831549.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_831549() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.dxc.hlsl
index 892b4f3..10af682 100644
--- a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_831549() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_831549();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.fxc.hlsl
index 892b4f3..90d9cfb 100644
--- a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_831549() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.glsl
index dabc82d..fe245b9 100644
--- a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_831549() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_831549() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_831549() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.msl
index 73533b3..a5f16dd 100644
--- a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_831549(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_831549(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_831549(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_831549(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_831549(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_831549(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_831549(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_831549(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.spvasm
index 709654f..86321ad 100644
--- a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_831549 "textureGather_831549"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureGather_831549 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %47 = OpTypeFunction %v4float
+%textureGather_831549 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %uint_1 ConstOffset %37
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %uint_1 ConstOffset %40
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_831549
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_831549
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_831549
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_831549
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_831549
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_831549
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.wgsl
index 35d382c..e2bc336 100644
--- a/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/831549.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_831549() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_831549();
diff --git a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl
index be40a06..f2f7d45 100644
--- a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<f32>
 fn textureGather_8578bc() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.dxc.hlsl
index 0b8ccbe..2aecb3b 100644
--- a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8578bc() {
   float4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.fxc.hlsl
index 0b8ccbe..2aecb3b 100644
--- a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8578bc() {
   float4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.msl
index 5484cbc..1ffea46 100644
--- a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_8578bc(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_8578bc(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1u, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_8578bc(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_8578bc(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_8578bc(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_8578bc(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_8578bc(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_8578bc(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.spvasm
index efca13c..4f10f1d 100644
--- a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_8578bc "textureGather_8578bc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGather_8578bc = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureGather_8578bc = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %uint_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %uint_1
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGather_8578bc
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGather_8578bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_8578bc
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_8578bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_8578bc
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_8578bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.wgsl
index 1b8d833..45b527d 100644
--- a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_8578bc() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_8578bc();
diff --git a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl
index 128b112..a0e1779 100644
--- a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube<u32>, sampler: sampler, coords: vec3<f32>) -> vec4<u32>
 fn textureGather_89680f() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.dxc.hlsl
index 9993543..e81a30b 100644
--- a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_89680f() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.fxc.hlsl
index 9993543..e81a30b 100644
--- a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_89680f() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.glsl
index 5d7428e..68c555e 100644
--- a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_89680f() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_89680f() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_89680f() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.msl
index cd3b77f..ab9e10f 100644
--- a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_89680f(texturecube<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_89680f(texturecube<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_89680f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_89680f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_89680f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_89680f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_89680f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_89680f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.spvasm
index 6a811a6..34c03fe 100644
--- a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_89680f "textureGather_89680f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,46 +48,54 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %32 = OpConstantNull %v4uint
-         %33 = OpTypeFunction %v4float
-%textureGather_89680f = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %32
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4uint %25 %28 %uint_1
-               OpStore %res %20
+         %35 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %40 = OpTypeFunction %v4float
+%textureGather_89680f = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %35
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4uint %28 %31 %uint_1
+               OpStore %res %24
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %39 = OpLoad %v4uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureGather_89680f
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureGather_89680f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %20
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_89680f
+%fragment_main = OpFunction %void None %20
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_89680f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_89680f
+%compute_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_89680f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.wgsl
index d9f97fb..ed9158a 100644
--- a/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/89680f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_89680f() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_89680f();
diff --git a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl
index dfc7f37..c018c09 100644
--- a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<i32>
 fn textureGather_8b754c() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.dxc.hlsl
index 09bd5ec..5cdd833 100644
--- a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8b754c() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.fxc.hlsl
index 09bd5ec..5cdd833 100644
--- a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8b754c() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.glsl
index 2205065..3e942c2 100644
--- a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_8b754c() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_8b754c() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_8b754c() {
   ivec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.msl
index 55d478d..c16ca8d 100644
--- a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_8b754c(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_8b754c(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_8b754c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_8b754c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_8b754c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_8b754c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_8b754c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_8b754c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.spvasm
index b47c0d7..782de61 100644
--- a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_8b754c "textureGather_8b754c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,51 +48,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %37 = OpConstantNull %v4int
-         %38 = OpTypeFunction %v4float
-%textureGather_8b754c = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %37
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4int %25 %34 %int_1
-               OpStore %res %20
+         %40 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %46 = OpTypeFunction %v4float
+%textureGather_8b754c = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %40
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4int %28 %37 %int_1
+               OpStore %res %24
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %45 = OpLoad %v4int %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_8b754c
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_8b754c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_8b754c
+%fragment_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_8b754c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_8b754c
+%compute_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_8b754c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.wgsl
index 8f8d037..2c85ae5 100644
--- a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_8b754c() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_8b754c();
diff --git a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl
index c0a8d2b5..ca61681 100644
--- a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d<u32>, sampler: sampler, coords: vec2<f32>) -> vec4<u32>
 fn textureGather_8fae00() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.dxc.hlsl
index 309ca1d..769c474 100644
--- a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8fae00() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.fxc.hlsl
index 309ca1d..769c474 100644
--- a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8fae00() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.glsl
index d3e13cb..9c55f1d 100644
--- a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_8fae00() {
   uvec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_8fae00() {
   uvec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_8fae00() {
   uvec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.msl
index 1bcc7c4..2d50727 100644
--- a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_8fae00(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_8fae00(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_8fae00(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_8fae00(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_8fae00(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_8fae00(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_8fae00(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_8fae00(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.spvasm
index aa7bf7f..dbfd7c9 100644
--- a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_8fae00 "textureGather_8fae00"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,46 +48,54 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %32 = OpConstantNull %v4uint
-         %33 = OpTypeFunction %v4float
-%textureGather_8fae00 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %32
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4uint %25 %28 %uint_1
-               OpStore %res %20
+         %35 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %40 = OpTypeFunction %v4float
+%textureGather_8fae00 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %35
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4uint %28 %31 %uint_1
+               OpStore %res %24
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %39 = OpLoad %v4uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureGather_8fae00
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureGather_8fae00
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %20
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_8fae00
+%fragment_main = OpFunction %void None %20
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_8fae00
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_8fae00
+%compute_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_8fae00
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.wgsl
index 272f02c..c76444b 100644
--- a/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/8fae00.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_8fae00() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_8fae00();
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl
index ffa5d1b..bd9c5cc 100644
--- a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<u32>
 fn textureGather_92ea47() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.dxc.hlsl
index 94fb7b7..2025afc 100644
--- a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_92ea47() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.fxc.hlsl
index 94fb7b7..2025afc 100644
--- a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_92ea47() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.glsl
index 4990c83..c9134e5 100644
--- a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_92ea47() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_92ea47() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_92ea47() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.msl
index 00eb725..d0ff8c4 100644
--- a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_92ea47(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_92ea47(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_92ea47(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_92ea47(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_92ea47(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_92ea47(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_92ea47(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_92ea47(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.spvasm
index 52d8221..f9953d6 100644
--- a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_92ea47 "textureGather_92ea47"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,53 +48,61 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %39 = OpConstantNull %v4uint
-         %40 = OpTypeFunction %v4float
-%textureGather_92ea47 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertSToF %float %int_1
-         %35 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %35 %uint_1
-               OpStore %res %20
+         %42 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %47 = OpTypeFunction %v4float
+%textureGather_92ea47 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertSToF %float %int_1
+         %38 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %38 %uint_1
+               OpStore %res %24
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %46 = OpLoad %v4uint %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_92ea47
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_92ea47
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_92ea47
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_92ea47
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_92ea47
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_92ea47
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.wgsl
index 945fa52..e34814d 100644
--- a/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/92ea47.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_92ea47() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_92ea47();
diff --git a/test/tint/builtins/gen/literal/textureGather/986700.wgsl b/test/tint/builtins/gen/literal/textureGather/986700.wgsl
index 10ccd14..58679b4 100644
--- a/test/tint/builtins/gen/literal/textureGather/986700.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/986700.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d<u32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<u32>
 fn textureGather_986700() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.dxc.hlsl
index 55c1085..b1bc989 100644
--- a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_986700() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_986700();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.fxc.hlsl
index 55c1085..7ec214e 100644
--- a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_986700() {
   uint4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.glsl
index 022cc38..f1dda73 100644
--- a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_986700() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_986700() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_986700() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.msl
index c91ad74..6c02162 100644
--- a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_986700(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_986700(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_986700(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_986700(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_986700(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_986700(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_986700(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_986700(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.spvasm
index d0e948e..4ecb635 100644
--- a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_986700 "textureGather_986700"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,58 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %33 = OpConstantComposite %v2int %int_1 %int_1
+         %36 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %36 = OpConstantNull %v4uint
-         %37 = OpTypeFunction %v4float
-%textureGather_986700 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %36
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4uint %25 %28 %uint_1 ConstOffset %33
-               OpStore %res %20
+         %39 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %44 = OpTypeFunction %v4float
+%textureGather_986700 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %39
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4uint %28 %31 %uint_1 ConstOffset %36
+               OpStore %res %24
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %43 = OpLoad %v4uint %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_986700
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGather_986700
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_986700
+%fragment_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_986700
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_986700
+%compute_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_986700
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.wgsl
index b1c4903..ac38e66 100644
--- a/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/986700.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_986700() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_986700();
diff --git a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl
index b0f60e5..1109492 100644
--- a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<f32>
 fn textureGather_9a6358() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.dxc.hlsl
index a53f003..f60feee 100644
--- a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_9a6358() {
   float4 res = arg_0.Gather(arg_1, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.fxc.hlsl
index a53f003..f60feee 100644
--- a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_9a6358() {
   float4 res = arg_0.Gather(arg_1, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.glsl
index 7c2be9a..e4e4aa1 100644
--- a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_9a6358() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 0.0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_9a6358() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 0.0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_9a6358() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 0.0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.msl
index 574220f..868d513 100644
--- a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_9a6358(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_9a6358(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_9a6358(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_9a6358(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_9a6358(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_9a6358(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_9a6358(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_9a6358(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.spvasm
index e6c0a1a..163c9c3 100644
--- a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_9a6358 "textureGather_9a6358"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,51 +47,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %37 = OpTypeFunction %v4float
-%textureGather_9a6358 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_9a6358 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_0
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_9a6358
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_9a6358
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_9a6358
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_9a6358
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_9a6358
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_9a6358
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.wgsl
index 866c99c..d33efc0 100644
--- a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_9a6358() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_9a6358();
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl
index cccf583..14f6027 100644
--- a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<i32>
 fn textureGather_9ab41e() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.dxc.hlsl
index b2d02d9..94ebf29 100644
--- a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_9ab41e() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_9ab41e();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.fxc.hlsl
index b2d02d9..1f2e7e2 100644
--- a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_9ab41e() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.glsl
index 3c8c9f0..ab1b40b 100644
--- a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_9ab41e() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_9ab41e() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_9ab41e() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.msl
index b46b1b4..5bccae3 100644
--- a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_9ab41e(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_9ab41e(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_9ab41e(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_9ab41e(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_9ab41e(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_9ab41e(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_9ab41e(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_9ab41e(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.spvasm
index aeefee6..8bad6a4 100644
--- a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_9ab41e "textureGather_9ab41e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,55 +48,63 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %41 = OpConstantNull %v4int
-         %42 = OpTypeFunction %v4float
-%textureGather_9ab41e = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %41
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4int %25 %34 %uint_1 ConstOffset %38
-               OpStore %res %20
+         %44 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %49 = OpTypeFunction %v4float
+%textureGather_9ab41e = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %44
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4int %28 %37 %uint_1 ConstOffset %41
+               OpStore %res %24
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %48 = OpLoad %v4int %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_9ab41e
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_9ab41e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_9ab41e
+%fragment_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_9ab41e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGather_9ab41e
+%compute_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGather_9ab41e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.wgsl
index db129e4..6eb340c 100644
--- a/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/9ab41e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_9ab41e() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_9ab41e();
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl
index 09c36d8..085f1c5 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<u32>
 fn textureGather_a0372b() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.dxc.hlsl
index 1b83181..fad58cb 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_a0372b() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.fxc.hlsl
index 1b83181..fad58cb 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_a0372b() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.glsl
index ace0faf..32ce804 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_a0372b() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_a0372b() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_a0372b() {
   uvec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.msl
index 53c065b..44081fb 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_a0372b(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_a0372b(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_a0372b(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_a0372b(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_a0372b(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_a0372b(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_a0372b(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_a0372b(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.spvasm
index 70fd385..03d39fd 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_a0372b "textureGather_a0372b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,53 +48,61 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %39 = OpConstantNull %v4uint
-         %40 = OpTypeFunction %v4float
-%textureGather_a0372b = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %34 %int_1
-               OpStore %res %20
+         %42 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %47 = OpTypeFunction %v4float
+%textureGather_a0372b = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %37 %int_1
+               OpStore %res %24
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %46 = OpLoad %v4uint %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_a0372b
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_a0372b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_a0372b
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_a0372b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_a0372b
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_a0372b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.wgsl
index 13b48f3..0c94413 100644
--- a/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/a0372b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_a0372b() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_a0372b();
diff --git a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl
index 7b7b363..bbe2262 100644
--- a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_a68027() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.dxc.hlsl
index 67fe27a..5266bbb 100644
--- a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_a68027() {
   float4 res = arg_0.Gather(arg_1, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_a68027();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.fxc.hlsl
index 67fe27a..65c2a7e 100644
--- a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_a68027() {
   float4 res = arg_0.Gather(arg_1, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.glsl
index e93a788..dda61bb 100644
--- a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_a68027() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_a68027() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_a68027() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.msl
index 88b1490..c21feca 100644
--- a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_a68027(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_a68027(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_a68027(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_a68027(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_a68027(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_a68027(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_a68027(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_a68027(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.spvasm
index b4fe504..968f533 100644
--- a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_a68027 "textureGather_a68027"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,55 +47,63 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %41 = OpTypeFunction %v4float
-%textureGather_a68027 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %48 = OpTypeFunction %v4float
+%textureGather_a68027 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_0 ConstOffset %38
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_0 ConstOffset %41
+               OpStore %res %22
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %47 = OpLoad %v4float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_a68027
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_a68027
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_a68027
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_a68027
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_a68027
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_a68027
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.wgsl
index 29a6f59..828c638 100644
--- a/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/a68027.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_a68027() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_a68027();
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl
index 4d606ab..6229b92 100644
--- a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube_array<i32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<i32>
 fn textureGather_aaf6bd() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.dxc.hlsl
index 1746c5f..d0369c1 100644
--- a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_aaf6bd() {
   int4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.fxc.hlsl
index 1746c5f..d0369c1 100644
--- a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_aaf6bd() {
   int4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.msl
index c040733..fc3c623 100644
--- a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_aaf6bd(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_aaf6bd(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_aaf6bd(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_aaf6bd(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_aaf6bd(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_aaf6bd(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_aaf6bd(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_aaf6bd(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.spvasm
index 3c85db7..8e6092c 100644
--- a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_aaf6bd "textureGather_aaf6bd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,53 +49,61 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %39 = OpConstantNull %v4int
-         %40 = OpTypeFunction %v4float
-%textureGather_aaf6bd = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpCompositeExtract %float %28 2
-         %32 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v4float %29 %30 %31 %32
-         %20 = OpImageGather %v4int %25 %34 %uint_1
-               OpStore %res %20
+         %42 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %47 = OpTypeFunction %v4float
+%textureGather_aaf6bd = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpCompositeExtract %float %31 2
+         %35 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v4float %32 %33 %34 %35
+         %24 = OpImageGather %v4int %28 %37 %uint_1
+               OpStore %res %24
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %46 = OpLoad %v4int %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_aaf6bd
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_aaf6bd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_aaf6bd
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_aaf6bd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_aaf6bd
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_aaf6bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.wgsl
index df39466..8df1cfa 100644
--- a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_aaf6bd() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_aaf6bd();
diff --git a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl
index 98d2001..459a993 100644
--- a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_af55b3() {
   var res: vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.dxc.hlsl
index de1d972..22b40d9 100644
--- a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_af55b3() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_af55b3();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.fxc.hlsl
index de1d972..f02ea6e 100644
--- a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_af55b3() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.glsl
index e76bd21..a320e6b 100644
--- a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_af55b3() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_af55b3() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_af55b3() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.msl
index 508e894..2a92205 100644
--- a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_af55b3(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_af55b3(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_af55b3(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_af55b3(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_af55b3(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_af55b3(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_af55b3(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_af55b3(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.spvasm
index 8220229..51fb869 100644
--- a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_af55b3 "textureGather_af55b3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,56 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %30 = OpConstantComposite %v2int %int_1 %int_1
+         %33 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %33 = OpTypeFunction %v4float
-%textureGather_af55b3 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
+%textureGather_af55b3 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %int_1 ConstOffset %30
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %int_1 ConstOffset %33
+               OpStore %res %22
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureGather_af55b3
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureGather_af55b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_af55b3
+%fragment_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_af55b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_af55b3
+%compute_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_af55b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.wgsl
index a229a96..124bebe 100644
--- a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_af55b3() {
   var res : vec4<f32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_af55b3();
diff --git a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl
index 83881aa..7de490d 100644
--- a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d<i32>, sampler: sampler, coords: vec2<f32>) -> vec4<i32>
 fn textureGather_bb3ac5() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.dxc.hlsl
index caf9dc9..ffb68d6 100644
--- a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_bb3ac5() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.fxc.hlsl
index caf9dc9..ffb68d6 100644
--- a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_bb3ac5() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.glsl
index 29b1352..5eb84a5 100644
--- a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bb3ac5() {
   ivec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bb3ac5() {
   ivec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bb3ac5() {
   ivec4 res = textureGather(arg_1_arg_2, vec2(1.0f), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.msl
index 13e04f3..ea1514f 100644
--- a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_bb3ac5(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_bb3ac5(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_bb3ac5(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_bb3ac5(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_bb3ac5(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_bb3ac5(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_bb3ac5(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_bb3ac5(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.spvasm
index 70b1404..e4c3a6d 100644
--- a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_bb3ac5 "textureGather_bb3ac5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,46 +48,55 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %32 = OpConstantNull %v4int
-         %33 = OpTypeFunction %v4float
-%textureGather_bb3ac5 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %32
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4int %25 %28 %int_1
-               OpStore %res %20
+         %35 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %41 = OpTypeFunction %v4float
+%textureGather_bb3ac5 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %35
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4int %28 %31 %int_1
+               OpStore %res %24
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %40 = OpLoad %v4int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureGather_bb3ac5
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureGather_bb3ac5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %20
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_bb3ac5
+%fragment_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_bb3ac5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_bb3ac5
+%compute_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_bb3ac5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.wgsl
index 53bb85a..b10f9f9 100644
--- a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_bb3ac5() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_bb3ac5();
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl
index 4b33ea2..2868b61 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<i32>
 fn textureGather_bd33b6() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.dxc.hlsl
index fc6816d..fe92082 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_bd33b6() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_bd33b6();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.fxc.hlsl
index fc6816d..cba27f5 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_bd33b6() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.glsl
index 26d2694..2c3315b 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bd33b6() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bd33b6() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bd33b6() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.msl
index 1c48649..e59d902 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_bd33b6(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_bd33b6(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_bd33b6(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_bd33b6(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_bd33b6(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_bd33b6(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_bd33b6(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_bd33b6(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.spvasm
index 27e924a..d398d1d 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_bd33b6 "textureGather_bd33b6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,55 +48,63 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %41 = OpConstantNull %v4int
-         %42 = OpTypeFunction %v4float
-%textureGather_bd33b6 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %41
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertUToF %float %uint_1
-         %35 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4int %25 %35 %int_1 ConstOffset %38
-               OpStore %res %20
+         %44 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %49 = OpTypeFunction %v4float
+%textureGather_bd33b6 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %44
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertUToF %float %uint_1
+         %38 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4int %28 %38 %int_1 ConstOffset %41
+               OpStore %res %24
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %48 = OpLoad %v4int %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_bd33b6
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_bd33b6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_bd33b6
+%fragment_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_bd33b6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGather_bd33b6
+%compute_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGather_bd33b6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.wgsl
index 5fda733..df41a55 100644
--- a/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/bd33b6.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_bd33b6() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_bd33b6();
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl
index e9d4004..0d50449 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube_array<u32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<u32>
 fn textureGather_be276f() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.dxc.hlsl
index 18c39e8..f406a31 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_be276f() {
   uint4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.fxc.hlsl
index 18c39e8..f406a31 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_be276f() {
   uint4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.msl
index 3161486..94bf852 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_be276f(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_be276f(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1u, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_be276f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_be276f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_be276f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_be276f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_be276f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_be276f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.spvasm
index b74fcbb..07df72b 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_be276f "textureGather_be276f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,53 +49,61 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %39 = OpConstantNull %v4uint
-         %40 = OpTypeFunction %v4float
-%textureGather_be276f = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpCompositeExtract %float %28 2
-         %32 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v4float %29 %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %34 %int_1
-               OpStore %res %20
+         %42 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %47 = OpTypeFunction %v4float
+%textureGather_be276f = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpCompositeExtract %float %31 2
+         %35 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v4float %32 %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %37 %int_1
+               OpStore %res %24
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %46 = OpLoad %v4uint %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_be276f
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_be276f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_be276f
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_be276f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_be276f
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_be276f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.wgsl
index f7c77f8..d6c294e 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_be276f() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_be276f();
diff --git a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl
index 0ab09af..5b27d14 100644
--- a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube_array<i32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<i32>
 fn textureGather_c0640c() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.dxc.hlsl
index 53c8b4e..647d3f1 100644
--- a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_c0640c() {
   int4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.fxc.hlsl
index 53c8b4e..647d3f1 100644
--- a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_c0640c() {
   int4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.msl
index e115386..4a46c21 100644
--- a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_c0640c(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_c0640c(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_c0640c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_c0640c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_c0640c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_c0640c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_c0640c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_c0640c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.spvasm
index fd94873..9355ed2 100644
--- a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_c0640c "textureGather_c0640c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,51 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %37 = OpConstantNull %v4int
-         %38 = OpTypeFunction %v4float
-%textureGather_c0640c = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %37
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpCompositeExtract %float %28 2
-         %32 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v4float %29 %30 %31 %32
-         %20 = OpImageGather %v4int %25 %34 %int_1
-               OpStore %res %20
+         %40 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %46 = OpTypeFunction %v4float
+%textureGather_c0640c = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %40
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpCompositeExtract %float %31 2
+         %35 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v4float %32 %33 %34 %35
+         %24 = OpImageGather %v4int %28 %37 %int_1
+               OpStore %res %24
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %45 = OpLoad %v4int %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_c0640c
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_c0640c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_c0640c
+%fragment_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_c0640c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_c0640c
+%compute_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_c0640c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.wgsl
index d8531e5..7a65603 100644
--- a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_c0640c() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_c0640c();
diff --git a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl
index b92775d..ec09d84 100644
--- a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d<i32>, sampler: sampler, coords: vec2<f32>) -> vec4<i32>
 fn textureGather_ccadde() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.dxc.hlsl
index 33dd7a8..858049f 100644
--- a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ccadde() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.fxc.hlsl
index 33dd7a8..858049f 100644
--- a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ccadde() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.glsl
index 444809b..d77443f 100644
--- a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_ccadde() {
   ivec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_ccadde() {
   ivec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_ccadde() {
   ivec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.msl
index 0e7c2a9..e8b98c0 100644
--- a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_ccadde(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_ccadde(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_ccadde(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_ccadde(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_ccadde(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_ccadde(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_ccadde(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_ccadde(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.spvasm
index 9730bc7..081a0a0 100644
--- a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_ccadde "textureGather_ccadde"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,47 +48,55 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %33 = OpConstantNull %v4int
-         %34 = OpTypeFunction %v4float
-%textureGather_ccadde = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %33
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4int %25 %28 %uint_1
-               OpStore %res %20
+         %36 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %41 = OpTypeFunction %v4float
+%textureGather_ccadde = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %36
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4int %28 %31 %uint_1
+               OpStore %res %24
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %40 = OpLoad %v4int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureGather_ccadde
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureGather_ccadde
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %20
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_ccadde
+%fragment_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_ccadde
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_ccadde
+%compute_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_ccadde
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.wgsl
index 882bff66..f516396 100644
--- a/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/ccadde.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_ccadde() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_ccadde();
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl
index 4b9cb3d..7f40521 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<u32>
 fn textureGather_ce5578() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.dxc.hlsl
index 789664a..d76f138 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ce5578() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_ce5578();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.fxc.hlsl
index 789664a..0f5abf0f 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ce5578() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.glsl
index f1da0f6..74dfcd6 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_ce5578() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_ce5578() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_ce5578() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.msl
index 3d69aa1..1f3a6fe 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_ce5578(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_ce5578(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_ce5578(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_ce5578(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_ce5578(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_ce5578(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_ce5578(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_ce5578(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.spvasm
index 028e742..e89a526 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_ce5578 "textureGather_ce5578"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,55 +48,63 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %41 = OpConstantNull %v4uint
-         %42 = OpTypeFunction %v4float
-%textureGather_ce5578 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %41
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %34 %int_1 ConstOffset %38
-               OpStore %res %20
+         %44 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %49 = OpTypeFunction %v4float
+%textureGather_ce5578 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %44
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %37 %int_1 ConstOffset %41
+               OpStore %res %24
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %48 = OpLoad %v4uint %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_ce5578
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_ce5578
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_ce5578
+%fragment_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_ce5578
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGather_ce5578
+%compute_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGather_ce5578
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.wgsl
index e7bf4f9..4bf4317 100644
--- a/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/ce5578.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_ce5578() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_ce5578();
diff --git a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl
index d620c39..afea563 100644
--- a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<i32>
 fn textureGather_cf9112() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.dxc.hlsl
index bb0b068..626625c 100644
--- a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_cf9112() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_cf9112();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.fxc.hlsl
index bb0b068..a5fd470 100644
--- a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_cf9112() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.glsl
index bf3a3b2..b5d3f6a 100644
--- a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_cf9112() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_cf9112() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_cf9112() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.msl
index a6de319..83a581c 100644
--- a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_cf9112(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_cf9112(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_cf9112(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_cf9112(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_cf9112(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_cf9112(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_cf9112(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_cf9112(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.spvasm
index e8069dd..fd06a4a 100644
--- a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_cf9112 "textureGather_cf9112"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,55 +48,63 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %41 = OpConstantNull %v4int
-         %42 = OpTypeFunction %v4float
-%textureGather_cf9112 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %41
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertUToF %float %uint_1
-         %35 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4int %25 %35 %uint_1 ConstOffset %38
-               OpStore %res %20
+         %44 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %49 = OpTypeFunction %v4float
+%textureGather_cf9112 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %44
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertUToF %float %uint_1
+         %38 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4int %28 %38 %uint_1 ConstOffset %41
+               OpStore %res %24
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %48 = OpLoad %v4int %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_cf9112
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_cf9112
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_cf9112
+%fragment_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_cf9112
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGather_cf9112
+%compute_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGather_cf9112
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.wgsl
index 564f9d4..6ea0271 100644
--- a/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/cf9112.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_cf9112() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_cf9112();
diff --git a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl
index ccf992d..f8d7160 100644
--- a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<u32>
 fn textureGather_d1f187() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.dxc.hlsl
index a243d4d..debf884 100644
--- a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d1f187() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_d1f187();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.fxc.hlsl
index a243d4d..e1a19fd 100644
--- a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d1f187() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.glsl
index c3560b3..124f3da 100644
--- a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_d1f187() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_d1f187() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_d1f187() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.msl
index 10a2701..0547f9b 100644
--- a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d1f187(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d1f187(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d1f187(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_d1f187(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d1f187(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d1f187(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d1f187(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d1f187(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.spvasm
index 6dc0006..44dbcc8 100644
--- a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d1f187 "textureGather_d1f187"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,54 +48,62 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %40 = OpConstantNull %v4uint
-         %41 = OpTypeFunction %v4float
-%textureGather_d1f187 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %40
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertSToF %float %int_1
-         %35 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %35 %int_1 ConstOffset %37
-               OpStore %res %20
+         %43 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %48 = OpTypeFunction %v4float
+%textureGather_d1f187 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %43
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertSToF %float %int_1
+         %38 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %38 %int_1 ConstOffset %40
+               OpStore %res %24
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %47 = OpLoad %v4uint %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_d1f187
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_d1f187
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_d1f187
+%fragment_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_d1f187
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_d1f187
+%compute_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_d1f187
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.wgsl
index d1d1604..840fbae 100644
--- a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_d1f187() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d1f187();
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl
index 4bb48af..cb118b9 100644
--- a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube_array<u32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<u32>
 fn textureGather_d4b5c6() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.dxc.hlsl
index db76898..c73dbcd 100644
--- a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d4b5c6() {
   uint4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.fxc.hlsl
index db76898..c73dbcd 100644
--- a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d4b5c6() {
   uint4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.msl
index b650d7c..8a22575 100644
--- a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d4b5c6(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d4b5c6(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d4b5c6(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_d4b5c6(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d4b5c6(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d4b5c6(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d4b5c6(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d4b5c6(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.spvasm
index b18aa5c..1ecebf8 100644
--- a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d4b5c6 "textureGather_d4b5c6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,53 +49,61 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %39 = OpConstantNull %v4uint
-         %40 = OpTypeFunction %v4float
-%textureGather_d4b5c6 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpCompositeExtract %float %28 2
-         %32 = OpConvertSToF %float %int_1
-         %35 = OpCompositeConstruct %v4float %29 %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %35 %uint_1
-               OpStore %res %20
+         %42 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %47 = OpTypeFunction %v4float
+%textureGather_d4b5c6 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpCompositeExtract %float %31 2
+         %35 = OpConvertSToF %float %int_1
+         %38 = OpCompositeConstruct %v4float %32 %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %38 %uint_1
+               OpStore %res %24
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %46 = OpLoad %v4uint %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_d4b5c6
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_d4b5c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_d4b5c6
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_d4b5c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_d4b5c6
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_d4b5c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.wgsl
index 609c368..180f259 100644
--- a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_d4b5c6() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d4b5c6();
diff --git a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl
index 073ad9d..413d372 100644
--- a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_d6507c() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.dxc.hlsl
index 50b89a7..4d61735 100644
--- a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d6507c() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_d6507c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.fxc.hlsl
index 50b89a7..09703c6 100644
--- a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d6507c() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.glsl
index 910608c..f3648ad 100644
--- a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d6507c() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d6507c() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d6507c() {
   vec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.msl
index b1765cd..6e44005 100644
--- a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d6507c(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d6507c(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d6507c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_d6507c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d6507c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d6507c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d6507c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d6507c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.spvasm
index c60fde8..e84e602 100644
--- a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d6507c "textureGather_d6507c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,49 +47,57 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %32 = OpConstantComposite %v2int %int_1 %int_1
+         %35 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpTypeFunction %v4float
-%textureGather_d6507c = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %42 = OpTypeFunction %v4float
+%textureGather_d6507c = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %uint_1 ConstOffset %32
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %uint_1 ConstOffset %35
+               OpStore %res %22
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %41 = OpLoad %v4float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGather_d6507c
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureGather_d6507c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_d6507c
+%fragment_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_d6507c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_d6507c
+%compute_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_d6507c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.wgsl
index dde2df1..56b25db 100644
--- a/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d6507c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_d6507c() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d6507c();
diff --git a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl
index 0c7ac79..f486614 100644
--- a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
 fn textureGather_d8e958() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.dxc.hlsl
index 4e15eb9..9df2413 100644
--- a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d8e958() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.fxc.hlsl
index 4e15eb9..9df2413 100644
--- a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d8e958() {
   float4 res = arg_1.GatherGreen(arg_2, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.glsl
index d16dc37..44b345a 100644
--- a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d8e958() {
   vec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d8e958() {
   vec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d8e958() {
   vec4 res = textureGather(arg_1_arg_2, vec2(1.0f), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.msl
index 7370e3d..69ed93c 100644
--- a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d8e958(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d8e958(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d8e958(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_d8e958(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d8e958(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d8e958(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d8e958(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d8e958(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.spvasm
index af1b869..90ef5b8 100644
--- a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d8e958 "textureGather_d8e958"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,45 +47,53 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
-%textureGather_d8e958 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %38 = OpTypeFunction %v4float
+%textureGather_d8e958 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageGather %v4float %23 %26 %uint_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageGather %v4float %26 %29 %uint_1
+               OpStore %res %22
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureGather_d8e958
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureGather_d8e958
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_d8e958
+%fragment_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGather_d8e958
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_d8e958
+%compute_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_d8e958
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.wgsl
index baa6500..019412c 100644
--- a/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d8e958.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_d8e958() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d8e958();
diff --git a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl
index 321c953..dd99eb2 100644
--- a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGather_d90605() {
   var res: vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.dxc.hlsl
index 2b2b068..bac2f3a 100644
--- a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d90605() {
   float4 res = arg_0.Gather(arg_1, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_d90605();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.fxc.hlsl
index 2b2b068..247ce07 100644
--- a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d90605() {
   float4 res = arg_0.Gather(arg_1, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.glsl
index 62ea44e..aba1326 100644
--- a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d90605() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d90605() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d90605() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.msl
index 9d7e1fa..f529f82 100644
--- a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d90605(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d90605(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d90605(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_d90605(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d90605(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d90605(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d90605(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d90605(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.spvasm
index 13a26f2..6da92db 100644
--- a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d90605 "textureGather_d90605"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,53 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %int_0 = OpConstant %int 0
       %v2int = OpTypeVector %int 2
-         %36 = OpConstantComposite %v2int %int_1 %int_1
+         %39 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %39 = OpTypeFunction %v4float
-%textureGather_d90605 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %47 = OpTypeFunction %v4float
+%textureGather_d90605 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %int_0 ConstOffset %36
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %int_0 ConstOffset %39
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_d90605
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_d90605
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_d90605
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_d90605
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_d90605
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_d90605
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.wgsl
index 67d080c..d7c52e2 100644
--- a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_d90605() {
   var res : vec4<f32> = textureGather(arg_0, arg_1, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d90605();
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl
index 67a70dd..2c4fdd2 100644
--- a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<f32>
 fn textureGather_d98d59() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.dxc.hlsl
index 847af83..5c89b92 100644
--- a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d98d59() {
   float4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.fxc.hlsl
index 847af83..5c89b92 100644
--- a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d98d59() {
   float4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.msl
index 7b5236f..6e0b5b2 100644
--- a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d98d59(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d98d59(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d98d59(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_d98d59(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d98d59(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d98d59(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d98d59(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d98d59(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.spvasm
index d431a1a..70f1112 100644
--- a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d98d59 "textureGather_d98d59"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,52 +48,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGather_d98d59 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_d98d59 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %uint_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %uint_1
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_d98d59
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_d98d59
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_d98d59
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_d98d59
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_d98d59
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_d98d59
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.wgsl
index 5b2fb59..5d9cf77 100644
--- a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_d98d59() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d98d59();
diff --git a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl
index afce732..298b9e8 100644
--- a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d<i32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<i32>
 fn textureGather_dc6661() {
   var res: vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.dxc.hlsl
index ed4cb87..e2ba7b5 100644
--- a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_dc6661() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_dc6661();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.fxc.hlsl
index ed4cb87..cd71e96 100644
--- a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_dc6661() {
   int4 res = arg_1.GatherGreen(arg_2, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.glsl
index ca5290e..538ac28 100644
--- a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_dc6661() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_dc6661() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_dc6661() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec2(1.0f), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.msl
index cff8c55..7195107 100644
--- a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_dc6661(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_dc6661(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_dc6661(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_dc6661(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_dc6661(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_dc6661(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_dc6661(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_dc6661(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.spvasm
index dbe25ea..012aa4d 100644
--- a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_dc6661 "textureGather_dc6661"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,58 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %33 = OpConstantComposite %v2int %int_1 %int_1
+         %36 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %36 = OpConstantNull %v4int
-         %37 = OpTypeFunction %v4float
-%textureGather_dc6661 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %36
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %20 = OpImageGather %v4int %25 %28 %uint_1 ConstOffset %33
-               OpStore %res %20
+         %39 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %44 = OpTypeFunction %v4float
+%textureGather_dc6661 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %39
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %24 = OpImageGather %v4int %28 %31 %uint_1 ConstOffset %36
+               OpStore %res %24
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %43 = OpLoad %v4int %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_dc6661
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGather_dc6661
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_dc6661
+%fragment_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_dc6661
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_dc6661
+%compute_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_dc6661
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.wgsl
index 2554a6d..d7fee96 100644
--- a/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/dc6661.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_dc6661() {
   var res : vec4<i32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_dc6661();
diff --git a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl
index 3b023f5..42aa837 100644
--- a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_cube_array<u32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<u32>
 fn textureGather_e2acac() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.dxc.hlsl
index 939783f..91004dd 100644
--- a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e2acac() {
   uint4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.fxc.hlsl
index 939783f..91004dd 100644
--- a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e2acac() {
   uint4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.msl
index 1b4d074..9f8b1ed 100644
--- a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_e2acac(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_e2acac(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1u, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_e2acac(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_e2acac(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_e2acac(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_e2acac(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_e2acac(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_e2acac(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.spvasm
index a96aeef..a1a56f1 100644
--- a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_e2acac "textureGather_e2acac"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,51 +49,59 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %37 = OpConstantNull %v4uint
-         %38 = OpTypeFunction %v4float
-%textureGather_e2acac = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %37
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpCompositeExtract %float %28 2
-         %32 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v4float %29 %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %34 %uint_1
-               OpStore %res %20
+         %40 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %45 = OpTypeFunction %v4float
+%textureGather_e2acac = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %40
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpCompositeExtract %float %31 2
+         %35 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v4float %32 %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %37 %uint_1
+               OpStore %res %24
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %44 = OpLoad %v4uint %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_e2acac
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_e2acac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %20
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_e2acac
+%fragment_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_e2acac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_e2acac
+%compute_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_e2acac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.wgsl
index 9a2bd67..e7948e5 100644
--- a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_e2acac() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_e2acac();
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl
index 307415a..4ca465e 100644
--- a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<u32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<u32>
 fn textureGather_e3165f() {
   var res: vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.dxc.hlsl
index 64a3795..a57d7d5 100644
--- a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e3165f() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_e3165f();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.fxc.hlsl
index 64a3795..6aa6a37 100644
--- a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e3165f() {
   uint4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.glsl
index 1b7a7d6..07df1a2 100644
--- a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_e3165f() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_e3165f() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_e3165f() {
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.msl
index 3fec78a..c54a8d2 100644
--- a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_e3165f(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_e3165f(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_e3165f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_e3165f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_e3165f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_e3165f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_e3165f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_e3165f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.spvasm
index e068a6b..b2eb994 100644
--- a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_e3165f "textureGather_e3165f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,55 +48,63 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %41 = OpConstantNull %v4uint
-         %42 = OpTypeFunction %v4float
-%textureGather_e3165f = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %41
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertSToF %float %int_1
-         %35 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %35 %uint_1 ConstOffset %38
-               OpStore %res %20
+         %44 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %49 = OpTypeFunction %v4float
+%textureGather_e3165f = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %44
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertSToF %float %int_1
+         %38 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %38 %uint_1 ConstOffset %41
+               OpStore %res %24
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %48 = OpLoad %v4uint %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_e3165f
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_e3165f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_e3165f
+%fragment_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_e3165f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGather_e3165f
+%compute_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGather_e3165f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.wgsl
index e7641f8..f1b04cc 100644
--- a/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/e3165f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_e3165f() {
   var res : vec4<u32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_e3165f();
diff --git a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl
index 2556148..e8efa34 100644
--- a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_2d_array<i32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<i32>
 fn textureGather_e9d390() {
   var res: vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.dxc.hlsl
index eb97f7f..d7f5569 100644
--- a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e9d390() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGather_e9d390();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.fxc.hlsl
index eb97f7f..27b2a60 100644
--- a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e9d390() {
   int4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.glsl
index 783e77d..7268253 100644
--- a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_e9d390() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_e9d390() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_e9d390() {
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(vec2(1.0f), float(1)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.msl
index 7b05586..22670a5 100644
--- a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_e9d390(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_e9d390(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   int4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_e9d390(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_e9d390(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_e9d390(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_e9d390(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_e9d390(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_e9d390(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.spvasm
index 1918101..a735993 100644
--- a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_e9d390 "textureGather_e9d390"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,53 +48,62 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %29 = OpConstantComposite %v2float %float_1 %float_1
+         %32 = OpConstantComposite %v2float %float_1 %float_1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %36 = OpConstantComposite %v2int %int_1 %int_1
+         %39 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %39 = OpConstantNull %v4int
-         %40 = OpTypeFunction %v4float
-%textureGather_e9d390 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %39
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v3float %30 %31 %32
-         %20 = OpImageGather %v4int %25 %34 %int_1 ConstOffset %36
-               OpStore %res %20
+         %42 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %48 = OpTypeFunction %v4float
+%textureGather_e9d390 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %42
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v3float %33 %34 %35
+         %24 = OpImageGather %v4int %28 %37 %int_1 ConstOffset %39
+               OpStore %res %24
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %47 = OpLoad %v4int %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_e9d390
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_e9d390
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_e9d390
+%fragment_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_e9d390
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_e9d390
+%compute_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_e9d390
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.wgsl
index 4bb6967..782cd02 100644
--- a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_e9d390() {
   var res : vec4<i32> = textureGather(1i, arg_1, arg_2, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_e9d390();
diff --git a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl
index 02e3c9e..b2eea4a 100644
--- a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: u32, texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<f32>
 fn textureGather_ea8eb4() {
   var res: vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.dxc.hlsl
index 1441e14..a6169bd 100644
--- a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ea8eb4() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.fxc.hlsl
index 1441e14..a6169bd 100644
--- a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ea8eb4() {
   float4 res = arg_1.GatherGreen(arg_2, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.glsl
index a81c2ff..6e42449 100644
--- a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_ea8eb4() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_ea8eb4() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_ea8eb4() {
   vec4 res = textureGather(arg_1_arg_2, vec3(vec2(1.0f), float(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.msl
index 8c8a791..51d8b2c 100644
--- a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_ea8eb4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_ea8eb4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), 1u, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_ea8eb4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_ea8eb4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_ea8eb4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_ea8eb4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_ea8eb4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_ea8eb4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.spvasm
index 2fbe377..d5d7b7f 100644
--- a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_ea8eb4 "textureGather_ea8eb4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,50 +47,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGather_ea8eb4 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureGather_ea8eb4 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_2
-         %21 = OpLoad %11 %arg_1
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageGather %v4float %23 %33 %uint_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_2
+         %24 = OpLoad %11 %arg_1
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageGather %v4float %26 %36 %uint_1
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGather_ea8eb4
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGather_ea8eb4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGather_ea8eb4
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_ea8eb4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_ea8eb4
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_ea8eb4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.wgsl
index 9338598..9c7835b 100644
--- a/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/ea8eb4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_ea8eb4() {
   var res : vec4<f32> = textureGather(1u, arg_1, arg_2, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_ea8eb4();
diff --git a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl
index 1dccc19..6e355dd 100644
--- a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl
@@ -26,7 +26,9 @@
 // fn textureGather(@const component: i32, texture: texture_cube_array<u32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<u32>
 fn textureGather_f2c6e3() {
   var res: vec4<u32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.dxc.hlsl
index e9504c0..8287ba3 100644
--- a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_f2c6e3() {
   uint4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.fxc.hlsl
index e9504c0..8287ba3 100644
--- a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_f2c6e3() {
   uint4 res = arg_1.GatherGreen(arg_2, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.msl
index c720bbc..d57dd1a 100644
--- a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_f2c6e3(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_f2c6e3(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   uint4 res = tint_symbol_1.gather(tint_symbol_2, float3(1.0f), 1, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_f2c6e3(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_f2c6e3(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_f2c6e3(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_f2c6e3(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_f2c6e3(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_f2c6e3(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.spvasm
index 9929191..776e5be 100644
--- a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_f2c6e3 "textureGather_f2c6e3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-       %void = OpTypeVoid
-         %16 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
-         %24 = OpTypeSampledImage %11
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %20 = OpTypeFunction %void
+         %27 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %31 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %38 = OpConstantNull %v4uint
-         %39 = OpTypeFunction %v4float
-%textureGather_f2c6e3 = OpFunction %void None %16
-         %19 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %38
-         %22 = OpLoad %15 %arg_2
-         %23 = OpLoad %11 %arg_1
-         %25 = OpSampledImage %24 %23 %22
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpCompositeExtract %float %28 2
-         %32 = OpConvertSToF %float %int_1
-         %35 = OpCompositeConstruct %v4float %29 %30 %31 %32
-         %20 = OpImageGather %v4uint %25 %35 %int_1
-               OpStore %res %20
+         %41 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %46 = OpTypeFunction %v4float
+%textureGather_f2c6e3 = OpFunction %void None %20
+         %23 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %41
+         %25 = OpLoad %15 %arg_2
+         %26 = OpLoad %11 %arg_1
+         %28 = OpSampledImage %27 %26 %25
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpCompositeExtract %float %31 2
+         %35 = OpConvertSToF %float %int_1
+         %38 = OpCompositeConstruct %v4float %32 %33 %34 %35
+         %24 = OpImageGather %v4uint %28 %38 %int_1
+               OpStore %res %24
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %45 = OpLoad %v4uint %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_f2c6e3
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_f2c6e3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %20
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_f2c6e3
+%fragment_main = OpFunction %void None %20
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_f2c6e3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_f2c6e3
+%compute_main = OpFunction %void None %20
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_f2c6e3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.wgsl
index d7b38f2..62c6144 100644
--- a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGather_f2c6e3() {
   var res : vec4<u32> = textureGather(1i, arg_1, arg_2, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_f2c6e3();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl
index 7255eea..69cb192 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: u32, depth_ref: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGatherCompare_144a9a() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.dxc.hlsl
index e09886a..bc7dc6c 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_144a9a() {
   float4 res = arg_0.GatherCmp(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGatherCompare_144a9a();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.fxc.hlsl
index e09886a..6610f71 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_144a9a() {
   float4 res = arg_0.GatherCmp(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.glsl
index 4e9b3f5..39e8e9f 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_144a9a() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_144a9a() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_144a9a() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.msl
index ec65869..dea0625 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_144a9a(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_144a9a(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float2(1.0f), 1u, 1.0f, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_144a9a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_144a9a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_144a9a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_144a9a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_144a9a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_144a9a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.spvasm
index 2080c9c..efd0c0a 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_144a9a "textureGatherCompare_144a9a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureGatherCompare_144a9a = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %47 = OpTypeFunction %v4float
+%textureGatherCompare_144a9a = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageDrefGather %v4float %23 %33 %float_1 ConstOffset %37
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageDrefGather %v4float %26 %36 %float_1 ConstOffset %40
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGatherCompare_144a9a
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGatherCompare_144a9a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGatherCompare_144a9a
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGatherCompare_144a9a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGatherCompare_144a9a
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGatherCompare_144a9a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.wgsl
index e862875..5bbba01 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/144a9a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_144a9a() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_144a9a();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl
index 7ebc626..75e861b 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> vec4<f32>
 fn textureGatherCompare_182fd4() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.dxc.hlsl
index c58d9d6..b9c1591 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_182fd4() {
   float4 res = arg_0.GatherCmp(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.fxc.hlsl
index c58d9d6..b9c1591 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_182fd4() {
   float4 res = arg_0.GatherCmp(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.glsl
index b6a28aa..6dcc848 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_182fd4() {
   vec4 res = textureGather(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_182fd4() {
   vec4 res = textureGather(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_182fd4() {
   vec4 res = textureGather(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.msl
index 4bae14a..1cee9c6 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_182fd4(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_182fd4(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float3(1.0f), 1.0f);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_182fd4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_182fd4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_182fd4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_182fd4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_182fd4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_182fd4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.spvasm
index c86a01e..fcca813 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_182fd4 "textureGatherCompare_182fd4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,43 +47,52 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %29 = OpTypeFunction %v4float
-%textureGatherCompare_182fd4 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%textureGatherCompare_182fd4 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageDrefGather %v4float %23 %26 %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageDrefGather %v4float %26 %29 %float_1
+               OpStore %res %22
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureGatherCompare_182fd4
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureGatherCompare_182fd4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGatherCompare_182fd4
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGatherCompare_182fd4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGatherCompare_182fd4
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGatherCompare_182fd4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.wgsl
index 970f9e0..b29967e 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_182fd4() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_182fd4();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl
index 5caeb53..ef1f39e 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: u32, depth_ref: f32) -> vec4<f32>
 fn textureGatherCompare_2e409c() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec3<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.dxc.hlsl
index 292a956..2e0b025 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_2e409c() {
   float4 res = arg_0.GatherCmp(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.fxc.hlsl
index 292a956..2e0b025 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_2e409c() {
   float4 res = arg_0.GatherCmp(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.msl
index 266a38a..55f556c 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_2e409c(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_2e409c(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float3(1.0f), 1u, 1.0f);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_2e409c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_2e409c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_2e409c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_2e409c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_2e409c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_2e409c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.spvasm
index 462fa94..11def53 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_2e409c "textureGatherCompare_2e409c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGatherCompare_2e409c = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureGatherCompare_2e409c = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageDrefGather %v4float %23 %33 %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageDrefGather %v4float %26 %36 %float_1
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGatherCompare_2e409c
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGatherCompare_2e409c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGatherCompare_2e409c
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGatherCompare_2e409c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGatherCompare_2e409c
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGatherCompare_2e409c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.wgsl
index 2ac3798..10d120e 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_2e409c() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec3<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_2e409c();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl
index aa0a49f..6e0d470 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGatherCompare_313add() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.f), 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.dxc.hlsl
index e491dd6..f548353 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_313add() {
   float4 res = arg_0.GatherCmp(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGatherCompare_313add();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.fxc.hlsl
index e491dd6..e0342b8 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_313add() {
   float4 res = arg_0.GatherCmp(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.glsl
index 4c62095..9dcc8fc 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_313add() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec2(1.0f), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_313add() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec2(1.0f), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_313add() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec2(1.0f), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.msl
index 94695aa..6eb1cf2 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_313add(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_313add(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float2(1.0f), 1.0f, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_313add(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_313add(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_313add(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_313add(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_313add(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_313add(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.spvasm
index 9514a14..442b80a 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_313add "textureGatherCompare_313add"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,56 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v2int %int_1 %int_1
+         %33 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %33 = OpTypeFunction %v4float
-%textureGatherCompare_313add = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
+%textureGatherCompare_313add = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageDrefGather %v4float %23 %26 %float_1 ConstOffset %30
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageDrefGather %v4float %26 %29 %float_1 ConstOffset %33
+               OpStore %res %22
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureGatherCompare_313add
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureGatherCompare_313add
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGatherCompare_313add
+%fragment_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGatherCompare_313add
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGatherCompare_313add
+%compute_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGatherCompare_313add
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.wgsl
index bf4da2a..6f32f1c 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_313add() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.0f), 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_313add();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl
index 708587c..eff87f2 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: i32, depth_ref: f32) -> vec4<f32>
 fn textureGatherCompare_60d2d1() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec3<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.dxc.hlsl
index efa458c..38caeb8 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_60d2d1() {
   float4 res = arg_0.GatherCmp(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.fxc.hlsl
index efa458c..38caeb8 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_60d2d1() {
   float4 res = arg_0.GatherCmp(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.msl
index 4b8a3dc..093e065 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_60d2d1(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_60d2d1(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float3(1.0f), 1, 1.0f);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_60d2d1(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_60d2d1(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_60d2d1(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_60d2d1(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_60d2d1(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_60d2d1(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.spvasm
index 455ebfd..3b5524c 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_60d2d1 "textureGatherCompare_60d2d1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGatherCompare_60d2d1 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureGatherCompare_60d2d1 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageDrefGather %v4float %23 %33 %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageDrefGather %v4float %26 %36 %float_1
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGatherCompare_60d2d1
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGatherCompare_60d2d1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGatherCompare_60d2d1
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGatherCompare_60d2d1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGatherCompare_60d2d1
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGatherCompare_60d2d1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.wgsl
index 1c58353..0f5b0b5 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_60d2d1() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec3<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_60d2d1();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl
index a08f813..6c2df55 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> vec4<f32>
 fn textureGatherCompare_6d9352() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.dxc.hlsl
index 0d45110..900581d 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_6d9352() {
   float4 res = arg_0.GatherCmp(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.fxc.hlsl
index 0d45110..900581d 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_6d9352() {
   float4 res = arg_0.GatherCmp(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.glsl
index 69d67d8..d430d69 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_6d9352() {
   vec4 res = textureGather(arg_0_arg_1, vec2(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_6d9352() {
   vec4 res = textureGather(arg_0_arg_1, vec2(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_6d9352() {
   vec4 res = textureGather(arg_0_arg_1, vec2(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.msl
index d9890db..5c4f099 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_6d9352(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_6d9352(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float2(1.0f), 1.0f);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_6d9352(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_6d9352(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_6d9352(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_6d9352(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_6d9352(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_6d9352(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.spvasm
index a51254d..f186392 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_6d9352 "textureGatherCompare_6d9352"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,43 +47,52 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %29 = OpTypeFunction %v4float
-%textureGatherCompare_6d9352 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%textureGatherCompare_6d9352 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageDrefGather %v4float %23 %26 %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageDrefGather %v4float %26 %29 %float_1
+               OpStore %res %22
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureGatherCompare_6d9352
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureGatherCompare_6d9352
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGatherCompare_6d9352
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGatherCompare_6d9352
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGatherCompare_6d9352
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGatherCompare_6d9352
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.wgsl
index 50afea1..6ef97c3 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_6d9352() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_6d9352();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl
index ae922ac..78ed9a9 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: i32, depth_ref: f32) -> vec4<f32>
 fn textureGatherCompare_783e65() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.dxc.hlsl
index d3c0caf..03503ac 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_783e65() {
   float4 res = arg_0.GatherCmp(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.fxc.hlsl
index d3c0caf..03503ac 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_783e65() {
   float4 res = arg_0.GatherCmp(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.glsl
index 5f0ff47..dcf0d62 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_783e65() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_783e65() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_783e65() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.msl
index 99117b5..7999dfb 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_783e65(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_783e65(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float2(1.0f), 1, 1.0f);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_783e65(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_783e65(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_783e65(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_783e65(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_783e65(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_783e65(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.spvasm
index bf059ec..72670b3 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_783e65 "textureGatherCompare_783e65"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,50 +47,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGatherCompare_783e65 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureGatherCompare_783e65 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageDrefGather %v4float %23 %33 %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageDrefGather %v4float %26 %36 %float_1
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGatherCompare_783e65
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGatherCompare_783e65
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGatherCompare_783e65
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGatherCompare_783e65
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGatherCompare_783e65
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGatherCompare_783e65
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.wgsl
index d465987..3c0e5eb 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_783e65() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_783e65();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl
index 287fded..2a9d915 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: u32, depth_ref: f32) -> vec4<f32>
 fn textureGatherCompare_b5bc43() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.dxc.hlsl
index 3712822..19bfc8f 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_b5bc43() {
   float4 res = arg_0.GatherCmp(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.fxc.hlsl
index 3712822..19bfc8f 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_b5bc43() {
   float4 res = arg_0.GatherCmp(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.glsl
index 2558351..343dccb 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_b5bc43() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_b5bc43() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_b5bc43() {
   vec4 res = textureGather(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.msl
index 7f2c077..839138e 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_b5bc43(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_b5bc43(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float2(1.0f), 1u, 1.0f);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_b5bc43(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_b5bc43(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_b5bc43(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_b5bc43(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_b5bc43(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_b5bc43(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.spvasm
index f44ebac..8ec7fbc 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_b5bc43 "textureGatherCompare_b5bc43"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,50 +47,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGatherCompare_b5bc43 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureGatherCompare_b5bc43 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageDrefGather %v4float %23 %33 %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageDrefGather %v4float %26 %36 %float_1
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGatherCompare_b5bc43
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGatherCompare_b5bc43
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGatherCompare_b5bc43
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGatherCompare_b5bc43
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGatherCompare_b5bc43
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGatherCompare_b5bc43
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.wgsl
index 47b8417..8b7280c 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/b5bc43.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_b5bc43() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_b5bc43();
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl
index 24c5b53..6edc52f 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl
@@ -26,7 +26,9 @@
 // fn textureGatherCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: i32, depth_ref: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureGatherCompare_f585cc() {
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.dxc.hlsl
index 7df2b78..d1bb42a 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_f585cc() {
   float4 res = arg_0.GatherCmp(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureGatherCompare_f585cc();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.fxc.hlsl
index 7df2b78..28b0011 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_f585cc() {
   float4 res = arg_0.GatherCmp(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.glsl
index 69f0437..e33bef2 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_f585cc() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_f585cc() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_f585cc() {
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.msl
index d04ae1b..a8c2316 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_f585cc(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_f585cc(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, float2(1.0f), 1, 1.0f, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_f585cc(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_f585cc(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_f585cc(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_f585cc(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_f585cc(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_f585cc(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.spvasm
index 441d09a..31ff63f 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_f585cc "textureGatherCompare_f585cc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %35 = OpConstantComposite %v2int %int_1 %int_1
+         %38 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGatherCompare_f585cc = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %46 = OpTypeFunction %v4float
+%textureGatherCompare_f585cc = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageDrefGather %v4float %23 %33 %float_1 ConstOffset %35
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageDrefGather %v4float %26 %36 %float_1 ConstOffset %38
+               OpStore %res %22
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGatherCompare_f585cc
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGatherCompare_f585cc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGatherCompare_f585cc
+%fragment_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGatherCompare_f585cc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGatherCompare_f585cc
+%compute_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGatherCompare_f585cc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.wgsl
index c4a766e..bb96c26 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureGatherCompare_f585cc() {
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_f585cc();
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl
index 7740c87..59b1e06 100644
--- a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<f32>, coords: vec3<i32>, level: u32) -> vec4<f32>
 fn textureLoad_019da0() {
   var res: vec4<f32> = textureLoad(arg_0, vec3<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.dxc.hlsl
index a6529f3..629bd0c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_019da0() {
   float4 res = arg_0.Load(int4((1).xxx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.fxc.hlsl
index a6529f3..629bd0c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_019da0() {
   float4 res = arg_0.Load(int4((1).xxx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.glsl
index c50964f..45f44f9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_019da0() {
   vec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_019da0() {
   vec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_019da0() {
   vec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.msl
index f65f491..8057e61 100644
--- a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_019da0(texture3d<float, access::sample> tint_symbol_1) {
+void textureLoad_019da0(texture3d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint3(int3(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureLoad_019da0(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_019da0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_019da0(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_019da0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_019da0(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_019da0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.spvasm
index d3c19e8..098d198 100644
--- a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_019da0 "textureLoad_019da0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,44 +41,52 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %21 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %24 = OpConstantComposite %v3int %int_1 %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %26 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_019da0 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_019da0 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Lod %uint_1
+               OpStore %res %19
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_019da0
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_019da0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_019da0
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_019da0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_019da0
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_019da0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.wgsl
index 6be5845..f316651 100644
--- a/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/019da0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_019da0() {
   var res : vec4<f32> = textureLoad(arg_0, vec3<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_019da0();
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl
index c975fc8..6947b18 100644
--- a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<u32>, array_index: u32, level: i32) -> vec4<u32>
 fn textureLoad_026217() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.dxc.hlsl
index 9e62a78..a55e6f9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_026217() {
   uint4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.fxc.hlsl
index 9e62a78..a55e6f9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_026217() {
   uint4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.glsl
index cc5bd39..388725a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_026217() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_026217() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_026217() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.msl
index 5b3b457..a29a810 100644
--- a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_026217(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_026217(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_026217(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_026217(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_026217(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_026217(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_026217(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_026217(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.spvasm
index e0eeadc..a64a850 100644
--- a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_026217 "textureLoad_026217"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,49 +42,57 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %31 = OpConstantNull %v4uint
-         %32 = OpTypeFunction %v4float
+         %34 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_026217 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %31
-         %19 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %uint %23 0
-         %25 = OpCompositeExtract %uint %23 1
-         %26 = OpCompositeConstruct %v3uint %24 %25 %uint_1
-         %17 = OpImageFetch %v4uint %19 %26 Lod %int_1
-               OpStore %res %17
+%textureLoad_026217 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %34
+         %22 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %uint %26 0
+         %28 = OpCompositeExtract %uint %26 1
+         %29 = OpCompositeConstruct %v3uint %27 %28 %uint_1
+         %21 = OpImageFetch %v4uint %22 %29 Lod %int_1
+               OpStore %res %21
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %38 = OpLoad %v4uint %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_026217
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_026217
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_026217
+%fragment_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_026217
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_026217
+%compute_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_026217
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.wgsl
index 1e8d2fd..28c9642 100644
--- a/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/026217.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_026217() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_026217();
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl
index 827a434..f659841 100644
--- a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d_array, coords: vec2<u32>, array_index: i32, level: u32) -> f32
 fn textureLoad_04b911() {
   var res: f32 = textureLoad(arg_0, vec2<u32>(1u), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.dxc.hlsl
index 7f98f2a..807ec6a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_04b911() {
   float res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), 1u)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.fxc.hlsl
index 7f98f2a..807ec6a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_04b911() {
   float res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), 1u)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.glsl
index 57a08063..1ad880c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_04b911() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_04b911() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_04b911() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.msl
index c01b94e..26f5d65 100644
--- a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_04b911(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_04b911(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(uint2(1u)), 1, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_04b911(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_04b911(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_04b911(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_04b911(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_04b911(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_04b911(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.spvasm
index 9eb7c41..73a7958 100644
--- a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_04b911 "textureLoad_04b911"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,50 +41,58 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_04b911 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_04b911 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %uint %23 0
-         %25 = OpCompositeExtract %uint %23 1
-         %26 = OpBitcast %uint %int_1
-         %29 = OpCompositeConstruct %v3uint %24 %25 %26
-         %17 = OpImageFetch %v4float %18 %29 Lod %uint_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %uint %26 0
+         %28 = OpCompositeExtract %uint %26 1
+         %29 = OpBitcast %uint %int_1
+         %32 = OpCompositeConstruct %v3uint %27 %28 %29
+         %20 = OpImageFetch %v4float %21 %32 Lod %uint_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %37 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %38 = OpLoad %float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_04b911
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_04b911
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_04b911
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_04b911
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_04b911
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_04b911
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.wgsl
index 6a1b6bf..16ac2ea 100644
--- a/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/04b911.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_04b911() {
   var res : f32 = textureLoad(arg_0, vec2<u32>(1u), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_04b911();
diff --git a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl
index 3c8c90a..9e3b651 100644
--- a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<i32>, coords: u32, level: u32) -> vec4<i32>
 fn textureLoad_0cb698() {
   var res: vec4<i32> = textureLoad(arg_0, 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.dxc.hlsl
index e4c470c..e8b2520 100644
--- a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_0cb698() {
   int4 res = arg_0.Load(uint2(1u, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.fxc.hlsl
index e4c470c..e8b2520 100644
--- a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_0cb698() {
   int4 res = arg_0.Load(uint2(1u, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.glsl
index 5def0a5..f26f312 100644
--- a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_0cb698() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_0cb698() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_0cb698() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.msl
index ca1ce7f..0fbdc86 100644
--- a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_0cb698(texture1d<int, access::sample> tint_symbol_1) {
+void textureLoad_0cb698(texture1d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint(1u), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureLoad_0cb698(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_0cb698(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_0cb698(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_0cb698(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_0cb698(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_0cb698(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.spvasm
index ee178e7..a86b6a7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_0cb698 "textureLoad_0cb698"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %24 = OpConstantNull %v4int
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_0cb698 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %uint_1 Lod %uint_1
-               OpStore %res %17
+%textureLoad_0cb698 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %uint_1 Lod %uint_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %31 = OpLoad %v4int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureLoad_0cb698
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureLoad_0cb698
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_0cb698
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_0cb698
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_0cb698
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_0cb698
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.wgsl
index 50dea1a..5e121c0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/0cb698.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_0cb698() {
   var res : vec4<i32> = textureLoad(arg_0, 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_0cb698();
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl
index 2de236d..84dec3a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<f32>, coords: u32, level: i32) -> vec4<f32>
 fn textureLoad_1373dc() {
   var res: vec4<f32> = textureLoad(arg_0, 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.dxc.hlsl
index 30cef21..5ac2903 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1373dc() {
   float4 res = arg_0.Load(uint2(1u, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.fxc.hlsl
index 30cef21..5ac2903 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1373dc() {
   float4 res = arg_0.Load(uint2(1u, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.glsl
index 73e3675..0fe6d93 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1373dc() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1373dc() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1373dc() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.msl
index 683b90c..71acb20 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1373dc(texture1d<float, access::sample> tint_symbol_1) {
+void textureLoad_1373dc(texture1d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint(1u), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureLoad_1373dc(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_1373dc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1373dc(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1373dc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1373dc(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1373dc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.spvasm
index c7efb23..0789537 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1373dc "textureLoad_1373dc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,42 +42,50 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %24 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1373dc = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_1373dc = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %uint_1 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %uint_1 Lod %int_1
+               OpStore %res %19
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_1373dc
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureLoad_1373dc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %15
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_1373dc
+%fragment_main = OpFunction %void None %15
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_1373dc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_1373dc
+%compute_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_1373dc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.wgsl
index c304750..f5f3aaf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1373dc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_1373dc() {
   var res : vec4<f32> = textureLoad(arg_0, 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1373dc();
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl
index 9001543..5d2b23b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<u32>, array_index: i32, level: i32) -> vec4<i32>
 fn textureLoad_168dc8() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.dxc.hlsl
index b00f60d..8c0586c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_168dc8() {
   int4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.fxc.hlsl
index b00f60d..8c0586c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_168dc8() {
   int4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.glsl
index 766be6f..16e6215 100644
--- a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_168dc8() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_168dc8() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_168dc8() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.msl
index 2563a9a..6ff0917 100644
--- a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_168dc8(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_168dc8(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(uint2(1u)), 1, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_168dc8(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_168dc8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_168dc8(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_168dc8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_168dc8(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_168dc8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.spvasm
index e212e56..7edb226 100644
--- a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_168dc8 "textureLoad_168dc8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,58 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %27 = OpConstantComposite %v2uint %uint_1 %uint_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %32 = OpConstantNull %v4int
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_168dc8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %32
-         %19 = OpLoad %11 %arg_0
-         %25 = OpCompositeExtract %uint %24 0
-         %26 = OpCompositeExtract %uint %24 1
-         %27 = OpBitcast %uint %int_1
-         %29 = OpCompositeConstruct %v3uint %25 %26 %27
-         %17 = OpImageFetch %v4int %19 %29 Lod %int_1
-               OpStore %res %17
+%textureLoad_168dc8 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %35
+         %22 = OpLoad %11 %arg_0
+         %28 = OpCompositeExtract %uint %27 0
+         %29 = OpCompositeExtract %uint %27 1
+         %30 = OpBitcast %uint %int_1
+         %32 = OpCompositeConstruct %v3uint %28 %29 %30
+         %21 = OpImageFetch %v4int %22 %32 Lod %int_1
+               OpStore %res %21
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %39 = OpLoad %v4int %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_168dc8
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_168dc8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_168dc8
+%fragment_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_168dc8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_168dc8
+%compute_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_168dc8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.wgsl
index 300c1ce..a7625cc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/168dc8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_168dc8() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_168dc8();
diff --git a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl
index 5a70d33..f3d60f2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d, coords: vec2<i32>, level: i32) -> f32
 fn textureLoad_19cf87() {
   var res: f32 = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.dxc.hlsl
index 67e6c7f..0b975f7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_19cf87() {
   float res = arg_0.Load(int3((1).xx, 1)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.fxc.hlsl
index 67e6c7f..0b975f7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_19cf87() {
   float res = arg_0.Load(int3((1).xx, 1)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.glsl
index ca25169..ecdf575 100644
--- a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_19cf87() {
   float res = texelFetch(arg_0_1, ivec2(1), 1).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_19cf87() {
   float res = texelFetch(arg_0_1, ivec2(1), 1).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_19cf87() {
   float res = texelFetch(arg_0_1, ivec2(1), 1).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.msl
index 1fdb40c..cd8c488 100644
--- a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_19cf87(depth2d<float, access::sample> tint_symbol_1) {
+void textureLoad_19cf87(depth2d<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(int2(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureLoad_19cf87(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_19cf87(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_19cf87(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_19cf87(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_19cf87(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_19cf87(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.spvasm
index c98b894..768cc0a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_19cf87 "textureLoad_19cf87"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_19cf87 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_19cf87 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4float %18 %22 Lod %int_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageFetch %v4float %21 %25 Lod %int_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %31 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %32 = OpLoad %float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureLoad_19cf87
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_19cf87
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_19cf87
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_19cf87
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_19cf87
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_19cf87
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.wgsl
index 118ecdc..6c0989a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_19cf87() {
   var res : f32 = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_19cf87();
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl
index 658102b..1766a96 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<i32>, array_index: u32, level: u32) -> vec4<u32>
 fn textureLoad_1b051f() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.dxc.hlsl
index b022c62..4a090aa 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1b051f() {
   uint4 res = arg_0.Load(int4(int3((1).xx, int(1u)), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.fxc.hlsl
index b022c62..4a090aa 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1b051f() {
   uint4 res = arg_0.Load(int4(int3((1).xx, int(1u)), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.glsl
index 1d3c84e..033e345 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b051f() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b051f() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b051f() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.msl
index 8de4367a..4aa2689 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1b051f(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_1b051f(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(int2(1)), 1u, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_1b051f(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_1b051f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1b051f(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1b051f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1b051f(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1b051f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.spvasm
index bbf31ea..8215d1d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1b051f "textureLoad_1b051f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,58 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %24 = OpConstantComposite %v2int %int_1 %int_1
+         %27 = OpConstantComposite %v2int %int_1 %int_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %32 = OpConstantNull %v4uint
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1b051f = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %32
-         %19 = OpLoad %11 %arg_0
-         %25 = OpCompositeExtract %int %24 0
-         %26 = OpCompositeExtract %int %24 1
-         %27 = OpBitcast %int %uint_1
-         %29 = OpCompositeConstruct %v3int %25 %26 %27
-         %17 = OpImageFetch %v4uint %19 %29 Lod %uint_1
-               OpStore %res %17
+%textureLoad_1b051f = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %35
+         %22 = OpLoad %11 %arg_0
+         %28 = OpCompositeExtract %int %27 0
+         %29 = OpCompositeExtract %int %27 1
+         %30 = OpBitcast %int %uint_1
+         %32 = OpCompositeConstruct %v3int %28 %29 %30
+         %21 = OpImageFetch %v4uint %22 %32 Lod %uint_1
+               OpStore %res %21
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %39 = OpLoad %v4uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_1b051f
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_1b051f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_1b051f
+%fragment_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_1b051f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_1b051f
+%compute_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_1b051f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.wgsl
index a4543cf..337955c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b051f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_1b051f() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1b051f();
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl
index 6ab674c..c6839ba 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<u32>, coords: i32, level: i32) -> vec4<u32>
 fn textureLoad_1b8588() {
   var res: vec4<u32> = textureLoad(arg_0, 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.dxc.hlsl
index bcb60f5..a42d53a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1b8588() {
   uint4 res = arg_0.Load(int2(1, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.fxc.hlsl
index bcb60f5..a42d53a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1b8588() {
   uint4 res = arg_0.Load(int2(1, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.glsl
index 1ed0f4d..2d9c055 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b8588() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b8588() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b8588() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.msl
index a71b52b..de62d8e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1b8588(texture1d<uint, access::sample> tint_symbol_1) {
+void textureLoad_1b8588(texture1d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint(1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureLoad_1b8588(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_1b8588(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1b8588(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1b8588(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1b8588(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1b8588(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.spvasm
index c4ae1ec..ddd6d19 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1b8588 "textureLoad_1b8588"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %24 = OpConstantNull %v4uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1b8588 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %int_1 Lod %int_1
-               OpStore %res %17
+%textureLoad_1b8588 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %int_1 Lod %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %31 = OpLoad %v4uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureLoad_1b8588
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureLoad_1b8588
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_1b8588
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_1b8588
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_1b8588
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_1b8588
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.wgsl
index 2d61c15..5bd7bbc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_1b8588() {
   var res : vec4<u32> = textureLoad(arg_0, 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1b8588();
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl
index 8fca51e..86dbd9a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_external, coords: vec2<u32>) -> vec4<f32>
 fn textureLoad_1bfdfb() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
index 17a7cd2..ffc7aef 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
@@ -91,8 +91,11 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureLoad_1bfdfb() {
   float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1u).xx, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
index 17a7cd2..ffc7aef 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
@@ -91,8 +91,11 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureLoad_1bfdfb() {
   float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1u).xx, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
index 598afb2..50390aa 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
@@ -74,8 +74,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1bfdfb() {
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -168,8 +173,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1bfdfb() {
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -256,8 +266,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1bfdfb() {
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, uvec2(1u), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
index e9166ef..f5f7e00 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
@@ -95,33 +95,34 @@
   return float4(color, 1.0f);
 }
 
-void textureLoad_1bfdfb(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_3) {
+void textureLoad_1bfdfb(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_3, device float4* const tint_symbol_4) {
   float4 res = textureLoadExternal(tint_symbol_1, tint_symbol_2, uint2(1u), tint_unpack_vec3_in_composite_1(*(tint_symbol_3)));
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, texture2d<float, access::sample> tint_symbol_5, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_6) {
-  textureLoad_1bfdfb(tint_symbol_4, tint_symbol_5, tint_symbol_6);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_7, device float4* const tint_symbol_8) {
+  textureLoad_1bfdfb(tint_symbol_5, tint_symbol_6, tint_symbol_7, tint_symbol_8);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], texture2d<float, access::sample> tint_symbol_8 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_9 [[buffer(2)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], texture2d<float, access::sample> tint_symbol_10 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_11 [[buffer(2)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], texture2d<float, access::sample> tint_symbol_11 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_12 [[buffer(2)]]) {
-  textureLoad_1bfdfb(tint_symbol_10, tint_symbol_11, tint_symbol_12);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_15 [[buffer(2)]], device float4* tint_symbol_16 [[buffer(0)]]) {
+  textureLoad_1bfdfb(tint_symbol_13, tint_symbol_14, tint_symbol_15, tint_symbol_16);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_15 [[buffer(2)]]) {
-  textureLoad_1bfdfb(tint_symbol_13, tint_symbol_14, tint_symbol_15);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_17 [[texture(0)]], texture2d<float, access::sample> tint_symbol_18 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_19 [[buffer(2)]], device float4* tint_symbol_20 [[buffer(0)]]) {
+  textureLoad_1bfdfb(tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
index 166be15..11e3ff2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 157
+; Bound: 163
 ; Schema: 0
                OpCapability Shader
-         %29 = OpExtInstImport "GLSL.std.450"
+         %32 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,6 +37,9 @@
                OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
                OpName %ext_tex_params "ext_tex_params"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %gammaCorrection "gammaCorrection"
                OpName %v "v"
                OpName %params "params"
@@ -94,6 +97,10 @@
                OpDecorate %ext_tex_params Binding 2
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
                OpMemberDecorate %ExternalTextureParams 0 Offset 0
                OpMemberDecorate %ExternalTextureParams 1 Offset 4
                OpMemberDecorate %ExternalTextureParams 2 Offset 16
@@ -129,167 +136,174 @@
 %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
 %ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-         %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %26 = OpTypeFunction %v3float %v3float %GammaTransferParams
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %43 = OpConstantNull %v3float
+         %46 = OpConstantNull %v3float
      %v2uint = OpTypeVector %uint 2
 %mat3v2float = OpTypeMatrix %v2float 3
 %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat3v2float
-         %63 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams
+         %66 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams
      %uint_1 = OpConstant %uint 1
-         %74 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %77 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
-         %84 = OpConstantNull %int
+         %87 = OpConstantNull %int
     %float_1 = OpConstant %float 1
-         %97 = OpConstantNull %uint
-        %115 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
+        %100 = OpConstantNull %uint
+        %118 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
        %void = OpTypeVoid
-        %130 = OpTypeFunction %void
+        %133 = OpTypeFunction %void
      %uint_0 = OpConstant %uint 0
 %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-        %144 = OpTypeFunction %v4float
-%gammaCorrection = OpFunction %v3float None %23
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+        %150 = OpTypeFunction %v4float
+%gammaCorrection = OpFunction %v3float None %26
           %v = OpFunctionParameter %v3float
      %params = OpFunctionParameter %GammaTransferParams
-         %27 = OpLabel
-         %41 = OpVariable %_ptr_Function_v3float Function %43
-         %53 = OpVariable %_ptr_Function_v3float Function %43
-         %59 = OpVariable %_ptr_Function_v3float Function %43
-         %28 = OpExtInst %v3float %29 FAbs %v
-         %30 = OpCompositeExtract %float %params 4
-         %31 = OpCompositeConstruct %v3float %30 %30 %30
-         %32 = OpFOrdLessThan %v3bool %28 %31
-         %35 = OpExtInst %v3float %29 FSign %v
-         %36 = OpCompositeExtract %float %params 3
-         %37 = OpExtInst %v3float %29 FAbs %v
-         %38 = OpVectorTimesScalar %v3float %37 %36
-         %39 = OpCompositeExtract %float %params 6
-         %44 = OpCompositeConstruct %v3float %39 %39 %39
-         %40 = OpFAdd %v3float %38 %44
-         %45 = OpFMul %v3float %35 %40
-         %46 = OpExtInst %v3float %29 FSign %v
-         %48 = OpCompositeExtract %float %params 1
-         %49 = OpExtInst %v3float %29 FAbs %v
-         %50 = OpVectorTimesScalar %v3float %49 %48
-         %51 = OpCompositeExtract %float %params 2
-         %54 = OpCompositeConstruct %v3float %51 %51 %51
-         %52 = OpFAdd %v3float %50 %54
-         %55 = OpCompositeExtract %float %params 0
-         %56 = OpCompositeConstruct %v3float %55 %55 %55
-         %47 = OpExtInst %v3float %29 Pow %52 %56
-         %57 = OpCompositeExtract %float %params 5
-         %60 = OpCompositeConstruct %v3float %57 %57 %57
-         %58 = OpFAdd %v3float %47 %60
-         %61 = OpFMul %v3float %46 %58
-         %62 = OpSelect %v3float %32 %45 %61
-               OpReturnValue %62
+         %30 = OpLabel
+         %44 = OpVariable %_ptr_Function_v3float Function %46
+         %56 = OpVariable %_ptr_Function_v3float Function %46
+         %62 = OpVariable %_ptr_Function_v3float Function %46
+         %31 = OpExtInst %v3float %32 FAbs %v
+         %33 = OpCompositeExtract %float %params 4
+         %34 = OpCompositeConstruct %v3float %33 %33 %33
+         %35 = OpFOrdLessThan %v3bool %31 %34
+         %38 = OpExtInst %v3float %32 FSign %v
+         %39 = OpCompositeExtract %float %params 3
+         %40 = OpExtInst %v3float %32 FAbs %v
+         %41 = OpVectorTimesScalar %v3float %40 %39
+         %42 = OpCompositeExtract %float %params 6
+         %47 = OpCompositeConstruct %v3float %42 %42 %42
+         %43 = OpFAdd %v3float %41 %47
+         %48 = OpFMul %v3float %38 %43
+         %49 = OpExtInst %v3float %32 FSign %v
+         %51 = OpCompositeExtract %float %params 1
+         %52 = OpExtInst %v3float %32 FAbs %v
+         %53 = OpVectorTimesScalar %v3float %52 %51
+         %54 = OpCompositeExtract %float %params 2
+         %57 = OpCompositeConstruct %v3float %54 %54 %54
+         %55 = OpFAdd %v3float %53 %57
+         %58 = OpCompositeExtract %float %params 0
+         %59 = OpCompositeConstruct %v3float %58 %58 %58
+         %50 = OpExtInst %v3float %32 Pow %55 %59
+         %60 = OpCompositeExtract %float %params 5
+         %63 = OpCompositeConstruct %v3float %60 %60 %60
+         %61 = OpFAdd %v3float %50 %63
+         %64 = OpFMul %v3float %49 %61
+         %65 = OpSelect %v3float %35 %48 %64
+               OpReturnValue %65
                OpFunctionEnd
-%textureLoadExternal = OpFunction %v4float None %63
+%textureLoadExternal = OpFunction %v4float None %66
      %plane0 = OpFunctionParameter %11
      %plane1 = OpFunctionParameter %11
       %coord = OpFunctionParameter %v2uint
    %params_0 = OpFunctionParameter %ExternalTextureParams
-         %72 = OpLabel
-      %color = OpVariable %_ptr_Function_v3float Function %43
-         %75 = OpShiftRightLogical %v2uint %coord %74
-         %77 = OpCompositeExtract %uint %params_0 0
-         %78 = OpIEqual %bool %77 %uint_1
-               OpSelectionMerge %79 None
-               OpBranchConditional %78 %80 %81
-         %80 = OpLabel
-         %82 = OpImageFetch %v4float %plane0 %coord Lod %84
-         %85 = OpVectorShuffle %v3float %82 %82 0 1 2
-               OpStore %color %85
-               OpBranch %79
-         %81 = OpLabel
-         %86 = OpImageFetch %v4float %plane0 %coord Lod %84
-         %87 = OpCompositeExtract %float %86 0
-         %88 = OpImageFetch %v4float %plane1 %75 Lod %84
-         %89 = OpVectorShuffle %v2float %88 %88 0 1
+         %75 = OpLabel
+      %color = OpVariable %_ptr_Function_v3float Function %46
+         %78 = OpShiftRightLogical %v2uint %coord %77
+         %80 = OpCompositeExtract %uint %params_0 0
+         %81 = OpIEqual %bool %80 %uint_1
+               OpSelectionMerge %82 None
+               OpBranchConditional %81 %83 %84
+         %83 = OpLabel
+         %85 = OpImageFetch %v4float %plane0 %coord Lod %87
+         %88 = OpVectorShuffle %v3float %85 %85 0 1 2
+               OpStore %color %88
+               OpBranch %82
+         %84 = OpLabel
+         %89 = OpImageFetch %v4float %plane0 %coord Lod %87
          %90 = OpCompositeExtract %float %89 0
-         %91 = OpCompositeExtract %float %89 1
-         %93 = OpCompositeConstruct %v4float %87 %90 %91 %float_1
-         %94 = OpCompositeExtract %mat3v4float %params_0 2
-         %95 = OpVectorTimesMatrix %v3float %93 %94
-               OpStore %color %95
-               OpBranch %79
-         %79 = OpLabel
-         %96 = OpCompositeExtract %uint %params_0 1
-         %98 = OpIEqual %bool %96 %97
-               OpSelectionMerge %99 None
-               OpBranchConditional %98 %100 %99
-        %100 = OpLabel
-        %102 = OpLoad %v3float %color
-        %103 = OpCompositeExtract %GammaTransferParams %params_0 3
-        %101 = OpFunctionCall %v3float %gammaCorrection %102 %103
-               OpStore %color %101
-        %104 = OpCompositeExtract %mat3v3float %params_0 5
+         %91 = OpImageFetch %v4float %plane1 %78 Lod %87
+         %92 = OpVectorShuffle %v2float %91 %91 0 1
+         %93 = OpCompositeExtract %float %92 0
+         %94 = OpCompositeExtract %float %92 1
+         %96 = OpCompositeConstruct %v4float %90 %93 %94 %float_1
+         %97 = OpCompositeExtract %mat3v4float %params_0 2
+         %98 = OpVectorTimesMatrix %v3float %96 %97
+               OpStore %color %98
+               OpBranch %82
+         %82 = OpLabel
+         %99 = OpCompositeExtract %uint %params_0 1
+        %101 = OpIEqual %bool %99 %100
+               OpSelectionMerge %102 None
+               OpBranchConditional %101 %103 %102
+        %103 = OpLabel
         %105 = OpLoad %v3float %color
-        %106 = OpMatrixTimesVector %v3float %104 %105
-               OpStore %color %106
+        %106 = OpCompositeExtract %GammaTransferParams %params_0 3
+        %104 = OpFunctionCall %v3float %gammaCorrection %105 %106
+               OpStore %color %104
+        %107 = OpCompositeExtract %mat3v3float %params_0 5
         %108 = OpLoad %v3float %color
-        %109 = OpCompositeExtract %GammaTransferParams %params_0 4
-        %107 = OpFunctionCall %v3float %gammaCorrection %108 %109
-               OpStore %color %107
-               OpBranch %99
-         %99 = OpLabel
-        %110 = OpLoad %v3float %color
-        %111 = OpCompositeExtract %float %110 0
-        %112 = OpCompositeExtract %float %110 1
-        %113 = OpCompositeExtract %float %110 2
-        %114 = OpCompositeConstruct %v4float %111 %112 %113 %float_1
-               OpReturnValue %114
+        %109 = OpMatrixTimesVector %v3float %107 %108
+               OpStore %color %109
+        %111 = OpLoad %v3float %color
+        %112 = OpCompositeExtract %GammaTransferParams %params_0 4
+        %110 = OpFunctionCall %v3float %gammaCorrection %111 %112
+               OpStore %color %110
+               OpBranch %102
+        %102 = OpLabel
+        %113 = OpLoad %v3float %color
+        %114 = OpCompositeExtract %float %113 0
+        %115 = OpCompositeExtract %float %113 1
+        %116 = OpCompositeExtract %float %113 2
+        %117 = OpCompositeConstruct %v4float %114 %115 %116 %float_1
+               OpReturnValue %117
                OpFunctionEnd
-%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %115
+%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %118
         %val = OpFunctionParameter %ExternalTextureParams_std140
-        %118 = OpLabel
-        %119 = OpCompositeExtract %uint %val 0
-        %120 = OpCompositeExtract %uint %val 1
-        %121 = OpCompositeExtract %mat3v4float %val 2
-        %122 = OpCompositeExtract %GammaTransferParams %val 3
-        %123 = OpCompositeExtract %GammaTransferParams %val 4
-        %124 = OpCompositeExtract %mat3v3float %val 5
-        %125 = OpCompositeExtract %v2float %val 6
-        %126 = OpCompositeExtract %v2float %val 7
-        %127 = OpCompositeExtract %v2float %val 8
-        %128 = OpCompositeConstruct %mat3v2float %125 %126 %127
-        %129 = OpCompositeConstruct %ExternalTextureParams %119 %120 %121 %122 %123 %124 %128
-               OpReturnValue %129
+        %121 = OpLabel
+        %122 = OpCompositeExtract %uint %val 0
+        %123 = OpCompositeExtract %uint %val 1
+        %124 = OpCompositeExtract %mat3v4float %val 2
+        %125 = OpCompositeExtract %GammaTransferParams %val 3
+        %126 = OpCompositeExtract %GammaTransferParams %val 4
+        %127 = OpCompositeExtract %mat3v3float %val 5
+        %128 = OpCompositeExtract %v2float %val 6
+        %129 = OpCompositeExtract %v2float %val 7
+        %130 = OpCompositeExtract %v2float %val 8
+        %131 = OpCompositeConstruct %mat3v2float %128 %129 %130
+        %132 = OpCompositeConstruct %ExternalTextureParams %122 %123 %124 %125 %126 %127 %131
+               OpReturnValue %132
                OpFunctionEnd
-%textureLoad_1bfdfb = OpFunction %void None %130
-        %133 = OpLabel
+%textureLoad_1bfdfb = OpFunction %void None %133
+        %136 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-        %135 = OpLoad %11 %arg_0
-        %136 = OpLoad %11 %ext_tex_plane_1
-        %140 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
-        %141 = OpLoad %ExternalTextureParams_std140 %140
-        %137 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %141
-        %134 = OpFunctionCall %v4float %textureLoadExternal %135 %136 %74 %137
-               OpStore %res %134
+        %138 = OpLoad %11 %arg_0
+        %139 = OpLoad %11 %ext_tex_plane_1
+        %143 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
+        %144 = OpLoad %ExternalTextureParams_std140 %143
+        %140 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %144
+        %137 = OpFunctionCall %v4float %textureLoadExternal %138 %139 %77 %140
+               OpStore %res %137
+        %148 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+        %149 = OpLoad %v4float %res
+               OpStore %148 %149
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %144
-        %146 = OpLabel
-        %147 = OpFunctionCall %void %textureLoad_1bfdfb
+%vertex_main_inner = OpFunction %v4float None %150
+        %152 = OpLabel
+        %153 = OpFunctionCall %void %textureLoad_1bfdfb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %130
-        %149 = OpLabel
-        %150 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %150
+%vertex_main = OpFunction %void None %133
+        %155 = OpLabel
+        %156 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %156
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %130
-        %152 = OpLabel
-        %153 = OpFunctionCall %void %textureLoad_1bfdfb
+%fragment_main = OpFunction %void None %133
+        %158 = OpLabel
+        %159 = OpFunctionCall %void %textureLoad_1bfdfb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %130
-        %155 = OpLabel
-        %156 = OpFunctionCall %void %textureLoad_1bfdfb
+%compute_main = OpFunction %void None %133
+        %161 = OpLabel
+        %162 = OpFunctionCall %void %textureLoad_1bfdfb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.wgsl
index 0f0f7e5..a254bd3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_1bfdfb() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1bfdfb();
diff --git a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl
index a58f7f1..687e59a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<u32>, coords: vec3<u32>, level: u32) -> vec4<u32>
 fn textureLoad_1c562a() {
   var res: vec4<u32> = textureLoad(arg_0, vec3<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.dxc.hlsl
index 105cec9..718ae3d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1c562a() {
   uint4 res = arg_0.Load(uint4((1u).xxx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.fxc.hlsl
index 105cec9..718ae3d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1c562a() {
   uint4 res = arg_0.Load(uint4((1u).xxx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.glsl
index a2ea319..7e6a2dd 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1c562a() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1c562a() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1c562a() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.msl
index d302202..37ad889 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1c562a(texture3d<uint, access::sample> tint_symbol_1) {
+void textureLoad_1c562a(texture3d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint3(uint3(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureLoad_1c562a(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_1c562a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1c562a(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1c562a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1c562a(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1c562a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.spvasm
index 715a68f..c3e07e6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1c562a "textureLoad_1c562a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %25 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %25 = OpConstantNull %v4uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1c562a = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %22 Lod %uint_1
-               OpStore %res %17
+%textureLoad_1c562a = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %25 Lod %uint_1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %32 = OpLoad %v4uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_1c562a
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_1c562a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_1c562a
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_1c562a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_1c562a
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_1c562a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.wgsl
index 18a8b91..01b2179 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1c562a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_1c562a() {
   var res : vec4<u32> = textureLoad(arg_0, vec3<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1c562a();
diff --git a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl
index 7076b0d..5e1679b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<f32>, coords: vec3<i32>, level: i32) -> vec4<f32>
 fn textureLoad_1f2016() {
   var res: vec4<f32> = textureLoad(arg_0, vec3<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.dxc.hlsl
index 4c90af7..2a55c04 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1f2016() {
   float4 res = arg_0.Load(int4((1).xxx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.fxc.hlsl
index 4c90af7..2a55c04 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1f2016() {
   float4 res = arg_0.Load(int4((1).xxx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.glsl
index 7665fa9..900ef2c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1f2016() {
   vec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1f2016() {
   vec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1f2016() {
   vec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.msl
index 4b467ff..4123304 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1f2016(texture3d<float, access::sample> tint_symbol_1) {
+void textureLoad_1f2016(texture3d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint3(int3(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureLoad_1f2016(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_1f2016(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1f2016(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1f2016(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1f2016(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1f2016(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.spvasm
index d4b7a52..4fcc91e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1f2016 "textureLoad_1f2016"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,51 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %21 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %24 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %24 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1f2016 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_1f2016 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Lod %int_1
+               OpStore %res %19
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_1f2016
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureLoad_1f2016
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %15
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_1f2016
+%fragment_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_1f2016
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_1f2016
+%compute_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_1f2016
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.wgsl
index 0f12804..b52cfc0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_1f2016() {
   var res : vec4<f32> = textureLoad(arg_0, vec3<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1f2016();
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl
index e03b36b..3ab81a6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<u32>, coords: u32, level: i32) -> vec4<u32>
 fn textureLoad_216c37() {
   var res: vec4<u32> = textureLoad(arg_0, 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.dxc.hlsl
index 4b154a8..592174b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_216c37() {
   uint4 res = arg_0.Load(uint2(1u, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.fxc.hlsl
index 4b154a8..592174b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_216c37() {
   uint4 res = arg_0.Load(uint2(1u, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.glsl
index f7b8688..59445f7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_216c37() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_216c37() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_216c37() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.msl
index 96fe68d..694a991 100644
--- a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_216c37(texture1d<uint, access::sample> tint_symbol_1) {
+void textureLoad_216c37(texture1d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint(1u), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureLoad_216c37(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_216c37(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_216c37(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_216c37(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_216c37(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_216c37(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.spvasm
index d323ef0..7a7c1b8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_216c37 "textureLoad_216c37"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %25 = OpConstantNull %v4uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_216c37 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %uint_1 Lod %int_1
-               OpStore %res %17
+%textureLoad_216c37 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %uint_1 Lod %int_1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %32 = OpLoad %v4uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_216c37
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_216c37
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_216c37
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_216c37
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_216c37
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_216c37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.wgsl
index 812abaa..5ec592f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/216c37.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_216c37() {
   var res : vec4<u32> = textureLoad(arg_0, 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_216c37();
diff --git a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl
index 9b748d3..41df5f8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<f32>, coords: vec3<u32>, level: u32) -> vec4<f32>
 fn textureLoad_21d1c4() {
   var res: vec4<f32> = textureLoad(arg_0, vec3<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.dxc.hlsl
index 9bb0b90..1ccb64e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_21d1c4() {
   float4 res = arg_0.Load(uint4((1u).xxx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.fxc.hlsl
index 9bb0b90..1ccb64e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_21d1c4() {
   float4 res = arg_0.Load(uint4((1u).xxx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.glsl
index 22257eb..da38bb4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_21d1c4() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_21d1c4() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_21d1c4() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.msl
index d0e07c0..95e5e7f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_21d1c4(texture3d<float, access::sample> tint_symbol_1) {
+void textureLoad_21d1c4(texture3d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint3(uint3(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureLoad_21d1c4(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_21d1c4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_21d1c4(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_21d1c4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_21d1c4(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_21d1c4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.spvasm
index 10c41ba..9d5e2a3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_21d1c4 "textureLoad_21d1c4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,50 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %21 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %24 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %24 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_21d1c4 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_21d1c4 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Lod %uint_1
+               OpStore %res %19
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_21d1c4
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureLoad_21d1c4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %15
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_21d1c4
+%fragment_main = OpFunction %void None %15
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_21d1c4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_21d1c4
+%compute_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_21d1c4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.wgsl
index 6f8836b..15ff028 100644
--- a/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/21d1c4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_21d1c4() {
   var res : vec4<f32> = textureLoad(arg_0, vec3<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_21d1c4();
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl
index 3fcb072..02878f0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<i32>, coords: vec3<u32>, level: i32) -> vec4<i32>
 fn textureLoad_223246() {
   var res: vec4<i32> = textureLoad(arg_0, vec3<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.dxc.hlsl
index eb9abb9..8fc7b38 100644
--- a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_223246() {
   int4 res = arg_0.Load(uint4((1u).xxx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.fxc.hlsl
index eb9abb9..8fc7b38 100644
--- a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_223246() {
   int4 res = arg_0.Load(uint4((1u).xxx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.glsl
index b9e9662..1bea6e5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_223246() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_223246() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_223246() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.msl
index f2a55f3..12408c6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_223246(texture3d<int, access::sample> tint_symbol_1) {
+void textureLoad_223246(texture3d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint3(uint3(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureLoad_223246(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_223246(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_223246(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_223246(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_223246(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_223246(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.spvasm
index f047829..a4ec4ae 100644
--- a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_223246 "textureLoad_223246"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %26 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %27 = OpConstantNull %v4int
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_223246 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %23 Lod %int_1
-               OpStore %res %17
+%textureLoad_223246 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %26 Lod %int_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %34 = OpLoad %v4int %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_223246
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_223246
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_223246
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_223246
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_223246
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_223246
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.wgsl
index fca4b78..410eeff 100644
--- a/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/223246.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_223246() {
   var res : vec4<i32> = textureLoad(arg_0, vec3<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_223246();
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl
index f0c424d..e295bc8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<u32>, array_index: i32, level: u32) -> vec4<i32>
 fn textureLoad_2363be() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.dxc.hlsl
index eaad1bf..6c75b43 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2363be() {
   int4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.fxc.hlsl
index eaad1bf..6c75b43 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2363be() {
   int4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.glsl
index 9b0a59d..38ab811 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_2363be() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_2363be() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_2363be() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.msl
index bccc5c9..033ad2a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_2363be(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_2363be(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(uint2(1u)), 1, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_2363be(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_2363be(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_2363be(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_2363be(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_2363be(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_2363be(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.spvasm
index 8913113..ea9e85e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_2363be "textureLoad_2363be"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,58 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %27 = OpConstantComposite %v2uint %uint_1 %uint_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %32 = OpConstantNull %v4int
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_2363be = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %32
-         %19 = OpLoad %11 %arg_0
-         %25 = OpCompositeExtract %uint %24 0
-         %26 = OpCompositeExtract %uint %24 1
-         %27 = OpBitcast %uint %int_1
-         %29 = OpCompositeConstruct %v3uint %25 %26 %27
-         %17 = OpImageFetch %v4int %19 %29 Lod %uint_1
-               OpStore %res %17
+%textureLoad_2363be = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %35
+         %22 = OpLoad %11 %arg_0
+         %28 = OpCompositeExtract %uint %27 0
+         %29 = OpCompositeExtract %uint %27 1
+         %30 = OpBitcast %uint %int_1
+         %32 = OpCompositeConstruct %v3uint %28 %29 %30
+         %21 = OpImageFetch %v4int %22 %32 Lod %uint_1
+               OpStore %res %21
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %39 = OpLoad %v4int %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_2363be
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_2363be
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_2363be
+%fragment_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_2363be
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_2363be
+%compute_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_2363be
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.wgsl
index 2a5b51f..89eb1ed 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2363be.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_2363be() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_2363be();
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl
index 8e7407e..ef58bb2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<f32>, coords: vec2<i32>, level: u32) -> vec4<f32>
 fn textureLoad_2d479c() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.dxc.hlsl
index 14a97df..c5dfdf3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2d479c() {
   float4 res = arg_0.Load(int3((1).xx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.fxc.hlsl
index 14a97df..c5dfdf3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2d479c() {
   float4 res = arg_0.Load(int3((1).xx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.glsl
index baf0eac..862b32c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2d479c() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2d479c() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2d479c() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.msl
index 918c872..41616ec 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_2d479c(texture2d<float, access::sample> tint_symbol_1) {
+void textureLoad_2d479c(texture2d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(int2(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureLoad_2d479c(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_2d479c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_2d479c(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_2d479c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_2d479c(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_2d479c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.spvasm
index d56c68c..1b2a969 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_2d479c "textureLoad_2d479c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,44 +41,52 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %21 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %26 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_2d479c = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_2d479c = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Lod %uint_1
+               OpStore %res %19
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_2d479c
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_2d479c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_2d479c
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_2d479c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_2d479c
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_2d479c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.wgsl
index 33dcc85..8caaae4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2d479c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_2d479c() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_2d479c();
diff --git a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl
index f62ef1d..ceeeb34 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<f32>, coords: vec2<u32>, sample_index: u32) -> vec4<f32>
 fn textureLoad_2e09aa() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.dxc.hlsl
index fcb6480..2d90026 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2e09aa() {
   float4 res = arg_0.Load((1u).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.fxc.hlsl
index fcb6480..2d90026 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2e09aa() {
   float4 res = arg_0.Load((1u).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.glsl
index 630e2fa..44efb98 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2e09aa() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2e09aa() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2e09aa() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.msl
index 3ae89d4..7effb23 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_2e09aa(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_2e09aa(texture2d_ms<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_2e09aa(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_2e09aa(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_2e09aa(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_2e09aa(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_2e09aa(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_2e09aa(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.spvasm
index cce0307..ccbbcef 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_2e09aa "textureLoad_2e09aa"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,50 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %21 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %24 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_2e09aa = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_2e09aa = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Sample %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Sample %uint_1
+               OpStore %res %19
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_2e09aa
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureLoad_2e09aa
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %15
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_2e09aa
+%fragment_main = OpFunction %void None %15
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_2e09aa
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_2e09aa
+%compute_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_2e09aa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.wgsl
index 58a8595..7f7f3a6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2e09aa.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_2e09aa() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_2e09aa();
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl
index 098f8ed..5b3263e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<i32>, coords: vec2<i32>, sample_index: u32) -> vec4<i32>
 fn textureLoad_38f8ab() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.dxc.hlsl
index 1e31cb2..9982563 100644
--- a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.dxc.hlsl
@@ -1,7 +1,11 @@
+SKIP: FAILED
+
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_38f8ab() {
   int4 res = arg_0.Load((1).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -30,3 +34,40 @@
   textureLoad_38f8ab();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.fxc.hlsl
index 1e31cb2..5544f5b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_38f8ab() {
   int4 res = arg_0.Load((1).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.glsl
index 696e66a..e6bf029 100644
--- a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_38f8ab() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_38f8ab() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_38f8ab() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.msl
index 889349b..30bb460 100644
--- a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_38f8ab(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureLoad_38f8ab(texture2d_ms<int, access::read> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(int2(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureLoad_38f8ab(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_38f8ab(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_38f8ab(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_38f8ab(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_38f8ab(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_38f8ab(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.spvasm
index d440a8a..8f1cde1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_38f8ab "textureLoad_38f8ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %27 = OpConstantNull %v4int
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_38f8ab = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %22 Sample %uint_1
-               OpStore %res %17
+%textureLoad_38f8ab = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %25 Sample %uint_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %34 = OpLoad %v4int %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_38f8ab
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_38f8ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_38f8ab
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_38f8ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_38f8ab
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_38f8ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.wgsl
index a97ddc2..e6e1fe6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/38f8ab.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_38f8ab() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_38f8ab();
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl
index f829c89..20533f2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<i32>, array_index: u32, level: u32) -> vec4<f32>
 fn textureLoad_3c96e8() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.dxc.hlsl
index d280db1..2c992db 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3c96e8() {
   float4 res = arg_0.Load(int4(int3((1).xx, int(1u)), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.fxc.hlsl
index d280db1..2c992db 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3c96e8() {
   float4 res = arg_0.Load(int4(int3((1).xx, int(1u)), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.glsl
index 92d7508..aac5b35 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3c96e8() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3c96e8() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3c96e8() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.msl
index ad54598..f9d3b10 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_3c96e8(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_3c96e8(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(int2(1)), 1u, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_3c96e8(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_3c96e8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_3c96e8(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_3c96e8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_3c96e8(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_3c96e8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.spvasm
index 479336b..4313e85 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_3c96e8 "textureLoad_3c96e8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,57 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_3c96e8 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_3c96e8 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %23 = OpCompositeExtract %int %22 0
-         %24 = OpCompositeExtract %int %22 1
-         %25 = OpBitcast %int %uint_1
-         %28 = OpCompositeConstruct %v3int %23 %24 %25
-         %16 = OpImageFetch %v4float %17 %28 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %26 = OpCompositeExtract %int %25 0
+         %27 = OpCompositeExtract %int %25 1
+         %28 = OpBitcast %int %uint_1
+         %31 = OpCompositeConstruct %v3int %26 %27 %28
+         %19 = OpImageFetch %v4float %20 %31 Lod %uint_1
+               OpStore %res %19
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_3c96e8
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_3c96e8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_3c96e8
+%fragment_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_3c96e8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_3c96e8
+%compute_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_3c96e8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.wgsl
index a4d17d7..21369e9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3c96e8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_3c96e8() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_3c96e8();
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl
index 7668515..2339215 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<u32>, array_index: u32, level: i32) -> vec4<i32>
 fn textureLoad_3d3fd1() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl
index 5ad0afa..d350063 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3d3fd1() {
   int4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl
index 5ad0afa..d350063 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3d3fd1() {
   int4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.glsl
index 4792dc9..2160e9a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_3d3fd1() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_3d3fd1() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_3d3fd1() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.msl
index c19db9b..97f967e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_3d3fd1(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_3d3fd1(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_3d3fd1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_3d3fd1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_3d3fd1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_3d3fd1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_3d3fd1(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_3d3fd1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.spvasm
index 430ee7f..2b890ea 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_3d3fd1 "textureLoad_3d3fd1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,49 +42,57 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %27 = OpConstantComposite %v2uint %uint_1 %uint_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %31 = OpConstantNull %v4int
-         %32 = OpTypeFunction %v4float
+         %34 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_3d3fd1 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %31
-         %19 = OpLoad %11 %arg_0
-         %25 = OpCompositeExtract %uint %24 0
-         %26 = OpCompositeExtract %uint %24 1
-         %27 = OpCompositeConstruct %v3uint %25 %26 %uint_1
-         %17 = OpImageFetch %v4int %19 %27 Lod %int_1
-               OpStore %res %17
+%textureLoad_3d3fd1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %34
+         %22 = OpLoad %11 %arg_0
+         %28 = OpCompositeExtract %uint %27 0
+         %29 = OpCompositeExtract %uint %27 1
+         %30 = OpCompositeConstruct %v3uint %28 %29 %uint_1
+         %21 = OpImageFetch %v4int %22 %30 Lod %int_1
+               OpStore %res %21
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %38 = OpLoad %v4int %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_3d3fd1
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_3d3fd1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_3d3fd1
+%fragment_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_3d3fd1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_3d3fd1
+%compute_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_3d3fd1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.wgsl
index 2175060..a21cb64 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3d3fd1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_3d3fd1() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_3d3fd1();
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl
index 81954b0..3edd33b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<f32>, coords: i32, level: u32) -> vec4<f32>
 fn textureLoad_3da3ed() {
   var res: vec4<f32> = textureLoad(arg_0, 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.dxc.hlsl
index ae51c8e..0d35476 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3da3ed() {
   float4 res = arg_0.Load(int2(1, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.fxc.hlsl
index ae51c8e..0d35476 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3da3ed() {
   float4 res = arg_0.Load(int2(1, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.glsl
index f09b08e..042fcae 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3da3ed() {
   vec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3da3ed() {
   vec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3da3ed() {
   vec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.msl
index 84e357d..f6cdc95 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_3da3ed(texture1d<float, access::sample> tint_symbol_1) {
+void textureLoad_3da3ed(texture1d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint(1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureLoad_3da3ed(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_3da3ed(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_3da3ed(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_3da3ed(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_3da3ed(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_3da3ed(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.spvasm
index 45bef6a..a366848 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_3da3ed "textureLoad_3da3ed"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,42 +42,50 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %24 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_3da3ed = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_3da3ed = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %int_1 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %int_1 Lod %uint_1
+               OpStore %res %19
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_3da3ed
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureLoad_3da3ed
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %15
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_3da3ed
+%fragment_main = OpFunction %void None %15
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_3da3ed
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_3da3ed
+%compute_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_3da3ed
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.wgsl
index e832060..483513a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3da3ed.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_3da3ed() {
   var res : vec4<f32> = textureLoad(arg_0, 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_3da3ed();
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl
index 6fd6433..c7b4472 100644
--- a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<f32>, coords: vec2<u32>, level: i32) -> vec4<f32>
 fn textureLoad_439e2a() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.dxc.hlsl
index eadf395..695b145 100644
--- a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_439e2a() {
   float4 res = arg_0.Load(uint3((1u).xx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.fxc.hlsl
index eadf395..695b145 100644
--- a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_439e2a() {
   float4 res = arg_0.Load(uint3((1u).xx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.glsl
index 0b40108..0011cbb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_439e2a() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_439e2a() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_439e2a() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.msl
index 8908484..1b243b4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_439e2a(texture2d<float, access::sample> tint_symbol_1) {
+void textureLoad_439e2a(texture2d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureLoad_439e2a(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_439e2a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_439e2a(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_439e2a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_439e2a(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_439e2a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.spvasm
index 81e00fd..66e3d53 100644
--- a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_439e2a "textureLoad_439e2a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,44 +41,52 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %21 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %26 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_439e2a = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_439e2a = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Lod %int_1
+               OpStore %res %19
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_439e2a
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_439e2a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_439e2a
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_439e2a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_439e2a
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_439e2a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.wgsl
index 2d369bc..5e749f8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/439e2a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_439e2a() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_439e2a();
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl
index dc25830c..94600b5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<u32>, array_index: i32, level: u32) -> vec4<f32>
 fn textureLoad_46a93f() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.dxc.hlsl
index 4342746..003d1d5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_46a93f() {
   float4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.fxc.hlsl
index 4342746..003d1d5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_46a93f() {
   float4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.glsl
index 1fb6bc8..691431e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_46a93f() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_46a93f() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_46a93f() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.msl
index 3329dec..a01ed6d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_46a93f(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_46a93f(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_46a93f(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_46a93f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_46a93f(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_46a93f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_46a93f(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_46a93f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.spvasm
index c241fcb..99e4dc4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_46a93f "textureLoad_46a93f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,57 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_46a93f = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_46a93f = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %23 = OpCompositeExtract %uint %22 0
-         %24 = OpCompositeExtract %uint %22 1
-         %25 = OpBitcast %uint %int_1
-         %28 = OpCompositeConstruct %v3uint %23 %24 %25
-         %16 = OpImageFetch %v4float %17 %28 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %26 = OpCompositeExtract %uint %25 0
+         %27 = OpCompositeExtract %uint %25 1
+         %28 = OpBitcast %uint %int_1
+         %31 = OpCompositeConstruct %v3uint %26 %27 %28
+         %19 = OpImageFetch %v4float %20 %31 Lod %uint_1
+               OpStore %res %19
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_46a93f
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_46a93f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_46a93f
+%fragment_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_46a93f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_46a93f
+%compute_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_46a93f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.wgsl
index 3113448..d51ef25 100644
--- a/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/46a93f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_46a93f() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_46a93f();
diff --git a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl
index 90aa004..e2a9041 100644
--- a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<i32>, coords: vec3<u32>, level: u32) -> vec4<i32>
 fn textureLoad_47e818() {
   var res: vec4<i32> = textureLoad(arg_0, vec3<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.dxc.hlsl
index 8c4b83d..ae63f83 100644
--- a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_47e818() {
   int4 res = arg_0.Load(uint4((1u).xxx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.fxc.hlsl
index 8c4b83d..ae63f83 100644
--- a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_47e818() {
   int4 res = arg_0.Load(uint4((1u).xxx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.glsl
index 029590a..ee52c46 100644
--- a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_47e818() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_47e818() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_47e818() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.msl
index 6ecc7e3..c663eb4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_47e818(texture3d<int, access::sample> tint_symbol_1) {
+void textureLoad_47e818(texture3d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint3(uint3(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureLoad_47e818(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_47e818(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_47e818(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_47e818(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_47e818(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_47e818(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.spvasm
index 4c8586c..2fe5d3d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_47e818 "textureLoad_47e818"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %26 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %26 = OpConstantNull %v4int
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_47e818 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %26
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %23 Lod %uint_1
-               OpStore %res %17
+%textureLoad_47e818 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %29
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %26 Lod %uint_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %33 = OpLoad %v4int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_47e818
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_47e818
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_47e818
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_47e818
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_47e818
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_47e818
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.wgsl
index 6136a75..ccd4368 100644
--- a/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/47e818.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_47e818() {
   var res : vec4<i32> = textureLoad(arg_0, vec3<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_47e818();
diff --git a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl
index daeb8ca..6419280 100644
--- a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<f32>, coords: vec2<i32>, level: i32) -> vec4<f32>
 fn textureLoad_484344() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.dxc.hlsl
index 89d6153..4361360 100644
--- a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_484344() {
   float4 res = arg_0.Load(int3((1).xx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.fxc.hlsl
index 89d6153..4361360 100644
--- a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_484344() {
   float4 res = arg_0.Load(int3((1).xx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.glsl
index fadc4d6..f8fd177 100644
--- a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_484344() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_484344() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_484344() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.msl
index c216bdd..4bb257a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_484344(texture2d<float, access::sample> tint_symbol_1) {
+void textureLoad_484344(texture2d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(int2(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureLoad_484344(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_484344(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_484344(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_484344(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_484344(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_484344(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.spvasm
index a3f3250..936ecd9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_484344 "textureLoad_484344"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,51 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %21 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %24 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_484344 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_484344 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Lod %int_1
+               OpStore %res %19
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_484344
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureLoad_484344
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %15
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_484344
+%fragment_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_484344
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_484344
+%compute_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_484344
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.wgsl
index d9f4d56..750625a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_484344() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_484344();
diff --git a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl
index ccf8f01..c9f241a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<u32>, coords: vec2<u32>, sample_index: u32) -> vec4<u32>
 fn textureLoad_49f76f() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.dxc.hlsl
index 173f0f3..ddf606e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_49f76f() {
   uint4 res = arg_0.Load((1u).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.fxc.hlsl
index 173f0f3..ddf606e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_49f76f() {
   uint4 res = arg_0.Load((1u).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.glsl
index 345b3ce..cc95cba 100644
--- a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_49f76f() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_49f76f() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_49f76f() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.msl
index b4f6aa4..1db1f54 100644
--- a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_49f76f(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureLoad_49f76f(texture2d_ms<uint, access::read> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureLoad_49f76f(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_49f76f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_49f76f(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_49f76f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_49f76f(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_49f76f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.spvasm
index 9e7b602..331c1e9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_49f76f "textureLoad_49f76f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %25 = OpConstantNull %v4uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_49f76f = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %22 Sample %uint_1
-               OpStore %res %17
+%textureLoad_49f76f = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %25 Sample %uint_1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %32 = OpLoad %v4uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_49f76f
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_49f76f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_49f76f
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_49f76f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_49f76f
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_49f76f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.wgsl
index 11774fa..6ca01c6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/49f76f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_49f76f() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_49f76f();
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl
index 5b9f223..5a32d2d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<i32>, array_index: u32, level: i32) -> vec4<f32>
 fn textureLoad_4acb64() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.dxc.hlsl
index eb2d9c4..7c94a6c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4acb64() {
   float4 res = arg_0.Load(int4(int3((1).xx, int(1u)), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.fxc.hlsl
index eb2d9c4..7c94a6c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4acb64() {
   float4 res = arg_0.Load(int4(int3((1).xx, int(1u)), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.glsl
index af90d6c..a6ba478 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_4acb64() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_4acb64() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_4acb64() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.msl
index 390a2d2..d574b4e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_4acb64(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_4acb64(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(int2(1)), 1u, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_4acb64(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_4acb64(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_4acb64(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_4acb64(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_4acb64(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_4acb64(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.spvasm
index b77fa30..cb67c5db 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_4acb64 "textureLoad_4acb64"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,57 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_4acb64 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_4acb64 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %23 = OpCompositeExtract %int %22 0
-         %24 = OpCompositeExtract %int %22 1
-         %25 = OpBitcast %int %uint_1
-         %28 = OpCompositeConstruct %v3int %23 %24 %25
-         %16 = OpImageFetch %v4float %17 %28 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %26 = OpCompositeExtract %int %25 0
+         %27 = OpCompositeExtract %int %25 1
+         %28 = OpBitcast %int %uint_1
+         %31 = OpCompositeConstruct %v3int %26 %27 %28
+         %19 = OpImageFetch %v4float %20 %31 Lod %int_1
+               OpStore %res %19
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_4acb64
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_4acb64
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_4acb64
+%fragment_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_4acb64
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_4acb64
+%compute_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_4acb64
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.wgsl
index b3783d9..6cfb4b8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4acb64.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_4acb64() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_4acb64();
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl
index fad9797..7c227f4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<i32>, coords: u32, level: i32) -> vec4<i32>
 fn textureLoad_4c423f() {
   var res: vec4<i32> = textureLoad(arg_0, 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.dxc.hlsl
index 8e65740..6c31741 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4c423f() {
   int4 res = arg_0.Load(uint2(1u, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.fxc.hlsl
index 8e65740..6c31741 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4c423f() {
   int4 res = arg_0.Load(uint2(1u, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.glsl
index dc5e7ae..88a9cd4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4c423f() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4c423f() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4c423f() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.msl
index d02ad77..266b580 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_4c423f(texture1d<int, access::sample> tint_symbol_1) {
+void textureLoad_4c423f(texture1d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint(1u), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureLoad_4c423f(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_4c423f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_4c423f(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_4c423f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_4c423f(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_4c423f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.spvasm
index b119edc..9833283 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_4c423f "textureLoad_4c423f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %25 = OpConstantNull %v4int
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_4c423f = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %uint_1 Lod %int_1
-               OpStore %res %17
+%textureLoad_4c423f = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %uint_1 Lod %int_1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %32 = OpLoad %v4int %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_4c423f
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_4c423f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_4c423f
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_4c423f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_4c423f
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_4c423f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.wgsl
index 08cd408..e105634 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4c423f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_4c423f() {
   var res : vec4<i32> = textureLoad(arg_0, 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_4c423f();
diff --git a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl
index c16d5b6..e016535 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_multisampled_2d, coords: vec2<u32>, sample_index: u32) -> f32
 fn textureLoad_4db25c() {
   var res: f32 = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.dxc.hlsl
index ba4ee5f..d663550 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4db25c() {
   float res = arg_0.Load(uint3((1u).xx, uint(0)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.fxc.hlsl
index ba4ee5f..d663550 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4db25c() {
   float res = arg_0.Load(uint3((1u).xx, uint(0)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.glsl
index 2b58f65..10aa3e4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_4db25c() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_4db25c() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_4db25c() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.msl
index c1f80e6..b6c6fe8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_4db25c(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_4db25c(depth2d_ms<float, access::read> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_4db25c(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_4db25c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_4db25c(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_4db25c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_4db25c(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_4db25c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.spvasm
index 32be0e4..ebc9cce 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_4db25c "textureLoad_4db25c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,51 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_4db25c = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_4db25c = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4float %18 %22 Sample %uint_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageFetch %v4float %21 %25 Sample %uint_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %30 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %31 = OpLoad %float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureLoad_4db25c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureLoad_4db25c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %15
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_4db25c
+%fragment_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_4db25c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_4db25c
+%compute_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_4db25c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.wgsl
index 016d7b3..7d9a54a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4db25c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_4db25c() {
   var res : f32 = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_4db25c();
diff --git a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl
index 0cab940..a43d1b9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<i32>, coords: vec3<i32>, level: i32) -> vec4<i32>
 fn textureLoad_4fd803() {
   var res: vec4<i32> = textureLoad(arg_0, vec3<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.dxc.hlsl
index 6d0e1ca..01a644f1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4fd803() {
   int4 res = arg_0.Load(int4((1).xxx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.fxc.hlsl
index 6d0e1ca..01a644f1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4fd803() {
   int4 res = arg_0.Load(int4((1).xxx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.glsl
index 6b6428c..d6c691b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4fd803() {
   ivec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4fd803() {
   ivec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4fd803() {
   ivec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.msl
index b3c9573..1f57acc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_4fd803(texture3d<int, access::sample> tint_symbol_1) {
+void textureLoad_4fd803(texture3d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint3(int3(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureLoad_4fd803(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_4fd803(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_4fd803(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_4fd803(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_4fd803(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_4fd803(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.spvasm
index 09c742b..a7c9480 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_4fd803 "textureLoad_4fd803"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,52 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %25 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %25 = OpConstantNull %v4int
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_4fd803 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %22 Lod %int_1
-               OpStore %res %17
+%textureLoad_4fd803 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %25 Lod %int_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %33 = OpLoad %v4int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_4fd803
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_4fd803
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_4fd803
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_4fd803
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_4fd803
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_4fd803
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.wgsl
index 60d259e..a7a07cf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_4fd803() {
   var res : vec4<i32> = textureLoad(arg_0, vec3<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_4fd803();
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl
index c02faf2..1216822 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<u32>, array_index: i32, level: i32) -> vec4<u32>
 fn textureLoad_53e142() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.dxc.hlsl
index 3aa59fd..209f017 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_53e142() {
   uint4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.fxc.hlsl
index 3aa59fd..209f017 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_53e142() {
   uint4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.glsl
index 2784890..5689678 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_53e142() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_53e142() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_53e142() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.msl
index bff4dce..b1f2545 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_53e142(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_53e142(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(uint2(1u)), 1, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_53e142(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_53e142(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_53e142(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_53e142(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_53e142(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_53e142(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.spvasm
index 0d6f864..5c44a19 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_53e142 "textureLoad_53e142"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,58 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %32 = OpConstantNull %v4uint
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_53e142 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %32
-         %19 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %uint %23 0
-         %25 = OpCompositeExtract %uint %23 1
-         %26 = OpBitcast %uint %int_1
-         %29 = OpCompositeConstruct %v3uint %24 %25 %26
-         %17 = OpImageFetch %v4uint %19 %29 Lod %int_1
-               OpStore %res %17
+%textureLoad_53e142 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %35
+         %22 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %uint %26 0
+         %28 = OpCompositeExtract %uint %26 1
+         %29 = OpBitcast %uint %int_1
+         %32 = OpCompositeConstruct %v3uint %27 %28 %29
+         %21 = OpImageFetch %v4uint %22 %32 Lod %int_1
+               OpStore %res %21
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %39 = OpLoad %v4uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_53e142
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_53e142
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_53e142
+%fragment_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_53e142
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_53e142
+%compute_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_53e142
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.wgsl
index 61ac9cd..6445947 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/53e142.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_53e142() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_53e142();
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl
index 8709118..7917f8a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<u32>, array_index: i32, level: i32) -> vec4<f32>
 fn textureLoad_54a59b() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.dxc.hlsl
index 05c3ea6..c25d644 100644
--- a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_54a59b() {
   float4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.fxc.hlsl
index 05c3ea6..c25d644 100644
--- a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_54a59b() {
   float4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.glsl
index d0261ec..fc3a1e8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_54a59b() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_54a59b() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_54a59b() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.msl
index 76de435..822aa06 100644
--- a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_54a59b(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_54a59b(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_54a59b(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_54a59b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_54a59b(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_54a59b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_54a59b(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_54a59b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.spvasm
index a74c27d..8eeebee 100644
--- a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_54a59b "textureLoad_54a59b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,57 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_54a59b = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_54a59b = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %23 = OpCompositeExtract %uint %22 0
-         %24 = OpCompositeExtract %uint %22 1
-         %25 = OpBitcast %uint %int_1
-         %28 = OpCompositeConstruct %v3uint %23 %24 %25
-         %16 = OpImageFetch %v4float %17 %28 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %26 = OpCompositeExtract %uint %25 0
+         %27 = OpCompositeExtract %uint %25 1
+         %28 = OpBitcast %uint %int_1
+         %31 = OpCompositeConstruct %v3uint %26 %27 %28
+         %19 = OpImageFetch %v4float %20 %31 Lod %int_1
+               OpStore %res %19
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_54a59b
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_54a59b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_54a59b
+%fragment_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_54a59b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_54a59b
+%compute_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_54a59b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.wgsl
index 501de96..1a0df0f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/54a59b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_54a59b() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_54a59b();
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl
index 23e75f1..382b5b9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<i32>, coords: i32, level: i32) -> vec4<i32>
 fn textureLoad_5a2f9d() {
   var res: vec4<i32> = textureLoad(arg_0, 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.dxc.hlsl
index 4c84ba1..baf28f5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_5a2f9d() {
   int4 res = arg_0.Load(int2(1, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.fxc.hlsl
index 4c84ba1..baf28f5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_5a2f9d() {
   int4 res = arg_0.Load(int2(1, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.glsl
index 4c85dce..6486983 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_5a2f9d() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_5a2f9d() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_5a2f9d() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.msl
index be59bdf..3d1deaa 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_5a2f9d(texture1d<int, access::sample> tint_symbol_1) {
+void textureLoad_5a2f9d(texture1d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint(1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureLoad_5a2f9d(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_5a2f9d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_5a2f9d(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_5a2f9d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_5a2f9d(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_5a2f9d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.spvasm
index 0b388a6..f99ffdc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_5a2f9d "textureLoad_5a2f9d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,50 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %23 = OpConstantNull %v4int
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_5a2f9d = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %int_1 Lod %int_1
-               OpStore %res %17
+%textureLoad_5a2f9d = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %int_1 Lod %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %31 = OpLoad %v4int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_5a2f9d
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureLoad_5a2f9d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_5a2f9d
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_5a2f9d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_5a2f9d
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_5a2f9d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.wgsl
index c0eae95..0688c59 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_5a2f9d() {
   var res : vec4<i32> = textureLoad(arg_0, 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_5a2f9d();
diff --git a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl
index 6a412e6..b2914c7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<u32>, coords: vec2<i32>, level: i32) -> vec4<u32>
 fn textureLoad_6154d4() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.dxc.hlsl
index 515b575..00c5354 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6154d4() {
   uint4 res = arg_0.Load(int3((1).xx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.fxc.hlsl
index 515b575..00c5354 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6154d4() {
   uint4 res = arg_0.Load(int3((1).xx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.glsl
index 7ec67ea..9d30a03 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6154d4() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6154d4() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6154d4() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.msl
index 26372cd..4e28008 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6154d4(texture2d<uint, access::sample> tint_symbol_1) {
+void textureLoad_6154d4(texture2d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(int2(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureLoad_6154d4(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_6154d4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6154d4(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6154d4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6154d4(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6154d4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.spvasm
index 9601d63..0fec8ce 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6154d4 "textureLoad_6154d4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %26 = OpConstantNull %v4uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6154d4 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %26
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %23 Lod %int_1
-               OpStore %res %17
+%textureLoad_6154d4 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %29
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %26 Lod %int_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %33 = OpLoad %v4uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_6154d4
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_6154d4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_6154d4
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_6154d4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_6154d4
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_6154d4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.wgsl
index 59fe73e..d636d68 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_6154d4() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6154d4();
diff --git a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl
index a30de18..5dd7eb8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_multisampled_2d, coords: vec2<i32>, sample_index: i32) -> f32
 fn textureLoad_6273b1() {
   var res: f32 = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.dxc.hlsl
index 599f9fb..074a8fe 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6273b1() {
   float res = arg_0.Load(int3((1).xx, 0), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.fxc.hlsl
index 599f9fb..074a8fe 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6273b1() {
   float res = arg_0.Load(int3((1).xx, 0), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.glsl
index 9da482c..29b2ab6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6273b1() {
   float res = texelFetch(arg_0_1, ivec2(1), 1).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6273b1() {
   float res = texelFetch(arg_0_1, ivec2(1), 1).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6273b1() {
   float res = texelFetch(arg_0_1, ivec2(1), 1).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.msl
index fd32c20..5b6db08 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6273b1(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_6273b1(depth2d_ms<float, access::read> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(int2(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_6273b1(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_6273b1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6273b1(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6273b1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6273b1(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6273b1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.spvasm
index 58aacb9..b4b9a9f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6273b1 "textureLoad_6273b1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6273b1 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_6273b1 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4float %18 %22 Sample %int_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageFetch %v4float %21 %25 Sample %int_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %31 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %32 = OpLoad %float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureLoad_6273b1
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_6273b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_6273b1
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_6273b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_6273b1
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_6273b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.wgsl
index ad54e19..935ca336 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_6273b1() {
   var res : f32 = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6273b1();
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl
index b23027c..f3c2a9f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<i32>, coords: i32, level: u32) -> vec4<i32>
 fn textureLoad_62d1de() {
   var res: vec4<i32> = textureLoad(arg_0, 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.dxc.hlsl
index 51ff9e6..483d32f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_62d1de() {
   int4 res = arg_0.Load(int2(1, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.fxc.hlsl
index 51ff9e6..483d32f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_62d1de() {
   int4 res = arg_0.Load(int2(1, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.glsl
index 825667b..9b76f58 100644
--- a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_62d1de() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_62d1de() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_62d1de() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.msl
index 1f95d13..c3697ca 100644
--- a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_62d1de(texture1d<int, access::sample> tint_symbol_1) {
+void textureLoad_62d1de(texture1d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint(1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureLoad_62d1de(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_62d1de(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_62d1de(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_62d1de(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_62d1de(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_62d1de(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.spvasm
index 0e3b453..2f17cc0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_62d1de "textureLoad_62d1de"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %25 = OpConstantNull %v4int
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_62d1de = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %int_1 Lod %uint_1
-               OpStore %res %17
+%textureLoad_62d1de = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %int_1 Lod %uint_1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %32 = OpLoad %v4int %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_62d1de
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_62d1de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_62d1de
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_62d1de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_62d1de
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_62d1de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.wgsl
index d456895..d06b148 100644
--- a/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/62d1de.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_62d1de() {
   var res : vec4<i32> = textureLoad(arg_0, 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_62d1de();
diff --git a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl
index 464ee33..71531fb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<i32>, coords: vec2<u32>, sample_index: u32) -> vec4<i32>
 fn textureLoad_639962() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.dxc.hlsl
index 135287e..1eedc46 100644
--- a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_639962() {
   int4 res = arg_0.Load((1u).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.fxc.hlsl
index 135287e..1eedc46 100644
--- a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_639962() {
   int4 res = arg_0.Load((1u).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.glsl
index b7f55c8..8f6b661 100644
--- a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_639962() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_639962() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_639962() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.msl
index ac9b81f..de7ae66 100644
--- a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_639962(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureLoad_639962(texture2d_ms<int, access::read> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureLoad_639962(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_639962(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_639962(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_639962(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_639962(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_639962(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.spvasm
index 9dab4a0..18b4d2e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_639962 "textureLoad_639962"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %26 = OpConstantNull %v4int
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_639962 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %26
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %23 Sample %uint_1
-               OpStore %res %17
+%textureLoad_639962 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %29
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %26 Sample %uint_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %33 = OpLoad %v4int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_639962
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_639962
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_639962
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_639962
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_639962
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_639962
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.wgsl
index 1b47969..b3e49bf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/639962.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_639962() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_639962();
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl
index 34e2fd1..9459202 100644
--- a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<i32>, array_index: i32, level: u32) -> vec4<u32>
 fn textureLoad_656d76() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.dxc.hlsl
index 3d3a154..a93143a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_656d76() {
   uint4 res = arg_0.Load(int4(int3((1).xx, 1), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.fxc.hlsl
index 3d3a154..a93143a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_656d76() {
   uint4 res = arg_0.Load(int4(int3((1).xx, 1), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.glsl
index 28f6396..8bf0b27 100644
--- a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_656d76() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_656d76() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_656d76() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.msl
index bc1b598..16873bf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_656d76(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_656d76(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(int2(1)), 1, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_656d76(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_656d76(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_656d76(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_656d76(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_656d76(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_656d76(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.spvasm
index 29e4722..e9db878 100644
--- a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_656d76 "textureLoad_656d76"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,49 +42,57 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %24 = OpConstantComposite %v2int %int_1 %int_1
+         %27 = OpConstantComposite %v2int %int_1 %int_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %31 = OpConstantNull %v4uint
-         %32 = OpTypeFunction %v4float
+         %34 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_656d76 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %31
-         %19 = OpLoad %11 %arg_0
-         %25 = OpCompositeExtract %int %24 0
-         %26 = OpCompositeExtract %int %24 1
-         %27 = OpCompositeConstruct %v3int %25 %26 %int_1
-         %17 = OpImageFetch %v4uint %19 %27 Lod %uint_1
-               OpStore %res %17
+%textureLoad_656d76 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %34
+         %22 = OpLoad %11 %arg_0
+         %28 = OpCompositeExtract %int %27 0
+         %29 = OpCompositeExtract %int %27 1
+         %30 = OpCompositeConstruct %v3int %28 %29 %int_1
+         %21 = OpImageFetch %v4uint %22 %30 Lod %uint_1
+               OpStore %res %21
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %38 = OpLoad %v4uint %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_656d76
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_656d76
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_656d76
+%fragment_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_656d76
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_656d76
+%compute_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_656d76
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.wgsl
index 8f0880b..0b03c8c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/656d76.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_656d76() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_656d76();
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl
index 88c8732..d2edd6c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d_array, coords: vec2<i32>, array_index: u32, level: u32) -> f32
 fn textureLoad_66be47() {
   var res: f32 = textureLoad(arg_0, vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.dxc.hlsl
index d8dfa1d..dd6fb83 100644
--- a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_66be47() {
   float res = arg_0.Load(int4(int3((1).xx, int(1u)), int(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.fxc.hlsl
index d8dfa1d..dd6fb83 100644
--- a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_66be47() {
   float res = arg_0.Load(int4(int3((1).xx, int(1u)), int(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.glsl
index 5ae469f..3889522 100644
--- a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_66be47() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_66be47() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_66be47() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.msl
index f939f98..5a51b41 100644
--- a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_66be47(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_66be47(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(int2(1)), 1u, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_66be47(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_66be47(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_66be47(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_66be47(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_66be47(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_66be47(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.spvasm
index 75d29e2b..097c5f4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_66be47 "textureLoad_66be47"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,50 +41,58 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_66be47 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_66be47 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %int %23 0
-         %25 = OpCompositeExtract %int %23 1
-         %26 = OpBitcast %int %uint_1
-         %29 = OpCompositeConstruct %v3int %24 %25 %26
-         %17 = OpImageFetch %v4float %18 %29 Lod %uint_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %int %26 0
+         %28 = OpCompositeExtract %int %26 1
+         %29 = OpBitcast %int %uint_1
+         %32 = OpCompositeConstruct %v3int %27 %28 %29
+         %20 = OpImageFetch %v4float %21 %32 Lod %uint_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %37 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %38 = OpLoad %float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_66be47
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_66be47
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_66be47
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_66be47
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_66be47
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_66be47
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.wgsl
index 74559b9..d9ff8f2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/66be47.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_66be47() {
   var res : f32 = textureLoad(arg_0, vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_66be47();
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl
index 9ddd349..b2512ac 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_multisampled_2d, coords: vec2<i32>, sample_index: u32) -> f32
 fn textureLoad_6925bc() {
   var res: f32 = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.dxc.hlsl
index f0c82ff..26cfb12 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6925bc() {
   float res = arg_0.Load(int3((1).xx, 0), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.fxc.hlsl
index f0c82ff..26cfb12 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6925bc() {
   float res = arg_0.Load(int3((1).xx, 0), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.glsl
index 0dec904..41563c5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6925bc() {
   float res = texelFetch(arg_0_1, ivec2(1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6925bc() {
   float res = texelFetch(arg_0_1, ivec2(1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6925bc() {
   float res = texelFetch(arg_0_1, ivec2(1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.msl
index 2ffbebe..5bd0644 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6925bc(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_6925bc(depth2d_ms<float, access::read> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(int2(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_6925bc(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_6925bc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6925bc(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6925bc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6925bc(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6925bc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.spvasm
index 7a5ea4e..301ffea 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6925bc "textureLoad_6925bc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,53 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %27 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6925bc = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_6925bc = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4float %18 %22 Sample %uint_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageFetch %v4float %21 %25 Sample %uint_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_6925bc
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_6925bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_6925bc
+%fragment_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_6925bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_6925bc
+%compute_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_6925bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.wgsl
index e75432f..0c6027c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6925bc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_6925bc() {
   var res : f32 = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6925bc();
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl
index 26bd09c..f7673c8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<u32>, coords: i32, level: u32) -> vec4<u32>
 fn textureLoad_6b77d4() {
   var res: vec4<u32> = textureLoad(arg_0, 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.dxc.hlsl
index 6ca9686..22d686d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6b77d4() {
   uint4 res = arg_0.Load(int2(1, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.fxc.hlsl
index 6ca9686..22d686d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6b77d4() {
   uint4 res = arg_0.Load(int2(1, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.glsl
index 14aca1e..46e425a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6b77d4() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6b77d4() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6b77d4() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1, 0), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.msl
index 7669ab8..82e4578 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6b77d4(texture1d<uint, access::sample> tint_symbol_1) {
+void textureLoad_6b77d4(texture1d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint(1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureLoad_6b77d4(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_6b77d4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6b77d4(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6b77d4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6b77d4(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6b77d4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.spvasm
index 1f1b990..f8d35f3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6b77d4 "textureLoad_6b77d4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %25 = OpConstantNull %v4uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6b77d4 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %int_1 Lod %uint_1
-               OpStore %res %17
+%textureLoad_6b77d4 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %int_1 Lod %uint_1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %32 = OpLoad %v4uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_6b77d4
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_6b77d4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_6b77d4
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_6b77d4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_6b77d4
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_6b77d4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.wgsl
index 11e4711..d4a9812 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6b77d4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_6b77d4() {
   var res : vec4<u32> = textureLoad(arg_0, 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6b77d4();
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl
index 43e349c..d888abe 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<u32>, coords: vec3<i32>, level: u32) -> vec4<u32>
 fn textureLoad_6bf4b7() {
   var res: vec4<u32> = textureLoad(arg_0, vec3<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl
index 8a41510..ebb5167 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6bf4b7() {
   uint4 res = arg_0.Load(int4((1).xxx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl
index 8a41510..ebb5167 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6bf4b7() {
   uint4 res = arg_0.Load(int4((1).xxx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.glsl
index 5ae612b..133b9d3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6bf4b7() {
   uvec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6bf4b7() {
   uvec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6bf4b7() {
   uvec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.msl
index ddac3e7..fc40c3b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6bf4b7(texture3d<uint, access::sample> tint_symbol_1) {
+void textureLoad_6bf4b7(texture3d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint3(int3(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureLoad_6bf4b7(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_6bf4b7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6bf4b7(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6bf4b7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6bf4b7(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6bf4b7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.spvasm
index 4f756fc..68d2906 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6bf4b7 "textureLoad_6bf4b7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %26 = OpConstantComposite %v3int %int_1 %int_1 %int_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %27 = OpConstantNull %v4uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6bf4b7 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %23 Lod %uint_1
-               OpStore %res %17
+%textureLoad_6bf4b7 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %26 Lod %uint_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %34 = OpLoad %v4uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_6bf4b7
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_6bf4b7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_6bf4b7
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_6bf4b7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_6bf4b7
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_6bf4b7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.wgsl
index 07d7ba6..ac975ea 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf4b7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_6bf4b7() {
   var res : vec4<u32> = textureLoad(arg_0, vec3<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6bf4b7();
diff --git a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl
index 849bb5a..e0eee52 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<f32>, coords: u32, level: u32) -> vec4<f32>
 fn textureLoad_6d376a() {
   var res: vec4<f32> = textureLoad(arg_0, 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.dxc.hlsl
index 51583e3..c2ac6bc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6d376a() {
   float4 res = arg_0.Load(uint2(1u, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.fxc.hlsl
index 51583e3..c2ac6bc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6d376a() {
   float4 res = arg_0.Load(uint2(1u, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.glsl
index 04f82ef..b0d1d9c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_6d376a() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_6d376a() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_6d376a() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.msl
index c5370ac..8b97611 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6d376a(texture1d<float, access::sample> tint_symbol_1) {
+void textureLoad_6d376a(texture1d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint(1u), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureLoad_6d376a(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_6d376a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6d376a(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6d376a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6d376a(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6d376a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.spvasm
index c627641..77a4a84 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6d376a "textureLoad_6d376a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %22 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6d376a = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_6d376a = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %uint_1 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %uint_1 Lod %uint_1
+               OpStore %res %19
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureLoad_6d376a
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureLoad_6d376a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %15
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureLoad_6d376a
+%fragment_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureLoad_6d376a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_6d376a
+%compute_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_6d376a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.wgsl
index 498f136..35a3287 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6d376a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_6d376a() {
   var res : vec4<f32> = textureLoad(arg_0, 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6d376a();
diff --git a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl
index 2e6d30a..407f21d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<i32>, coords: vec2<u32>, level: u32) -> vec4<i32>
 fn textureLoad_714471() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.dxc.hlsl
index 7982262..3411048 100644
--- a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_714471() {
   int4 res = arg_0.Load(uint3((1u).xx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.fxc.hlsl
index 7982262..3411048 100644
--- a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_714471() {
   int4 res = arg_0.Load(uint3((1u).xx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.glsl
index 3131d47..2038ec9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_714471() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_714471() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_714471() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.msl
index cf68b69..da0b676 100644
--- a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_714471(texture2d<int, access::sample> tint_symbol_1) {
+void textureLoad_714471(texture2d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureLoad_714471(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_714471(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_714471(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_714471(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_714471(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_714471(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.spvasm
index 12ce134..4da0cf0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_714471 "textureLoad_714471"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %26 = OpConstantNull %v4int
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_714471 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %26
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %23 Lod %uint_1
-               OpStore %res %17
+%textureLoad_714471 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %29
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %26 Lod %uint_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %33 = OpLoad %v4int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_714471
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_714471
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_714471
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_714471
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_714471
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_714471
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.wgsl
index 638bd91..99acd75 100644
--- a/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/714471.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_714471() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_714471();
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl
index a3698ed..d99294b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<i32>, array_index: i32, level: u32) -> vec4<f32>
 fn textureLoad_789045() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.dxc.hlsl
index 4ff5d93..d83b259 100644
--- a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_789045() {
   float4 res = arg_0.Load(int4(int3((1).xx, 1), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.fxc.hlsl
index 4ff5d93..d83b259 100644
--- a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_789045() {
   float4 res = arg_0.Load(int4(int3((1).xx, 1), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.glsl
index 4e4fbf8..cf52a8f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_789045() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_789045() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_789045() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.msl
index be0339f..0a4c180 100644
--- a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_789045(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_789045(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(int2(1)), 1, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_789045(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_789045(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_789045(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_789045(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_789045(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_789045(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.spvasm
index 013a260..44e354d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_789045 "textureLoad_789045"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,48 +41,56 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_789045 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_789045 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %23 = OpCompositeExtract %int %22 0
-         %24 = OpCompositeExtract %int %22 1
-         %25 = OpCompositeConstruct %v3int %23 %24 %int_1
-         %16 = OpImageFetch %v4float %17 %25 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %26 = OpCompositeExtract %int %25 0
+         %27 = OpCompositeExtract %int %25 1
+         %28 = OpCompositeConstruct %v3int %26 %27 %int_1
+         %19 = OpImageFetch %v4float %20 %28 Lod %uint_1
+               OpStore %res %19
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureLoad_789045
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureLoad_789045
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_789045
+%fragment_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_789045
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_789045
+%compute_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_789045
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.wgsl
index d104278..a08f4d8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/789045.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_789045() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_789045();
diff --git a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl
index c966379..70d6b76 100644
--- a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<i32>, array_index: i32, level: i32) -> vec4<i32>
 fn textureLoad_79e697() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.dxc.hlsl
index 0c1d428..66c867d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_79e697() {
   int4 res = arg_0.Load(int4(int3((1).xx, 1), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.fxc.hlsl
index 0c1d428..66c867d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_79e697() {
   int4 res = arg_0.Load(int4(int3((1).xx, 1), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.glsl
index 82d11ca..3691302 100644
--- a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_79e697() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_79e697() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_79e697() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.msl
index cb7faf1..5a49771 100644
--- a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_79e697(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_79e697(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(int2(1)), 1, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_79e697(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_79e697(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_79e697(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_79e697(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_79e697(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_79e697(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.spvasm
index 3e48766..af7c161 100644
--- a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_79e697 "textureLoad_79e697"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,47 +42,56 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %29 = OpConstantNull %v4int
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_79e697 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %29
-         %19 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %int %23 0
-         %25 = OpCompositeExtract %int %23 1
-         %26 = OpCompositeConstruct %v3int %24 %25 %int_1
-         %17 = OpImageFetch %v4int %19 %26 Lod %int_1
-               OpStore %res %17
+%textureLoad_79e697 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %32
+         %22 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %int %26 0
+         %28 = OpCompositeExtract %int %26 1
+         %29 = OpCompositeConstruct %v3int %27 %28 %int_1
+         %21 = OpImageFetch %v4int %22 %29 Lod %int_1
+               OpStore %res %21
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %37 = OpLoad %v4int %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureLoad_79e697
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_79e697
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_79e697
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_79e697
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_79e697
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_79e697
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.wgsl
index fd39584..9c7b749 100644
--- a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_79e697() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_79e697();
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl
index 266c389..2d85b83 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<i32>, array_index: u32, level: i32) -> vec4<u32>
 fn textureLoad_7ab4df() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.dxc.hlsl
index 30e23b4..0a0990f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7ab4df() {
   uint4 res = arg_0.Load(int4(int3((1).xx, int(1u)), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.fxc.hlsl
index 30e23b4..0a0990f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7ab4df() {
   uint4 res = arg_0.Load(int4(int3((1).xx, int(1u)), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.glsl
index 66522c5..4123f4f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7ab4df() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7ab4df() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7ab4df() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.msl
index f9e6924..197c178 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7ab4df(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_7ab4df(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(int2(1)), 1u, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_7ab4df(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_7ab4df(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7ab4df(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7ab4df(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7ab4df(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7ab4df(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.spvasm
index 5239cbe..d481ec7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7ab4df "textureLoad_7ab4df"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,58 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %24 = OpConstantComposite %v2int %int_1 %int_1
+         %27 = OpConstantComposite %v2int %int_1 %int_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %32 = OpConstantNull %v4uint
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7ab4df = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %32
-         %19 = OpLoad %11 %arg_0
-         %25 = OpCompositeExtract %int %24 0
-         %26 = OpCompositeExtract %int %24 1
-         %27 = OpBitcast %int %uint_1
-         %29 = OpCompositeConstruct %v3int %25 %26 %27
-         %17 = OpImageFetch %v4uint %19 %29 Lod %int_1
-               OpStore %res %17
+%textureLoad_7ab4df = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %35
+         %22 = OpLoad %11 %arg_0
+         %28 = OpCompositeExtract %int %27 0
+         %29 = OpCompositeExtract %int %27 1
+         %30 = OpBitcast %int %uint_1
+         %32 = OpCompositeConstruct %v3int %28 %29 %30
+         %21 = OpImageFetch %v4uint %22 %32 Lod %int_1
+               OpStore %res %21
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %39 = OpLoad %v4uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_7ab4df
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_7ab4df
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_7ab4df
+%fragment_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_7ab4df
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_7ab4df
+%compute_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_7ab4df
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.wgsl
index 5377bd3..5c6dd4e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7ab4df.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_7ab4df() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7ab4df();
diff --git a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl
index beea60d..af6b169 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d_array, coords: vec2<u32>, array_index: u32, level: u32) -> f32
 fn textureLoad_7b63e0() {
   var res: f32 = textureLoad(arg_0, vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.dxc.hlsl
index 8244761..f8e4e39 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7b63e0() {
   float res = arg_0.Load(uint4(uint3((1u).xx, 1u), 1u)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.fxc.hlsl
index 8244761..f8e4e39 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7b63e0() {
   float res = arg_0.Load(uint4(uint3((1u).xx, 1u), 1u)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.glsl
index ff50479..956dbc3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7b63e0() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7b63e0() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7b63e0() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.msl
index 9abd6c7..a43651e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7b63e0(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_7b63e0(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(uint2(1u)), 1u, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_7b63e0(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_7b63e0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7b63e0(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7b63e0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7b63e0(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7b63e0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.spvasm
index 6656cd0..e7eb14d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7b63e0 "textureLoad_7b63e0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,47 +41,55 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %29 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7b63e0 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_7b63e0 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %uint %23 0
-         %25 = OpCompositeExtract %uint %23 1
-         %26 = OpCompositeConstruct %v3uint %24 %25 %uint_1
-         %17 = OpImageFetch %v4float %18 %26 Lod %uint_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %uint %26 0
+         %28 = OpCompositeExtract %uint %26 1
+         %29 = OpCompositeConstruct %v3uint %27 %28 %uint_1
+         %20 = OpImageFetch %v4float %21 %29 Lod %uint_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %34 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %35 = OpLoad %float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureLoad_7b63e0
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureLoad_7b63e0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_7b63e0
+%fragment_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_7b63e0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_7b63e0
+%compute_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_7b63e0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.wgsl
index 239a544..ec4719f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7b63e0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_7b63e0() {
   var res : f32 = textureLoad(arg_0, vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7b63e0();
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl
index 748948b..3786f42 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<i32>, coords: vec2<u32>, sample_index: i32) -> vec4<i32>
 fn textureLoad_7bee94() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.dxc.hlsl
index 693590e1a..ce67822 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7bee94() {
   int4 res = arg_0.Load((1u).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.fxc.hlsl
index 693590e1a..ce67822 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7bee94() {
   int4 res = arg_0.Load((1u).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.glsl
index bfebea4..ebab6eb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_7bee94() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_7bee94() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_7bee94() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.msl
index dfa9ee3..8f50cf6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7bee94(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureLoad_7bee94(texture2d_ms<int, access::read> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureLoad_7bee94(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_7bee94(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7bee94(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7bee94(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7bee94(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7bee94(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.spvasm
index e0dee27..5a92c49 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7bee94 "textureLoad_7bee94"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %27 = OpConstantNull %v4int
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7bee94 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %23 Sample %int_1
-               OpStore %res %17
+%textureLoad_7bee94 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %26 Sample %int_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %34 = OpLoad %v4int %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_7bee94
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_7bee94
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_7bee94
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_7bee94
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_7bee94
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_7bee94
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.wgsl
index 8c33199..8ffeffd 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7bee94.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_7bee94() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7bee94();
diff --git a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl
index 8964b48..29700d7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<i32>, array_index: i32, level: i32) -> vec4<u32>
 fn textureLoad_7c90e5() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.dxc.hlsl
index 2f4abe7..38f57e9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7c90e5() {
   uint4 res = arg_0.Load(int4(int3((1).xx, 1), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.fxc.hlsl
index 2f4abe7..38f57e9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7c90e5() {
   uint4 res = arg_0.Load(int4(int3((1).xx, 1), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.glsl
index 1df83b0..fd86207 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7c90e5() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7c90e5() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7c90e5() {
   uvec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.msl
index 234f4e9..8e0fdf2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7c90e5(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_7c90e5(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(int2(1)), 1, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_7c90e5(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_7c90e5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7c90e5(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7c90e5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7c90e5(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7c90e5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.spvasm
index 03d6263..d7c605e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7c90e5 "textureLoad_7c90e5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,56 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %24 = OpConstantComposite %v2int %int_1 %int_1
+         %27 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %30 = OpConstantNull %v4uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7c90e5 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %30
-         %19 = OpLoad %11 %arg_0
-         %25 = OpCompositeExtract %int %24 0
-         %26 = OpCompositeExtract %int %24 1
-         %27 = OpCompositeConstruct %v3int %25 %26 %int_1
-         %17 = OpImageFetch %v4uint %19 %27 Lod %int_1
-               OpStore %res %17
+%textureLoad_7c90e5 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %33
+         %22 = OpLoad %11 %arg_0
+         %28 = OpCompositeExtract %int %27 0
+         %29 = OpCompositeExtract %int %27 1
+         %30 = OpCompositeConstruct %v3int %28 %29 %int_1
+         %21 = OpImageFetch %v4uint %22 %30 Lod %int_1
+               OpStore %res %21
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %37 = OpLoad %v4uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_7c90e5
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_7c90e5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_7c90e5
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_7c90e5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_7c90e5
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_7c90e5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.wgsl
index 4a75a29..8c9fecc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_7c90e5() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7c90e5();
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl
index 70a9779..029a41e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d, coords: vec2<u32>, level: i32) -> f32
 fn textureLoad_7fd822() {
   var res: f32 = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.dxc.hlsl
index 873d58f..4d6e957 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7fd822() {
   float res = arg_0.Load(uint3((1u).xx, uint(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.fxc.hlsl
index 873d58f..4d6e957 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7fd822() {
   float res = arg_0.Load(uint3((1u).xx, uint(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.glsl
index fd8f548..94a6d80 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7fd822() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7fd822() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7fd822() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.msl
index 6d825c1..a0493f5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7fd822(depth2d<float, access::sample> tint_symbol_1) {
+void textureLoad_7fd822(depth2d<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureLoad_7fd822(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_7fd822(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7fd822(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7fd822(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7fd822(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7fd822(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.spvasm
index 8eb5347..a8125ed 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7fd822 "textureLoad_7fd822"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,53 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %27 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7fd822 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_7fd822 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4float %18 %22 Lod %int_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageFetch %v4float %21 %25 Lod %int_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_7fd822
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_7fd822
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_7fd822
+%fragment_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_7fd822
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_7fd822
+%compute_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_7fd822
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.wgsl
index 8085a1c..215c1bb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7fd822.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_7fd822() {
   var res : f32 = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7fd822();
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl
index 4263395..52ccfad 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<f32>, coords: i32, level: i32) -> vec4<f32>
 fn textureLoad_81c381() {
   var res: vec4<f32> = textureLoad(arg_0, 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.dxc.hlsl
index ae2cf94..6d9d979 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_81c381() {
   float4 res = arg_0.Load(int2(1, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.fxc.hlsl
index ae2cf94..6d9d979 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_81c381() {
   float4 res = arg_0.Load(int2(1, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.glsl
index 3fc37a2..9fa911d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_81c381() {
   vec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_81c381() {
   vec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_81c381() {
   vec4 res = texelFetch(arg_0_1, ivec2(1, 0), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.msl
index 29a6d1b..a33376e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_81c381(texture1d<float, access::sample> tint_symbol_1) {
+void textureLoad_81c381(texture1d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint(1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureLoad_81c381(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_81c381(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_81c381(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_81c381(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_81c381(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_81c381(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.spvasm
index 0b24295..f9740ef 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_81c381 "textureLoad_81c381"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,49 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_81c381 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_81c381 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %int_1 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %int_1 Lod %int_1
+               OpStore %res %19
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %29 = OpLoad %v4float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureLoad_81c381
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureLoad_81c381
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %15
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureLoad_81c381
+%fragment_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureLoad_81c381
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_81c381
+%compute_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_81c381
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.wgsl
index 4931968..e19107a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_81c381() {
   var res : vec4<f32> = textureLoad(arg_0, 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_81c381();
diff --git a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl
index d2acc42..baf8b85 100644
--- a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<f32>, coords: vec2<u32>, level: u32) -> vec4<f32>
 fn textureLoad_84dee1() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.dxc.hlsl
index ff8c041..28fe73c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_84dee1() {
   float4 res = arg_0.Load(uint3((1u).xx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.fxc.hlsl
index ff8c041..28fe73c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_84dee1() {
   float4 res = arg_0.Load(uint3((1u).xx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.glsl
index 7591aea..34292d5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_84dee1() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_84dee1() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_84dee1() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.msl
index f078b11..aef80d9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_84dee1(texture2d<float, access::sample> tint_symbol_1) {
+void textureLoad_84dee1(texture2d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureLoad_84dee1(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_84dee1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_84dee1(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_84dee1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_84dee1(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_84dee1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.spvasm
index 0ec3c1c..5ca2005 100644
--- a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_84dee1 "textureLoad_84dee1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,50 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %21 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %24 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_84dee1 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_84dee1 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Lod %uint_1
+               OpStore %res %19
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_84dee1
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureLoad_84dee1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %15
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_84dee1
+%fragment_main = OpFunction %void None %15
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_84dee1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_84dee1
+%compute_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_84dee1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.wgsl
index 208a704..42042db 100644
--- a/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/84dee1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_84dee1() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_84dee1();
diff --git a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl
index 538bce5..c4c8253 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<u32>, array_index: u32, level: u32) -> vec4<u32>
 fn textureLoad_8527b1() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.dxc.hlsl
index efe6675..90eac0e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_8527b1() {
   uint4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.fxc.hlsl
index efe6675..90eac0e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_8527b1() {
   uint4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.glsl
index b2dd9c5..fc46b49 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_8527b1() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_8527b1() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_8527b1() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.msl
index 90a940f..b869ffa 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_8527b1(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_8527b1(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_8527b1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_8527b1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_8527b1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_8527b1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_8527b1(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_8527b1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.spvasm
index a761158..d128f57 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_8527b1 "textureLoad_8527b1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,47 +42,55 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %29 = OpConstantNull %v4uint
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_8527b1 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %29
-         %19 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %uint %23 0
-         %25 = OpCompositeExtract %uint %23 1
-         %26 = OpCompositeConstruct %v3uint %24 %25 %uint_1
-         %17 = OpImageFetch %v4uint %19 %26 Lod %uint_1
-               OpStore %res %17
+%textureLoad_8527b1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %32
+         %22 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %uint %26 0
+         %28 = OpCompositeExtract %uint %26 1
+         %29 = OpCompositeConstruct %v3uint %27 %28 %uint_1
+         %21 = OpImageFetch %v4uint %22 %29 Lod %uint_1
+               OpStore %res %21
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %36 = OpLoad %v4uint %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureLoad_8527b1
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureLoad_8527b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_8527b1
+%fragment_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_8527b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_8527b1
+%compute_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_8527b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.wgsl
index b54aad1..0932663 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8527b1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_8527b1() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_8527b1();
diff --git a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl
index 8d2249e..9d3b5bc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<i32>, array_index: i32, level: i32) -> vec4<f32>
 fn textureLoad_87be85() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.dxc.hlsl
index 46729c6..af27d37 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_87be85() {
   float4 res = arg_0.Load(int4(int3((1).xx, 1), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.fxc.hlsl
index 46729c6..af27d37 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_87be85() {
   float4 res = arg_0.Load(int4(int3((1).xx, 1), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.glsl
index 29b9790..5da6f7e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_87be85() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_87be85() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_87be85() {
   vec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.msl
index 91e436d..8a09158 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_87be85(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_87be85(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(int2(1)), 1, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_87be85(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_87be85(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_87be85(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_87be85(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_87be85(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_87be85(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.spvasm
index cf811e4..6d01fc1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_87be85 "textureLoad_87be85"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,46 +41,55 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %28 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_87be85 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_87be85 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %23 = OpCompositeExtract %int %22 0
-         %24 = OpCompositeExtract %int %22 1
-         %25 = OpCompositeConstruct %v3int %23 %24 %int_1
-         %16 = OpImageFetch %v4float %17 %25 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %26 = OpCompositeExtract %int %25 0
+         %27 = OpCompositeExtract %int %25 1
+         %28 = OpCompositeConstruct %v3int %26 %27 %int_1
+         %19 = OpImageFetch %v4float %20 %28 Lod %int_1
+               OpStore %res %19
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_87be85
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureLoad_87be85
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_87be85
+%fragment_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_87be85
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_87be85
+%compute_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_87be85
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.wgsl
index d99ca4e..b103a8e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_87be85() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_87be85();
diff --git a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl
index 4e672d3..387f6bd 100644
--- a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<u32>, coords: vec2<u32>, level: u32) -> vec4<u32>
 fn textureLoad_897cf3() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.dxc.hlsl
index af0a0d2..5d62f99 100644
--- a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_897cf3() {
   uint4 res = arg_0.Load(uint3((1u).xx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.fxc.hlsl
index af0a0d2..5d62f99 100644
--- a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_897cf3() {
   uint4 res = arg_0.Load(uint3((1u).xx, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.glsl
index cf52a14..da4fe59 100644
--- a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_897cf3() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_897cf3() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_897cf3() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.msl
index d0a6e41..a0a5b0b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_897cf3(texture2d<uint, access::sample> tint_symbol_1) {
+void textureLoad_897cf3(texture2d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureLoad_897cf3(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_897cf3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_897cf3(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_897cf3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_897cf3(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_897cf3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.spvasm
index 1203f24..7a89b81 100644
--- a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_897cf3 "textureLoad_897cf3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %25 = OpConstantNull %v4uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_897cf3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %22 Lod %uint_1
-               OpStore %res %17
+%textureLoad_897cf3 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %25 Lod %uint_1
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %32 = OpLoad %v4uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_897cf3
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_897cf3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_897cf3
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_897cf3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_897cf3
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_897cf3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.wgsl
index abaebd3..197e960 100644
--- a/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/897cf3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_897cf3() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_897cf3();
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl
index 7b35415..c47c4df 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_external, coords: vec2<i32>) -> vec4<f32>
 fn textureLoad_8acf41() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl
index 7356d4e..682ef71 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl
@@ -91,8 +91,11 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureLoad_8acf41() {
   float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1).xx, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl
index 7356d4e..682ef71 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl
@@ -91,8 +91,11 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureLoad_8acf41() {
   float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1).xx, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
index 5629e71..ef39bd8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
@@ -74,8 +74,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_8acf41() {
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -168,8 +173,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_8acf41() {
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -256,8 +266,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_8acf41() {
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, ivec2(1), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
index 8ef22b0..d685600 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
@@ -95,33 +95,34 @@
   return float4(color, 1.0f);
 }
 
-void textureLoad_8acf41(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_3) {
+void textureLoad_8acf41(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_3, device float4* const tint_symbol_4) {
   float4 res = textureLoadExternal(tint_symbol_1, tint_symbol_2, int2(1), tint_unpack_vec3_in_composite_1(*(tint_symbol_3)));
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, texture2d<float, access::sample> tint_symbol_5, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_6) {
-  textureLoad_8acf41(tint_symbol_4, tint_symbol_5, tint_symbol_6);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_7, device float4* const tint_symbol_8) {
+  textureLoad_8acf41(tint_symbol_5, tint_symbol_6, tint_symbol_7, tint_symbol_8);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], texture2d<float, access::sample> tint_symbol_8 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_9 [[buffer(2)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], texture2d<float, access::sample> tint_symbol_10 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_11 [[buffer(2)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], texture2d<float, access::sample> tint_symbol_11 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_12 [[buffer(2)]]) {
-  textureLoad_8acf41(tint_symbol_10, tint_symbol_11, tint_symbol_12);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_15 [[buffer(2)]], device float4* tint_symbol_16 [[buffer(0)]]) {
+  textureLoad_8acf41(tint_symbol_13, tint_symbol_14, tint_symbol_15, tint_symbol_16);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_15 [[buffer(2)]]) {
-  textureLoad_8acf41(tint_symbol_13, tint_symbol_14, tint_symbol_15);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_17 [[texture(0)]], texture2d<float, access::sample> tint_symbol_18 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_19 [[buffer(2)]], device float4* tint_symbol_20 [[buffer(0)]]) {
+  textureLoad_8acf41(tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
index 2142ab2..ed333d8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 160
+; Bound: 166
 ; Schema: 0
                OpCapability Shader
-         %29 = OpExtInstImport "GLSL.std.450"
+         %32 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,6 +37,9 @@
                OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
                OpName %ext_tex_params "ext_tex_params"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %gammaCorrection "gammaCorrection"
                OpName %v "v"
                OpName %params "params"
@@ -94,6 +97,10 @@
                OpDecorate %ext_tex_params Binding 2
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
                OpMemberDecorate %ExternalTextureParams 0 Offset 0
                OpMemberDecorate %ExternalTextureParams 1 Offset 4
                OpMemberDecorate %ExternalTextureParams 2 Offset 16
@@ -129,170 +136,177 @@
 %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
 %ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-         %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %26 = OpTypeFunction %v3float %v3float %GammaTransferParams
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %43 = OpConstantNull %v3float
+         %46 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
 %mat3v2float = OpTypeMatrix %v2float 3
 %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat3v2float
-         %63 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams
+         %66 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %76 = OpConstantComposite %v2uint %uint_1 %uint_1
-         %85 = OpConstantNull %int
+         %79 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %88 = OpConstantNull %int
     %float_1 = OpConstant %float 1
-         %98 = OpConstantNull %uint
-        %116 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
+        %101 = OpConstantNull %uint
+        %119 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
        %void = OpTypeVoid
-        %131 = OpTypeFunction %void
+        %134 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-        %139 = OpConstantComposite %v2int %int_1 %int_1
+        %142 = OpConstantComposite %v2int %int_1 %int_1
      %uint_0 = OpConstant %uint 0
 %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-        %147 = OpTypeFunction %v4float
-%gammaCorrection = OpFunction %v3float None %23
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+        %153 = OpTypeFunction %v4float
+%gammaCorrection = OpFunction %v3float None %26
           %v = OpFunctionParameter %v3float
      %params = OpFunctionParameter %GammaTransferParams
-         %27 = OpLabel
-         %41 = OpVariable %_ptr_Function_v3float Function %43
-         %53 = OpVariable %_ptr_Function_v3float Function %43
-         %59 = OpVariable %_ptr_Function_v3float Function %43
-         %28 = OpExtInst %v3float %29 FAbs %v
-         %30 = OpCompositeExtract %float %params 4
-         %31 = OpCompositeConstruct %v3float %30 %30 %30
-         %32 = OpFOrdLessThan %v3bool %28 %31
-         %35 = OpExtInst %v3float %29 FSign %v
-         %36 = OpCompositeExtract %float %params 3
-         %37 = OpExtInst %v3float %29 FAbs %v
-         %38 = OpVectorTimesScalar %v3float %37 %36
-         %39 = OpCompositeExtract %float %params 6
-         %44 = OpCompositeConstruct %v3float %39 %39 %39
-         %40 = OpFAdd %v3float %38 %44
-         %45 = OpFMul %v3float %35 %40
-         %46 = OpExtInst %v3float %29 FSign %v
-         %48 = OpCompositeExtract %float %params 1
-         %49 = OpExtInst %v3float %29 FAbs %v
-         %50 = OpVectorTimesScalar %v3float %49 %48
-         %51 = OpCompositeExtract %float %params 2
-         %54 = OpCompositeConstruct %v3float %51 %51 %51
-         %52 = OpFAdd %v3float %50 %54
-         %55 = OpCompositeExtract %float %params 0
-         %56 = OpCompositeConstruct %v3float %55 %55 %55
-         %47 = OpExtInst %v3float %29 Pow %52 %56
-         %57 = OpCompositeExtract %float %params 5
-         %60 = OpCompositeConstruct %v3float %57 %57 %57
-         %58 = OpFAdd %v3float %47 %60
-         %61 = OpFMul %v3float %46 %58
-         %62 = OpSelect %v3float %32 %45 %61
-               OpReturnValue %62
+         %30 = OpLabel
+         %44 = OpVariable %_ptr_Function_v3float Function %46
+         %56 = OpVariable %_ptr_Function_v3float Function %46
+         %62 = OpVariable %_ptr_Function_v3float Function %46
+         %31 = OpExtInst %v3float %32 FAbs %v
+         %33 = OpCompositeExtract %float %params 4
+         %34 = OpCompositeConstruct %v3float %33 %33 %33
+         %35 = OpFOrdLessThan %v3bool %31 %34
+         %38 = OpExtInst %v3float %32 FSign %v
+         %39 = OpCompositeExtract %float %params 3
+         %40 = OpExtInst %v3float %32 FAbs %v
+         %41 = OpVectorTimesScalar %v3float %40 %39
+         %42 = OpCompositeExtract %float %params 6
+         %47 = OpCompositeConstruct %v3float %42 %42 %42
+         %43 = OpFAdd %v3float %41 %47
+         %48 = OpFMul %v3float %38 %43
+         %49 = OpExtInst %v3float %32 FSign %v
+         %51 = OpCompositeExtract %float %params 1
+         %52 = OpExtInst %v3float %32 FAbs %v
+         %53 = OpVectorTimesScalar %v3float %52 %51
+         %54 = OpCompositeExtract %float %params 2
+         %57 = OpCompositeConstruct %v3float %54 %54 %54
+         %55 = OpFAdd %v3float %53 %57
+         %58 = OpCompositeExtract %float %params 0
+         %59 = OpCompositeConstruct %v3float %58 %58 %58
+         %50 = OpExtInst %v3float %32 Pow %55 %59
+         %60 = OpCompositeExtract %float %params 5
+         %63 = OpCompositeConstruct %v3float %60 %60 %60
+         %61 = OpFAdd %v3float %50 %63
+         %64 = OpFMul %v3float %49 %61
+         %65 = OpSelect %v3float %35 %48 %64
+               OpReturnValue %65
                OpFunctionEnd
-%textureLoadExternal = OpFunction %v4float None %63
+%textureLoadExternal = OpFunction %v4float None %66
      %plane0 = OpFunctionParameter %11
      %plane1 = OpFunctionParameter %11
       %coord = OpFunctionParameter %v2int
    %params_0 = OpFunctionParameter %ExternalTextureParams
-         %73 = OpLabel
-      %color = OpVariable %_ptr_Function_v3float Function %43
-         %77 = OpShiftRightArithmetic %v2int %coord %76
-         %79 = OpCompositeExtract %uint %params_0 0
-         %80 = OpIEqual %bool %79 %uint_1
-               OpSelectionMerge %81 None
-               OpBranchConditional %80 %82 %83
-         %82 = OpLabel
-         %84 = OpImageFetch %v4float %plane0 %coord Lod %85
-         %86 = OpVectorShuffle %v3float %84 %84 0 1 2
-               OpStore %color %86
-               OpBranch %81
-         %83 = OpLabel
-         %87 = OpImageFetch %v4float %plane0 %coord Lod %85
-         %88 = OpCompositeExtract %float %87 0
-         %89 = OpImageFetch %v4float %plane1 %77 Lod %85
-         %90 = OpVectorShuffle %v2float %89 %89 0 1
+         %76 = OpLabel
+      %color = OpVariable %_ptr_Function_v3float Function %46
+         %80 = OpShiftRightArithmetic %v2int %coord %79
+         %82 = OpCompositeExtract %uint %params_0 0
+         %83 = OpIEqual %bool %82 %uint_1
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %86
+         %85 = OpLabel
+         %87 = OpImageFetch %v4float %plane0 %coord Lod %88
+         %89 = OpVectorShuffle %v3float %87 %87 0 1 2
+               OpStore %color %89
+               OpBranch %84
+         %86 = OpLabel
+         %90 = OpImageFetch %v4float %plane0 %coord Lod %88
          %91 = OpCompositeExtract %float %90 0
-         %92 = OpCompositeExtract %float %90 1
-         %94 = OpCompositeConstruct %v4float %88 %91 %92 %float_1
-         %95 = OpCompositeExtract %mat3v4float %params_0 2
-         %96 = OpVectorTimesMatrix %v3float %94 %95
-               OpStore %color %96
-               OpBranch %81
-         %81 = OpLabel
-         %97 = OpCompositeExtract %uint %params_0 1
-         %99 = OpIEqual %bool %97 %98
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
-        %103 = OpLoad %v3float %color
-        %104 = OpCompositeExtract %GammaTransferParams %params_0 3
-        %102 = OpFunctionCall %v3float %gammaCorrection %103 %104
-               OpStore %color %102
-        %105 = OpCompositeExtract %mat3v3float %params_0 5
+         %92 = OpImageFetch %v4float %plane1 %80 Lod %88
+         %93 = OpVectorShuffle %v2float %92 %92 0 1
+         %94 = OpCompositeExtract %float %93 0
+         %95 = OpCompositeExtract %float %93 1
+         %97 = OpCompositeConstruct %v4float %91 %94 %95 %float_1
+         %98 = OpCompositeExtract %mat3v4float %params_0 2
+         %99 = OpVectorTimesMatrix %v3float %97 %98
+               OpStore %color %99
+               OpBranch %84
+         %84 = OpLabel
+        %100 = OpCompositeExtract %uint %params_0 1
+        %102 = OpIEqual %bool %100 %101
+               OpSelectionMerge %103 None
+               OpBranchConditional %102 %104 %103
+        %104 = OpLabel
         %106 = OpLoad %v3float %color
-        %107 = OpMatrixTimesVector %v3float %105 %106
-               OpStore %color %107
+        %107 = OpCompositeExtract %GammaTransferParams %params_0 3
+        %105 = OpFunctionCall %v3float %gammaCorrection %106 %107
+               OpStore %color %105
+        %108 = OpCompositeExtract %mat3v3float %params_0 5
         %109 = OpLoad %v3float %color
-        %110 = OpCompositeExtract %GammaTransferParams %params_0 4
-        %108 = OpFunctionCall %v3float %gammaCorrection %109 %110
-               OpStore %color %108
-               OpBranch %100
-        %100 = OpLabel
-        %111 = OpLoad %v3float %color
-        %112 = OpCompositeExtract %float %111 0
-        %113 = OpCompositeExtract %float %111 1
-        %114 = OpCompositeExtract %float %111 2
-        %115 = OpCompositeConstruct %v4float %112 %113 %114 %float_1
-               OpReturnValue %115
+        %110 = OpMatrixTimesVector %v3float %108 %109
+               OpStore %color %110
+        %112 = OpLoad %v3float %color
+        %113 = OpCompositeExtract %GammaTransferParams %params_0 4
+        %111 = OpFunctionCall %v3float %gammaCorrection %112 %113
+               OpStore %color %111
+               OpBranch %103
+        %103 = OpLabel
+        %114 = OpLoad %v3float %color
+        %115 = OpCompositeExtract %float %114 0
+        %116 = OpCompositeExtract %float %114 1
+        %117 = OpCompositeExtract %float %114 2
+        %118 = OpCompositeConstruct %v4float %115 %116 %117 %float_1
+               OpReturnValue %118
                OpFunctionEnd
-%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %116
+%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %119
         %val = OpFunctionParameter %ExternalTextureParams_std140
-        %119 = OpLabel
-        %120 = OpCompositeExtract %uint %val 0
-        %121 = OpCompositeExtract %uint %val 1
-        %122 = OpCompositeExtract %mat3v4float %val 2
-        %123 = OpCompositeExtract %GammaTransferParams %val 3
-        %124 = OpCompositeExtract %GammaTransferParams %val 4
-        %125 = OpCompositeExtract %mat3v3float %val 5
-        %126 = OpCompositeExtract %v2float %val 6
-        %127 = OpCompositeExtract %v2float %val 7
-        %128 = OpCompositeExtract %v2float %val 8
-        %129 = OpCompositeConstruct %mat3v2float %126 %127 %128
-        %130 = OpCompositeConstruct %ExternalTextureParams %120 %121 %122 %123 %124 %125 %129
-               OpReturnValue %130
+        %122 = OpLabel
+        %123 = OpCompositeExtract %uint %val 0
+        %124 = OpCompositeExtract %uint %val 1
+        %125 = OpCompositeExtract %mat3v4float %val 2
+        %126 = OpCompositeExtract %GammaTransferParams %val 3
+        %127 = OpCompositeExtract %GammaTransferParams %val 4
+        %128 = OpCompositeExtract %mat3v3float %val 5
+        %129 = OpCompositeExtract %v2float %val 6
+        %130 = OpCompositeExtract %v2float %val 7
+        %131 = OpCompositeExtract %v2float %val 8
+        %132 = OpCompositeConstruct %mat3v2float %129 %130 %131
+        %133 = OpCompositeConstruct %ExternalTextureParams %123 %124 %125 %126 %127 %128 %132
+               OpReturnValue %133
                OpFunctionEnd
-%textureLoad_8acf41 = OpFunction %void None %131
-        %134 = OpLabel
+%textureLoad_8acf41 = OpFunction %void None %134
+        %137 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-        %136 = OpLoad %11 %arg_0
-        %137 = OpLoad %11 %ext_tex_plane_1
-        %143 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
-        %144 = OpLoad %ExternalTextureParams_std140 %143
-        %140 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %144
-        %135 = OpFunctionCall %v4float %textureLoadExternal %136 %137 %139 %140
-               OpStore %res %135
+        %139 = OpLoad %11 %arg_0
+        %140 = OpLoad %11 %ext_tex_plane_1
+        %146 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
+        %147 = OpLoad %ExternalTextureParams_std140 %146
+        %143 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %147
+        %138 = OpFunctionCall %v4float %textureLoadExternal %139 %140 %142 %143
+               OpStore %res %138
+        %151 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+        %152 = OpLoad %v4float %res
+               OpStore %151 %152
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %147
-        %149 = OpLabel
-        %150 = OpFunctionCall %void %textureLoad_8acf41
+%vertex_main_inner = OpFunction %v4float None %153
+        %155 = OpLabel
+        %156 = OpFunctionCall %void %textureLoad_8acf41
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %131
-        %152 = OpLabel
-        %153 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %153
+%vertex_main = OpFunction %void None %134
+        %158 = OpLabel
+        %159 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %159
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %131
-        %155 = OpLabel
-        %156 = OpFunctionCall %void %textureLoad_8acf41
+%fragment_main = OpFunction %void None %134
+        %161 = OpLabel
+        %162 = OpFunctionCall %void %textureLoad_8acf41
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %131
-        %158 = OpLabel
-        %159 = OpFunctionCall %void %textureLoad_8acf41
+%compute_main = OpFunction %void None %134
+        %164 = OpLabel
+        %165 = OpFunctionCall %void %textureLoad_8acf41
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.wgsl
index 5577b26..8c4f784 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_8acf41() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_8acf41();
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl
index 436c43a..29c54e8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d, coords: vec2<i32>, level: u32) -> f32
 fn textureLoad_8ccbe3() {
   var res: f32 = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl
index bd1f283..9ff7163 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_8ccbe3() {
   float res = arg_0.Load(int3((1).xx, int(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl
index bd1f283..9ff7163 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_8ccbe3() {
   float res = arg_0.Load(int3((1).xx, int(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.glsl
index d700b3e..616f6d9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_8ccbe3() {
   float res = texelFetch(arg_0_1, ivec2(1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_8ccbe3() {
   float res = texelFetch(arg_0_1, ivec2(1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_8ccbe3() {
   float res = texelFetch(arg_0_1, ivec2(1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.msl
index b53534c..9bdf1e9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_8ccbe3(depth2d<float, access::sample> tint_symbol_1) {
+void textureLoad_8ccbe3(depth2d<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(int2(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureLoad_8ccbe3(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_8ccbe3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_8ccbe3(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_8ccbe3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_8ccbe3(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_8ccbe3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.spvasm
index 4333057..b481e50 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_8ccbe3 "textureLoad_8ccbe3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,53 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %27 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_8ccbe3 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_8ccbe3 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4float %18 %22 Lod %uint_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageFetch %v4float %21 %25 Lod %uint_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_8ccbe3
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_8ccbe3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_8ccbe3
+%fragment_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_8ccbe3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_8ccbe3
+%compute_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_8ccbe3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.wgsl
index 3128d1e..4f954bb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8ccbe3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_8ccbe3() {
   var res : f32 = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_8ccbe3();
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl
index 75a6136..d590849 100644
--- a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<u32>, coords: vec3<u32>, level: i32) -> vec4<u32>
 fn textureLoad_92eb1f() {
   var res: vec4<u32> = textureLoad(arg_0, vec3<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.dxc.hlsl
index 27f26d4..9b8c47d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_92eb1f() {
   uint4 res = arg_0.Load(uint4((1u).xxx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.fxc.hlsl
index 27f26d4..9b8c47d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_92eb1f() {
   uint4 res = arg_0.Load(uint4((1u).xxx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.glsl
index 03a01dc..f8160a9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_92eb1f() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_92eb1f() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_92eb1f() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.msl
index a71ae9c..1b4a902 100644
--- a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_92eb1f(texture3d<uint, access::sample> tint_symbol_1) {
+void textureLoad_92eb1f(texture3d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint3(uint3(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureLoad_92eb1f(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_92eb1f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_92eb1f(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_92eb1f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_92eb1f(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_92eb1f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.spvasm
index f9adb7a..f6fc637 100644
--- a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_92eb1f "textureLoad_92eb1f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %25 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %27 = OpConstantNull %v4uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_92eb1f = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %22 Lod %int_1
-               OpStore %res %17
+%textureLoad_92eb1f = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %25 Lod %int_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %34 = OpLoad %v4uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_92eb1f
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_92eb1f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_92eb1f
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_92eb1f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_92eb1f
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_92eb1f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.wgsl
index a09f3b3..100300f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/92eb1f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_92eb1f() {
   var res : vec4<u32> = textureLoad(arg_0, vec3<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_92eb1f();
diff --git a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl
index 6702db2..9a67c0c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<u32>, array_index: u32, level: u32) -> vec4<f32>
 fn textureLoad_96efd5() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.dxc.hlsl
index d31d27a..3fb2884 100644
--- a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_96efd5() {
   float4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.fxc.hlsl
index d31d27a..3fb2884 100644
--- a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_96efd5() {
   float4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.glsl
index 93f63df..80a6e20 100644
--- a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_96efd5() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_96efd5() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_96efd5() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.msl
index 68bce43..5b1fc9c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_96efd5(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_96efd5(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_96efd5(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_96efd5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_96efd5(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_96efd5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_96efd5(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_96efd5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.spvasm
index 95d4da6..995343a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_96efd5 "textureLoad_96efd5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,46 +41,54 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %28 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_96efd5 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_96efd5 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %23 = OpCompositeExtract %uint %22 0
-         %24 = OpCompositeExtract %uint %22 1
-         %25 = OpCompositeConstruct %v3uint %23 %24 %uint_1
-         %16 = OpImageFetch %v4float %17 %25 Lod %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %26 = OpCompositeExtract %uint %25 0
+         %27 = OpCompositeExtract %uint %25 1
+         %28 = OpCompositeConstruct %v3uint %26 %27 %uint_1
+         %19 = OpImageFetch %v4float %20 %28 Lod %uint_1
+               OpStore %res %19
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %34 = OpLoad %v4float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_96efd5
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_96efd5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %15
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_96efd5
+%fragment_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_96efd5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_96efd5
+%compute_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_96efd5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.wgsl
index c335e7c..939c509 100644
--- a/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/96efd5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_96efd5() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_96efd5();
diff --git a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl
index 41979d9..a5ec2d5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<u32>, array_index: u32, level: u32) -> vec4<i32>
 fn textureLoad_9885b0() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.dxc.hlsl
index a284ba8..f511cba 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9885b0() {
   int4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.fxc.hlsl
index a284ba8..f511cba 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9885b0() {
   int4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.glsl
index 8ae9074..d03c88f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9885b0() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9885b0() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9885b0() {
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.msl
index 843028c..ee466af 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9885b0(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_9885b0(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_9885b0(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_9885b0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9885b0(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9885b0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9885b0(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9885b0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.spvasm
index 95cbcb3..8bbd8ad 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9885b0 "textureLoad_9885b0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,56 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %27 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %30 = OpConstantNull %v4int
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9885b0 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %30
-         %19 = OpLoad %11 %arg_0
-         %25 = OpCompositeExtract %uint %24 0
-         %26 = OpCompositeExtract %uint %24 1
-         %27 = OpCompositeConstruct %v3uint %25 %26 %uint_1
-         %17 = OpImageFetch %v4int %19 %27 Lod %uint_1
-               OpStore %res %17
+%textureLoad_9885b0 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %33
+         %22 = OpLoad %11 %arg_0
+         %28 = OpCompositeExtract %uint %27 0
+         %29 = OpCompositeExtract %uint %27 1
+         %30 = OpCompositeConstruct %v3uint %28 %29 %uint_1
+         %21 = OpImageFetch %v4int %22 %30 Lod %uint_1
+               OpStore %res %21
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %37 = OpLoad %v4int %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_9885b0
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_9885b0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_9885b0
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_9885b0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_9885b0
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_9885b0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.wgsl
index 5f84beb..87910f2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9885b0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_9885b0() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9885b0();
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl
index 80fb11e..bc826cc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<i32>, coords: vec2<u32>, level: i32) -> vec4<i32>
 fn textureLoad_9aa733() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.dxc.hlsl
index 8862e3e..6795bf6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9aa733() {
   int4 res = arg_0.Load(uint3((1u).xx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.fxc.hlsl
index 8862e3e..6795bf6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9aa733() {
   int4 res = arg_0.Load(uint3((1u).xx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.glsl
index 79c181b..ced2c42 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9aa733() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9aa733() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9aa733() {
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.msl
index b159851..ff9d99e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9aa733(texture2d<int, access::sample> tint_symbol_1) {
+void textureLoad_9aa733(texture2d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureLoad_9aa733(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_9aa733(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9aa733(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9aa733(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9aa733(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9aa733(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.spvasm
index d58cf9e..6cffdd8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9aa733 "textureLoad_9aa733"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %27 = OpConstantNull %v4int
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9aa733 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %23 Lod %int_1
-               OpStore %res %17
+%textureLoad_9aa733 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %26 Lod %int_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %34 = OpLoad %v4int %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_9aa733
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_9aa733
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_9aa733
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_9aa733
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_9aa733
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_9aa733
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.wgsl
index 16e206d..d730cd2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9aa733.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_9aa733() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9aa733();
diff --git a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl
index d3628ce..cf9ad9c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d_array, coords: vec2<i32>, array_index: i32, level: i32) -> f32
 fn textureLoad_9b2667() {
   var res: f32 = textureLoad(arg_0, vec2<i32>(1i), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.dxc.hlsl
index 6504431..b838208 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9b2667() {
   float res = arg_0.Load(int4(int3((1).xx, 1), 1)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.fxc.hlsl
index 6504431..b838208 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9b2667() {
   float res = arg_0.Load(int4(int3((1).xx, 1), 1)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.glsl
index 6b28c51..23a020a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9b2667() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9b2667() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9b2667() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), 1).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.msl
index 594a572..89bea9e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9b2667(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_9b2667(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(int2(1)), 1, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_9b2667(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_9b2667(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9b2667(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9b2667(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9b2667(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9b2667(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.spvasm
index 83123f0..0dda290 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9b2667 "textureLoad_9b2667"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,47 +41,56 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %29 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9b2667 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_9b2667 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %int %23 0
-         %25 = OpCompositeExtract %int %23 1
-         %26 = OpCompositeConstruct %v3int %24 %25 %int_1
-         %17 = OpImageFetch %v4float %18 %26 Lod %int_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %int %26 0
+         %28 = OpCompositeExtract %int %26 1
+         %29 = OpCompositeConstruct %v3int %27 %28 %int_1
+         %20 = OpImageFetch %v4float %21 %29 Lod %int_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureLoad_9b2667
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureLoad_9b2667
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_9b2667
+%fragment_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_9b2667
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_9b2667
+%compute_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_9b2667
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.wgsl
index 1cf5e1c..8473fed 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_9b2667() {
   var res : f32 = textureLoad(arg_0, vec2<i32>(1i), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9b2667();
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl
index 0902bff..3d7845a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<i32>, array_index: i32, level: u32) -> vec4<i32>
 fn textureLoad_9d70e9() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.dxc.hlsl
index 0f72bb7..d47dcdb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9d70e9() {
   int4 res = arg_0.Load(int4(int3((1).xx, 1), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.fxc.hlsl
index 0f72bb7..d47dcdb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9d70e9() {
   int4 res = arg_0.Load(int4(int3((1).xx, 1), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.glsl
index 9db5445..6f76ed1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9d70e9() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9d70e9() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9d70e9() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.msl
index 4571e17..6f0d0c4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9d70e9(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_9d70e9(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(int2(1)), 1, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_9d70e9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_9d70e9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9d70e9(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9d70e9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9d70e9(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9d70e9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.spvasm
index 935921c..2474294 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9d70e9 "textureLoad_9d70e9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,49 +42,57 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %31 = OpConstantNull %v4int
-         %32 = OpTypeFunction %v4float
+         %34 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9d70e9 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %31
-         %19 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %int %23 0
-         %25 = OpCompositeExtract %int %23 1
-         %26 = OpCompositeConstruct %v3int %24 %25 %int_1
-         %17 = OpImageFetch %v4int %19 %26 Lod %uint_1
-               OpStore %res %17
+%textureLoad_9d70e9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %34
+         %22 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %int %26 0
+         %28 = OpCompositeExtract %int %26 1
+         %29 = OpCompositeConstruct %v3int %27 %28 %int_1
+         %21 = OpImageFetch %v4int %22 %29 Lod %uint_1
+               OpStore %res %21
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %38 = OpLoad %v4int %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_9d70e9
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_9d70e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_9d70e9
+%fragment_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_9d70e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_9d70e9
+%compute_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_9d70e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.wgsl
index 4e40023..dd9f768 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9d70e9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_9d70e9() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9d70e9();
diff --git a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl
index d371de4..55373be 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d, coords: vec2<u32>, level: u32) -> f32
 fn textureLoad_9ed19e() {
   var res: f32 = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.dxc.hlsl
index 097458e..1fab947 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9ed19e() {
   float res = arg_0.Load(uint3((1u).xx, 1u)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.fxc.hlsl
index 097458e..1fab947 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9ed19e() {
   float res = arg_0.Load(uint3((1u).xx, 1u)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.glsl
index 3e9d565..df593ee 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9ed19e() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9ed19e() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9ed19e() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.msl
index e602994..90de22e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9ed19e(depth2d<float, access::sample> tint_symbol_1) {
+void textureLoad_9ed19e(depth2d<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureLoad_9ed19e(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_9ed19e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9ed19e(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9ed19e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9ed19e(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9ed19e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.spvasm
index 1732f24..e090e01 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9ed19e "textureLoad_9ed19e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,51 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9ed19e = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_9ed19e = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4float %18 %22 Lod %uint_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageFetch %v4float %21 %25 Lod %uint_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %30 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %31 = OpLoad %float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureLoad_9ed19e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureLoad_9ed19e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %15
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_9ed19e
+%fragment_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_9ed19e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_9ed19e
+%compute_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_9ed19e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.wgsl
index 616cbee..1edfde5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9ed19e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_9ed19e() {
   var res : f32 = textureLoad(arg_0, vec2<u32>(1u), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9ed19e();
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl
index 83c3e93..ee9634c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<i32>, array_index: u32, level: u32) -> vec4<i32>
 fn textureLoad_9fbfd9() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl
index 80664b9..2463331 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9fbfd9() {
   int4 res = arg_0.Load(int4(int3((1).xx, int(1u)), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl
index 80664b9..2463331 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9fbfd9() {
   int4 res = arg_0.Load(int4(int3((1).xx, int(1u)), int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.glsl
index 56966fe..1be8fa7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9fbfd9() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9fbfd9() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9fbfd9() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.msl
index 3ce02b0..e02af1f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9fbfd9(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_9fbfd9(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(int2(1)), 1u, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_9fbfd9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_9fbfd9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9fbfd9(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9fbfd9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9fbfd9(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9fbfd9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.spvasm
index d7b72c9..1efeaf8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9fbfd9 "textureLoad_9fbfd9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,58 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %32 = OpConstantNull %v4int
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9fbfd9 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %32
-         %19 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %int %23 0
-         %25 = OpCompositeExtract %int %23 1
-         %26 = OpBitcast %int %uint_1
-         %29 = OpCompositeConstruct %v3int %24 %25 %26
-         %17 = OpImageFetch %v4int %19 %29 Lod %uint_1
-               OpStore %res %17
+%textureLoad_9fbfd9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %35
+         %22 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %int %26 0
+         %28 = OpCompositeExtract %int %26 1
+         %29 = OpBitcast %int %uint_1
+         %32 = OpCompositeConstruct %v3int %27 %28 %29
+         %21 = OpImageFetch %v4int %22 %32 Lod %uint_1
+               OpStore %res %21
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %39 = OpLoad %v4int %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_9fbfd9
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_9fbfd9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_9fbfd9
+%fragment_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_9fbfd9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_9fbfd9
+%compute_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_9fbfd9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.wgsl
index de62644..0137c86 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9fbfd9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_9fbfd9() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9fbfd9();
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl
index ac921a3..ad190a8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<u32>, coords: vec2<u32>, array_index: i32, level: u32) -> vec4<u32>
 fn textureLoad_a24be1() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.dxc.hlsl
index bb3431e..4b8ee8c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a24be1() {
   uint4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.fxc.hlsl
index bb3431e..4b8ee8c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a24be1() {
   uint4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.glsl
index f0ccba1..b00166a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a24be1() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a24be1() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a24be1() {
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.msl
index d23a41d..d244261 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_a24be1(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_a24be1(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(uint2(1u)), 1, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_a24be1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_a24be1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_a24be1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_a24be1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_a24be1(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_a24be1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.spvasm
index 76b41b4..2de3bd8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_a24be1 "textureLoad_a24be1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,58 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %32 = OpConstantNull %v4uint
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_a24be1 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %32
-         %19 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %uint %23 0
-         %25 = OpCompositeExtract %uint %23 1
-         %26 = OpBitcast %uint %int_1
-         %29 = OpCompositeConstruct %v3uint %24 %25 %26
-         %17 = OpImageFetch %v4uint %19 %29 Lod %uint_1
-               OpStore %res %17
+%textureLoad_a24be1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %35
+         %22 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %uint %26 0
+         %28 = OpCompositeExtract %uint %26 1
+         %29 = OpBitcast %uint %int_1
+         %32 = OpCompositeConstruct %v3uint %27 %28 %29
+         %21 = OpImageFetch %v4uint %22 %32 Lod %uint_1
+               OpStore %res %21
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %39 = OpLoad %v4uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_a24be1
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_a24be1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_a24be1
+%fragment_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_a24be1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_a24be1
+%compute_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_a24be1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.wgsl
index 626e827..2d58aaa 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a24be1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_a24be1() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_a24be1();
diff --git a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl
index ecf3176..91151eb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<f32>, coords: vec2<i32>, sample_index: i32) -> vec4<f32>
 fn textureLoad_a583c9() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.dxc.hlsl
index 899ff24..5226f14 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.dxc.hlsl
@@ -1,7 +1,11 @@
+SKIP: FAILED
+
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a583c9() {
   float4 res = arg_0.Load((1).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -30,3 +34,40 @@
   textureLoad_a583c9();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.f32 @dx.op.textureLoad.f32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.f32 @dx.op.textureLoad.f32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.f32 @dx.op.textureLoad.f32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.fxc.hlsl
index 899ff24..3386be2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a583c9() {
   float4 res = arg_0.Load((1).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.glsl
index 946647d..9d50ac3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_a583c9() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_a583c9() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_a583c9() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.msl
index a80c05e..595f844 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_a583c9(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_a583c9(texture2d_ms<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(int2(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_a583c9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_a583c9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_a583c9(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_a583c9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_a583c9(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_a583c9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.spvasm
index e87546e..2a93fd3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_a583c9 "textureLoad_a583c9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,51 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %21 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %24 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_a583c9 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_a583c9 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Sample %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Sample %int_1
+               OpStore %res %19
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_a583c9
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureLoad_a583c9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %15
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_a583c9
+%fragment_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_a583c9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_a583c9
+%compute_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_a583c9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.wgsl
index 14a43a6..d72084e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_a583c9() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_a583c9();
diff --git a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl
index 200ddd1..da1a6fc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<u32>, coords: vec3<i32>, level: i32) -> vec4<u32>
 fn textureLoad_a9a9f5() {
   var res: vec4<u32> = textureLoad(arg_0, vec3<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.dxc.hlsl
index 49cda15..1cc69cb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a9a9f5() {
   uint4 res = arg_0.Load(int4((1).xxx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.fxc.hlsl
index 49cda15..1cc69cb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a9a9f5() {
   uint4 res = arg_0.Load(int4((1).xxx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.glsl
index aa54ff3..f7bcb7b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a9a9f5() {
   uvec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a9a9f5() {
   uvec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a9a9f5() {
   uvec4 res = texelFetch(arg_0_1, ivec3(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.msl
index f6c9bdb..d56470a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_a9a9f5(texture3d<uint, access::sample> tint_symbol_1) {
+void textureLoad_a9a9f5(texture3d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint3(int3(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureLoad_a9a9f5(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_a9a9f5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_a9a9f5(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_a9a9f5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_a9a9f5(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_a9a9f5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.spvasm
index 0c42002..c710bd6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_a9a9f5 "textureLoad_a9a9f5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %26 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %26 = OpConstantNull %v4uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_a9a9f5 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %26
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %23 Lod %int_1
-               OpStore %res %17
+%textureLoad_a9a9f5 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %29
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %26 Lod %int_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %33 = OpLoad %v4uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_a9a9f5
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_a9a9f5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_a9a9f5
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_a9a9f5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_a9a9f5
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_a9a9f5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.wgsl
index f6df350..89fb77e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_a9a9f5() {
   var res : vec4<u32> = textureLoad(arg_0, vec3<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_a9a9f5();
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl
index 3dfd2f1..25e3729 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<i32>, coords: vec2<i32>, array_index: u32, level: i32) -> vec4<i32>
 fn textureLoad_b29f71() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.dxc.hlsl
index 3a5de15..5200393 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b29f71() {
   int4 res = arg_0.Load(int4(int3((1).xx, int(1u)), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.fxc.hlsl
index 3a5de15..5200393 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b29f71() {
   int4 res = arg_0.Load(int4(int3((1).xx, int(1u)), 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.glsl
index f6920c3..ca9896b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_b29f71() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_b29f71() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_b29f71() {
   ivec4 res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.msl
index 9a49097..ad4fc2c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_b29f71(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_b29f71(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(int2(1)), 1u, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_b29f71(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_b29f71(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_b29f71(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_b29f71(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_b29f71(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_b29f71(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.spvasm
index 8df6b91..3a88edd 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_b29f71 "textureLoad_b29f71"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,58 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %32 = OpConstantNull %v4int
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_b29f71 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %32
-         %19 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %int %23 0
-         %25 = OpCompositeExtract %int %23 1
-         %26 = OpBitcast %int %uint_1
-         %29 = OpCompositeConstruct %v3int %24 %25 %26
-         %17 = OpImageFetch %v4int %19 %29 Lod %int_1
-               OpStore %res %17
+%textureLoad_b29f71 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %35
+         %22 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %int %26 0
+         %28 = OpCompositeExtract %int %26 1
+         %29 = OpBitcast %int %uint_1
+         %32 = OpCompositeConstruct %v3int %27 %28 %29
+         %21 = OpImageFetch %v4int %22 %32 Lod %int_1
+               OpStore %res %21
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %39 = OpLoad %v4int %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_b29f71
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_b29f71
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_b29f71
+%fragment_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_b29f71
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_b29f71
+%compute_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_b29f71
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.wgsl
index c83bd68..ef69270 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b29f71.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_b29f71() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_b29f71();
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl
index 68177d1..0c24719 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d_array, coords: vec2<u32>, array_index: i32, level: i32) -> f32
 fn textureLoad_b6ba5d() {
   var res: f32 = textureLoad(arg_0, vec2<u32>(1u), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl
index 3631e3b..0730735 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b6ba5d() {
   float res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl
index 3631e3b..0730735 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b6ba5d() {
   float res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.glsl
index 183125f..fd6d569d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_b6ba5d() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_b6ba5d() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_b6ba5d() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), uint(1))), 1).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.msl
index 965aea7..d2d14d8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_b6ba5d(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_b6ba5d(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(uint2(1u)), 1, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_b6ba5d(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_b6ba5d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_b6ba5d(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_b6ba5d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_b6ba5d(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_b6ba5d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.spvasm
index f93a99a..a85cf64 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_b6ba5d "textureLoad_b6ba5d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,50 +41,58 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_b6ba5d = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_b6ba5d = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %uint %23 0
-         %25 = OpCompositeExtract %uint %23 1
-         %26 = OpBitcast %uint %int_1
-         %29 = OpCompositeConstruct %v3uint %24 %25 %26
-         %17 = OpImageFetch %v4float %18 %29 Lod %int_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %uint %26 0
+         %28 = OpCompositeExtract %uint %26 1
+         %29 = OpBitcast %uint %int_1
+         %32 = OpCompositeConstruct %v3uint %27 %28 %29
+         %20 = OpImageFetch %v4float %21 %32 Lod %int_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %37 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %38 = OpLoad %float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_b6ba5d
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_b6ba5d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_b6ba5d
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_b6ba5d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_b6ba5d
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_b6ba5d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.wgsl
index bb45604..a7a9031 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b6ba5d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_b6ba5d() {
   var res : f32 = textureLoad(arg_0, vec2<u32>(1u), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_b6ba5d();
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl
index 7b360ac..6d079a9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<u32>, coords: vec2<u32>, level: i32) -> vec4<u32>
 fn textureLoad_b73f6b() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.dxc.hlsl
index 40bf70c..1f71969 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b73f6b() {
   uint4 res = arg_0.Load(uint3((1u).xx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.fxc.hlsl
index 40bf70c..1f71969 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b73f6b() {
   uint4 res = arg_0.Load(uint3((1u).xx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.glsl
index 9129c98..211dcd2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_b73f6b() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_b73f6b() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_b73f6b() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.msl
index fb6414e..e37c16e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_b73f6b(texture2d<uint, access::sample> tint_symbol_1) {
+void textureLoad_b73f6b(texture2d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureLoad_b73f6b(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_b73f6b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_b73f6b(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_b73f6b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_b73f6b(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_b73f6b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.spvasm
index c258b1f..7de685a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_b73f6b "textureLoad_b73f6b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %27 = OpConstantNull %v4uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_b73f6b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %22 Lod %int_1
-               OpStore %res %17
+%textureLoad_b73f6b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %25 Lod %int_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %34 = OpLoad %v4uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_b73f6b
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_b73f6b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_b73f6b
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_b73f6b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_b73f6b
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_b73f6b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.wgsl
index fbfde8a..029cc3e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b73f6b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_b73f6b() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_b73f6b();
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl
index 7c1b11c..55c9e99 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<f32>, coords: vec2<i32>, sample_index: u32) -> vec4<f32>
 fn textureLoad_b75d4a() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.dxc.hlsl
index 8d6034b..e7af5b9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.dxc.hlsl
@@ -1,7 +1,11 @@
+SKIP: FAILED
+
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b75d4a() {
   float4 res = arg_0.Load((1).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -30,3 +34,40 @@
   textureLoad_b75d4a();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.f32 @dx.op.textureLoad.f32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.f32 @dx.op.textureLoad.f32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.f32 @dx.op.textureLoad.f32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.fxc.hlsl
index 8d6034b..91f473e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b75d4a() {
   float4 res = arg_0.Load((1).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.glsl
index c73b745..1f4ad5d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_b75d4a() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_b75d4a() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_b75d4a() {
   vec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.msl
index 9e6c646..639f606 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_b75d4a(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_b75d4a(texture2d_ms<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(int2(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_b75d4a(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_b75d4a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_b75d4a(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_b75d4a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_b75d4a(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_b75d4a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.spvasm
index 2c00abc..02a60d1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_b75d4a "textureLoad_b75d4a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,44 +41,52 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %21 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %26 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_b75d4a = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_b75d4a = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Sample %uint_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Sample %uint_1
+               OpStore %res %19
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_b75d4a
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_b75d4a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_b75d4a
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_b75d4a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_b75d4a
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_b75d4a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.wgsl
index e0ac92c..011ca92 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b75d4a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_b75d4a() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_b75d4a();
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl
index 04234f9..fd123ff 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_1d<u32>, coords: u32, level: u32) -> vec4<u32>
 fn textureLoad_bc3201() {
   var res: vec4<u32> = textureLoad(arg_0, 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.dxc.hlsl
index 1da9ad5..8c70a09 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_bc3201() {
   uint4 res = arg_0.Load(uint2(1u, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.fxc.hlsl
index 1da9ad5..8c70a09 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_bc3201() {
   uint4 res = arg_0.Load(uint2(1u, 1u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.glsl
index eb87c92..015ff21 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_bc3201() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_bc3201() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_bc3201() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u, 0u)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.msl
index aaf9344..44c586f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_bc3201(texture1d<uint, access::sample> tint_symbol_1) {
+void textureLoad_bc3201(texture1d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint(1u), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureLoad_bc3201(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_bc3201(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_bc3201(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_bc3201(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_bc3201(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_bc3201(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.spvasm
index e156f8a..b0b8acf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_bc3201 "textureLoad_bc3201"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %23 = OpConstantNull %v4uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_bc3201 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %uint_1 Lod %uint_1
-               OpStore %res %17
+%textureLoad_bc3201 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %uint_1 Lod %uint_1
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %30 = OpLoad %v4uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureLoad_bc3201
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureLoad_bc3201
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_bc3201
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_bc3201
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_bc3201
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_bc3201
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.wgsl
index f4de77b..1911022 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bc3201.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_bc3201() {
   var res : vec4<u32> = textureLoad(arg_0, 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_bc3201();
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl
index 72bc65a..ebaba08 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<f32>, coords: vec3<u32>, level: i32) -> vec4<f32>
 fn textureLoad_bcbb3c() {
   var res: vec4<f32> = textureLoad(arg_0, vec3<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl
index d1270b1..c03ab5a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_bcbb3c() {
   float4 res = arg_0.Load(uint4((1u).xxx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl
index d1270b1..c03ab5a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_bcbb3c() {
   float4 res = arg_0.Load(uint4((1u).xxx, uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.glsl
index 12d1532..daf5eca 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_bcbb3c() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_bcbb3c() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_bcbb3c() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.msl
index bb6243e..62645c3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_bcbb3c(texture3d<float, access::sample> tint_symbol_1) {
+void textureLoad_bcbb3c(texture3d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint3(uint3(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureLoad_bcbb3c(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_bcbb3c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_bcbb3c(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_bcbb3c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_bcbb3c(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_bcbb3c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.spvasm
index f73237b..1cc4125 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_bcbb3c "textureLoad_bcbb3c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,44 +41,52 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %21 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %24 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %26 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_bcbb3c = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_bcbb3c = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Lod %int_1
+               OpStore %res %19
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_bcbb3c
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_bcbb3c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_bcbb3c
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_bcbb3c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_bcbb3c
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_bcbb3c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.wgsl
index 6760114..7bfc6f6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bcbb3c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_bcbb3c() {
   var res : vec4<f32> = textureLoad(arg_0, vec3<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_bcbb3c();
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl
index c653ca5..2cb78b5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d_array, coords: vec2<i32>, array_index: u32, level: i32) -> f32
 fn textureLoad_c16e00() {
   var res: f32 = textureLoad(arg_0, vec2<i32>(1i), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.dxc.hlsl
index 2cc06f6..68b1dea 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c16e00() {
   float res = arg_0.Load(int4(int3((1).xx, int(1u)), 1)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.fxc.hlsl
index 2cc06f6..68b1dea 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c16e00() {
   float res = arg_0.Load(int4(int3((1).xx, int(1u)), 1)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.glsl
index 3871cbc..2a36aa2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_c16e00() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_c16e00() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_c16e00() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), int(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.msl
index 0172359..6bd6a2b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_c16e00(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_c16e00(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(int2(1)), 1u, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_c16e00(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_c16e00(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_c16e00(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_c16e00(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_c16e00(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_c16e00(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.spvasm
index a26dedc..7f163b5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_c16e00 "textureLoad_c16e00"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,50 +41,58 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_c16e00 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_c16e00 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %int %23 0
-         %25 = OpCompositeExtract %int %23 1
-         %26 = OpBitcast %int %uint_1
-         %29 = OpCompositeConstruct %v3int %24 %25 %26
-         %17 = OpImageFetch %v4float %18 %29 Lod %int_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %int %26 0
+         %28 = OpCompositeExtract %int %26 1
+         %29 = OpBitcast %int %uint_1
+         %32 = OpCompositeConstruct %v3int %27 %28 %29
+         %20 = OpImageFetch %v4float %21 %32 Lod %int_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %37 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %38 = OpLoad %float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_c16e00
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_c16e00
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_c16e00
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_c16e00
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_c16e00
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_c16e00
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.wgsl
index a2b063b..161921c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c16e00.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_c16e00() {
   var res : f32 = textureLoad(arg_0, vec2<i32>(1i), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_c16e00();
diff --git a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl
index a112e75..78f1b1e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<i32>, coords: vec2<i32>, level: i32) -> vec4<i32>
 fn textureLoad_c2a480() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.dxc.hlsl
index 12025bf..ff0457b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c2a480() {
   int4 res = arg_0.Load(int3((1).xx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.fxc.hlsl
index 12025bf..ff0457b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c2a480() {
   int4 res = arg_0.Load(int3((1).xx, 1));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.glsl
index cb7e8df..806d55b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_c2a480() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_c2a480() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_c2a480() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.msl
index ca4ac4e..0836d8a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_c2a480(texture2d<int, access::sample> tint_symbol_1) {
+void textureLoad_c2a480(texture2d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(int2(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureLoad_c2a480(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_c2a480(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_c2a480(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_c2a480(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_c2a480(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_c2a480(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.spvasm
index c5f9924..a42d1a1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_c2a480 "textureLoad_c2a480"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,52 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %25 = OpConstantNull %v4int
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_c2a480 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %22 Lod %int_1
-               OpStore %res %17
+%textureLoad_c2a480 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %25 Lod %int_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %33 = OpLoad %v4int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_c2a480
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_c2a480
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_c2a480
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_c2a480
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_c2a480
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_c2a480
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.wgsl
index 3e94689..ef9c223 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_c2a480() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_c2a480();
diff --git a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl
index a1cc531..445d896 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<u32>, coords: vec2<i32>, sample_index: i32) -> vec4<u32>
 fn textureLoad_c378ee() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.dxc.hlsl
index 1d70b91..5e32990 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.dxc.hlsl
@@ -1,7 +1,11 @@
+SKIP: FAILED
+
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c378ee() {
   uint4 res = arg_0.Load((1).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -30,3 +34,40 @@
   textureLoad_c378ee();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.fxc.hlsl
index 1d70b91..2fd8940 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c378ee() {
   uint4 res = arg_0.Load((1).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.glsl
index 7578fc0..42be2dbd 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_c378ee() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_c378ee() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_c378ee() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.msl
index 5d9e980..d9bc550 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_c378ee(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureLoad_c378ee(texture2d_ms<uint, access::read> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(int2(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureLoad_c378ee(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_c378ee(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_c378ee(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_c378ee(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_c378ee(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_c378ee(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.spvasm
index 67eaa27..d9fc440 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_c378ee "textureLoad_c378ee"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %26 = OpConstantNull %v4uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_c378ee = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %26
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %23 Sample %int_1
-               OpStore %res %17
+%textureLoad_c378ee = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %29
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %26 Sample %int_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %33 = OpLoad %v4uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_c378ee
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_c378ee
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_c378ee
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_c378ee
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_c378ee
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_c378ee
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.wgsl
index 3a19878..34ae14d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_c378ee() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_c378ee();
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl
index 21d4579..a40f40a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<u32>, coords: vec2<i32>, sample_index: u32) -> vec4<u32>
 fn textureLoad_cad5f2() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.dxc.hlsl
index 35323e9..0bf069d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.dxc.hlsl
@@ -1,7 +1,11 @@
+SKIP: FAILED
+
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_cad5f2() {
   uint4 res = arg_0.Load((1).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -30,3 +34,40 @@
   textureLoad_cad5f2();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.fxc.hlsl
index 35323e9..5186a06 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_cad5f2() {
   uint4 res = arg_0.Load((1).xx, 1u);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.glsl
index 212df3b..c9b175e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_cad5f2() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_cad5f2() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_cad5f2() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.msl
index d2d03a0..7a82224 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_cad5f2(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureLoad_cad5f2(texture2d_ms<uint, access::read> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(int2(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureLoad_cad5f2(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_cad5f2(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_cad5f2(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_cad5f2(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_cad5f2(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_cad5f2(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.spvasm
index 770f50b..64e552f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_cad5f2 "textureLoad_cad5f2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %27 = OpConstantNull %v4uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_cad5f2 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %23 Sample %uint_1
-               OpStore %res %17
+%textureLoad_cad5f2 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %26 Sample %uint_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %34 = OpLoad %v4uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_cad5f2
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_cad5f2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_cad5f2
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_cad5f2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_cad5f2
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_cad5f2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.wgsl
index c1ff4e1..4a65096 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cad5f2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_cad5f2() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_cad5f2();
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl
index b2a49a0..60b2dcf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d_array, coords: vec2<u32>, array_index: u32, level: i32) -> f32
 fn textureLoad_cb57c2() {
   var res: f32 = textureLoad(arg_0, vec2<u32>(1u), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.dxc.hlsl
index 17a6eb8..1133b04 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_cb57c2() {
   float res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.fxc.hlsl
index 17a6eb8..1133b04 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_cb57c2() {
   float res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.glsl
index 1b6e405..d831606 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_cb57c2() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_cb57c2() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_cb57c2() {
   float res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.msl
index 9b10a8a..f452b77 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_cb57c2(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_cb57c2(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(uint2(1u)), 1u, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_cb57c2(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_cb57c2(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_cb57c2(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_cb57c2(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_cb57c2(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_cb57c2(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.spvasm
index aabd47f..a899f91 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_cb57c2 "textureLoad_cb57c2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,57 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %26 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %31 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_cb57c2 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_cb57c2 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %uint %23 0
-         %25 = OpCompositeExtract %uint %23 1
-         %26 = OpCompositeConstruct %v3uint %24 %25 %uint_1
-         %17 = OpImageFetch %v4float %18 %26 Lod %int_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %uint %26 0
+         %28 = OpCompositeExtract %uint %26 1
+         %29 = OpCompositeConstruct %v3uint %27 %28 %uint_1
+         %20 = OpImageFetch %v4float %21 %29 Lod %int_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %36 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %37 = OpLoad %float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_cb57c2
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_cb57c2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_cb57c2
+%fragment_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_cb57c2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_cb57c2
+%compute_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_cb57c2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.wgsl
index 8aa33ed..4b915bb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cb57c2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_cb57c2() {
   var res : f32 = textureLoad(arg_0, vec2<u32>(1u), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_cb57c2();
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl
index 785f37c..0219a9a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_3d<i32>, coords: vec3<i32>, level: u32) -> vec4<i32>
 fn textureLoad_e35f72() {
   var res: vec4<i32> = textureLoad(arg_0, vec3<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.dxc.hlsl
index 314a8cd..cdfc09d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_e35f72() {
   int4 res = arg_0.Load(int4((1).xxx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.fxc.hlsl
index 314a8cd..cdfc09d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_e35f72() {
   int4 res = arg_0.Load(int4((1).xxx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.glsl
index c76b195..a0f91f3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e35f72() {
   ivec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e35f72() {
   ivec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e35f72() {
   ivec4 res = texelFetch(arg_0_1, ivec3(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.msl
index 8d90d9d..bc343cf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_e35f72(texture3d<int, access::sample> tint_symbol_1) {
+void textureLoad_e35f72(texture3d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint3(int3(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureLoad_e35f72(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_e35f72(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_e35f72(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_e35f72(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_e35f72(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_e35f72(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.spvasm
index d2e44af..518f95b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_e35f72 "textureLoad_e35f72"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %25 = OpConstantComposite %v3int %int_1 %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %27 = OpConstantNull %v4int
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_e35f72 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %22 Lod %uint_1
-               OpStore %res %17
+%textureLoad_e35f72 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %25 Lod %uint_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %34 = OpLoad %v4int %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_e35f72
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_e35f72
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_e35f72
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_e35f72
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_e35f72
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_e35f72
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.wgsl
index 9f98211..141a012 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e35f72.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_e35f72() {
   var res : vec4<i32> = textureLoad(arg_0, vec3<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_e35f72();
diff --git a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl
index 5f75cfc..f6e294b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<i32>, coords: vec2<i32>, sample_index: i32) -> vec4<i32>
 fn textureLoad_e3d2cc() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.dxc.hlsl
index e6d2e54..9a6faf0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.dxc.hlsl
@@ -1,7 +1,11 @@
+SKIP: FAILED
+
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_e3d2cc() {
   int4 res = arg_0.Load((1).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -30,3 +34,40 @@
   textureLoad_e3d2cc();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %3 = call %dx.types.ResRet.i32 @dx.op.textureLoad.i32(i32 66, %dx.types.Handle %2, i32 1, i64 1, i64 1, i32 undef, i32 undef, i32 undef, i32 undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.fxc.hlsl
index e6d2e54..873f8aa 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_e3d2cc() {
   int4 res = arg_0.Load((1).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.glsl
index 0a3f39b..75aee64 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e3d2cc() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e3d2cc() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e3d2cc() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.msl
index 219ced8..797d5d5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_e3d2cc(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureLoad_e3d2cc(texture2d_ms<int, access::read> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(int2(1)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureLoad_e3d2cc(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_e3d2cc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_e3d2cc(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_e3d2cc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_e3d2cc(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_e3d2cc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.spvasm
index b675216..d2fc40e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_e3d2cc "textureLoad_e3d2cc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,52 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %25 = OpConstantNull %v4int
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_e3d2cc = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %25
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %22 Sample %int_1
-               OpStore %res %17
+%textureLoad_e3d2cc = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %28
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %25 Sample %int_1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %33 = OpLoad %v4int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_e3d2cc
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_e3d2cc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_e3d2cc
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_e3d2cc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_e3d2cc
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_e3d2cc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.wgsl
index bcca84f..2fd7bb8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_e3d2cc() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_e3d2cc();
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl
index a148c96..3aa01f9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<u32>, coords: vec2<i32>, level: u32) -> vec4<u32>
 fn textureLoad_ebfb92() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.dxc.hlsl
index b5068f8..b4eed4d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_ebfb92() {
   uint4 res = arg_0.Load(int3((1).xx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.fxc.hlsl
index b5068f8..b4eed4d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_ebfb92() {
   uint4 res = arg_0.Load(int3((1).xx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.glsl
index 3304740..7d95906 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_ebfb92() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_ebfb92() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_ebfb92() {
   uvec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.msl
index 150e05f..fcb7dee 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_ebfb92(texture2d<uint, access::sample> tint_symbol_1) {
+void textureLoad_ebfb92(texture2d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(int2(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureLoad_ebfb92(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_ebfb92(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_ebfb92(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_ebfb92(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_ebfb92(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_ebfb92(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.spvasm
index 2d2b7c1..cc498c4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_ebfb92 "textureLoad_ebfb92"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %27 = OpConstantNull %v4uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_ebfb92 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %23 Lod %uint_1
-               OpStore %res %17
+%textureLoad_ebfb92 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %26 Lod %uint_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %34 = OpLoad %v4uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_ebfb92
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_ebfb92
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_ebfb92
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_ebfb92
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_ebfb92
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_ebfb92
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.wgsl
index ba62a2d..ed60b59 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ebfb92.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_ebfb92() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_ebfb92();
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl
index c40b098..956443b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<f32>, coords: vec2<u32>, sample_index: i32) -> vec4<f32>
 fn textureLoad_f0abad() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.dxc.hlsl
index 87dd503..2e8dcdc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f0abad() {
   float4 res = arg_0.Load((1u).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.fxc.hlsl
index 87dd503..2e8dcdc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f0abad() {
   float4 res = arg_0.Load((1u).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.glsl
index e3f38e3..09f8ad4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f0abad() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f0abad() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f0abad() {
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.msl
index cb62355..4b9aefe 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_f0abad(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_f0abad(texture2d_ms<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_f0abad(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_f0abad(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_f0abad(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_f0abad(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_f0abad(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_f0abad(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.spvasm
index 2ee3f4d..8b50544 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_f0abad "textureLoad_f0abad"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,44 +41,52 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %21 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %26 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_f0abad = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_f0abad = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %16 = OpImageFetch %v4float %17 %21 Sample %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %19 = OpImageFetch %v4float %20 %24 Sample %int_1
+               OpStore %res %19
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureLoad_f0abad
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureLoad_f0abad
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_f0abad
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_f0abad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_f0abad
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_f0abad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.wgsl
index 39a6743..e68be40 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f0abad.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_f0abad() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_f0abad();
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl
index 8ded634..a8b3c3d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d_array<f32>, coords: vec2<u32>, array_index: u32, level: i32) -> vec4<f32>
 fn textureLoad_f348d9() {
   var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.dxc.hlsl
index 3ed4094..80797a6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f348d9() {
   float4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.fxc.hlsl
index 3ed4094..80797a6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f348d9() {
   float4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.glsl
index 8ee158a..55aa76a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f348d9() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f348d9() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f348d9() {
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(uvec2(1u), 1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.msl
index fc4b059..3d32096 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_f348d9(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_f348d9(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u, 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_f348d9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_f348d9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_f348d9(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_f348d9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_f348d9(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_f348d9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.spvasm
index dda8c12..f8b7505 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_f348d9 "textureLoad_f348d9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,48 +41,56 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_f348d9 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_f348d9 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %17 = OpLoad %11 %arg_0
-         %23 = OpCompositeExtract %uint %22 0
-         %24 = OpCompositeExtract %uint %22 1
-         %25 = OpCompositeConstruct %v3uint %23 %24 %uint_1
-         %16 = OpImageFetch %v4float %17 %25 Lod %int_1
-               OpStore %res %16
+         %20 = OpLoad %11 %arg_0
+         %26 = OpCompositeExtract %uint %25 0
+         %27 = OpCompositeExtract %uint %25 1
+         %28 = OpCompositeConstruct %v3uint %26 %27 %uint_1
+         %19 = OpImageFetch %v4float %20 %28 Lod %int_1
+               OpStore %res %19
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureLoad_f348d9
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureLoad_f348d9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_f348d9
+%fragment_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_f348d9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_f348d9
+%compute_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_f348d9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.wgsl
index e36ca47..fbe102b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f348d9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_f348d9() {
   var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_f348d9();
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl
index deaef28..4d91f06 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_2d<i32>, coords: vec2<i32>, level: u32) -> vec4<i32>
 fn textureLoad_f85291() {
   var res: vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.dxc.hlsl
index f506fc9..64e77a6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f85291() {
   int4 res = arg_0.Load(int3((1).xx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.fxc.hlsl
index f506fc9..64e77a6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f85291() {
   int4 res = arg_0.Load(int3((1).xx, int(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.glsl
index 7aaf2b6..f955722 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_f85291() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_f85291() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_f85291() {
   ivec4 res = texelFetch(arg_0_1, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.msl
index 4a0ede2..0b624de 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_f85291(texture2d<int, access::sample> tint_symbol_1) {
+void textureLoad_f85291(texture2d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int4 res = tint_symbol_1.read(uint2(int2(1)), 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureLoad_f85291(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_f85291(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_f85291(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_f85291(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_f85291(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_f85291(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.spvasm
index 72f452b..db1cd88 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_f85291 "textureLoad_f85291"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %27 = OpConstantNull %v4int
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_f85291 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4int Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4int %19 %22 Lod %uint_1
-               OpStore %res %17
+%textureLoad_f85291 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4int Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4int %22 %25 Lod %uint_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %34 = OpLoad %v4int %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_f85291
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_f85291
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_f85291
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_f85291
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_f85291
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_f85291
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.wgsl
index 7fcdc5b..97b28e5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f85291.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_f85291() {
   var res : vec4<i32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_f85291();
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl
index 8e6c0ac..76e8c34 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_multisampled_2d, coords: vec2<u32>, sample_index: i32) -> f32
 fn textureLoad_fcd23d() {
   var res: f32 = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.dxc.hlsl
index c684738..fdc9889 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_fcd23d() {
   float res = arg_0.Load(uint3((1u).xx, uint(0)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.fxc.hlsl
index c684738..fdc9889 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_fcd23d() {
   float res = arg_0.Load(uint3((1u).xx, uint(0)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.glsl
index d812b0d..3d58724 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_fcd23d() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_fcd23d() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_fcd23d() {
   float res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.msl
index db62b99..44a5930 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_fcd23d(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_fcd23d(depth2d_ms<float, access::read> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_fcd23d(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_fcd23d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_fcd23d(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_fcd23d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_fcd23d(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_fcd23d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.spvasm
index 57fb66f..534eb40 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_fcd23d "textureLoad_fcd23d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,53 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %27 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_fcd23d = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_fcd23d = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4float %18 %22 Sample %int_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageFetch %v4float %21 %25 Sample %int_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureLoad_fcd23d
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureLoad_fcd23d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_fcd23d
+%fragment_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_fcd23d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_fcd23d
+%compute_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_fcd23d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.wgsl
index bb55cae..600533b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fcd23d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_fcd23d() {
   var res : f32 = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_fcd23d();
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl
index 0d15c85..8d68b9e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_multisampled_2d<u32>, coords: vec2<u32>, sample_index: i32) -> vec4<u32>
 fn textureLoad_fe0565() {
   var res: vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.dxc.hlsl
index 85598d6..43b9765 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_fe0565() {
   uint4 res = arg_0.Load((1u).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.fxc.hlsl
index 85598d6..43b9765 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_fe0565() {
   uint4 res = arg_0.Load((1u).xx, 1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.glsl
index a805a77..7a2fdbe 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_fe0565() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_fe0565() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_fe0565() {
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(1u)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.msl
index ab16eeb..5743df7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_fe0565(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureLoad_fe0565(texture2d_ms<uint, access::read> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint4 res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureLoad_fe0565(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_fe0565(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_fe0565(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_fe0565(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_fe0565(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_fe0565(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.spvasm
index 4ba192b..d8cb26d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_fe0565 "textureLoad_fe0565"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %27 = OpConstantNull %v4uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_fe0565 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v4uint Function %27
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageFetch %v4uint %19 %22 Sample %int_1
-               OpStore %res %17
+%textureLoad_fe0565 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v4uint Function %30
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageFetch %v4uint %22 %25 Sample %int_1
+               OpStore %res %21
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %34 = OpLoad %v4uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_fe0565
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_fe0565
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_fe0565
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_fe0565
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_fe0565
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_fe0565
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.wgsl
index 1fc5a55..ce7b37c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fe0565.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_fe0565() {
   var res : vec4<u32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_fe0565();
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl
index 13bdf40..8ce3edc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl
@@ -25,7 +25,9 @@
 // fn textureLoad(texture: texture_depth_2d_array, coords: vec2<i32>, array_index: i32, level: u32) -> f32
 fn textureLoad_ff1119() {
   var res: f32 = textureLoad(arg_0, vec2<i32>(1i), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.dxc.hlsl
index 9563888..bab5389 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.dxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_ff1119() {
   float res = arg_0.Load(int4(int3((1).xx, 1), int(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.fxc.hlsl
index 9563888..bab5389 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.fxc.hlsl
@@ -1,7 +1,9 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_ff1119() {
   float res = arg_0.Load(int4(int3((1).xx, 1), int(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.glsl
index 7a186c9..4facd90 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_ff1119() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_ff1119() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_ff1119() {
   float res = texelFetch(arg_0_1, ivec3(ivec2(1), 1), int(1u)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.msl
index e8df23c..c3ba3c1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_ff1119(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_ff1119(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol_1.read(uint2(int2(1)), 1, 1u);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_ff1119(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_ff1119(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_ff1119(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_ff1119(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_ff1119(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_ff1119(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.spvasm
index c95bc7e..bd7066f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_ff1119 "textureLoad_ff1119"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -23,6 +26,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,57 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %31 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_ff1119 = OpFunction %void None %12
-         %15 = OpLabel
+%textureLoad_ff1119 = OpFunction %void None %15
+         %18 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %18 = OpLoad %11 %arg_0
-         %24 = OpCompositeExtract %int %23 0
-         %25 = OpCompositeExtract %int %23 1
-         %26 = OpCompositeConstruct %v3int %24 %25 %int_1
-         %17 = OpImageFetch %v4float %18 %26 Lod %uint_1
-         %16 = OpCompositeExtract %float %17 0
-               OpStore %res %16
+         %21 = OpLoad %11 %arg_0
+         %27 = OpCompositeExtract %int %26 0
+         %28 = OpCompositeExtract %int %26 1
+         %29 = OpCompositeConstruct %v3int %27 %28 %int_1
+         %20 = OpImageFetch %v4float %21 %29 Lod %uint_1
+         %19 = OpCompositeExtract %float %20 0
+               OpStore %res %19
+         %36 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %37 = OpLoad %float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_ff1119
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_ff1119
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %15
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_ff1119
+%fragment_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_ff1119
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_ff1119
+%compute_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_ff1119
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.wgsl
index 54b519f..9797b26 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ff1119.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureLoad_ff1119() {
   var res : f32 = textureLoad(arg_0, vec2<i32>(1i), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_ff1119();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl
index ddc52ad..faccc8a 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba16uint, write>) -> u32
 fn textureNumLayers_014a3b() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
index 470f2ac..2e51013 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_014a3b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
index 470f2ac..2e51013 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_014a3b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.glsl
index c1c9781..001d1ff 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_014a3b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_014a3b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_014a3b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.msl
index 4a03eda..3d95ab2 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_014a3b(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_014a3b(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_014a3b(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_014a3b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_014a3b(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_014a3b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_014a3b(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_014a3b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.spvasm
index 2acde0b..5ae6c69 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_014a3b "textureNumLayers_014a3b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_014a3b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_014a3b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_014a3b
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_014a3b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_014a3b
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_014a3b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_014a3b
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_014a3b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.wgsl
index 9c87b00..77ff4ca 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_014a3b() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_014a3b();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl
index 4ffee75..a600f9d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rg32uint, write>) -> u32
 fn textureNumLayers_071ebc() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
index 11a36cc..21687b3 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_071ebc() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
index 11a36cc..21687b3 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_071ebc() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.msl
index f9657e8..321ef94 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_071ebc(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_071ebc(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_071ebc(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_071ebc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_071ebc(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_071ebc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_071ebc(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_071ebc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.spvasm
index 7a70e26..3f2b516 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_071ebc "textureNumLayers_071ebc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,41 +45,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_071ebc = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_071ebc = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_071ebc
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_071ebc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_071ebc
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_071ebc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_071ebc
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_071ebc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.wgsl
index 61626de..8db525a 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_071ebc() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_071ebc();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl
index bba0167..f3ba91e 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_2d_array<f32>) -> u32
 fn textureNumLayers_0ec222() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
index 8ff2543..d4585bf 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_0ec222() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
index 8ff2543..d4585bf 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_0ec222() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.glsl
index 37ecbb1..e67a1c0 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_0ec222() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_0ec222() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_0ec222() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.msl
index 63e8634..618d019 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_0ec222(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureNumLayers_0ec222(texture2d_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureNumLayers_0ec222(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_0ec222(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_0ec222(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_0ec222(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_0ec222(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_0ec222(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.spvasm
index b6d7c2b..6650da1 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_0ec222 "textureNumLayers_0ec222"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_0ec222 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %25
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySizeLod %v3uint %20 %int_0
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_0ec222 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %28
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %23 %int_0
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureNumLayers_0ec222
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureNumLayers_0ec222
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLayers_0ec222
+%fragment_main = OpFunction %void None %16
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLayers_0ec222
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureNumLayers_0ec222
+%compute_main = OpFunction %void None %16
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureNumLayers_0ec222
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.wgsl
index 3f18e09..3a05299 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_0ec222() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_0ec222();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl
index d42261f..37991e6 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<bgra8unorm, write>) -> u32
 fn textureNumLayers_1f858a() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.dxc.hlsl
index d8f7810..4c51864 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_1f858a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.fxc.hlsl
index d8f7810..4c51864 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_1f858a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.glsl
index 0eff466..690008d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_1f858a() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_1f858a() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_1f858a() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.msl
index 688f54e..bea281a 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_1f858a(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_1f858a(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_1f858a(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_1f858a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_1f858a(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_1f858a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_1f858a(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_1f858a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.spvasm
index 9eab744..fe5e70c 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_1f858a "textureNumLayers_1f858a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_1f858a = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_1f858a = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_1f858a
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_1f858a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_1f858a
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_1f858a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_1f858a
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_1f858a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.wgsl
index d08138f..ce2df9f 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/1f858a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_1f858a() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_1f858a();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl
index 376f70d..b8b9391 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<r32float, write>) -> u32
 fn textureNumLayers_3465ec() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
index b8ba0b2..b966ed6 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_3465ec() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
index b8ba0b2..b966ed6 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_3465ec() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.glsl
index 0e7b8e8..0ef28f0 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_3465ec() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_3465ec() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_3465ec() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.msl
index 356deb4..2137269 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_3465ec(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_3465ec(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_3465ec(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_3465ec(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_3465ec(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_3465ec(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_3465ec(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_3465ec(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.spvasm
index fae4592..9e87f31 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_3465ec "textureNumLayers_3465ec"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_3465ec = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_3465ec = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_3465ec
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_3465ec
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_3465ec
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_3465ec
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_3465ec
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_3465ec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.wgsl
index 409c7e8..cb2757a 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_3465ec() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_3465ec();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl
index 881a6d3..cc14dda 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rg32sint, write>) -> u32
 fn textureNumLayers_3580ab() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
index 8ff6e3c..d47a7c6 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_3580ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
index 8ff6e3c..d47a7c6 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_3580ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.msl
index e6235c5..aaf3c1e 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_3580ab(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_3580ab(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_3580ab(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_3580ab(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_3580ab(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_3580ab(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_3580ab(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_3580ab(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.spvasm
index 2e0c867..b9ba8f7 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_3580ab "textureNumLayers_3580ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,42 +45,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_3580ab = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_3580ab = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_3580ab
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_3580ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_3580ab
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_3580ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_3580ab
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_3580ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.wgsl
index 6434d12..510aee0 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_3580ab() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_3580ab();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl
index 5b17e29..1aaeb53 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba8snorm, write>) -> u32
 fn textureNumLayers_4c4333() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
index f4f07a9..f68a984 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_4c4333() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
index f4f07a9..f68a984 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_4c4333() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.glsl
index 0fef0c7..1d5c395 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_4c4333() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_4c4333() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_4c4333() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.msl
index e7e878d..b4f9955 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_4c4333(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_4c4333(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_4c4333(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_4c4333(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_4c4333(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_4c4333(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_4c4333(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_4c4333(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.spvasm
index 942e442..bd24b3f 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_4c4333 "textureNumLayers_4c4333"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_4c4333 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_4c4333 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_4c4333
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_4c4333
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_4c4333
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_4c4333
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_4c4333
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_4c4333
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.wgsl
index 3217266..6b180b5 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_4c4333() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_4c4333();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl
index 6d37cbd..d673fe1 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<r32sint, write>) -> u32
 fn textureNumLayers_59eb57() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
index 6ac9329..350ae83 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_59eb57() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
index 6ac9329..350ae83 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_59eb57() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.glsl
index 5d27d74..af22f02 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_59eb57() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_59eb57() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_59eb57() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.msl
index bc42953..eb3c75b 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_59eb57(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_59eb57(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_59eb57(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_59eb57(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_59eb57(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_59eb57(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_59eb57(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_59eb57(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.spvasm
index 8fdfad3..85c6b71 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_59eb57 "textureNumLayers_59eb57"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_59eb57 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_59eb57 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_59eb57
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_59eb57
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_59eb57
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_59eb57
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_59eb57
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_59eb57
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.wgsl
index eb6df73..0131332 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_59eb57() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_59eb57();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl
index ef61c18..283194a 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba8uint, write>) -> u32
 fn textureNumLayers_61bd23() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
index 89f3e18..9a565a2 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_61bd23() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
index 89f3e18..9a565a2 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_61bd23() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.glsl
index c709957..b661842 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_61bd23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_61bd23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_61bd23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.msl
index cee795a..0b15875 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_61bd23(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_61bd23(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_61bd23(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_61bd23(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_61bd23(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_61bd23(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_61bd23(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_61bd23(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.spvasm
index ca56085..2cc1fbf 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_61bd23 "textureNumLayers_61bd23"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_61bd23 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_61bd23 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_61bd23
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_61bd23
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_61bd23
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_61bd23
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_61bd23
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_61bd23
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.wgsl
index 9a53a59..9b69b1b 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_61bd23() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_61bd23();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl
index a5ece22..ac6eb30 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_2d_array<i32>) -> u32
 fn textureNumLayers_77be7b() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
index baad1e8..283dc9c 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_77be7b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
index baad1e8..283dc9c 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_77be7b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.glsl
index 6af1d4b..f5f87b3 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_77be7b() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_77be7b() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_77be7b() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.msl
index bb749fd..7494a26 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_77be7b(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureNumLayers_77be7b(texture2d_array<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureNumLayers_77be7b(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_77be7b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_77be7b(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_77be7b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_77be7b(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_77be7b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.spvasm
index c5d95de..36ec10d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_77be7b "textureNumLayers_77be7b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_77be7b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %25
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_77be7b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %28
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureNumLayers_77be7b
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureNumLayers_77be7b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLayers_77be7b
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLayers_77be7b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureNumLayers_77be7b
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureNumLayers_77be7b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.wgsl
index e61657d..73c9c8b 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_77be7b() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_77be7b();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl
index 9184fe8..94229f8 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rg32float, write>) -> u32
 fn textureNumLayers_7f28cf() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
index ffe3a19..7429e92 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_7f28cf() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
index ffe3a19..7429e92 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_7f28cf() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.msl
index dfa6427..fe936f0 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_7f28cf(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_7f28cf(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_7f28cf(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_7f28cf(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_7f28cf(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_7f28cf(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_7f28cf(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_7f28cf(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.spvasm
index fae74c5..43de7fa 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_7f28cf "textureNumLayers_7f28cf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_7f28cf = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_7f28cf = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_7f28cf
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_7f28cf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_7f28cf
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_7f28cf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_7f28cf
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_7f28cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.wgsl
index 9315c01..0f1e810 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_7f28cf() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_7f28cf();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl
index 95d81a8..bf3ea7b 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba8sint, write>) -> u32
 fn textureNumLayers_878dea() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
index 60c70b1..2ea7b75 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_878dea() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
index 60c70b1..2ea7b75 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_878dea() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.glsl
index e29de3e..f2f8fe7 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_878dea() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_878dea() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_878dea() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.msl
index 7b10509..408d585 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_878dea(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_878dea(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_878dea(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_878dea(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_878dea(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_878dea(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_878dea(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_878dea(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.spvasm
index 8426d4a..8c4e6d8 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_878dea "textureNumLayers_878dea"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_878dea = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_878dea = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_878dea
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_878dea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_878dea
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_878dea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_878dea
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_878dea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.wgsl
index c164c88..a60c4c7 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_878dea() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_878dea();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl
index 4939ab3..e855d67 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<r32uint, write>) -> u32
 fn textureNumLayers_87faad() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
index 04ccdcf..b3c201d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_87faad() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
index 04ccdcf..b3c201d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_87faad() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.glsl
index 00057ca..a635720 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_87faad() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_87faad() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_87faad() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.msl
index acf16b3..ac13e7f 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_87faad(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_87faad(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_87faad(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_87faad(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_87faad(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_87faad(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_87faad(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_87faad(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.spvasm
index 4a12d33..265840d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_87faad "textureNumLayers_87faad"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_87faad = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_87faad = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_87faad
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_87faad
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_87faad
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_87faad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_87faad
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_87faad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.wgsl
index fcd265c..dc82212 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_87faad() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_87faad();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl
index b3f969b..3c2e0d3 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_2d_array<u32>) -> u32
 fn textureNumLayers_8ac32a() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
index 92e4a10..a0b679a 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8ac32a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
index 92e4a10..a0b679a 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8ac32a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.glsl
index 083cd13..8b87e5c 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8ac32a() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8ac32a() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8ac32a() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.msl
index 218af14..998366f 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_8ac32a(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureNumLayers_8ac32a(texture2d_array<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureNumLayers_8ac32a(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_8ac32a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_8ac32a(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_8ac32a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_8ac32a(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_8ac32a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.spvasm
index febad27..e5e7227 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_8ac32a "textureNumLayers_8ac32a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_8ac32a = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %25
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySizeLod %v3uint %20 %int_0
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_8ac32a = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %28
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %23 %int_0
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureNumLayers_8ac32a
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureNumLayers_8ac32a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLayers_8ac32a
+%fragment_main = OpFunction %void None %16
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLayers_8ac32a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureNumLayers_8ac32a
+%compute_main = OpFunction %void None %16
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureNumLayers_8ac32a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.wgsl
index 65a1ae2..6b4be19 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_8ac32a() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_8ac32a();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl
index 95138eb..c4cba51 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba32sint, write>) -> u32
 fn textureNumLayers_8bd987() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
index dcf3497..d83e727 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8bd987() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
index dcf3497..d83e727 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8bd987() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.glsl
index 9c3f6ec..3c84a10 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8bd987() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8bd987() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8bd987() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.msl
index 004cbbb..9374ece 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_8bd987(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_8bd987(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_8bd987(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_8bd987(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_8bd987(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_8bd987(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_8bd987(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_8bd987(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.spvasm
index bebc91d..9247067 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_8bd987 "textureNumLayers_8bd987"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_8bd987 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_8bd987 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_8bd987
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_8bd987
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_8bd987
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_8bd987
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_8bd987
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_8bd987
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.wgsl
index 7183fb6..971c7ff 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_8bd987() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_8bd987();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl
index 3f42b29..c0a4577 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba8unorm, write>) -> u32
 fn textureNumLayers_8dbf23() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
index 4f752ed..cbff36e 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8dbf23() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
index 4f752ed..cbff36e 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8dbf23() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.glsl
index 9015e24..c00260a 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8dbf23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8dbf23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8dbf23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.msl
index 8643e42..cc0c8ad 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_8dbf23(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_8dbf23(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_8dbf23(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_8dbf23(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_8dbf23(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_8dbf23(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_8dbf23(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_8dbf23(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.spvasm
index 9c3631f..debc253 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_8dbf23 "textureNumLayers_8dbf23"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_8dbf23 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_8dbf23 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_8dbf23
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_8dbf23
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_8dbf23
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_8dbf23
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_8dbf23
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_8dbf23
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.wgsl
index a64feba..f056108 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_8dbf23() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_8dbf23();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl
index d7a18ea..fb2759c 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba32uint, write>) -> u32
 fn textureNumLayers_9695c6() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
index 6ff2f32..48d7d57 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_9695c6() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
index 6ff2f32..48d7d57 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_9695c6() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.glsl
index f8c145d..95cdd1f 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_9695c6() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_9695c6() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_9695c6() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.msl
index 827321c..bacd5a0 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_9695c6(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_9695c6(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_9695c6(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_9695c6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_9695c6(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_9695c6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_9695c6(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_9695c6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.spvasm
index 4d2ffb8..0f626d0 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_9695c6 "textureNumLayers_9695c6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_9695c6 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_9695c6 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_9695c6
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_9695c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_9695c6
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_9695c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_9695c6
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_9695c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.wgsl
index 117a723..dca6cd9 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_9695c6() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_9695c6();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl
index b455e68..de6656d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba16float, write>) -> u32
 fn textureNumLayers_98a9cf() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
index 572767c..c13f3aa 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_98a9cf() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
index 572767c..c13f3aa 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_98a9cf() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.glsl
index b8ccb95..0b00cc7 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_98a9cf() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_98a9cf() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_98a9cf() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.msl
index b8c1954..be7b506 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_98a9cf(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_98a9cf(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_98a9cf(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_98a9cf(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_98a9cf(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_98a9cf(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_98a9cf(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_98a9cf(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.spvasm
index 1908b56..33e1af2 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_98a9cf "textureNumLayers_98a9cf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_98a9cf = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_98a9cf = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_98a9cf
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_98a9cf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_98a9cf
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_98a9cf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_98a9cf
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_98a9cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.wgsl
index aa0b1f9..53de27c 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_98a9cf() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_98a9cf();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl
index 9c1cbc6..937c6ec 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_depth_2d_array) -> u32
 fn textureNumLayers_a9d3f5() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
index fca4556..d14e5ea 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_a9d3f5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
index fca4556..d14e5ea 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_a9d3f5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.glsl
index 9e5f8bc..4705af1 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_a9d3f5() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_a9d3f5() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_a9d3f5() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.msl
index 74a0acb..6467491 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_a9d3f5(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureNumLayers_a9d3f5(depth2d_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureNumLayers_a9d3f5(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_a9d3f5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_a9d3f5(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_a9d3f5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_a9d3f5(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_a9d3f5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.spvasm
index 7d3120e..54a597e 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_a9d3f5 "textureNumLayers_a9d3f5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_a9d3f5 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %25
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySizeLod %v3uint %20 %int_0
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_a9d3f5 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %28
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %23 %int_0
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureNumLayers_a9d3f5
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureNumLayers_a9d3f5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLayers_a9d3f5
+%fragment_main = OpFunction %void None %16
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLayers_a9d3f5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureNumLayers_a9d3f5
+%compute_main = OpFunction %void None %16
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureNumLayers_a9d3f5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.wgsl
index 83afd90..61062bc 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_a9d3f5() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_a9d3f5();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl
index 979ac02..49cc0a2 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba32float, write>) -> u32
 fn textureNumLayers_d75a0b() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
index f358a3d..22a44ee 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_d75a0b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
index f358a3d..22a44ee 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_d75a0b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.glsl
index 597783b..e54aa63 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_d75a0b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_d75a0b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_d75a0b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.msl
index dfc443c..55b2bb6 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_d75a0b(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_d75a0b(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_d75a0b(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_d75a0b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_d75a0b(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_d75a0b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_d75a0b(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_d75a0b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.spvasm
index 7a3a47f..814a33e 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_d75a0b "textureNumLayers_d75a0b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_d75a0b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_d75a0b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_d75a0b
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_d75a0b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_d75a0b
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_d75a0b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_d75a0b
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_d75a0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.wgsl
index c5e7e0e..c1c703e 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_d75a0b() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_d75a0b();
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl
index 647b9db..1409f7e 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba16sint, write>) -> u32
 fn textureNumLayers_de8087() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
index 4502c30..515081d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_de8087() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
index 4502c30..515081d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_de8087() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.glsl
index 6fb197a..6f34c77 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_de8087() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_de8087() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_de8087() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.msl
index cd677f5..8d65220 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_de8087(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_de8087(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_de8087(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_de8087(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_de8087(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_de8087(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_de8087(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_de8087(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.spvasm
index 3065daf..11e2199 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_de8087 "textureNumLayers_de8087"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_de8087 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_de8087 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_de8087
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_de8087
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_de8087
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_de8087
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_de8087
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_de8087
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.wgsl
index fdab8ff..73909d0 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_de8087() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_de8087();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl
index 6068edc..e8abd88 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d_array<u32>) -> u32
 fn textureNumLevels_181090() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.dxc.hlsl
index fa19226..13c1604 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_181090() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.fxc.hlsl
index fa19226..13c1604 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_181090() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.msl
index b685d58..33df0c9 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_181090(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_181090(texture2d_array<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_181090(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_181090(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_181090(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_181090(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_181090(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_181090(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.spvasm
index b2fba9b..fa48fdb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_181090 "textureNumLevels_181090"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_181090 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_181090 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_181090
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_181090
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_181090
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_181090
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_181090
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_181090
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.wgsl
index cca5c8c..94b3345 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_181090() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_181090();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl
index 4aaac8f..dcf7a42 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d<i32>) -> u32
 fn textureNumLevels_1a3fa9() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
index b613075..0c746e4 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_1a3fa9() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
index b613075..0c746e4 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_1a3fa9() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.msl
index a5903ae..19c3fef 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_1a3fa9(texture2d<int, access::sample> tint_symbol_1) {
+void textureNumLevels_1a3fa9(texture2d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureNumLevels_1a3fa9(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_1a3fa9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_1a3fa9(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_1a3fa9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_1a3fa9(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_1a3fa9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.spvasm
index 21e699e..04245ab 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_1a3fa9 "textureNumLevels_1a3fa9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_1a3fa9 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_1a3fa9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_1a3fa9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_1a3fa9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_1a3fa9
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_1a3fa9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_1a3fa9
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_1a3fa9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.wgsl
index f5ad42c..e3b56e3 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_1a3fa9() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_1a3fa9();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl
index f08517f..db3b6c3 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_1d<u32>) -> u32
 fn textureNumLevels_1a7fc3() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
index 72945be..6e53b9d 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_1a7fc3() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
index 72945be..6e53b9d 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_1a7fc3() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.msl
index 7acfb61..aba7503 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_1a7fc3(texture1d<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_1a7fc3(texture1d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_1a7fc3(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_1a7fc3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_1a7fc3(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_1a7fc3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_1a7fc3(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_1a7fc3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.spvasm
index 0a2fd38..60e1576 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_1a7fc3 "textureNumLevels_1a7fc3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,39 +44,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_1a7fc3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_1a7fc3 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_1a7fc3
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_1a7fc3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_1a7fc3
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_1a7fc3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_1a7fc3
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_1a7fc3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.wgsl
index d092a9f..d83c8b0 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_1a7fc3() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_1a7fc3();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl
index 6086ab5..3f33b52 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube<i32>) -> u32
 fn textureNumLevels_2267d8() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
index 0ada818..c3235ba 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2267d8() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
index 0ada818..c3235ba 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2267d8() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.msl
index 082aa8c..c0636d3 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_2267d8(texturecube<int, access::sample> tint_symbol_1) {
+void textureNumLevels_2267d8(texturecube<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
-  textureNumLevels_2267d8(tint_symbol_2);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_2267d8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_2267d8(tint_symbol_4);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_2267d8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_2267d8(tint_symbol_5);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_2267d8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.spvasm
index 0f18866..fc4282a 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_2267d8 "textureNumLevels_2267d8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_2267d8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_2267d8 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_2267d8
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_2267d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_2267d8
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_2267d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_2267d8
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_2267d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.wgsl
index 5714150..2861a38 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_2267d8() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_2267d8();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl
index 1a638e9..a70494c 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d<f32>) -> u32
 fn textureNumLevels_24b2c6() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
index 47607cf..3fd1c1f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_24b2c6() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
index 47607cf..3fd1c1f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_24b2c6() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.msl
index a532f60..37896d6 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_24b2c6(texture2d<float, access::sample> tint_symbol_1) {
+void textureNumLevels_24b2c6(texture2d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureNumLevels_24b2c6(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_24b2c6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_24b2c6(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_24b2c6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_24b2c6(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_24b2c6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.spvasm
index 5e5b33c..7c2e9fd 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_24b2c6 "textureNumLevels_24b2c6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_24b2c6 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_24b2c6 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_24b2c6
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_24b2c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_24b2c6
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_24b2c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_24b2c6
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_24b2c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.wgsl
index 9ffcb78..e30e79c 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_24b2c6() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_24b2c6();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl
index 07b2473..cc2d4e7 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_depth_cube_array) -> u32
 fn textureNumLevels_2bea6c() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
index 62d1125..6b5dac1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2bea6c() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
index 62d1125..6b5dac1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2bea6c() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.msl
index 480e5f0..831fd1f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_2bea6c(depthcube_array<float, access::sample> tint_symbol_1) {
+void textureNumLevels_2bea6c(depthcube_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
-  textureNumLevels_2bea6c(tint_symbol_2);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_2bea6c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_2bea6c(tint_symbol_4);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_2bea6c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_2bea6c(tint_symbol_5);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_2bea6c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.spvasm
index e4cf270..43795a2 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_2bea6c "textureNumLevels_2bea6c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_2bea6c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_2bea6c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_2bea6c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_2bea6c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_2bea6c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_2bea6c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_2bea6c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_2bea6c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.wgsl
index b37c0d6..35e51e4 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_2bea6c() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_2bea6c();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl
index ddc2d13..5e54260 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube<f32>) -> u32
 fn textureNumLevels_2df1ab() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
index 10020ec..75ff97e 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2df1ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
index 10020ec..75ff97e 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2df1ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.msl
index ecf68db..c55e206 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_2df1ab(texturecube<float, access::sample> tint_symbol_1) {
+void textureNumLevels_2df1ab(texturecube<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
-  textureNumLevels_2df1ab(tint_symbol_2);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_2df1ab(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_2df1ab(tint_symbol_4);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_2df1ab(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_2df1ab(tint_symbol_5);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_2df1ab(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.spvasm
index edaef1a..e3f70bd 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_2df1ab "textureNumLevels_2df1ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_2df1ab = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_2df1ab = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_2df1ab
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_2df1ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_2df1ab
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_2df1ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_2df1ab
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_2df1ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.wgsl
index 769cb30..b47a278 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_2df1ab() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_2df1ab();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl
index 9da74a3..c529153 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d_array<f32>) -> u32
 fn textureNumLevels_46dbd8() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
index 496e96a..a6639f1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_46dbd8() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
index 496e96a..a6639f1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_46dbd8() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.msl
index e8b2b34..bde3392 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_46dbd8(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureNumLevels_46dbd8(texture2d_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureNumLevels_46dbd8(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_46dbd8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_46dbd8(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_46dbd8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_46dbd8(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_46dbd8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.spvasm
index ddaa69f..cf9771c 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_46dbd8 "textureNumLevels_46dbd8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_46dbd8 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_46dbd8 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_46dbd8
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_46dbd8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_46dbd8
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_46dbd8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_46dbd8
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_46dbd8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.wgsl
index c2e380d..7d90369 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_46dbd8() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_46dbd8();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl
index 3de5217..ed64701 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_3d<u32>) -> u32
 fn textureNumLevels_60d9b8() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
index 354f39f..ea35f1f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_60d9b8() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
index 354f39f..ea35f1f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_60d9b8() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.msl
index 663fb4b..42ca5c9 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_60d9b8(texture3d<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_60d9b8(texture3d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_60d9b8(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_60d9b8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_60d9b8(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_60d9b8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_60d9b8(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_60d9b8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.spvasm
index 3aed187..e06a448 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_60d9b8 "textureNumLevels_60d9b8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_60d9b8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_60d9b8 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_60d9b8
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_60d9b8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_60d9b8
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_60d9b8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_60d9b8
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_60d9b8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.wgsl
index 70615e2..0d5a4b0 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_60d9b8() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_60d9b8();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl
index 178aec9..45d1837 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube_array<i32>) -> u32
 fn textureNumLevels_903920() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.dxc.hlsl
index c70af53..3751631 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_903920() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.fxc.hlsl
index c70af53..3751631 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_903920() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.msl
index 883fee7..0f008d8 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_903920(texturecube_array<int, access::sample> tint_symbol_1) {
+void textureNumLevels_903920(texturecube_array<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
-  textureNumLevels_903920(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_903920(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_903920(tint_symbol_4);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_903920(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_903920(tint_symbol_5);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_903920(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.spvasm
index ac2e7d7..351701d 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_903920 "textureNumLevels_903920"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_903920 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_903920 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_903920
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_903920
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_903920
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_903920
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_903920
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_903920
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.wgsl
index b924f23..4c2a5fb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_903920() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_903920();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl
index 410ef17..8ac3e10 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_3d<i32>) -> u32
 fn textureNumLevels_9a1a65() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
index 9c9b0cd..a002c04 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_9a1a65() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
index 9c9b0cd..a002c04 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_9a1a65() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.msl
index 548d2fa..c5351b3 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_9a1a65(texture3d<int, access::sample> tint_symbol_1) {
+void textureNumLevels_9a1a65(texture3d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureNumLevels_9a1a65(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_9a1a65(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_9a1a65(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_9a1a65(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_9a1a65(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_9a1a65(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.spvasm
index c308aff..8bfc603 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_9a1a65 "textureNumLevels_9a1a65"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_9a1a65 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_9a1a65 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_9a1a65
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_9a1a65
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_9a1a65
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_9a1a65
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_9a1a65
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_9a1a65
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.wgsl
index e6d5452..dc27971 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_9a1a65() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_9a1a65();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl
index 19188f3..b0973fc 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d_array<i32>) -> u32
 fn textureNumLevels_adc783() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
index 2ec43ed..f9a0a2b 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_adc783() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
index 2ec43ed..f9a0a2b 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_adc783() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.msl
index 47f6910..1292e4b 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_adc783(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureNumLevels_adc783(texture2d_array<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureNumLevels_adc783(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_adc783(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_adc783(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_adc783(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_adc783(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_adc783(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.spvasm
index 30e6a8c..95cf403 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_adc783 "textureNumLevels_adc783"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_adc783 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_adc783 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_adc783
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_adc783
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_adc783
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_adc783
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_adc783
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_adc783
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.wgsl
index b9595bf..c122a94 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_adc783() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_adc783();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl
index f279f4d..73cdfe7 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_depth_2d_array) -> u32
 fn textureNumLevels_ae911c() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
index f17da78..37f639b 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_ae911c() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
index f17da78..37f639b 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_ae911c() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.msl
index 24d1b4a..e55f5cb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_ae911c(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureNumLevels_ae911c(depth2d_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureNumLevels_ae911c(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_ae911c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_ae911c(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_ae911c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_ae911c(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_ae911c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.spvasm
index c50b3b7..4f2923e 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_ae911c "textureNumLevels_ae911c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_ae911c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_ae911c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_ae911c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_ae911c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_ae911c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_ae911c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_ae911c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_ae911c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.wgsl
index de4db0c..4083303 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_ae911c() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_ae911c();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl
index c2befb8..7936a26 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube<u32>) -> u32
 fn textureNumLevels_c386c8() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
index 09ec1bf..ef724e1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c386c8() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
index 09ec1bf..ef724e1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c386c8() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.msl
index 0aa6d50..d9e55a1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_c386c8(texturecube<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_c386c8(texturecube<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_c386c8(tint_symbol_2);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_c386c8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_c386c8(tint_symbol_4);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_c386c8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_c386c8(tint_symbol_5);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_c386c8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.spvasm
index ae0b33e..0b5f2e6 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_c386c8 "textureNumLevels_c386c8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_c386c8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_c386c8 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_c386c8
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_c386c8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_c386c8
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_c386c8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_c386c8
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_c386c8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.wgsl
index a5df507..c8ac8b8 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_c386c8() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_c386c8();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl
index 81e95be..b2507d0 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_1d<f32>) -> u32
 fn textureNumLevels_c399f9() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
index b0e7a2c..d4ce86c 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c399f9() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
index b0e7a2c..d4ce86c 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c399f9() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.msl
index 1b81eda..bd1eca7 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_c399f9(texture1d<float, access::sample> tint_symbol_1) {
+void textureNumLevels_c399f9(texture1d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureNumLevels_c399f9(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_c399f9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_c399f9(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_c399f9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_c399f9(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_c399f9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.spvasm
index ad86c06..8ae2e20 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_c399f9 "textureNumLevels_c399f9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_c399f9 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_c399f9 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_c399f9
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_c399f9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_c399f9
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_c399f9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_c399f9
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_c399f9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.wgsl
index b3bd844..03e6ecf 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_c399f9() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_c399f9();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl
index 814ecdf..f96f248 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_depth_cube) -> u32
 fn textureNumLevels_c8c25c() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
index 82cd2ba..6743680 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c8c25c() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
index 82cd2ba..6743680 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c8c25c() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.msl
index 3373867..fccf754 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_c8c25c(depthcube<float, access::sample> tint_symbol_1) {
+void textureNumLevels_c8c25c(depthcube<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
-  textureNumLevels_c8c25c(tint_symbol_2);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_c8c25c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_c8c25c(tint_symbol_4);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_c8c25c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_c8c25c(tint_symbol_5);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_c8c25c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.spvasm
index 302f9ab..e70c311 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_c8c25c "textureNumLevels_c8c25c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_c8c25c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_c8c25c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_c8c25c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_c8c25c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_c8c25c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_c8c25c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_c8c25c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_c8c25c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.wgsl
index e04b76d..c1deb0a 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_c8c25c() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_c8c25c();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl
index dac0818..dade7bf 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_depth_2d) -> u32
 fn textureNumLevels_d63126() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
index 3ff9634..60c007f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_d63126() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
index 3ff9634..60c007f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_d63126() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.msl
index dbfdf59..37ae504 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_d63126(depth2d<float, access::sample> tint_symbol_1) {
+void textureNumLevels_d63126(depth2d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureNumLevels_d63126(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_d63126(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_d63126(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_d63126(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_d63126(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_d63126(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.spvasm
index 897b81c..3524297 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_d63126 "textureNumLevels_d63126"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_d63126 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_d63126 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_d63126
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_d63126
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_d63126
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_d63126
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_d63126
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_d63126
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.wgsl
index 29d43d5..ed09b6a 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_d63126() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_d63126();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl
index fc67fd5..905433e 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube_array<f32>) -> u32
 fn textureNumLevels_d8f73b() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
index 168d30f..11cdebb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_d8f73b() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
index 168d30f..11cdebb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_d8f73b() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.msl
index 235bcec..305aef1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_d8f73b(texturecube_array<float, access::sample> tint_symbol_1) {
+void textureNumLevels_d8f73b(texturecube_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
-  textureNumLevels_d8f73b(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_d8f73b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_d8f73b(tint_symbol_4);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_d8f73b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_d8f73b(tint_symbol_5);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_d8f73b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.spvasm
index aac36d9..190eb81 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_d8f73b "textureNumLevels_d8f73b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_d8f73b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_d8f73b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_d8f73b
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_d8f73b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_d8f73b
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_d8f73b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_d8f73b
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_d8f73b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.wgsl
index 3aa9f91..88e34f0 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_d8f73b() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_d8f73b();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl
index 3904443..3b5c638 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_3d<f32>) -> u32
 fn textureNumLevels_ef7944() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
index 4b71eed..98c63e3 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_ef7944() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
index 4b71eed..98c63e3 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_ef7944() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.msl
index e63ad5f..25fcf3b 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_ef7944(texture3d<float, access::sample> tint_symbol_1) {
+void textureNumLevels_ef7944(texture3d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureNumLevels_ef7944(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_ef7944(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_ef7944(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_ef7944(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_ef7944(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_ef7944(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.spvasm
index b1b27b3..b48d9fb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_ef7944 "textureNumLevels_ef7944"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_ef7944 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_ef7944 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_ef7944
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_ef7944
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_ef7944
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_ef7944
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_ef7944
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_ef7944
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.wgsl
index cdf4c05..4c8b8ee 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_ef7944() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_ef7944();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl
index 3304810..b539f8f 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d<u32>) -> u32
 fn textureNumLevels_efd6df() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
index d053690..966eba3 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_efd6df() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
index d053690..966eba3 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_efd6df() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.msl
index d0e4baf..f4bbbef 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_efd6df(texture2d<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_efd6df(texture2d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_efd6df(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_efd6df(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_efd6df(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_efd6df(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_efd6df(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_efd6df(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.spvasm
index 818380b..dfd2ee5 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_efd6df "textureNumLevels_efd6df"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_efd6df = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_efd6df = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_efd6df
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_efd6df
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_efd6df
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_efd6df
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_efd6df
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_efd6df
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.wgsl
index 2f962e4..c490e1d 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_efd6df() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_efd6df();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl
index 8dbf86d..f99ab50 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_1d<i32>) -> u32
 fn textureNumLevels_f742c0() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
index e909b27..b9333cb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_f742c0() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
index e909b27..b9333cb 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_f742c0() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.msl
index e4bd743..2336b43 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_f742c0(texture1d<int, access::sample> tint_symbol_1) {
+void textureNumLevels_f742c0(texture1d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureNumLevels_f742c0(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_f742c0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_f742c0(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_f742c0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_f742c0(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_f742c0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.spvasm
index 2cbb0e7..941bfc4 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_f742c0 "textureNumLevels_f742c0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_f742c0 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_f742c0 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_f742c0
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_f742c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_f742c0
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_f742c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_f742c0
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_f742c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.wgsl
index 37f7f4c..0bdb1e0 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_f742c0() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_f742c0();
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl
index 2a5c129..9d8e930 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube_array<u32>) -> u32
 fn textureNumLevels_fe2171() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
index 622e968..30809fa 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_fe2171() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
index 622e968..30809fa 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_fe2171() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.msl
index a8221bf..02dc2ad 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_fe2171(texturecube_array<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_fe2171(texturecube_array<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_fe2171(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_fe2171(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_fe2171(tint_symbol_4);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_fe2171(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_fe2171(tint_symbol_5);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_fe2171(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.spvasm
index 1382ffe..eaafde1 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_fe2171 "textureNumLevels_fe2171"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,39 +44,47 @@
          %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_fe2171 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_fe2171 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_fe2171
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_fe2171
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_fe2171
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_fe2171
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_fe2171
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_fe2171
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.wgsl
index 8a0ab54..85b2ab7 100644
--- a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_fe2171() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_fe2171();
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl
index 47d2f3d..4c96b67 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumSamples(texture: texture_multisampled_2d<u32>) -> u32
 fn textureNumSamples_50f399() {
   var res: u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
index bfe4d22..3238202 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_50f399() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
index bfe4d22..3238202 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_50f399() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.msl
index 4de37b0..478120f 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumSamples_50f399(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureNumSamples_50f399(texture2d_ms<uint, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_samples();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureNumSamples_50f399(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumSamples_50f399(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureNumSamples_50f399(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumSamples_50f399(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureNumSamples_50f399(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumSamples_50f399(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.spvasm
index 57be983..3058e52 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumSamples_50f399 "textureNumSamples_50f399"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumSamples_50f399 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySamples %uint %18
-               OpStore %res %17
+%textureNumSamples_50f399 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySamples %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumSamples_50f399
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumSamples_50f399
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumSamples_50f399
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumSamples_50f399
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumSamples_50f399
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumSamples_50f399
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.wgsl
index a2d6199..f03e792 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumSamples_50f399() {
   var res : u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumSamples_50f399();
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl
index dbae081..0194a29 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumSamples(texture: texture_multisampled_2d<i32>) -> u32
 fn textureNumSamples_c1a777() {
   var res: u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
index 4998404..480fde4 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_c1a777() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
index 4998404..480fde4 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_c1a777() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.msl
index a8cdede..023ee06 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumSamples_c1a777(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureNumSamples_c1a777(texture2d_ms<int, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_samples();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureNumSamples_c1a777(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumSamples_c1a777(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureNumSamples_c1a777(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumSamples_c1a777(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureNumSamples_c1a777(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumSamples_c1a777(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.spvasm
index cb9cc2a..e41c69d 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumSamples_c1a777 "textureNumSamples_c1a777"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumSamples_c1a777 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySamples %uint %19
-               OpStore %res %17
+%textureNumSamples_c1a777 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySamples %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumSamples_c1a777
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumSamples_c1a777
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumSamples_c1a777
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumSamples_c1a777
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumSamples_c1a777
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumSamples_c1a777
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.wgsl
index 564ccf5..3f8f245 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumSamples_c1a777() {
   var res : u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumSamples_c1a777();
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl
index 5c9fcbb..22c7d5a 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumSamples(texture: texture_multisampled_2d<f32>) -> u32
 fn textureNumSamples_dbb799() {
   var res: u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
index 1878090..99e1f67 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_dbb799() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
index 1878090..99e1f67 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_dbb799() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.msl
index 2d6f774..a078949 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumSamples_dbb799(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureNumSamples_dbb799(texture2d_ms<float, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_samples();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureNumSamples_dbb799(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumSamples_dbb799(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureNumSamples_dbb799(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumSamples_dbb799(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureNumSamples_dbb799(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumSamples_dbb799(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.spvasm
index b48af47..966775b 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumSamples_dbb799 "textureNumSamples_dbb799"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumSamples_dbb799 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySamples %uint %18
-               OpStore %res %16
+%textureNumSamples_dbb799 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySamples %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumSamples_dbb799
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumSamples_dbb799
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumSamples_dbb799
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumSamples_dbb799
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumSamples_dbb799
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumSamples_dbb799
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.wgsl
index 79ad99b..3709e3d 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumSamples_dbb799() {
   var res : u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumSamples_dbb799();
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl
index 9389a95..7e415b4 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumSamples(texture: texture_depth_multisampled_2d) -> u32
 fn textureNumSamples_ecd321() {
   var res: u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
index 9015e45..658aa82 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_ecd321() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
index 9015e45..658aa82 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_ecd321() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.msl
index 95ee5b4..f9a55fb 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumSamples_ecd321(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureNumSamples_ecd321(depth2d_ms<float, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_samples();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureNumSamples_ecd321(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumSamples_ecd321(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureNumSamples_ecd321(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumSamples_ecd321(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureNumSamples_ecd321(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumSamples_ecd321(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.spvasm
index 41ea05b..a818da2 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumSamples_ecd321 "textureNumSamples_ecd321"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumSamples_ecd321 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySamples %uint %18
-               OpStore %res %16
+%textureNumSamples_ecd321 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySamples %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumSamples_ecd321
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumSamples_ecd321
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumSamples_ecd321
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumSamples_ecd321
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumSamples_ecd321
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumSamples_ecd321
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.wgsl
index 881972a..03ec0cb 100644
--- a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumSamples_ecd321() {
   var res : u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumSamples_ecd321();
diff --git a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl
index a85b019..21bad82 100644
--- a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> f32
 fn textureSample_0dff6c() {
   var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.dxc.hlsl
index b1bd4db..7a7f59e 100644
--- a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_0dff6c() {
   float res = arg_0.Sample(arg_1, (1.0f).xx, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_0dff6c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.fxc.hlsl
index b1bd4db..916a939 100644
--- a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_0dff6c() {
   float res = arg_0.Sample(arg_1, (1.0f).xx, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.glsl
index 569c11d..b5e60ce 100644
--- a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_0dff6c() {
   float res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.msl
index 921da0e..7124a24 100644
--- a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_0dff6c(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_0dff6c(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float2(1.0f), int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_0dff6c(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_0dff6c(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.spvasm
index f904425..49c202f 100644
--- a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_0dff6c "textureSample_0dff6c"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,32 +30,41 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %25 = OpConstantComposite %v2int %int_1 %int_1
+         %28 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %28 = OpConstantNull %float
-%textureSample_0dff6c = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %28
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %13 = OpImageSampleImplicitLod %v4float %18 %21 ConstOffset %25
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %31 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_0dff6c = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %31
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %16 = OpImageSampleImplicitLod %v4float %21 %24 ConstOffset %28
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureSample_0dff6c
+%fragment_main = OpFunction %void None %11
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureSample_0dff6c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.wgsl
index 077f24e..90085f2 100644
--- a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_0dff6c() {
   var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_0dff6c();
diff --git a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl
index 270ed3c..848bc13 100644
--- a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSample_17e988() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.dxc.hlsl
index 0d08b8a..8fa1242 100644
--- a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_17e988() {
   float4 res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_17e988();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.fxc.hlsl
index 0d08b8a..fa45f3c 100644
--- a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_17e988() {
   float4 res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.glsl
index e7e4671..28a5429 100644
--- a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_17e988() {
   vec4 res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.msl
index a0488ff..c47bbce 100644
--- a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_17e988(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_17e988(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_17e988(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_17e988(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.spvasm
index 577289c..e17682e 100644
--- a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_17e988 "textureSample_17e988"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,36 +30,45 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %29 = OpConstantComposite %v2int %int_1 %int_1
+         %32 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpConstantNull %v4float
-%textureSample_17e988 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %32
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpConvertSToF %float %int_1
-         %27 = OpCompositeConstruct %v3float %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27 ConstOffset %29
-               OpStore %res %12
+         %35 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_17e988 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %35
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpConvertSToF %float %int_1
+         %30 = OpCompositeConstruct %v3float %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30 ConstOffset %32
+               OpStore %res %16
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureSample_17e988
+%fragment_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureSample_17e988
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.wgsl
index 4f40854..12f19a2 100644
--- a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_17e988() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_17e988();
diff --git a/test/tint/builtins/gen/literal/textureSample/193203.wgsl b/test/tint/builtins/gen/literal/textureSample/193203.wgsl
index 7e6f166..0b3514d 100644
--- a/test/tint/builtins/gen/literal/textureSample/193203.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/193203.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSample_193203() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.dxc.hlsl
index 6c65bd9..2d617a1 100644
--- a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_193203() {
   float4 res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_193203();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.fxc.hlsl
index 6c65bd9..58e2ec3 100644
--- a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_193203() {
   float4 res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1u)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.glsl
index d937f89..b1938cd 100644
--- a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_193203() {
   vec4 res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.msl
index 94f0b02..291f84e 100644
--- a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_193203(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_193203(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1u, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_193203(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_193203(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.spvasm
index 23ed9ec..04a4897 100644
--- a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_193203 "textureSample_193203"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,38 +30,46 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %31 = OpConstantComposite %v2int %int_1 %int_1
+         %34 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpConstantNull %v4float
-%textureSample_193203 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %34
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpConvertUToF %float %uint_1
-         %27 = OpCompositeConstruct %v3float %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27 ConstOffset %31
-               OpStore %res %12
+         %37 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_193203 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %37
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpConvertUToF %float %uint_1
+         %30 = OpCompositeConstruct %v3float %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30 ConstOffset %34
+               OpStore %res %16
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %41 = OpLoad %v4float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureSample_193203
+%fragment_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSample_193203
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.wgsl
index 1338058..a9d3456 100644
--- a/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/193203.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_193203() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_193203();
diff --git a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl
index ecd6c55..d03fad6 100644
--- a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32) -> f32
 fn textureSample_1a4e1b() {
   var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.dxc.hlsl
index 48c3a12..42b5a71 100644
--- a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_1a4e1b() {
   float res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.fxc.hlsl
index 48c3a12..42b5a71 100644
--- a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_1a4e1b() {
   float res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.glsl
index eb3bbf5..b4aa95d 100644
--- a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_1a4e1b() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1u)), 0.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.msl
index f128704..3bf74ff 100644
--- a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_1a4e1b(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_1a4e1b(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1u);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_1a4e1b(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_1a4e1b(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.spvasm
index bfb607d..ab416db 100644
--- a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_1a4e1b "textureSample_1a4e1b"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,35 +30,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %25 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %31 = OpConstantNull %float
-%textureSample_1a4e1b = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %31
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %23 = OpCompositeExtract %float %22 0
-         %24 = OpCompositeExtract %float %22 1
-         %25 = OpConvertUToF %float %uint_1
-         %28 = OpCompositeConstruct %v3float %23 %24 %25
-         %13 = OpImageSampleImplicitLod %v4float %18 %28
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %34 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_1a4e1b = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %34
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %26 = OpCompositeExtract %float %25 0
+         %27 = OpCompositeExtract %float %25 1
+         %28 = OpConvertUToF %float %uint_1
+         %31 = OpCompositeConstruct %v3float %26 %27 %28
+         %16 = OpImageSampleImplicitLod %v4float %21 %31
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %37 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %38 = OpLoad %float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSample_1a4e1b
+%fragment_main = OpFunction %void None %11
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSample_1a4e1b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.wgsl
index ddcf5c1..0fb5489 100644
--- a/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/1a4e1b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_1a4e1b() {
   var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_1a4e1b();
diff --git a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl
index 28cf0ec..64f8d12 100644
--- a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, @const offset: vec3<i32>) -> vec4<f32>
 fn textureSample_2149ec() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.f), vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.dxc.hlsl
index 3d19892..3c10c67 100644
--- a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_2149ec() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xxx, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_2149ec();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.fxc.hlsl
index 3d19892..cdebcd3 100644
--- a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_2149ec() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xxx, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.glsl
index f84b20c..0fecc76 100644
--- a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_2149ec() {
   vec4 res = textureOffset(arg_0_arg_1, vec3(1.0f), ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.msl
index 8a65f3f..7540191 100644
--- a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_2149ec(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_2149ec(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f), int3(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_2149ec(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_2149ec(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.spvasm
index a239621..5f86952 100644
--- a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_2149ec "textureSample_2149ec"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,31 +30,40 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %24 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %27 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %27 = OpConstantNull %v4float
-%textureSample_2149ec = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %27
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20 ConstOffset %24
-               OpStore %res %12
+         %30 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_2149ec = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %30
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23 ConstOffset %27
+               OpStore %res %16
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureSample_2149ec
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureSample_2149ec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.wgsl
index 35374f7..608f3b9 100644
--- a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_2149ec() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.0f), vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_2149ec();
diff --git a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl
index 051eaf5..b703230 100644
--- a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>) -> f32
 fn textureSample_38bbb9() {
   var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.dxc.hlsl
index e03d4c2..9b53ecd 100644
--- a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_38bbb9() {
   float res = arg_0.Sample(arg_1, (1.0f).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.fxc.hlsl
index e03d4c2..9b53ecd 100644
--- a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_38bbb9() {
   float res = arg_0.Sample(arg_1, (1.0f).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.glsl
index 416111a..02abe9c 100644
--- a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_38bbb9() {
   float res = texture(arg_0_arg_1, vec3(vec2(1.0f), 0.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.msl
index cf5b10f..adba386 100644
--- a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_38bbb9(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_38bbb9(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float2(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_38bbb9(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_38bbb9(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.spvasm
index dea5bc7..6b68891 100644
--- a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_38bbb9 "textureSample_38bbb9"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,28 +30,37 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %24 = OpConstantNull %float
-%textureSample_38bbb9 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %24
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %13 = OpImageSampleImplicitLod %v4float %18 %21
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %27 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_38bbb9 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %27
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %16 = OpImageSampleImplicitLod %v4float %21 %24
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %31 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %32 = OpLoad %float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureSample_38bbb9
+%fragment_main = OpFunction %void None %11
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureSample_38bbb9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.wgsl
index 5289739..b20723c 100644
--- a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_38bbb9() {
   var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_38bbb9();
diff --git a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl
index 788c36c..2f3e0e2 100644
--- a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32>
 fn textureSample_3b50bd() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.dxc.hlsl
index e0704fc..e83f125 100644
--- a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_3b50bd() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.fxc.hlsl
index e0704fc..e83f125 100644
--- a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_3b50bd() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.glsl
index dee9372..81bebca 100644
--- a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_3b50bd() {
   vec4 res = texture(arg_0_arg_1, vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.msl
index a468d12..f73fceb 100644
--- a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_3b50bd(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_3b50bd(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_3b50bd(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_3b50bd(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.spvasm
index 688f51c..f1a884d 100644
--- a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_3b50bd "textureSample_3b50bd"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,27 +30,36 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpConstantNull %v4float
-%textureSample_3b50bd = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %23
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20
-               OpStore %res %12
+         %26 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_3b50bd = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %26
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23
+               OpStore %res %16
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureSample_3b50bd
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureSample_3b50bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.wgsl
index 8c8a881..720ab7f 100644
--- a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_3b50bd() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_3b50bd();
diff --git a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl
index 9ba4e8b..cdf6f00 100644
--- a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32, @const offset: vec2<i32>) -> f32
 fn textureSample_4703d0() {
   var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.dxc.hlsl
index fc84a42..bc8a4a6 100644
--- a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_4703d0() {
   float res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1u)), (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_4703d0();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.fxc.hlsl
index fc84a42..5800e2e 100644
--- a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_4703d0() {
   float res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1u)), (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.msl
index 4fb976b..a71513f 100644
--- a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_4703d0(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_4703d0(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1u, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_4703d0(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_4703d0(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.spvasm
index e0a5ff8..8aaa966 100644
--- a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_4703d0 "textureSample_4703d0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,39 +30,47 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %25 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %32 = OpConstantComposite %v2int %int_1 %int_1
+         %35 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpConstantNull %float
-%textureSample_4703d0 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %35
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %23 = OpCompositeExtract %float %22 0
-         %24 = OpCompositeExtract %float %22 1
-         %25 = OpConvertUToF %float %uint_1
-         %28 = OpCompositeConstruct %v3float %23 %24 %25
-         %13 = OpImageSampleImplicitLod %v4float %18 %28 ConstOffset %32
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %38 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_4703d0 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %38
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %26 = OpCompositeExtract %float %25 0
+         %27 = OpCompositeExtract %float %25 1
+         %28 = OpConvertUToF %float %uint_1
+         %31 = OpCompositeConstruct %v3float %26 %27 %28
+         %16 = OpImageSampleImplicitLod %v4float %21 %31 ConstOffset %35
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %41 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %42 = OpLoad %float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSample_4703d0
+%fragment_main = OpFunction %void None %11
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureSample_4703d0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.wgsl
index 26fc828..6097ee2 100644
--- a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_4703d0() {
   var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_4703d0();
diff --git a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl
index a7caecb..73af78e 100644
--- a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: i32) -> vec4<f32>
 fn textureSample_4dd1bf() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.dxc.hlsl
index 29b4291..af00377 100644
--- a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_4dd1bf() {
   float4 res = arg_0.Sample(arg_1, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.fxc.hlsl
index 29b4291..af00377 100644
--- a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_4dd1bf() {
   float4 res = arg_0.Sample(arg_1, float4((1.0f).xxx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.msl
index c6fdd3b..0f9b35c 100644
--- a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_4dd1bf(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_4dd1bf(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f), 1);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_4dd1bf(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_4dd1bf(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.spvasm
index 5a24085..a925abd 100644
--- a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_4dd1bf "textureSample_4dd1bf"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,34 +31,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpConstantNull %v4float
-%textureSample_4dd1bf = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %30
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpCompositeExtract %float %20 2
-         %24 = OpConvertSToF %float %int_1
-         %27 = OpCompositeConstruct %v4float %21 %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27
-               OpStore %res %12
+         %33 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_4dd1bf = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %33
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpCompositeExtract %float %23 2
+         %27 = OpConvertSToF %float %int_1
+         %30 = OpCompositeConstruct %v4float %24 %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30
+               OpStore %res %16
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSample_4dd1bf
+%fragment_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSample_4dd1bf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.wgsl
index 8c22933..f6bbed7 100644
--- a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_4dd1bf() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_4dd1bf();
diff --git a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl
index c896790..5aeb6a7 100644
--- a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
 fn textureSample_51b514() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.dxc.hlsl
index f2a4363..7649a83 100644
--- a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_51b514() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.fxc.hlsl
index f2a4363..7649a83 100644
--- a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_51b514() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.glsl
index f342935..12da042 100644
--- a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_51b514() {
   vec4 res = texture(arg_0_arg_1, vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.msl
index fc21a11..65cff29 100644
--- a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_51b514(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_51b514(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_51b514(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_51b514(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.spvasm
index c60d0d9a..5bb6740 100644
--- a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_51b514 "textureSample_51b514"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,27 +30,36 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %23 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpConstantNull %v4float
-%textureSample_51b514 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %23
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20
-               OpStore %res %12
+         %26 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_51b514 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %26
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23
+               OpStore %res %16
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureSample_51b514
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureSample_51b514
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.wgsl
index f2c44d4..bf064f0 100644
--- a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_51b514() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_51b514();
diff --git a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl
index c7b3649..72f4c1a 100644
--- a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32, @const offset: vec2<i32>) -> f32
 fn textureSample_60bf45() {
   var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.dxc.hlsl
index cd9ed54..df72aac 100644
--- a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_60bf45() {
   float res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1)), (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_60bf45();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.fxc.hlsl
index cd9ed54..1b02fb3 100644
--- a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_60bf45() {
   float res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1)), (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.msl
index a1c4154..bc8e8ac 100644
--- a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_60bf45(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_60bf45(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_60bf45(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_60bf45(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.spvasm
index 07330a4..55f5154 100644
--- a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_60bf45 "textureSample_60bf45"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,37 +30,46 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %25 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %30 = OpConstantComposite %v2int %int_1 %int_1
+         %33 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpConstantNull %float
-%textureSample_60bf45 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %33
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %23 = OpCompositeExtract %float %22 0
-         %24 = OpCompositeExtract %float %22 1
-         %25 = OpConvertSToF %float %int_1
-         %28 = OpCompositeConstruct %v3float %23 %24 %25
-         %13 = OpImageSampleImplicitLod %v4float %18 %28 ConstOffset %30
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %36 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_60bf45 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %36
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %26 = OpCompositeExtract %float %25 0
+         %27 = OpCompositeExtract %float %25 1
+         %28 = OpConvertSToF %float %int_1
+         %31 = OpCompositeConstruct %v3float %26 %27 %28
+         %16 = OpImageSampleImplicitLod %v4float %21 %31 ConstOffset %33
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %40 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %41 = OpLoad %float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSample_60bf45
+%fragment_main = OpFunction %void None %11
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSample_60bf45
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.wgsl
index 1ad211e..a81673e 100644
--- a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_60bf45() {
   var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_60bf45();
diff --git a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl
index d0f47d7..943d9f3 100644
--- a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32) -> vec4<f32>
 fn textureSample_6717ca() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.dxc.hlsl
index 7bb8465..19884fd 100644
--- a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_6717ca() {
   float4 res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.fxc.hlsl
index 7bb8465..19884fd 100644
--- a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_6717ca() {
   float4 res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.glsl
index 2a02847..12207a6 100644
--- a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_6717ca() {
   vec4 res = texture(arg_0_arg_1, vec3(vec2(1.0f), float(1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.msl
index 4d43b99..f899a06 100644
--- a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_6717ca(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_6717ca(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_6717ca(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_6717ca(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.spvasm
index 791030f..ca8d5eb 100644
--- a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_6717ca "textureSample_6717ca"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,34 +30,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpConstantNull %v4float
-%textureSample_6717ca = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %30
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpConvertSToF %float %int_1
-         %27 = OpCompositeConstruct %v3float %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27
-               OpStore %res %12
+         %33 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_6717ca = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %33
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpConvertSToF %float %int_1
+         %30 = OpCompositeConstruct %v3float %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30
+               OpStore %res %16
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSample_6717ca
+%fragment_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSample_6717ca
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.wgsl
index 294089d..e579ef4 100644
--- a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_6717ca() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_6717ca();
diff --git a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl
index 20676b9..34f3d70 100644
--- a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_1d<f32>, sampler: sampler, coords: f32) -> vec4<f32>
 fn textureSample_6e64fb() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.dxc.hlsl
index 40f4e00..58b9445 100644
--- a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture1D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_6e64fb() {
   float4 res = arg_0.Sample(arg_1, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.fxc.hlsl
index 40f4e00..58b9445 100644
--- a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture1D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_6e64fb() {
   float4 res = arg_0.Sample(arg_1, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.glsl
index 0563cdf5..4fcca05 100644
--- a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_6e64fb() {
   vec4 res = texture(arg_0_arg_1, vec2(1.0f, 0.5f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.msl
index 03d92d6..4af8a59 100644
--- a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_6e64fb(texture1d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_6e64fb(texture1d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, 1.0f);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_6e64fb(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_6e64fb(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.spvasm
index 83a8589..d7d1329 100644
--- a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_6e64fb "textureSample_6e64fb"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,25 +31,34 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %float_1 = OpConstant %float 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpConstantNull %v4float
-%textureSample_6e64fb = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %21
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %float_1
-               OpStore %res %12
+         %24 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_6e64fb = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %24
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %float_1
+               OpStore %res %16
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %29 = OpLoad %v4float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %textureSample_6e64fb
+%fragment_main = OpFunction %void None %12
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureSample_6e64fb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.wgsl
index 9109eb4..38b13c4 100644
--- a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_6e64fb() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_6e64fb();
diff --git a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl
index e59e22d..19c2863 100644
--- a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32) -> f32
 fn textureSample_7e9ffd() {
   var res: f32 = textureSample(arg_0, arg_1, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.dxc.hlsl
index ca968eb..f6defad 100644
--- a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_7e9ffd() {
   float res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.fxc.hlsl
index ca968eb..f6defad 100644
--- a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_7e9ffd() {
   float res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.glsl
index 71f476b..9d8a2f7 100644
--- a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_7e9ffd() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1)), 0.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.msl
index 0c46324..b729ba0 100644
--- a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_7e9ffd(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_7e9ffd(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_7e9ffd(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_7e9ffd(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.spvasm
index 78b2484..191ae26 100644
--- a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_7e9ffd "textureSample_7e9ffd"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,35 +30,44 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %25 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %31 = OpConstantNull %float
-%textureSample_7e9ffd = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %31
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %23 = OpCompositeExtract %float %22 0
-         %24 = OpCompositeExtract %float %22 1
-         %25 = OpConvertSToF %float %int_1
-         %28 = OpCompositeConstruct %v3float %23 %24 %25
-         %13 = OpImageSampleImplicitLod %v4float %18 %28
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %34 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_7e9ffd = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %34
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %26 = OpCompositeExtract %float %25 0
+         %27 = OpCompositeExtract %float %25 1
+         %28 = OpConvertSToF %float %int_1
+         %31 = OpCompositeConstruct %v3float %26 %27 %28
+         %16 = OpImageSampleImplicitLod %v4float %21 %31
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %38 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %39 = OpLoad %float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSample_7e9ffd
+%fragment_main = OpFunction %void None %11
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureSample_7e9ffd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.wgsl
index 7b6b971..53ffd7c 100644
--- a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_7e9ffd() {
   var res : f32 = textureSample(arg_0, arg_1, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_7e9ffd();
diff --git a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl
index e6e7dac..50de6cc 100644
--- a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: u32) -> f32
 fn textureSample_7fd8cb() {
   var res: f32 = textureSample(arg_0, arg_1, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.dxc.hlsl
index 72ac331..b6e1551 100644
--- a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_7fd8cb() {
   float res = arg_0.Sample(arg_1, float4((1.0f).xxx, float(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.fxc.hlsl
index 72ac331..b6e1551 100644
--- a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_7fd8cb() {
   float res = arg_0.Sample(arg_1, float4((1.0f).xxx, float(1u))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.msl
index b4a8598..3165ff1 100644
--- a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_7fd8cb(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_7fd8cb(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float3(1.0f), 1u);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_7fd8cb(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_7fd8cb(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.spvasm
index dd12402..4d12d4b 100644
--- a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_7fd8cb "textureSample_7fd8cb"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,35 +31,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %31 = OpConstantNull %float
-%textureSample_7fd8cb = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %31
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpCompositeExtract %float %21 2
-         %25 = OpConvertUToF %float %uint_1
-         %28 = OpCompositeConstruct %v4float %22 %23 %24 %25
-         %13 = OpImageSampleImplicitLod %v4float %18 %28
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %34 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_7fd8cb = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %34
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpCompositeExtract %float %24 2
+         %28 = OpConvertUToF %float %uint_1
+         %31 = OpCompositeConstruct %v4float %25 %26 %27 %28
+         %16 = OpImageSampleImplicitLod %v4float %21 %31
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %37 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %38 = OpLoad %float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSample_7fd8cb
+%fragment_main = OpFunction %void None %11
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSample_7fd8cb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.wgsl
index efb9aa8..6e17369 100644
--- a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_7fd8cb() {
   var res : f32 = textureSample(arg_0, arg_1, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_7fd8cb();
diff --git a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl
index 62b34f6..5fe486c 100644
--- a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSample_85c4ba() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.dxc.hlsl
index 7805be0..cd5043e 100644
--- a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_85c4ba() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_85c4ba();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.fxc.hlsl
index 7805be0..eea2b8c 100644
--- a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_85c4ba() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.glsl
index d2c3fdf..d000575 100644
--- a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_85c4ba() {
   vec4 res = textureOffset(arg_0_arg_1, vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.msl
index 8166410..cc6765a 100644
--- a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_85c4ba(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_85c4ba(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_85c4ba(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_85c4ba(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.spvasm
index c10c796..7740531 100644
--- a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_85c4ba "textureSample_85c4ba"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,31 +30,40 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %23 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %24 = OpConstantComposite %v2int %int_1 %int_1
+         %27 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %27 = OpConstantNull %v4float
-%textureSample_85c4ba = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %27
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20 ConstOffset %24
-               OpStore %res %12
+         %30 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_85c4ba = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %30
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23 ConstOffset %27
+               OpStore %res %16
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureSample_85c4ba
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureSample_85c4ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.wgsl
index aadd3ad..cf1dbd6 100644
--- a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_85c4ba() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_85c4ba();
diff --git a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl
index 44f9a7f..a146f3e 100644
--- a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: u32) -> vec4<f32>
 fn textureSample_bc7477() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.dxc.hlsl
index 77241f8..5828580 100644
--- a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_bc7477() {
   float4 res = arg_0.Sample(arg_1, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.fxc.hlsl
index 77241f8..5828580 100644
--- a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_bc7477() {
   float4 res = arg_0.Sample(arg_1, float4((1.0f).xxx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.msl
index 8391338..1db02c8 100644
--- a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_bc7477(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_bc7477(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f), 1u);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_bc7477(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_bc7477(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.spvasm
index f4bea58..dda682e 100644
--- a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_bc7477 "textureSample_bc7477"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,34 +31,42 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpConstantNull %v4float
-%textureSample_bc7477 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %30
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpCompositeExtract %float %20 2
-         %24 = OpConvertUToF %float %uint_1
-         %27 = OpCompositeConstruct %v4float %21 %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27
-               OpStore %res %12
+         %33 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_bc7477 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %33
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpCompositeExtract %float %23 2
+         %27 = OpConvertUToF %float %uint_1
+         %30 = OpCompositeConstruct %v4float %24 %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30
+               OpStore %res %16
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSample_bc7477
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSample_bc7477
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.wgsl
index 9dcbcfa..5f0bc2c 100644
--- a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_bc7477() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_bc7477();
diff --git a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl
index f694b6d..10466f8 100644
--- a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: i32) -> f32
 fn textureSample_c2f4e8() {
   var res: f32 = textureSample(arg_0, arg_1, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.dxc.hlsl
index 26b5e6f..63e62b1 100644
--- a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_c2f4e8() {
   float res = arg_0.Sample(arg_1, float4((1.0f).xxx, float(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.fxc.hlsl
index 26b5e6f..63e62b1 100644
--- a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_c2f4e8() {
   float res = arg_0.Sample(arg_1, float4((1.0f).xxx, float(1))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.msl
index 27a85f2..fbca80b 100644
--- a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_c2f4e8(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_c2f4e8(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float3(1.0f), 1);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_c2f4e8(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_c2f4e8(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.spvasm
index fde2213..20ec967 100644
--- a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_c2f4e8 "textureSample_c2f4e8"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,35 +31,44 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %31 = OpConstantNull %float
-%textureSample_c2f4e8 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %31
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpCompositeExtract %float %21 2
-         %25 = OpConvertSToF %float %int_1
-         %28 = OpCompositeConstruct %v4float %22 %23 %24 %25
-         %13 = OpImageSampleImplicitLod %v4float %18 %28
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %34 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_c2f4e8 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %34
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpCompositeExtract %float %24 2
+         %28 = OpConvertSToF %float %int_1
+         %31 = OpCompositeConstruct %v4float %25 %26 %27 %28
+         %16 = OpImageSampleImplicitLod %v4float %21 %31
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %38 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %39 = OpLoad %float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSample_c2f4e8
+%fragment_main = OpFunction %void None %11
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureSample_c2f4e8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.wgsl
index 9d26633..8d6bf29 100644
--- a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_c2f4e8() {
   var res : f32 = textureSample(arg_0, arg_1, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_c2f4e8();
diff --git a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl
index 7aeff75..e4cfbc7 100644
--- a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32) -> vec4<f32>
 fn textureSample_d6b281() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.dxc.hlsl
index 969ed3d..1bc4bbc 100644
--- a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_d6b281() {
   float4 res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.fxc.hlsl
index 969ed3d..1bc4bbc 100644
--- a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_d6b281() {
   float4 res = arg_0.Sample(arg_1, float3((1.0f).xx, float(1u)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.glsl
index e2d3e57..685201c 100644
--- a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_d6b281() {
   vec4 res = texture(arg_0_arg_1, vec3(vec2(1.0f), float(1u)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.msl
index 8f6e17e..9115fc8 100644
--- a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_d6b281(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_d6b281(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1u);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_d6b281(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_d6b281(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.spvasm
index 89da249..cc76c5c 100644
--- a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_d6b281 "textureSample_d6b281"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,34 +30,42 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpConstantNull %v4float
-%textureSample_d6b281 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %30
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpConvertUToF %float %uint_1
-         %27 = OpCompositeConstruct %v3float %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27
-               OpStore %res %12
+         %33 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_d6b281 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %33
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpConvertUToF %float %uint_1
+         %30 = OpCompositeConstruct %v3float %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30
+               OpStore %res %16
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSample_d6b281
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSample_d6b281
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.wgsl
index 351d73e..b5d23b8 100644
--- a/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/d6b281.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_d6b281() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_d6b281();
diff --git a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl
index e0e2213..5002ed0 100644
--- a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32>
 fn textureSample_e53267() {
   var res: vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.dxc.hlsl
index 7c72e8a..fcb9be9 100644
--- a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_e53267() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.fxc.hlsl
index 7c72e8a..fcb9be9 100644
--- a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_e53267() {
   float4 res = arg_0.Sample(arg_1, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.glsl
index bab2834..d83990f 100644
--- a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_e53267() {
   vec4 res = texture(arg_0_arg_1, vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.msl
index 273271f..749457d 100644
--- a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_e53267(texturecube<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_e53267(texturecube<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_e53267(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_e53267(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.spvasm
index faaae35..38e4ae4 100644
--- a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_e53267 "textureSample_e53267"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,27 +30,36 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpConstantNull %v4float
-%textureSample_e53267 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %23
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20
-               OpStore %res %12
+         %26 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_e53267 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %26
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23
+               OpStore %res %16
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureSample_e53267
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureSample_e53267
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.wgsl
index 4ed3277..7feeaea 100644
--- a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_e53267() {
   var res : vec4<f32> = textureSample(arg_0, arg_1, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_e53267();
diff --git a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl
index 9187195..97eb025 100644
--- a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl
@@ -26,7 +26,9 @@
 // fn textureSample(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>) -> f32
 fn textureSample_ea7030() {
   var res: f32 = textureSample(arg_0, arg_1, vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.dxc.hlsl
index efcac93..549f9d4 100644
--- a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_ea7030() {
   float res = arg_0.Sample(arg_1, (1.0f).xxx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.fxc.hlsl
index efcac93..549f9d4 100644
--- a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_ea7030() {
   float res = arg_0.Sample(arg_1, (1.0f).xxx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.glsl
index 8fbca7b..90e4b4b 100644
--- a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_ea7030() {
   float res = texture(arg_0_arg_1, vec4(vec3(1.0f), 0.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.msl
index c5cfd80..a7d7886 100644
--- a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_ea7030(depthcube<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_ea7030(depthcube<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample(tint_symbol_1, float3(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_ea7030(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_ea7030(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.spvasm
index 03c157a..143456a 100644
--- a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_ea7030 "textureSample_ea7030"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,28 +30,37 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %17 = OpTypeSampledImage %3
+         %20 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %24 = OpConstantNull %float
-%textureSample_ea7030 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %24
-         %15 = OpLoad %7 %arg_1
-         %16 = OpLoad %3 %arg_0
-         %18 = OpSampledImage %17 %16 %15
-         %13 = OpImageSampleImplicitLod %v4float %18 %21
-         %12 = OpCompositeExtract %float %13 0
-               OpStore %res %12
+         %27 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_ea7030 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %27
+         %18 = OpLoad %7 %arg_1
+         %19 = OpLoad %3 %arg_0
+         %21 = OpSampledImage %20 %19 %18
+         %16 = OpImageSampleImplicitLod %v4float %21 %24
+         %15 = OpCompositeExtract %float %16 0
+               OpStore %res %15
+         %31 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %32 = OpLoad %float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureSample_ea7030
+%fragment_main = OpFunction %void None %11
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureSample_ea7030
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.wgsl
index 5d10efe..d806388 100644
--- a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSample_ea7030() {
   var res : f32 = textureSample(arg_0, arg_1, vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_ea7030();
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl
index 080a6be..73a7c7b 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBaseClampToEdge(texture: texture_external, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
 fn textureSampleBaseClampToEdge_7c04e6() {
   var res: vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
index 66a6236..92065b2 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
@@ -102,8 +102,11 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureSampleBaseClampToEdge_7c04e6() {
   float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, (1.0f).xx, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
index 66a6236..92065b2 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
@@ -102,8 +102,11 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureSampleBaseClampToEdge_7c04e6() {
   float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, (1.0f).xx, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
index 4ff46db..df288db 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
@@ -83,8 +83,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_7c04e6() {
   vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -186,8 +191,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_7c04e6() {
   vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -283,8 +293,13 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_7c04e6() {
   vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, vec2(1.0f), conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
index 3a204fa..0a3c0eb 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
@@ -101,33 +101,34 @@
   return float4(color, 1.0f);
 }
 
-void textureSampleBaseClampToEdge_7c04e6(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, sampler tint_symbol_3, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_4) {
+void textureSampleBaseClampToEdge_7c04e6(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, sampler tint_symbol_3, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_4, device float4* const tint_symbol_5) {
   float4 res = textureSampleExternal(tint_symbol_1, tint_symbol_2, tint_symbol_3, float2(1.0f), tint_unpack_vec3_in_composite_1(*(tint_symbol_4)));
+  *(tint_symbol_5) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, sampler tint_symbol_7, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_8) {
-  textureSampleBaseClampToEdge_7c04e6(tint_symbol_5, tint_symbol_6, tint_symbol_7, tint_symbol_8);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_6, texture2d<float, access::sample> tint_symbol_7, sampler tint_symbol_8, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_9, device float4* const tint_symbol_10) {
+  textureSampleBaseClampToEdge_7c04e6(tint_symbol_6, tint_symbol_7, tint_symbol_8, tint_symbol_9, tint_symbol_10);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], texture2d<float, access::sample> tint_symbol_10 [[texture(1)]], sampler tint_symbol_11 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_12 [[buffer(2)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_11 [[texture(0)]], texture2d<float, access::sample> tint_symbol_12 [[texture(1)]], sampler tint_symbol_13 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_14 [[buffer(2)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_11, tint_symbol_12, tint_symbol_13, tint_symbol_14, tint_symbol_15);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], sampler tint_symbol_15 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_16 [[buffer(2)]]) {
-  textureSampleBaseClampToEdge_7c04e6(tint_symbol_13, tint_symbol_14, tint_symbol_15, tint_symbol_16);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_16 [[texture(0)]], texture2d<float, access::sample> tint_symbol_17 [[texture(1)]], sampler tint_symbol_18 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_19 [[buffer(2)]], device float4* tint_symbol_20 [[buffer(0)]]) {
+  textureSampleBaseClampToEdge_7c04e6(tint_symbol_16, tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_17 [[texture(0)]], texture2d<float, access::sample> tint_symbol_18 [[texture(1)]], sampler tint_symbol_19 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_20 [[buffer(2)]]) {
-  textureSampleBaseClampToEdge_7c04e6(tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_21 [[texture(0)]], texture2d<float, access::sample> tint_symbol_22 [[texture(1)]], sampler tint_symbol_23 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_24 [[buffer(2)]], device float4* tint_symbol_25 [[buffer(0)]]) {
+  textureSampleBaseClampToEdge_7c04e6(tint_symbol_21, tint_symbol_22, tint_symbol_23, tint_symbol_24, tint_symbol_25);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
index 76ed4d1..3f3fbe0 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 188
+; Bound: 194
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
-         %32 = OpExtInstImport "GLSL.std.450"
+         %35 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -39,6 +39,9 @@
                OpName %ext_tex_params "ext_tex_params"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %gammaCorrection "gammaCorrection"
                OpName %v "v"
                OpName %params "params"
@@ -99,6 +102,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
                OpMemberDecorate %ExternalTextureParams 0 Offset 0
                OpMemberDecorate %ExternalTextureParams 1 Offset 4
                OpMemberDecorate %ExternalTextureParams 2 Offset 16
@@ -137,195 +144,202 @@
          %25 = OpTypeSampler
 %_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
       %arg_1 = OpVariable %_ptr_UniformConstant_25 UniformConstant
-         %26 = OpTypeFunction %v3float %v3float %GammaTransferParams
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %29 = OpTypeFunction %v3float %v3float %GammaTransferParams
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %46 = OpConstantNull %v3float
+         %49 = OpConstantNull %v3float
 %mat3v2float = OpTypeMatrix %v2float 3
 %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat3v2float
-         %66 = OpTypeFunction %v4float %11 %11 %25 %v2float %ExternalTextureParams
+         %69 = OpTypeFunction %v4float %11 %11 %25 %v2float %ExternalTextureParams
     %float_1 = OpConstant %float 1
      %v2uint = OpTypeVector %uint 2
         %int = OpTypeInt 32 1
-         %86 = OpConstantNull %int
+         %89 = OpConstantNull %int
   %float_0_5 = OpConstant %float 0.5
-         %88 = OpConstantComposite %v2float %float_0_5 %float_0_5
+         %91 = OpConstantComposite %v2float %float_0_5 %float_0_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %94 = OpConstantNull %v2float
+         %97 = OpConstantNull %v2float
      %uint_1 = OpConstant %uint 1
-        %111 = OpTypeSampledImage %11
-        %126 = OpConstantNull %uint
-        %144 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
+        %114 = OpTypeSampledImage %11
+        %129 = OpConstantNull %uint
+        %147 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
        %void = OpTypeVoid
-        %159 = OpTypeFunction %void
-        %167 = OpConstantComposite %v2float %float_1 %float_1
+        %162 = OpTypeFunction %void
+        %170 = OpConstantComposite %v2float %float_1 %float_1
      %uint_0 = OpConstant %uint 0
 %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-        %175 = OpTypeFunction %v4float
-%gammaCorrection = OpFunction %v3float None %26
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+        %181 = OpTypeFunction %v4float
+%gammaCorrection = OpFunction %v3float None %29
           %v = OpFunctionParameter %v3float
      %params = OpFunctionParameter %GammaTransferParams
-         %30 = OpLabel
-         %44 = OpVariable %_ptr_Function_v3float Function %46
-         %56 = OpVariable %_ptr_Function_v3float Function %46
-         %62 = OpVariable %_ptr_Function_v3float Function %46
-         %31 = OpExtInst %v3float %32 FAbs %v
-         %33 = OpCompositeExtract %float %params 4
-         %34 = OpCompositeConstruct %v3float %33 %33 %33
-         %35 = OpFOrdLessThan %v3bool %31 %34
-         %38 = OpExtInst %v3float %32 FSign %v
-         %39 = OpCompositeExtract %float %params 3
-         %40 = OpExtInst %v3float %32 FAbs %v
-         %41 = OpVectorTimesScalar %v3float %40 %39
-         %42 = OpCompositeExtract %float %params 6
-         %47 = OpCompositeConstruct %v3float %42 %42 %42
-         %43 = OpFAdd %v3float %41 %47
-         %48 = OpFMul %v3float %38 %43
-         %49 = OpExtInst %v3float %32 FSign %v
-         %51 = OpCompositeExtract %float %params 1
-         %52 = OpExtInst %v3float %32 FAbs %v
-         %53 = OpVectorTimesScalar %v3float %52 %51
-         %54 = OpCompositeExtract %float %params 2
-         %57 = OpCompositeConstruct %v3float %54 %54 %54
-         %55 = OpFAdd %v3float %53 %57
-         %58 = OpCompositeExtract %float %params 0
-         %59 = OpCompositeConstruct %v3float %58 %58 %58
-         %50 = OpExtInst %v3float %32 Pow %55 %59
-         %60 = OpCompositeExtract %float %params 5
-         %63 = OpCompositeConstruct %v3float %60 %60 %60
-         %61 = OpFAdd %v3float %50 %63
-         %64 = OpFMul %v3float %49 %61
-         %65 = OpSelect %v3float %35 %48 %64
-               OpReturnValue %65
+         %33 = OpLabel
+         %47 = OpVariable %_ptr_Function_v3float Function %49
+         %59 = OpVariable %_ptr_Function_v3float Function %49
+         %65 = OpVariable %_ptr_Function_v3float Function %49
+         %34 = OpExtInst %v3float %35 FAbs %v
+         %36 = OpCompositeExtract %float %params 4
+         %37 = OpCompositeConstruct %v3float %36 %36 %36
+         %38 = OpFOrdLessThan %v3bool %34 %37
+         %41 = OpExtInst %v3float %35 FSign %v
+         %42 = OpCompositeExtract %float %params 3
+         %43 = OpExtInst %v3float %35 FAbs %v
+         %44 = OpVectorTimesScalar %v3float %43 %42
+         %45 = OpCompositeExtract %float %params 6
+         %50 = OpCompositeConstruct %v3float %45 %45 %45
+         %46 = OpFAdd %v3float %44 %50
+         %51 = OpFMul %v3float %41 %46
+         %52 = OpExtInst %v3float %35 FSign %v
+         %54 = OpCompositeExtract %float %params 1
+         %55 = OpExtInst %v3float %35 FAbs %v
+         %56 = OpVectorTimesScalar %v3float %55 %54
+         %57 = OpCompositeExtract %float %params 2
+         %60 = OpCompositeConstruct %v3float %57 %57 %57
+         %58 = OpFAdd %v3float %56 %60
+         %61 = OpCompositeExtract %float %params 0
+         %62 = OpCompositeConstruct %v3float %61 %61 %61
+         %53 = OpExtInst %v3float %35 Pow %58 %62
+         %63 = OpCompositeExtract %float %params 5
+         %66 = OpCompositeConstruct %v3float %63 %63 %63
+         %64 = OpFAdd %v3float %53 %66
+         %67 = OpFMul %v3float %52 %64
+         %68 = OpSelect %v3float %38 %51 %67
+               OpReturnValue %68
                OpFunctionEnd
-%textureSampleExternal = OpFunction %v4float None %66
+%textureSampleExternal = OpFunction %v4float None %69
      %plane0 = OpFunctionParameter %11
      %plane1 = OpFunctionParameter %11
         %smp = OpFunctionParameter %25
       %coord = OpFunctionParameter %v2float
    %params_0 = OpFunctionParameter %ExternalTextureParams
-         %75 = OpLabel
-         %92 = OpVariable %_ptr_Function_v2float Function %94
-        %101 = OpVariable %_ptr_Function_v2float Function %94
-      %color = OpVariable %_ptr_Function_v3float Function %46
-         %76 = OpCompositeExtract %mat3v2float %params_0 6
-         %77 = OpCompositeExtract %float %coord 0
-         %78 = OpCompositeExtract %float %coord 1
-         %80 = OpCompositeConstruct %v3float %77 %78 %float_1
-         %81 = OpMatrixTimesVector %v2float %76 %80
-         %83 = OpImageQuerySizeLod %v2uint %plane0 %86
-         %82 = OpConvertUToF %v2float %83
-         %89 = OpFDiv %v2float %88 %82
-         %95 = OpCompositeConstruct %v2float %float_1 %float_1
-         %91 = OpFSub %v2float %95 %89
-         %90 = OpExtInst %v2float %32 NClamp %81 %89 %91
-         %97 = OpImageQuerySizeLod %v2uint %plane1 %86
-         %96 = OpConvertUToF %v2float %97
-         %98 = OpFDiv %v2float %88 %96
-        %102 = OpCompositeConstruct %v2float %float_1 %float_1
-        %100 = OpFSub %v2float %102 %98
-         %99 = OpExtInst %v2float %32 NClamp %81 %98 %100
-        %104 = OpCompositeExtract %uint %params_0 0
-        %106 = OpIEqual %bool %104 %uint_1
-               OpSelectionMerge %107 None
-               OpBranchConditional %106 %108 %109
-        %108 = OpLabel
-        %112 = OpSampledImage %111 %plane0 %smp
-        %110 = OpImageSampleExplicitLod %v4float %112 %90 Lod %8
-        %113 = OpVectorShuffle %v3float %110 %110 0 1 2
-               OpStore %color %113
-               OpBranch %107
-        %109 = OpLabel
-        %115 = OpSampledImage %111 %plane0 %smp
-        %114 = OpImageSampleExplicitLod %v4float %115 %90 Lod %8
-        %116 = OpCompositeExtract %float %114 0
-        %118 = OpSampledImage %111 %plane1 %smp
-        %117 = OpImageSampleExplicitLod %v4float %118 %99 Lod %8
-        %119 = OpVectorShuffle %v2float %117 %117 0 1
-        %120 = OpCompositeExtract %float %119 0
-        %121 = OpCompositeExtract %float %119 1
-        %122 = OpCompositeConstruct %v4float %116 %120 %121 %float_1
-        %123 = OpCompositeExtract %mat3v4float %params_0 2
-        %124 = OpVectorTimesMatrix %v3float %122 %123
-               OpStore %color %124
-               OpBranch %107
-        %107 = OpLabel
-        %125 = OpCompositeExtract %uint %params_0 1
-        %127 = OpIEqual %bool %125 %126
-               OpSelectionMerge %128 None
-               OpBranchConditional %127 %129 %128
-        %129 = OpLabel
-        %131 = OpLoad %v3float %color
-        %132 = OpCompositeExtract %GammaTransferParams %params_0 3
-        %130 = OpFunctionCall %v3float %gammaCorrection %131 %132
-               OpStore %color %130
-        %133 = OpCompositeExtract %mat3v3float %params_0 5
+         %78 = OpLabel
+         %95 = OpVariable %_ptr_Function_v2float Function %97
+        %104 = OpVariable %_ptr_Function_v2float Function %97
+      %color = OpVariable %_ptr_Function_v3float Function %49
+         %79 = OpCompositeExtract %mat3v2float %params_0 6
+         %80 = OpCompositeExtract %float %coord 0
+         %81 = OpCompositeExtract %float %coord 1
+         %83 = OpCompositeConstruct %v3float %80 %81 %float_1
+         %84 = OpMatrixTimesVector %v2float %79 %83
+         %86 = OpImageQuerySizeLod %v2uint %plane0 %89
+         %85 = OpConvertUToF %v2float %86
+         %92 = OpFDiv %v2float %91 %85
+         %98 = OpCompositeConstruct %v2float %float_1 %float_1
+         %94 = OpFSub %v2float %98 %92
+         %93 = OpExtInst %v2float %35 NClamp %84 %92 %94
+        %100 = OpImageQuerySizeLod %v2uint %plane1 %89
+         %99 = OpConvertUToF %v2float %100
+        %101 = OpFDiv %v2float %91 %99
+        %105 = OpCompositeConstruct %v2float %float_1 %float_1
+        %103 = OpFSub %v2float %105 %101
+        %102 = OpExtInst %v2float %35 NClamp %84 %101 %103
+        %107 = OpCompositeExtract %uint %params_0 0
+        %109 = OpIEqual %bool %107 %uint_1
+               OpSelectionMerge %110 None
+               OpBranchConditional %109 %111 %112
+        %111 = OpLabel
+        %115 = OpSampledImage %114 %plane0 %smp
+        %113 = OpImageSampleExplicitLod %v4float %115 %93 Lod %8
+        %116 = OpVectorShuffle %v3float %113 %113 0 1 2
+               OpStore %color %116
+               OpBranch %110
+        %112 = OpLabel
+        %118 = OpSampledImage %114 %plane0 %smp
+        %117 = OpImageSampleExplicitLod %v4float %118 %93 Lod %8
+        %119 = OpCompositeExtract %float %117 0
+        %121 = OpSampledImage %114 %plane1 %smp
+        %120 = OpImageSampleExplicitLod %v4float %121 %102 Lod %8
+        %122 = OpVectorShuffle %v2float %120 %120 0 1
+        %123 = OpCompositeExtract %float %122 0
+        %124 = OpCompositeExtract %float %122 1
+        %125 = OpCompositeConstruct %v4float %119 %123 %124 %float_1
+        %126 = OpCompositeExtract %mat3v4float %params_0 2
+        %127 = OpVectorTimesMatrix %v3float %125 %126
+               OpStore %color %127
+               OpBranch %110
+        %110 = OpLabel
+        %128 = OpCompositeExtract %uint %params_0 1
+        %130 = OpIEqual %bool %128 %129
+               OpSelectionMerge %131 None
+               OpBranchConditional %130 %132 %131
+        %132 = OpLabel
         %134 = OpLoad %v3float %color
-        %135 = OpMatrixTimesVector %v3float %133 %134
-               OpStore %color %135
+        %135 = OpCompositeExtract %GammaTransferParams %params_0 3
+        %133 = OpFunctionCall %v3float %gammaCorrection %134 %135
+               OpStore %color %133
+        %136 = OpCompositeExtract %mat3v3float %params_0 5
         %137 = OpLoad %v3float %color
-        %138 = OpCompositeExtract %GammaTransferParams %params_0 4
-        %136 = OpFunctionCall %v3float %gammaCorrection %137 %138
-               OpStore %color %136
-               OpBranch %128
-        %128 = OpLabel
-        %139 = OpLoad %v3float %color
-        %140 = OpCompositeExtract %float %139 0
-        %141 = OpCompositeExtract %float %139 1
-        %142 = OpCompositeExtract %float %139 2
-        %143 = OpCompositeConstruct %v4float %140 %141 %142 %float_1
-               OpReturnValue %143
+        %138 = OpMatrixTimesVector %v3float %136 %137
+               OpStore %color %138
+        %140 = OpLoad %v3float %color
+        %141 = OpCompositeExtract %GammaTransferParams %params_0 4
+        %139 = OpFunctionCall %v3float %gammaCorrection %140 %141
+               OpStore %color %139
+               OpBranch %131
+        %131 = OpLabel
+        %142 = OpLoad %v3float %color
+        %143 = OpCompositeExtract %float %142 0
+        %144 = OpCompositeExtract %float %142 1
+        %145 = OpCompositeExtract %float %142 2
+        %146 = OpCompositeConstruct %v4float %143 %144 %145 %float_1
+               OpReturnValue %146
                OpFunctionEnd
-%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %144
+%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %147
         %val = OpFunctionParameter %ExternalTextureParams_std140
-        %147 = OpLabel
-        %148 = OpCompositeExtract %uint %val 0
-        %149 = OpCompositeExtract %uint %val 1
-        %150 = OpCompositeExtract %mat3v4float %val 2
-        %151 = OpCompositeExtract %GammaTransferParams %val 3
-        %152 = OpCompositeExtract %GammaTransferParams %val 4
-        %153 = OpCompositeExtract %mat3v3float %val 5
-        %154 = OpCompositeExtract %v2float %val 6
-        %155 = OpCompositeExtract %v2float %val 7
-        %156 = OpCompositeExtract %v2float %val 8
-        %157 = OpCompositeConstruct %mat3v2float %154 %155 %156
-        %158 = OpCompositeConstruct %ExternalTextureParams %148 %149 %150 %151 %152 %153 %157
-               OpReturnValue %158
+        %150 = OpLabel
+        %151 = OpCompositeExtract %uint %val 0
+        %152 = OpCompositeExtract %uint %val 1
+        %153 = OpCompositeExtract %mat3v4float %val 2
+        %154 = OpCompositeExtract %GammaTransferParams %val 3
+        %155 = OpCompositeExtract %GammaTransferParams %val 4
+        %156 = OpCompositeExtract %mat3v3float %val 5
+        %157 = OpCompositeExtract %v2float %val 6
+        %158 = OpCompositeExtract %v2float %val 7
+        %159 = OpCompositeExtract %v2float %val 8
+        %160 = OpCompositeConstruct %mat3v2float %157 %158 %159
+        %161 = OpCompositeConstruct %ExternalTextureParams %151 %152 %153 %154 %155 %156 %160
+               OpReturnValue %161
                OpFunctionEnd
-%textureSampleBaseClampToEdge_7c04e6 = OpFunction %void None %159
-        %162 = OpLabel
+%textureSampleBaseClampToEdge_7c04e6 = OpFunction %void None %162
+        %165 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-        %164 = OpLoad %11 %arg_0
-        %165 = OpLoad %11 %ext_tex_plane_1
-        %166 = OpLoad %25 %arg_1
-        %171 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
-        %172 = OpLoad %ExternalTextureParams_std140 %171
-        %168 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %172
-        %163 = OpFunctionCall %v4float %textureSampleExternal %164 %165 %166 %167 %168
-               OpStore %res %163
+        %167 = OpLoad %11 %arg_0
+        %168 = OpLoad %11 %ext_tex_plane_1
+        %169 = OpLoad %25 %arg_1
+        %174 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
+        %175 = OpLoad %ExternalTextureParams_std140 %174
+        %171 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %175
+        %166 = OpFunctionCall %v4float %textureSampleExternal %167 %168 %169 %170 %171
+               OpStore %res %166
+        %179 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+        %180 = OpLoad %v4float %res
+               OpStore %179 %180
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %175
-        %177 = OpLabel
-        %178 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
+%vertex_main_inner = OpFunction %v4float None %181
+        %183 = OpLabel
+        %184 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %159
-        %180 = OpLabel
-        %181 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %181
+%vertex_main = OpFunction %void None %162
+        %186 = OpLabel
+        %187 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %187
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %159
-        %183 = OpLabel
-        %184 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
+%fragment_main = OpFunction %void None %162
+        %189 = OpLabel
+        %190 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %159
-        %186 = OpLabel
-        %187 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
+%compute_main = OpFunction %void None %162
+        %192 = OpLabel
+        %193 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.wgsl
index dcebcd2..1aa0887 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBaseClampToEdge_7c04e6() {
   var res : vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleBaseClampToEdge_7c04e6();
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl
index e5e598c..e4d82f4 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBaseClampToEdge(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
 fn textureSampleBaseClampToEdge_9ca02c() {
   var res: vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.dxc.hlsl
index c868b5e..f7997fa 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.dxc.hlsl
@@ -9,9 +9,11 @@
 
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBaseClampToEdge_9ca02c() {
   float4 res = tint_textureSampleBaseClampToEdge(arg_0, arg_1, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.fxc.hlsl
index c868b5e..f7997fa 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.fxc.hlsl
@@ -9,9 +9,11 @@
 
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBaseClampToEdge_9ca02c() {
   float4 res = tint_textureSampleBaseClampToEdge(arg_0, arg_1, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
index 2d912aa..d8e7782 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
@@ -10,8 +10,13 @@
 
 uniform highp sampler2D arg_0_1;
 uniform highp sampler2D arg_0_arg_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_9ca02c() {
   vec4 res = tint_textureSampleBaseClampToEdge(arg_0_1, arg_0_arg_1, vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -40,8 +45,13 @@
 
 uniform highp sampler2D arg_0_1;
 uniform highp sampler2D arg_0_arg_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_9ca02c() {
   vec4 res = tint_textureSampleBaseClampToEdge(arg_0_1, arg_0_arg_1, vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -64,8 +74,13 @@
 
 uniform highp sampler2D arg_0_1;
 uniform highp sampler2D arg_0_arg_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_9ca02c() {
   vec4 res = tint_textureSampleBaseClampToEdge(arg_0_1, arg_0_arg_1, vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
index f1d03f2..625fdf2 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
@@ -8,33 +8,34 @@
   return t.sample(s, clamped, level(0.0f));
 }
 
-void textureSampleBaseClampToEdge_9ca02c(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleBaseClampToEdge_9ca02c(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_textureSampleBaseClampToEdge(tint_symbol_1, tint_symbol_2, float2(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleBaseClampToEdge_9ca02c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleBaseClampToEdge_9ca02c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleBaseClampToEdge_9ca02c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleBaseClampToEdge_9ca02c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleBaseClampToEdge_9ca02c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleBaseClampToEdge_9ca02c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
index cb680b0..c3a42c9 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 72
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
-         %32 = OpExtInstImport "GLSL.std.450"
+         %35 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -16,6 +16,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_textureSampleBaseClampToEdge "tint_textureSampleBaseClampToEdge"
                OpName %t "t"
                OpName %s "s"
@@ -32,6 +35,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -46,67 +53,75 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
     %v2float = OpTypeVector %float 2
-         %15 = OpTypeFunction %v4float %11 %14 %v2float
+         %18 = OpTypeFunction %v4float %11 %14 %v2float
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
         %int = OpTypeInt 32 1
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
   %float_0_5 = OpConstant %float 0.5
-         %29 = OpConstantComposite %v2float %float_0_5 %float_0_5
+         %32 = OpConstantComposite %v2float %float_0_5 %float_0_5
     %float_1 = OpConstant %float 1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %37 = OpConstantNull %v2float
-         %40 = OpTypeSampledImage %11
+         %40 = OpConstantNull %v2float
+         %43 = OpTypeSampledImage %11
        %void = OpTypeVoid
-         %42 = OpTypeFunction %void
-         %49 = OpConstantComposite %v2float %float_1 %float_1
+         %45 = OpTypeFunction %void
+         %52 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %52 = OpTypeFunction %v4float
-%tint_textureSampleBaseClampToEdge = OpFunction %v4float None %15
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %59 = OpTypeFunction %v4float
+%tint_textureSampleBaseClampToEdge = OpFunction %v4float None %18
           %t = OpFunctionParameter %11
           %s = OpFunctionParameter %14
       %coord = OpFunctionParameter %v2float
-         %21 = OpLabel
-         %35 = OpVariable %_ptr_Function_v2float Function %37
-         %23 = OpImageQuerySizeLod %v2uint %t %27
-         %22 = OpConvertUToF %v2float %23
-         %30 = OpFDiv %v2float %29 %22
-         %38 = OpCompositeConstruct %v2float %float_1 %float_1
-         %34 = OpFSub %v2float %38 %30
-         %31 = OpExtInst %v2float %32 NClamp %coord %30 %34
-         %41 = OpSampledImage %40 %t %s
-         %39 = OpImageSampleExplicitLod %v4float %41 %31 Lod %8
-               OpReturnValue %39
+         %24 = OpLabel
+         %38 = OpVariable %_ptr_Function_v2float Function %40
+         %26 = OpImageQuerySizeLod %v2uint %t %30
+         %25 = OpConvertUToF %v2float %26
+         %33 = OpFDiv %v2float %32 %25
+         %41 = OpCompositeConstruct %v2float %float_1 %float_1
+         %37 = OpFSub %v2float %41 %33
+         %34 = OpExtInst %v2float %35 NClamp %coord %33 %37
+         %44 = OpSampledImage %43 %t %s
+         %42 = OpImageSampleExplicitLod %v4float %44 %34 Lod %8
+               OpReturnValue %42
                OpFunctionEnd
-%textureSampleBaseClampToEdge_9ca02c = OpFunction %void None %42
-         %45 = OpLabel
+%textureSampleBaseClampToEdge_9ca02c = OpFunction %void None %45
+         %48 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %47 = OpLoad %11 %arg_0
-         %48 = OpLoad %14 %arg_1
-         %46 = OpFunctionCall %v4float %tint_textureSampleBaseClampToEdge %47 %48 %49
-               OpStore %res %46
+         %50 = OpLoad %11 %arg_0
+         %51 = OpLoad %14 %arg_1
+         %49 = OpFunctionCall %v4float %tint_textureSampleBaseClampToEdge %50 %51 %52
+               OpStore %res %49
+         %57 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %58 = OpLoad %v4float %res
+               OpStore %57 %58
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %52
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%vertex_main_inner = OpFunction %v4float None %59
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %42
-         %57 = OpLabel
-         %58 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %58
+%vertex_main = OpFunction %void None %45
+         %64 = OpLabel
+         %65 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %65
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %42
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%fragment_main = OpFunction %void None %45
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %42
-         %63 = OpLabel
-         %64 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%compute_main = OpFunction %void None %45
+         %70 = OpLabel
+         %71 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.wgsl
index 9ec6ff6..b6613a3 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBaseClampToEdge_9ca02c() {
   var res : vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleBaseClampToEdge_9ca02c();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl
index 1272f7f..ed25d11 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, bias: f32) -> vec4<f32>
 fn textureSampleBias_1c707e() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.dxc.hlsl
index 07f6325..75f07a2 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_1c707e() {
   float4 res = arg_0.SampleBias(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.fxc.hlsl
index 07f6325..75f07a2 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_1c707e() {
   float4 res = arg_0.SampleBias(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.glsl
index 84e14fe..e8e0a2c 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_1c707e() {
   vec4 res = texture(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.msl
index 39249ba..6736a9f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_1c707e(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_1c707e(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1u, bias(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_1c707e(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_1c707e(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.spvasm
index fea1a4d..3e0c8fe 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_1c707e "textureSampleBias_1c707e"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,34 +30,42 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpConstantNull %v4float
-%textureSampleBias_1c707e = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %30
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpConvertUToF %float %uint_1
-         %27 = OpCompositeConstruct %v3float %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27 Bias %float_1
-               OpStore %res %12
+         %33 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_1c707e = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %33
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpConvertUToF %float %uint_1
+         %30 = OpCompositeConstruct %v3float %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30 Bias %float_1
+               OpStore %res %16
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSampleBias_1c707e
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleBias_1c707e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.wgsl
index b8d2d75..d5830c9 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/1c707e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_1c707e() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_1c707e();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl
index 8c734db..0fc9256 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, bias: f32) -> vec4<f32>
 fn textureSampleBias_53b9f7() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.dxc.hlsl
index 4c8919f..90b69d7 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_53b9f7() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.fxc.hlsl
index 4c8919f..90b69d7 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_53b9f7() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.glsl
index ee550b4..4522baa 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_53b9f7() {
   vec4 res = texture(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.msl
index 294cda1..123a18c 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_53b9f7(texturecube<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_53b9f7(texturecube<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f), bias(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_53b9f7(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_53b9f7(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.spvasm
index e36e921..5d8c397 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_53b9f7 "textureSampleBias_53b9f7"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,27 +30,36 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpConstantNull %v4float
-%textureSampleBias_53b9f7 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %23
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20 Bias %float_1
-               OpStore %res %12
+         %26 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_53b9f7 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %26
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23 Bias %float_1
+               OpStore %res %16
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureSampleBias_53b9f7
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureSampleBias_53b9f7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.wgsl
index 6add8f8..287187d 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_53b9f7() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_53b9f7();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl
index c78555e..4943a3b 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, bias: f32, @const offset: vec3<i32>) -> vec4<f32>
 fn textureSampleBias_594824() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.f), 1.f, vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.dxc.hlsl
index 0ca62fc..1d8c852 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_594824() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xxx, 1.0f, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleBias_594824();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleBias.f32(i32 61, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.fxc.hlsl
index 0ca62fc..4c3e0ed 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_594824() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xxx, 1.0f, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.glsl
index a13ea63..5329946 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_594824() {
   vec4 res = textureOffset(arg_0_arg_1, vec3(1.0f), ivec3(1), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.msl
index a7214cb..6ed9a54 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_594824(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_594824(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f), bias(1.0f), int3(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_594824(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_594824(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.spvasm
index 700df82..c517d4a 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_594824 "textureSampleBias_594824"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,31 +30,40 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %24 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %27 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %27 = OpConstantNull %v4float
-%textureSampleBias_594824 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %27
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20 Bias|ConstOffset %float_1 %24
-               OpStore %res %12
+         %30 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_594824 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %30
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23 Bias|ConstOffset %float_1 %27
+               OpStore %res %16
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureSampleBias_594824
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureSampleBias_594824
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.wgsl
index 6a60558..d526b79 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_594824() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.0f), 1.0f, vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_594824();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl
index bba474e..a2eb851 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, bias: f32) -> vec4<f32>
 fn textureSampleBias_6a9113() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.dxc.hlsl
index 4949956..39f8b0b 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_6a9113() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.fxc.hlsl
index 4949956..39f8b0b 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_6a9113() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.glsl
index 7190a88..84f0785 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_6a9113() {
   vec4 res = texture(arg_0_arg_1, vec2(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.msl
index c3b8284..864174c 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_6a9113(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_6a9113(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), bias(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_6a9113(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_6a9113(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.spvasm
index 44afc2e..61632fa 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_6a9113 "textureSampleBias_6a9113"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,27 +30,36 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %23 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpConstantNull %v4float
-%textureSampleBias_6a9113 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %23
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20 Bias %float_1
-               OpStore %res %12
+         %26 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_6a9113 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %26
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23 Bias %float_1
+               OpStore %res %16
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureSampleBias_6a9113
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureSampleBias_6a9113
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.wgsl
index 7145dea..5c039b4 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_6a9113() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_6a9113();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl
index e7aae06..81a2db9 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, bias: f32) -> vec4<f32>
 fn textureSampleBias_80e579() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.dxc.hlsl
index acd8d6c..0ed8894 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_80e579() {
   float4 res = arg_0.SampleBias(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.fxc.hlsl
index acd8d6c..0ed8894 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_80e579() {
   float4 res = arg_0.SampleBias(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.glsl
index 27da1a2..eb4e969 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_80e579() {
   vec4 res = texture(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.msl
index 075eb4f..5eab171 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_80e579(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_80e579(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1, bias(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_80e579(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_80e579(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.spvasm
index 0e5ab6c..e13f31c 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_80e579 "textureSampleBias_80e579"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,34 +30,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpConstantNull %v4float
-%textureSampleBias_80e579 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %30
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpConvertSToF %float %int_1
-         %27 = OpCompositeConstruct %v3float %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27 Bias %float_1
-               OpStore %res %12
+         %33 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_80e579 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %33
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpConvertSToF %float %int_1
+         %30 = OpCompositeConstruct %v3float %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30 Bias %float_1
+               OpStore %res %16
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSampleBias_80e579
+%fragment_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSampleBias_80e579
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.wgsl
index 0bb6820..f2b855f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_80e579() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_80e579();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl
index 9c0fac2..8d958d8 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, bias: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleBias_87915c() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.dxc.hlsl
index 2f3e802..f19176d 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_87915c() {
   float4 res = arg_0.SampleBias(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleBias_87915c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleBias.f32(i32 61, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.fxc.hlsl
index 2f3e802..39ddee0 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_87915c() {
   float4 res = arg_0.SampleBias(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.glsl
index a9d8bb7..29e0562 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_87915c() {
   vec4 res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), ivec2(1), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.msl
index ce4bb4e..01f1eb8 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_87915c(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_87915c(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1u, bias(1.0f), int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_87915c(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_87915c(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.spvasm
index aa716b8..2ac4566 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_87915c "textureSampleBias_87915c"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,38 +30,46 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %31 = OpConstantComposite %v2int %int_1 %int_1
+         %34 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpConstantNull %v4float
-%textureSampleBias_87915c = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %34
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpConvertUToF %float %uint_1
-         %27 = OpCompositeConstruct %v3float %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27 Bias|ConstOffset %float_1 %31
-               OpStore %res %12
+         %37 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_87915c = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %37
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpConvertUToF %float %uint_1
+         %30 = OpCompositeConstruct %v3float %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30 Bias|ConstOffset %float_1 %34
+               OpStore %res %16
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %41 = OpLoad %v4float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureSampleBias_87915c
+%fragment_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSampleBias_87915c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.wgsl
index d8a4075..30588d0 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/87915c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_87915c() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_87915c();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl
index f238a26..d0ea750 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, bias: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleBias_9dbb51() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.dxc.hlsl
index 19f1088..4381252 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_9dbb51() {
   float4 res = arg_0.SampleBias(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleBias_9dbb51();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleBias.f32(i32 61, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.fxc.hlsl
index 19f1088..6d25e5f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_9dbb51() {
   float4 res = arg_0.SampleBias(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.glsl
index e66d254..c6f4f0f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_9dbb51() {
   vec4 res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), ivec2(1), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.msl
index 0ef2fee..3eead4f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_9dbb51(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_9dbb51(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), 1, bias(1.0f), int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_9dbb51(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_9dbb51(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.spvasm
index eb7f586..3fdfa20 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_9dbb51 "textureSampleBias_9dbb51"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,36 +30,45 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %29 = OpConstantComposite %v2int %int_1 %int_1
+         %32 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpConstantNull %v4float
-%textureSampleBias_9dbb51 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %32
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %22 = OpCompositeExtract %float %21 0
-         %23 = OpCompositeExtract %float %21 1
-         %24 = OpConvertSToF %float %int_1
-         %27 = OpCompositeConstruct %v3float %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27 Bias|ConstOffset %float_1 %29
-               OpStore %res %12
+         %35 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_9dbb51 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %35
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %25 = OpCompositeExtract %float %24 0
+         %26 = OpCompositeExtract %float %24 1
+         %27 = OpConvertSToF %float %int_1
+         %30 = OpCompositeConstruct %v3float %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30 Bias|ConstOffset %float_1 %32
+               OpStore %res %16
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureSampleBias_9dbb51
+%fragment_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureSampleBias_9dbb51
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.wgsl
index 7107527..51aedb4 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_9dbb51() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_9dbb51();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl
index 53df7a0..659b5012 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, bias: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleBias_a161cf() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.f), 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.dxc.hlsl
index 4945bcf..b4fb4cf 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_a161cf() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleBias_a161cf();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleBias.f32(i32 61, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.fxc.hlsl
index 4945bcf..5c3c06a 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_a161cf() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.glsl
index d87948b..7051751 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_a161cf() {
   vec4 res = textureOffset(arg_0_arg_1, vec2(1.0f), ivec2(1), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.msl
index c19ac1d..7e920e7 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_a161cf(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_a161cf(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), bias(1.0f), int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_a161cf(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_a161cf(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.spvasm
index 9ef90ee..4516d07 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_a161cf "textureSampleBias_a161cf"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,31 +30,40 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %23 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %24 = OpConstantComposite %v2int %int_1 %int_1
+         %27 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %27 = OpConstantNull %v4float
-%textureSampleBias_a161cf = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %27
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20 Bias|ConstOffset %float_1 %24
-               OpStore %res %12
+         %30 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_a161cf = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %30
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23 Bias|ConstOffset %float_1 %27
+               OpStore %res %16
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureSampleBias_a161cf
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureSampleBias_a161cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.wgsl
index 5e297e0..30262bc 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_a161cf() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec2<f32>(1.0f), 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_a161cf();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl
index 76bd6e3..f71c43f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: u32, bias: f32) -> vec4<f32>
 fn textureSampleBias_c6953d() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.dxc.hlsl
index 5910685..2cb4bf6 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_c6953d() {
   float4 res = arg_0.SampleBias(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.fxc.hlsl
index 5910685..2cb4bf6 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_c6953d() {
   float4 res = arg_0.SampleBias(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.msl
index 1b2d131..283c3be 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_c6953d(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_c6953d(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f), 1u, bias(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_c6953d(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_c6953d(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.spvasm
index a397331..23e715f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_c6953d "textureSampleBias_c6953d"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,34 +31,42 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpConstantNull %v4float
-%textureSampleBias_c6953d = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %30
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpCompositeExtract %float %20 2
-         %24 = OpConvertUToF %float %uint_1
-         %27 = OpCompositeConstruct %v4float %21 %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27 Bias %float_1
-               OpStore %res %12
+         %33 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_c6953d = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %33
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpCompositeExtract %float %23 2
+         %27 = OpConvertUToF %float %uint_1
+         %30 = OpCompositeConstruct %v4float %24 %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30 Bias %float_1
+               OpStore %res %16
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSampleBias_c6953d
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleBias_c6953d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.wgsl
index 05036e8..a60bec1 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_c6953d() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_c6953d();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl
index 69b7a6c..4e0b295 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, bias: f32) -> vec4<f32>
 fn textureSampleBias_d3fa1b() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.dxc.hlsl
index 4a3c173..c033878 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_d3fa1b() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.fxc.hlsl
index 4a3c173..c033878 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_d3fa1b() {
   float4 res = arg_0.SampleBias(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.glsl
index 0070577..122ade3 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_d3fa1b() {
   vec4 res = texture(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.msl
index abb2266..96aea01 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_d3fa1b(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_d3fa1b(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f), bias(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_d3fa1b(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_d3fa1b(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.spvasm
index f784b80..b8cb575 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_d3fa1b "textureSampleBias_d3fa1b"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,27 +30,36 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpConstantNull %v4float
-%textureSampleBias_d3fa1b = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %23
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %12 = OpImageSampleImplicitLod %v4float %17 %20 Bias %float_1
-               OpStore %res %12
+         %26 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_d3fa1b = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %26
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %16 = OpImageSampleImplicitLod %v4float %20 %23 Bias %float_1
+               OpStore %res %16
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %31 = OpLoad %v4float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureSampleBias_d3fa1b
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureSampleBias_d3fa1b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.wgsl
index 4b2a5ef..d5c0904 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_d3fa1b() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_d3fa1b();
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl
index 8ce34f3..c9c74da 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleBias(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: i32, bias: f32) -> vec4<f32>
 fn textureSampleBias_eed7c4() {
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.dxc.hlsl
index c7a3c0e..9b53d01 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_eed7c4() {
   float4 res = arg_0.SampleBias(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.fxc.hlsl
index c7a3c0e..9b53d01 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_eed7c4() {
   float4 res = arg_0.SampleBias(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.msl
index f85bedb..55d3a42 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_eed7c4(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_eed7c4(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float4 res = tint_symbol.sample(tint_symbol_1, float3(1.0f), 1, bias(1.0f));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_eed7c4(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_eed7c4(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.spvasm
index dd2157d..c4c1e95 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_eed7c4 "textureSampleBias_eed7c4"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,34 +31,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
-       %void = OpTypeVoid
-          %8 = OpTypeFunction %void
     %v4float = OpTypeVector %float 4
-         %16 = OpTypeSampledImage %3
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %12 = OpTypeFunction %void
+         %19 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %30 = OpConstantNull %v4float
-%textureSampleBias_eed7c4 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_v4float Function %30
-         %14 = OpLoad %7 %arg_1
-         %15 = OpLoad %3 %arg_0
-         %17 = OpSampledImage %16 %15 %14
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpCompositeExtract %float %20 2
-         %24 = OpConvertSToF %float %int_1
-         %27 = OpCompositeConstruct %v4float %21 %22 %23 %24
-         %12 = OpImageSampleImplicitLod %v4float %17 %27 Bias %float_1
-               OpStore %res %12
+         %33 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_eed7c4 = OpFunction %void None %12
+         %15 = OpLabel
+        %res = OpVariable %_ptr_Function_v4float Function %33
+         %17 = OpLoad %7 %arg_1
+         %18 = OpLoad %3 %arg_0
+         %20 = OpSampledImage %19 %18 %17
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpCompositeExtract %float %23 2
+         %27 = OpConvertSToF %float %int_1
+         %30 = OpCompositeConstruct %v4float %24 %25 %26 %27
+         %16 = OpImageSampleImplicitLod %v4float %20 %30 Bias %float_1
+               OpStore %res %16
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSampleBias_eed7c4
+%fragment_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSampleBias_eed7c4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.wgsl
index 7a4b852..bf7a4d9 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleBias_eed7c4() {
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, vec3<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_eed7c4();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl
index 7fdb1a2..b62fb29 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: u32, depth_ref: f32) -> f32
 fn textureSampleCompare_1912e5() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.dxc.hlsl
index 7a92361..e7b35ab 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_1912e5() {
   float res = arg_0.SampleCmp(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.fxc.hlsl
index 7a92361..e7b35ab 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_1912e5() {
   float res = arg_0.SampleCmp(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.msl
index 081841e..a8bd103 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_1912e5(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_1912e5(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float3(1.0f), 1u, 1.0f);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_1912e5(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_1912e5(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.spvasm
index c25195f..23d6ba9 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_1912e5 "textureSampleCompare_1912e5"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,34 +31,42 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v4float = OpTypeVector %float 4
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpConstantNull %float
-%textureSampleCompare_1912e5 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %30
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpCompositeExtract %float %20 2
-         %24 = OpConvertUToF %float %uint_1
-         %27 = OpCompositeConstruct %v4float %21 %22 %23 %24
-         %12 = OpImageSampleDrefImplicitLod %float %16 %27 %float_1
-               OpStore %res %12
+         %33 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_1912e5 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %33
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpCompositeExtract %float %23 2
+         %27 = OpConvertUToF %float %uint_1
+         %30 = OpCompositeConstruct %v4float %24 %25 %26 %27
+         %15 = OpImageSampleDrefImplicitLod %float %19 %30 %float_1
+               OpStore %res %15
+         %36 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %37 = OpLoad %float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSampleCompare_1912e5
+%fragment_main = OpFunction %void None %11
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleCompare_1912e5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.wgsl
index fe92032..c200c3c 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_1912e5() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_1912e5();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl
index 164f501..010d6f9 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> f32
 fn textureSampleCompare_3a5923() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.dxc.hlsl
index 0b84d35..b7417cb 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_3a5923() {
   float res = arg_0.SampleCmp(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.fxc.hlsl
index 0b84d35..b7417cb 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_3a5923() {
   float res = arg_0.SampleCmp(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.glsl
index 572b81d..6376337 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_3a5923() {
   float res = texture(arg_0_arg_1, vec3(vec2(1.0f), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.msl
index c2f18a0..c8826b5 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_3a5923(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_3a5923(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float2(1.0f), 1.0f);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_3a5923(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_3a5923(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.spvasm
index 3e1d3fc..c135107 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_3a5923 "textureSampleCompare_3a5923"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,26 +30,35 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %19 = OpConstantComposite %v2float %float_1 %float_1
+         %22 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpConstantNull %float
-%textureSampleCompare_3a5923 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %22
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %12 = OpImageSampleDrefImplicitLod %float %16 %19 %float_1
-               OpStore %res %12
+         %25 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_3a5923 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %25
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %15 = OpImageSampleDrefImplicitLod %float %19 %22 %float_1
+               OpStore %res %15
+         %29 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %30 = OpLoad %float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureSampleCompare_3a5923
+%fragment_main = OpFunction %void None %11
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureSampleCompare_3a5923
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.wgsl
index f25220e..4f275d2 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_3a5923() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_3a5923();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl
index 8f8b48f..6fe5fa4 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> f32
 fn textureSampleCompare_63fb83() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.dxc.hlsl
index 1b2f46c..6573645 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_63fb83() {
   float res = arg_0.SampleCmp(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.fxc.hlsl
index 1b2f46c..6573645 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_63fb83() {
   float res = arg_0.SampleCmp(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.glsl
index c44279d..92c0b71 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_63fb83() {
   float res = texture(arg_0_arg_1, vec4(vec3(1.0f), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.msl
index 675ddff..6012ef4 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_63fb83(depthcube<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_63fb83(depthcube<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float3(1.0f), 1.0f);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_63fb83(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_63fb83(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.spvasm
index a787c1e..af13641 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_63fb83 "textureSampleCompare_63fb83"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,26 +30,35 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %19 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpConstantNull %float
-%textureSampleCompare_63fb83 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %22
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %12 = OpImageSampleDrefImplicitLod %float %16 %19 %float_1
-               OpStore %res %12
+         %25 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_63fb83 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %25
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %15 = OpImageSampleDrefImplicitLod %float %19 %22 %float_1
+               OpStore %res %15
+         %29 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %30 = OpLoad %float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureSampleCompare_63fb83
+%fragment_main = OpFunction %void None %11
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureSampleCompare_63fb83
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.wgsl
index 23417db..7f58771 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_63fb83() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_63fb83();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl
index 63d0902..040b663 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: u32, depth_ref: f32, @const offset: vec2<i32>) -> f32
 fn textureSampleCompare_7b5025() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.dxc.hlsl
index c30bf79..975c3d4 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_7b5025() {
   float res = arg_0.SampleCmp(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleCompare_7b5025();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.fxc.hlsl
index c30bf79..6ce90ad 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_7b5025() {
   float res = arg_0.SampleCmp(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.msl
index b382b24..f55e079 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_7b5025(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_7b5025(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float2(1.0f), 1u, 1.0f, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_7b5025(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_7b5025(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.spvasm
index 7e77764..613ffda 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_7b5025 "textureSampleCompare_7b5025"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,37 +30,45 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %23 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v2int %int_1 %int_1
+         %33 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpConstantNull %float
-%textureSampleCompare_7b5025 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %33
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpConvertUToF %float %uint_1
-         %26 = OpCompositeConstruct %v3float %21 %22 %23
-         %12 = OpImageSampleDrefImplicitLod %float %16 %26 %float_1 ConstOffset %30
-               OpStore %res %12
+         %36 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_7b5025 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %36
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpConvertUToF %float %uint_1
+         %29 = OpCompositeConstruct %v3float %24 %25 %26
+         %15 = OpImageSampleDrefImplicitLod %float %19 %29 %float_1 ConstOffset %33
+               OpStore %res %15
+         %39 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %40 = OpLoad %float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleCompare_7b5025
+%fragment_main = OpFunction %void None %11
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureSampleCompare_7b5025
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.wgsl
index c2ed132..141aff9 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_7b5025() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_7b5025();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl
index 0a09974..f2e53c0 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: u32, depth_ref: f32) -> f32
 fn textureSampleCompare_90ae56() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.dxc.hlsl
index 25b14da..0ac887a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_90ae56() {
   float res = arg_0.SampleCmp(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.fxc.hlsl
index 25b14da..0ac887a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_90ae56() {
   float res = arg_0.SampleCmp(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.glsl
index 3b40ea3..ba390d1 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_90ae56() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1u)), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.msl
index 2722e0f..69bd1b0 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_90ae56(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_90ae56(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float2(1.0f), 1u, 1.0f);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_90ae56(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_90ae56(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.spvasm
index ddc3391..86b1e2a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_90ae56 "textureSampleCompare_90ae56"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,33 +30,41 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %23 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %29 = OpConstantNull %float
-%textureSampleCompare_90ae56 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %29
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpConvertUToF %float %uint_1
-         %26 = OpCompositeConstruct %v3float %21 %22 %23
-         %12 = OpImageSampleDrefImplicitLod %float %16 %26 %float_1
-               OpStore %res %12
+         %32 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_90ae56 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %32
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpConvertUToF %float %uint_1
+         %29 = OpCompositeConstruct %v3float %24 %25 %26
+         %15 = OpImageSampleDrefImplicitLod %float %19 %29 %float_1
+               OpStore %res %15
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureSampleCompare_90ae56
+%fragment_main = OpFunction %void None %11
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureSampleCompare_90ae56
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.wgsl
index 47b307a..16a0ff1 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/90ae56.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_90ae56() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_90ae56();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl
index aabaf7a..83b23af 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: i32, depth_ref: f32) -> f32
 fn textureSampleCompare_a3ca7e() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.dxc.hlsl
index 065ae8e..a034d5e 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_a3ca7e() {
   float res = arg_0.SampleCmp(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.fxc.hlsl
index 065ae8e..a034d5e 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_a3ca7e() {
   float res = arg_0.SampleCmp(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.msl
index 45b7d6d..97bb62f 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_a3ca7e(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_a3ca7e(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float3(1.0f), 1, 1.0f);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_a3ca7e(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_a3ca7e(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.spvasm
index d61275f..e192cef 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_a3ca7e "textureSampleCompare_a3ca7e"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,34 +31,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v4float = OpTypeVector %float 4
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %23 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpConstantNull %float
-%textureSampleCompare_a3ca7e = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %30
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpCompositeExtract %float %20 2
-         %24 = OpConvertSToF %float %int_1
-         %27 = OpCompositeConstruct %v4float %21 %22 %23 %24
-         %12 = OpImageSampleDrefImplicitLod %float %16 %27 %float_1
-               OpStore %res %12
+         %33 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_a3ca7e = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %33
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpCompositeExtract %float %23 2
+         %27 = OpConvertSToF %float %int_1
+         %30 = OpCompositeConstruct %v4float %24 %25 %26 %27
+         %15 = OpImageSampleDrefImplicitLod %float %19 %30 %float_1
+               OpStore %res %15
+         %37 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %38 = OpLoad %float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSampleCompare_a3ca7e
+%fragment_main = OpFunction %void None %11
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSampleCompare_a3ca7e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.wgsl
index 58499f5..75d8381 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_a3ca7e() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec3<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_a3ca7e();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl
index 3edb3b0..6813dcb 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: i32, depth_ref: f32, @const offset: vec2<i32>) -> f32
 fn textureSampleCompare_af1051() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.dxc.hlsl
index 40bf84a..3daa089 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_af1051() {
   float res = arg_0.SampleCmp(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleCompare_af1051();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.fxc.hlsl
index 40bf84a..7d96d72 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_af1051() {
   float res = arg_0.SampleCmp(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.msl
index d1a9096..01313c5 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_af1051(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_af1051(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float2(1.0f), 1, 1.0f, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_af1051(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_af1051(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.spvasm
index 168e219..bb47bfa 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_af1051 "textureSampleCompare_af1051"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,35 +30,44 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %23 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %28 = OpConstantComposite %v2int %int_1 %int_1
+         %31 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %31 = OpConstantNull %float
-%textureSampleCompare_af1051 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %31
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpConvertSToF %float %int_1
-         %26 = OpCompositeConstruct %v3float %21 %22 %23
-         %12 = OpImageSampleDrefImplicitLod %float %16 %26 %float_1 ConstOffset %28
-               OpStore %res %12
+         %34 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_af1051 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %34
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpConvertSToF %float %int_1
+         %29 = OpCompositeConstruct %v3float %24 %25 %26
+         %15 = OpImageSampleDrefImplicitLod %float %19 %29 %float_1 ConstOffset %31
+               OpStore %res %15
+         %38 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %39 = OpLoad %float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSampleCompare_af1051
+%fragment_main = OpFunction %void None %11
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureSampleCompare_af1051
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.wgsl
index c4cb087..117c77b 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_af1051() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_af1051();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl
index 548b875..b6d41d4 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: i32, depth_ref: f32) -> f32
 fn textureSampleCompare_dd431d() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.dxc.hlsl
index 56a5b3f..91d1bdf 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_dd431d() {
   float res = arg_0.SampleCmp(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.fxc.hlsl
index 56a5b3f..91d1bdf 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_dd431d() {
   float res = arg_0.SampleCmp(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.glsl
index b3fa410..f73f5e5 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_dd431d() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1)), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.msl
index d265725..7362036 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_dd431d(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_dd431d(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float2(1.0f), 1, 1.0f);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_dd431d(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_dd431d(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.spvasm
index 31d965f..f9df187 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_dd431d "textureSampleCompare_dd431d"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,33 +30,42 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %23 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %29 = OpConstantNull %float
-%textureSampleCompare_dd431d = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %29
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %21 = OpCompositeExtract %float %20 0
-         %22 = OpCompositeExtract %float %20 1
-         %23 = OpConvertSToF %float %int_1
-         %26 = OpCompositeConstruct %v3float %21 %22 %23
-         %12 = OpImageSampleDrefImplicitLod %float %16 %26 %float_1
-               OpStore %res %12
+         %32 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_dd431d = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %32
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %24 = OpCompositeExtract %float %23 0
+         %25 = OpCompositeExtract %float %23 1
+         %26 = OpConvertSToF %float %int_1
+         %29 = OpCompositeConstruct %v3float %24 %25 %26
+         %15 = OpImageSampleDrefImplicitLod %float %19 %29 %float_1
+               OpStore %res %15
+         %36 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %37 = OpLoad %float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureSampleCompare_dd431d
+%fragment_main = OpFunction %void None %11
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleCompare_dd431d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.wgsl
index e3f8030..12fb436 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_dd431d() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_dd431d();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl
index 83b1e26..e8c5a42 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> f32
 fn textureSampleCompare_dec064() {
   var res: f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.f), 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.dxc.hlsl
index 4db9f52..3acf3c1 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.dxc.hlsl
@@ -1,11 +1,28 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_dec064() {
   float res = arg_0.SampleCmp(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleCompare_dec064();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.fxc.hlsl
index 4db9f52..9873230 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_dec064() {
   float res = arg_0.SampleCmp(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.glsl
index f1d1987..33a580a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.glsl
@@ -3,8 +3,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_dec064() {
   float res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), 1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.msl
index 1714b59..a8bcf7e 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.msl
@@ -1,12 +1,13 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_dec064(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_dec064(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float res = tint_symbol.sample_compare(tint_symbol_1, float2(1.0f), 1.0f, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_dec064(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_dec064(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.spvasm
index 1d736d1..46fd96a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_dec064 "textureSampleCompare_dec064"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -16,6 +19,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -23,30 +30,39 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
-         %15 = OpTypeSampledImage %3
+         %11 = OpTypeFunction %void
+         %18 = OpTypeSampledImage %3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %19 = OpConstantComposite %v2float %float_1 %float_1
+         %22 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %26 = OpConstantNull %float
-%textureSampleCompare_dec064 = OpFunction %void None %8
-         %11 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %26
-         %13 = OpLoad %7 %arg_1
-         %14 = OpLoad %3 %arg_0
-         %16 = OpSampledImage %15 %14 %13
-         %12 = OpImageSampleDrefImplicitLod %float %16 %19 %float_1 ConstOffset %23
-               OpStore %res %12
+         %29 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_dec064 = OpFunction %void None %11
+         %14 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %29
+         %16 = OpLoad %7 %arg_1
+         %17 = OpLoad %3 %arg_0
+         %19 = OpSampledImage %18 %17 %16
+         %15 = OpImageSampleDrefImplicitLod %float %19 %22 %float_1 ConstOffset %26
+               OpStore %res %15
+         %33 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %34 = OpLoad %float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureSampleCompare_dec064
+%fragment_main = OpFunction %void None %11
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureSampleCompare_dec064
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.wgsl
index 5cee689..2762ab7 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompare_dec064() {
   var res : f32 = textureSampleCompare(arg_0, arg_1, vec2<f32>(1.0f), 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_dec064();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl
index 668a270..82b9d60 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: i32, depth_ref: f32) -> f32
 fn textureSampleCompareLevel_1116ed() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.dxc.hlsl
index 23f5d43..7572e3c 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_1116ed() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.fxc.hlsl
index 23f5d43..7572e3c 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_1116ed() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.glsl
index c77d7e9..6044632 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1116ed() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1)), 1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1116ed() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1)), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1116ed() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1)), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.msl
index b1652c7..c6c376d 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_1116ed(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_1116ed(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float2(1.0f), 1, 1.0f, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_1116ed(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_1116ed(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_1116ed(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_1116ed(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_1116ed(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_1116ed(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.spvasm
index 1c01ce4..cb10978 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_1116ed "textureSampleCompareLevel_1116ed"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,51 +47,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
     %float_0 = OpConstant %float 0
 %_ptr_Function_float = OpTypePointer Function %float
-         %37 = OpTypeFunction %v4float
-%textureSampleCompareLevel_1116ed = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %45 = OpTypeFunction %v4float
+%textureSampleCompareLevel_1116ed = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleDrefExplicitLod %float %23 %33 %float_1 Lod %float_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleDrefExplicitLod %float %26 %36 %float_1 Lod %float_0
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %44 = OpLoad %float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.wgsl
index 8a1f88c..fb2516b 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_1116ed() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_1116ed();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl
index af580e6..085e930 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> f32
 fn textureSampleCompareLevel_1568e3() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.dxc.hlsl
index bdfef71..bcc84ce 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_1568e3() {
   float res = arg_0.SampleCmpLevelZero(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.fxc.hlsl
index bdfef71..bcc84ce 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_1568e3() {
   float res = arg_0.SampleCmpLevelZero(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.glsl
index 2205e4d..6eed60f 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1568e3() {
   float res = texture(arg_0_arg_1, vec4(vec3(1.0f), 1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1568e3() {
   float res = texture(arg_0_arg_1, vec4(vec3(1.0f), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1568e3() {
   float res = texture(arg_0_arg_1, vec4(vec3(1.0f), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.msl
index ed8c9f2..331c216 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_1568e3(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_1568e3(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float3(1.0f), 1.0f, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_1568e3(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_1568e3(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_1568e3(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_1568e3(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_1568e3(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_1568e3(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.spvasm
index 7b336e2..82c3790 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_1568e3 "textureSampleCompareLevel_1568e3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,44 +47,53 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
     %float_0 = OpConstant %float 0
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeFunction %v4float
-%textureSampleCompareLevel_1568e3 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %38 = OpTypeFunction %v4float
+%textureSampleCompareLevel_1568e3 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleDrefExplicitLod %float %23 %26 %float_1 Lod %float_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleDrefExplicitLod %float %26 %29 %float_1 Lod %float_0
+               OpStore %res %22
+         %36 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %37 = OpLoad %float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
+%fragment_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
+%compute_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.wgsl
index 30a988d..9094a22 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_1568e3() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_1568e3();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl
index 1f52f7f..ba9589a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> f32
 fn textureSampleCompareLevel_2ad2b1() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.dxc.hlsl
index 1bf32a3..37b0e6f 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_2ad2b1() {
   float res = arg_0.SampleCmpLevelZero(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.fxc.hlsl
index 1bf32a3..37b0e6f 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_2ad2b1() {
   float res = arg_0.SampleCmpLevelZero(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.glsl
index 4a5b1ae..250737c 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_2ad2b1() {
   float res = texture(arg_0_arg_1, vec3(vec2(1.0f), 1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_2ad2b1() {
   float res = texture(arg_0_arg_1, vec3(vec2(1.0f), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_2ad2b1() {
   float res = texture(arg_0_arg_1, vec3(vec2(1.0f), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl
index ec2ed1f..3e15a9a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_2ad2b1(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_2ad2b1(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float2(1.0f), 1.0f, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_2ad2b1(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_2ad2b1(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_2ad2b1(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_2ad2b1(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_2ad2b1(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_2ad2b1(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.spvasm
index 0a3e8b9..0d4b1ff 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_2ad2b1 "textureSampleCompareLevel_2ad2b1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,44 +47,53 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
     %float_0 = OpConstant %float 0
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeFunction %v4float
-%textureSampleCompareLevel_2ad2b1 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %38 = OpTypeFunction %v4float
+%textureSampleCompareLevel_2ad2b1 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleDrefExplicitLod %float %23 %26 %float_1 Lod %float_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleDrefExplicitLod %float %26 %29 %float_1 Lod %float_0
+               OpStore %res %22
+         %36 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %37 = OpLoad %float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
+%fragment_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
+%compute_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.wgsl
index e715766..5d41272 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_2ad2b1() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_2ad2b1();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl
index 6406d08..2934481 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: i32, depth_ref: f32) -> f32
 fn textureSampleCompareLevel_4cf3a2() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec3<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.dxc.hlsl
index 5921377..bf9d05e 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_4cf3a2() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.fxc.hlsl
index 5921377..bf9d05e 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_4cf3a2() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl
index eb1412b..0441573 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_4cf3a2(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_4cf3a2(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float3(1.0f), 1, 1.0f, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_4cf3a2(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_4cf3a2(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_4cf3a2(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_4cf3a2(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_4cf3a2(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_4cf3a2(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.spvasm
index 44e64c3..d0b3f2c 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_4cf3a2 "textureSampleCompareLevel_4cf3a2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,51 +48,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
     %float_0 = OpConstant %float 0
 %_ptr_Function_float = OpTypePointer Function %float
-         %37 = OpTypeFunction %v4float
-%textureSampleCompareLevel_4cf3a2 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %45 = OpTypeFunction %v4float
+%textureSampleCompareLevel_4cf3a2 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageSampleDrefExplicitLod %float %23 %33 %float_1 Lod %float_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageSampleDrefExplicitLod %float %26 %36 %float_1 Lod %float_0
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %44 = OpLoad %float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.wgsl
index 0d98a0f..9b9fb7a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_4cf3a2() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec3<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_4cf3a2();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl
index 3316156..f313108 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: u32, depth_ref: f32) -> f32
 fn textureSampleCompareLevel_7dc3c0() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.dxc.hlsl
index e0be522..7d517c5 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_7dc3c0() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.fxc.hlsl
index e0be522..7d517c5 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_7dc3c0() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.glsl
index db5ecc8..a9bf133 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7dc3c0() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1u)), 1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7dc3c0() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1u)), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7dc3c0() {
   float res = texture(arg_0_arg_1, vec4(vec3(vec2(1.0f), float(1u)), 1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.msl
index 02aa881..4ecd409 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_7dc3c0(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_7dc3c0(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float2(1.0f), 1u, 1.0f, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_7dc3c0(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_7dc3c0(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_7dc3c0(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_7dc3c0(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_7dc3c0(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_7dc3c0(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.spvasm
index d144689..6e2faab 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_7dc3c0 "textureSampleCompareLevel_7dc3c0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,51 +47,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
     %float_0 = OpConstant %float 0
 %_ptr_Function_float = OpTypePointer Function %float
-         %37 = OpTypeFunction %v4float
-%textureSampleCompareLevel_7dc3c0 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %44 = OpTypeFunction %v4float
+%textureSampleCompareLevel_7dc3c0 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleDrefExplicitLod %float %23 %33 %float_1 Lod %float_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleDrefExplicitLod %float %26 %36 %float_1 Lod %float_0
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %43 = OpLoad %float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.wgsl
index 194ba59..5a3d1ae 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_7dc3c0() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_7dc3c0();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl
index 8a7f1ca..96aaf44 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> f32
 fn textureSampleCompareLevel_7f2b9a() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.f), 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.dxc.hlsl
index b5a7b64..365f471 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_7f2b9a() {
   float res = arg_0.SampleCmpLevelZero(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleCompareLevel_7f2b9a();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.fxc.hlsl
index b5a7b64..90d8b7e 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_7f2b9a() {
   float res = arg_0.SampleCmpLevelZero(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.glsl
index 9cd29f9..e586842 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7f2b9a() {
   float res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), 1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7f2b9a() {
   float res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), 1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7f2b9a() {
   float res = textureOffset(arg_0_arg_1, vec3(vec2(1.0f), 1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.msl
index 35b8444..942855c 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_7f2b9a(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_7f2b9a(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float2(1.0f), 1.0f, level(0), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_7f2b9a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_7f2b9a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_7f2b9a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_7f2b9a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_7f2b9a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_7f2b9a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.spvasm
index 298c239..55800d7 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_7f2b9a "textureSampleCompareLevel_7f2b9a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,48 +47,57 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
     %float_0 = OpConstant %float 0
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %31 = OpConstantComposite %v2int %int_1 %int_1
+         %34 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %34 = OpTypeFunction %v4float
-%textureSampleCompareLevel_7f2b9a = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %42 = OpTypeFunction %v4float
+%textureSampleCompareLevel_7f2b9a = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleDrefExplicitLod %float %23 %26 %float_1 Lod|ConstOffset %float_0 %31
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleDrefExplicitLod %float %26 %29 %float_1 Lod|ConstOffset %float_0 %34
+               OpStore %res %22
+         %40 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %41 = OpLoad %float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
+%fragment_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
+%compute_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.wgsl
index 4d9f947..ce52dca 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_7f2b9a() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.0f), 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_7f2b9a();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl
index 0f80ec6..51957c1 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: u32, depth_ref: f32) -> f32
 fn textureSampleCompareLevel_958c87() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec3<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.dxc.hlsl
index 2b0a18d..fdce4ee 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_958c87() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.fxc.hlsl
index 2b0a18d..fdce4ee 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_958c87() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.msl
index 8a6ee8a..8dd0f67 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_958c87(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_958c87(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float3(1.0f), 1u, 1.0f, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_958c87(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_958c87(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_958c87(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_958c87(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_958c87(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_958c87(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.spvasm
index d1e88c1..2d0a54f 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_958c87 "textureSampleCompareLevel_958c87"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,51 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
     %float_0 = OpConstant %float 0
 %_ptr_Function_float = OpTypePointer Function %float
-         %37 = OpTypeFunction %v4float
-%textureSampleCompareLevel_958c87 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %44 = OpTypeFunction %v4float
+%textureSampleCompareLevel_958c87 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageSampleDrefExplicitLod %float %23 %33 %float_1 Lod %float_0
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageSampleDrefExplicitLod %float %26 %36 %float_1 Lod %float_0
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %43 = OpLoad %float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureSampleCompareLevel_958c87
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleCompareLevel_958c87
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleCompareLevel_958c87
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleCompareLevel_958c87
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleCompareLevel_958c87
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleCompareLevel_958c87
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.wgsl
index b8e519d..e449162 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_958c87() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec3<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_958c87();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl
index 723be9a..adf19d0 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: i32, depth_ref: f32, @const offset: vec2<i32>) -> f32
 fn textureSampleCompareLevel_b6e47c() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.dxc.hlsl
index 77b7e86..2009f76 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_b6e47c() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleCompareLevel_b6e47c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.fxc.hlsl
index 77b7e86..3319df0 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_b6e47c() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.msl
index 75ff04c..df00255 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_b6e47c(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_b6e47c(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float2(1.0f), 1, 1.0f, level(0), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_b6e47c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_b6e47c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_b6e47c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_b6e47c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_b6e47c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_b6e47c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.spvasm
index b65a7c2..9280580 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_b6e47c "textureSampleCompareLevel_b6e47c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,53 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
     %float_0 = OpConstant %float 0
       %v2int = OpTypeVector %int 2
-         %36 = OpConstantComposite %v2int %int_1 %int_1
+         %39 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %39 = OpTypeFunction %v4float
-%textureSampleCompareLevel_b6e47c = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %47 = OpTypeFunction %v4float
+%textureSampleCompareLevel_b6e47c = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleDrefExplicitLod %float %23 %33 %float_1 Lod|ConstOffset %float_0 %36
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleDrefExplicitLod %float %26 %36 %float_1 Lod|ConstOffset %float_0 %39
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.wgsl
index 887ac6a..f041328 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_b6e47c() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_b6e47c();
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl
index 36d2f40..329f2a8 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleCompareLevel(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: u32, depth_ref: f32, @const offset: vec2<i32>) -> f32
 fn textureSampleCompareLevel_bcb3dd() {
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.dxc.hlsl
index e0c9224..aab7342 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_bcb3dd() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleCompareLevel_bcb3dd();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.fxc.hlsl
index e0c9224..4b7b0e2 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_bcb3dd() {
   float res = arg_0.SampleCmpLevelZero(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.msl
index 4259a5c..9b914d4 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_bcb3dd(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_bcb3dd(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample_compare(tint_symbol_2, float2(1.0f), 1u, 1.0f, level(0), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_bcb3dd(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_bcb3dd(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_bcb3dd(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_bcb3dd(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_bcb3dd(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_bcb3dd(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.spvasm
index 73aa482..f999f3f 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_bcb3dd "textureSampleCompareLevel_bcb3dd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,55 +47,63 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
     %float_0 = OpConstant %float 0
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %41 = OpTypeFunction %v4float
-%textureSampleCompareLevel_bcb3dd = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %48 = OpTypeFunction %v4float
+%textureSampleCompareLevel_bcb3dd = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleDrefExplicitLod %float %23 %33 %float_1 Lod|ConstOffset %float_0 %38
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleDrefExplicitLod %float %26 %36 %float_1 Lod|ConstOffset %float_0 %41
+               OpStore %res %22
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.wgsl
index 4e68be3..b373acb 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleCompareLevel_bcb3dd() {
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_bcb3dd();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl
index 9d50e04..a98d922 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32>
 fn textureSampleGrad_21402b() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.f), vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.dxc.hlsl
index 31b2abe..16a855a 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_21402b() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.fxc.hlsl
index 31b2abe..16a855a 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_21402b() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.glsl
index 9b6b7bf..ed8048b 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_21402b() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_21402b() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_21402b() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.msl
index 0f86e1c..7c6e52b 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_21402b(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_21402b(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), gradient3d(float3(1.0f), float3(1.0f)));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_21402b(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_21402b(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_21402b(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_21402b(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_21402b(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_21402b(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.spvasm
index 01c9f62..dafa0a9 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_21402b "textureSampleGrad_21402b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,43 +47,52 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %29 = OpTypeFunction %v4float
-%textureSampleGrad_21402b = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%textureSampleGrad_21402b = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Grad %26 %26
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Grad %29 %29
+               OpStore %res %22
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureSampleGrad_21402b
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleGrad_21402b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleGrad_21402b
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleGrad_21402b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleGrad_21402b
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleGrad_21402b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.wgsl
index 89efe6d..8fcc134 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_21402b() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_21402b();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl
index b81aa6a..c58aac1 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, ddx: vec2<f32>, ddy: vec2<f32>) -> vec4<f32>
 fn textureSampleGrad_2ecd8f() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.f), 1i, vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.dxc.hlsl
index a835873..7ef3878 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_2ecd8f() {
   float4 res = arg_0.SampleGrad(arg_1, float3((1.0f).xx, float(1)), (1.0f).xx, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.fxc.hlsl
index a835873..7ef3878 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_2ecd8f() {
   float4 res = arg_0.SampleGrad(arg_1, float3((1.0f).xx, float(1)), (1.0f).xx, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.glsl
index d3ab105..be8a782 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_2ecd8f() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(vec2(1.0f), float(1)), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_2ecd8f() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(vec2(1.0f), float(1)), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_2ecd8f() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(vec2(1.0f), float(1)), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.msl
index 2927067..6de3d84 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_2ecd8f(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_2ecd8f(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1, gradient2d(float2(1.0f), float2(1.0f)));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_2ecd8f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_2ecd8f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_2ecd8f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_2ecd8f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_2ecd8f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_2ecd8f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
index 0abdf22..34f4bc1 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_2ecd8f "textureSampleGrad_2ecd8f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,50 +47,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleGrad_2ecd8f = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureSampleGrad_2ecd8f = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Grad %27 %27
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Grad %30 %30
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleGrad_2ecd8f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleGrad_2ecd8f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleGrad_2ecd8f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
index 7ca3d1f..0cd285d 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_2ecd8f() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.0f), 1i, vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_2ecd8f();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl
index 3379bee..453402c 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, ddx: vec2<f32>, ddy: vec2<f32>) -> vec4<f32>
 fn textureSampleGrad_521263() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.f), vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.dxc.hlsl
index e45601c..fa19a08 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_521263() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xx, (1.0f).xx, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.fxc.hlsl
index e45601c..fa19a08 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_521263() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xx, (1.0f).xx, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.glsl
index 2780701..0907653 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_521263() {
   vec4 res = textureGrad(arg_0_arg_1, vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_521263() {
   vec4 res = textureGrad(arg_0_arg_1, vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_521263() {
   vec4 res = textureGrad(arg_0_arg_1, vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.msl
index 6a4297e..385eb89 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_521263(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_521263(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), gradient2d(float2(1.0f), float2(1.0f)));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_521263(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_521263(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_521263(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_521263(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_521263(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_521263(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.spvasm
index 6ad6311..441e558 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_521263 "textureSampleGrad_521263"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,43 +47,52 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %29 = OpTypeFunction %v4float
-%textureSampleGrad_521263 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%textureSampleGrad_521263 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Grad %26 %26
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Grad %29 %29
+               OpStore %res %22
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureSampleGrad_521263
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleGrad_521263
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleGrad_521263
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleGrad_521263
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleGrad_521263
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleGrad_521263
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.wgsl
index 1deee69..01d6d1b 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_521263() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_521263();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl
index 1cbe125..518d2df 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32>
 fn textureSampleGrad_5312f4() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.f), vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.dxc.hlsl
index 2839b8d..30445d7 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_5312f4() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.fxc.hlsl
index 2839b8d..30445d7 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_5312f4() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.glsl
index a163aeb..7b0c55a 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5312f4() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5312f4() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5312f4() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.msl
index d105445..60d7a74 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_5312f4(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_5312f4(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), gradientcube(float3(1.0f), float3(1.0f)));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_5312f4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_5312f4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_5312f4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_5312f4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_5312f4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_5312f4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.spvasm
index 30f8d94..f0fea18 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_5312f4 "textureSampleGrad_5312f4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,43 +47,52 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %29 = OpTypeFunction %v4float
-%textureSampleGrad_5312f4 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%textureSampleGrad_5312f4 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Grad %26 %26
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Grad %29 %29
+               OpStore %res %22
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureSampleGrad_5312f4
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleGrad_5312f4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleGrad_5312f4
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleGrad_5312f4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleGrad_5312f4
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleGrad_5312f4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.wgsl
index 6d19e05..3707711 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_5312f4() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_5312f4();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl
index 45d8aec..c9463c8 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>, @const offset: vec3<i32>) -> vec4<f32>
 fn textureSampleGrad_5884dd() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.f), vec3<f32>(1.f), vec3<f32>(1.f), vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.dxc.hlsl
index 6454b45..a59ae76 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_5884dd() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleGrad_5884dd();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.fxc.hlsl
index 6454b45..8922594 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_5884dd() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.glsl
index 5be5d15..8d14fb3 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5884dd() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f), ivec3(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5884dd() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f), ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5884dd() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(1.0f), vec3(1.0f), vec3(1.0f), ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.msl
index 024d415..1292573 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_5884dd(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_5884dd(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), gradient3d(float3(1.0f), float3(1.0f)), int3(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_5884dd(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_5884dd(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_5884dd(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_5884dd(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_5884dd(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_5884dd(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.spvasm
index dff750a..344a63c 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_5884dd "textureSampleGrad_5884dd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,56 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %33 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %33 = OpTypeFunction %v4float
-%textureSampleGrad_5884dd = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
+%textureSampleGrad_5884dd = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Grad|ConstOffset %26 %26 %30
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Grad|ConstOffset %29 %29 %33
+               OpStore %res %22
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleGrad_5884dd
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSampleGrad_5884dd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleGrad_5884dd
+%fragment_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleGrad_5884dd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleGrad_5884dd
+%compute_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleGrad_5884dd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.wgsl
index 67f251f..2a12baa 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_5884dd() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<f32>(1.0f), vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_5884dd();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl
index a4a5588..dbee21f 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, ddx: vec2<f32>, ddy: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleGrad_7cd6de() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.f), 1u, vec2<f32>(1.f), vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.dxc.hlsl
index 3336bc5..6871b07 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_7cd6de() {
   float4 res = arg_0.SampleGrad(arg_1, float3((1.0f).xx, float(1u)), (1.0f).xx, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleGrad_7cd6de();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.fxc.hlsl
index 3336bc5..e684a5d 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_7cd6de() {
   float4 res = arg_0.SampleGrad(arg_1, float3((1.0f).xx, float(1u)), (1.0f).xx, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.glsl
index 82bb5d0..a7aea2a 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_7cd6de() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_7cd6de() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_7cd6de() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.msl
index ef3b01d..43eaed8 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_7cd6de(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_7cd6de(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1u, gradient2d(float2(1.0f), float2(1.0f)), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_7cd6de(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_7cd6de(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_7cd6de(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_7cd6de(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_7cd6de(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_7cd6de(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.spvasm
index 2db04bc..6ec0877 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_7cd6de "textureSampleGrad_7cd6de"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureSampleGrad_7cd6de = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %47 = OpTypeFunction %v4float
+%textureSampleGrad_7cd6de = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Grad|ConstOffset %27 %27 %37
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Grad|ConstOffset %30 %30 %40
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleGrad_7cd6de
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleGrad_7cd6de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleGrad_7cd6de
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleGrad_7cd6de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleGrad_7cd6de
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleGrad_7cd6de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.wgsl
index aa33eef..7014505 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/7cd6de.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_7cd6de() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.0f), 1u, vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_7cd6de();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl
index f91acf5..31e33ee 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, ddx: vec2<f32>, ddy: vec2<f32>) -> vec4<f32>
 fn textureSampleGrad_a09131() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.f), 1u, vec2<f32>(1.f), vec2<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.dxc.hlsl
index 42d3d4a..1c73de4 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_a09131() {
   float4 res = arg_0.SampleGrad(arg_1, float3((1.0f).xx, float(1u)), (1.0f).xx, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.fxc.hlsl
index 42d3d4a..1c73de4 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_a09131() {
   float4 res = arg_0.SampleGrad(arg_1, float3((1.0f).xx, float(1u)), (1.0f).xx, (1.0f).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.glsl
index 56f8737..a74d222 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_a09131() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_a09131() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_a09131() {
   vec4 res = textureGrad(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.msl
index 3fa0710..62cb16a 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_a09131(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_a09131(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1u, gradient2d(float2(1.0f), float2(1.0f)));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_a09131(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_a09131(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_a09131(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_a09131(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_a09131(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_a09131(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.spvasm
index cdd9b30..5362a7e 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_a09131 "textureSampleGrad_a09131"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,50 +47,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleGrad_a09131 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureSampleGrad_a09131 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Grad %27 %27
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Grad %30 %30
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleGrad_a09131
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleGrad_a09131
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleGrad_a09131
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleGrad_a09131
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleGrad_a09131
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleGrad_a09131
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.wgsl
index eaec345..2784cb0 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/a09131.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_a09131() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.0f), 1u, vec2<f32>(1.0f), vec2<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_a09131();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl
index a266648..015cdad 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: u32, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32>
 fn textureSampleGrad_bbb58f() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.f), 1u, vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.dxc.hlsl
index fa78b8f..919caf8 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_bbb58f() {
   float4 res = arg_0.SampleGrad(arg_1, float4((1.0f).xxx, float(1u)), (1.0f).xxx, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.fxc.hlsl
index fa78b8f..919caf8 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_bbb58f() {
   float4 res = arg_0.SampleGrad(arg_1, float4((1.0f).xxx, float(1u)), (1.0f).xxx, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.msl
index 211c87f..bb8b13f 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_bbb58f(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_bbb58f(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), 1u, gradientcube(float3(1.0f), float3(1.0f)));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_bbb58f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_bbb58f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_bbb58f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_bbb58f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_bbb58f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_bbb58f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.spvasm
index 79969b6..04961e3 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_bbb58f "textureSampleGrad_bbb58f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleGrad_bbb58f = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureSampleGrad_bbb58f = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Grad %26 %26
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Grad %29 %29
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleGrad_bbb58f
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleGrad_bbb58f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleGrad_bbb58f
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleGrad_bbb58f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleGrad_bbb58f
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleGrad_bbb58f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.wgsl
index b2672b8..1497769 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_bbb58f() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.0f), 1u, vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_bbb58f();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl
index 59f4146..8be7e94 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, ddx: vec2<f32>, ddy: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleGrad_d4e3c5() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.f), vec2<f32>(1.f), vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.dxc.hlsl
index abee8b8..da67188 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_d4e3c5() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xx, (1.0f).xx, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleGrad_d4e3c5();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.fxc.hlsl
index abee8b8..8d39a1f 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_d4e3c5() {
   float4 res = arg_0.SampleGrad(arg_1, (1.0f).xx, (1.0f).xx, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.glsl
index 7eee4a3..6852e79 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d4e3c5() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec2(1.0f), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d4e3c5() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec2(1.0f), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d4e3c5() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec2(1.0f), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.msl
index 46f7401..3154d78 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_d4e3c5(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_d4e3c5(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), gradient2d(float2(1.0f), float2(1.0f)), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_d4e3c5(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_d4e3c5(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_d4e3c5(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_d4e3c5(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_d4e3c5(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_d4e3c5(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.spvasm
index 3156b3c..d56c353 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_d4e3c5 "textureSampleGrad_d4e3c5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,56 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v2int %int_1 %int_1
+         %33 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %33 = OpTypeFunction %v4float
-%textureSampleGrad_d4e3c5 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
+%textureSampleGrad_d4e3c5 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Grad|ConstOffset %26 %26 %30
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Grad|ConstOffset %29 %29 %33
+               OpStore %res %22
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleGrad_d4e3c5
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSampleGrad_d4e3c5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleGrad_d4e3c5
+%fragment_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleGrad_d4e3c5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleGrad_d4e3c5
+%compute_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleGrad_d4e3c5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.wgsl
index 7a99649..4ea61c6 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_d4e3c5() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_d4e3c5();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl
index 3536a86..0ec7fbf 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, ddx: vec2<f32>, ddy: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleGrad_d65515() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.f), 1i, vec2<f32>(1.f), vec2<f32>(1.f), vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.dxc.hlsl
index 5b13851..867844f 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_d65515() {
   float4 res = arg_0.SampleGrad(arg_1, float3((1.0f).xx, float(1)), (1.0f).xx, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleGrad_d65515();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.fxc.hlsl
index 5b13851..22e5144 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_d65515() {
   float4 res = arg_0.SampleGrad(arg_1, float3((1.0f).xx, float(1)), (1.0f).xx, (1.0f).xx, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.glsl
index 8e08c66..7ecdb27 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d65515() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d65515() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d65515() {
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), vec2(1.0f), vec2(1.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.msl
index b269220..5fc9b6b 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_d65515(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_d65515(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1, gradient2d(float2(1.0f), float2(1.0f)), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_d65515(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_d65515(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_d65515(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_d65515(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_d65515(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_d65515(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.spvasm
index 2feaabd..f70f9ba 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_d65515 "textureSampleGrad_d65515"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %35 = OpConstantComposite %v2int %int_1 %int_1
+         %38 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureSampleGrad_d65515 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %46 = OpTypeFunction %v4float
+%textureSampleGrad_d65515 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Grad|ConstOffset %27 %27 %35
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Grad|ConstOffset %30 %30 %38
+               OpStore %res %22
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleGrad_d65515
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleGrad_d65515
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureSampleGrad_d65515
+%fragment_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleGrad_d65515
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleGrad_d65515
+%compute_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleGrad_d65515
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.wgsl
index e627316..f118954 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_d65515() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec2<f32>(1.0f), 1i, vec2<f32>(1.0f), vec2<f32>(1.0f), vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_d65515();
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl
index faabeef..c2b0116 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleGrad(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: i32, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32>
 fn textureSampleGrad_e383db() {
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.f), 1i, vec3<f32>(1.f), vec3<f32>(1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.dxc.hlsl
index 87c187d..c886b41 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_e383db() {
   float4 res = arg_0.SampleGrad(arg_1, float4((1.0f).xxx, float(1)), (1.0f).xxx, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.fxc.hlsl
index 87c187d..c886b41 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_e383db() {
   float4 res = arg_0.SampleGrad(arg_1, float4((1.0f).xxx, float(1)), (1.0f).xxx, (1.0f).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.msl
index 2ce087f..ad955dc 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_e383db(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_e383db(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), 1, gradientcube(float3(1.0f), float3(1.0f)));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_e383db(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_e383db(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_e383db(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_e383db(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_e383db(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_e383db(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.spvasm
index 0e311b6..9c839e3 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_e383db "textureSampleGrad_e383db"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleGrad_e383db = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureSampleGrad_e383db = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Grad %26 %26
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Grad %29 %29
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleGrad_e383db
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleGrad_e383db
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleGrad_e383db
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleGrad_e383db
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleGrad_e383db
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleGrad_e383db
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.wgsl
index 8dfe9ae..fcc7940 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleGrad_e383db() {
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, vec3<f32>(1.0f), 1i, vec3<f32>(1.0f), vec3<f32>(1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_e383db();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl
index dc50131..d8cf479 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: i32) -> f32
 fn textureSampleLevel_02be59() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.dxc.hlsl
index 805efd4..477ff89 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_02be59() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.fxc.hlsl
index 805efd4..477ff89 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_02be59() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.glsl
index 50224c5..99f5205 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_02be59() {
   float res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_02be59() {
   float res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_02be59() {
   float res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.msl
index fe833d5..9d8fdad 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_02be59(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_02be59(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), level(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_02be59(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_02be59(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_02be59(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_02be59(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_02be59(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_02be59(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.spvasm
index e1b7508..219a265 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_02be59 "textureSampleLevel_02be59"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,56 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpTypeFunction %v4float
-%textureSampleLevel_02be59 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %41 = OpTypeFunction %v4float
+%textureSampleLevel_02be59 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %27 Lod %28
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %30 Lod %31
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %39 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %40 = OpLoad %float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleLevel_02be59
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSampleLevel_02be59
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleLevel_02be59
+%fragment_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_02be59
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_02be59
+%compute_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_02be59
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.wgsl
index bb6778c..3c7cf47 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_02be59() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_02be59();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl
index f5a413c..450831b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleLevel_0b0a1b() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.dxc.hlsl
index c221b22..274a2cb 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_0b0a1b() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_0b0a1b();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.fxc.hlsl
index c221b22..dd30715 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_0b0a1b() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.glsl
index b489559..5a1f05f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_0b0a1b() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec2(1.0f), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_0b0a1b() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec2(1.0f), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_0b0a1b() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec2(1.0f), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.msl
index 4bd6966..f494a40 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_0b0a1b(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_0b0a1b(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), level(1.0f), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_0b0a1b(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_0b0a1b(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_0b0a1b(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_0b0a1b(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_0b0a1b(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_0b0a1b(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.spvasm
index e75df16..91e792a 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_0b0a1b "textureSampleLevel_0b0a1b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,56 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v2int %int_1 %int_1
+         %33 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %33 = OpTypeFunction %v4float
-%textureSampleLevel_0b0a1b = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
+%textureSampleLevel_0b0a1b = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Lod|ConstOffset %float_1 %30
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Lod|ConstOffset %float_1 %33
+               OpStore %res %22
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleLevel_0b0a1b
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSampleLevel_0b0a1b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleLevel_0b0a1b
+%fragment_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_0b0a1b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_0b0a1b
+%compute_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_0b0a1b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.wgsl
index 7edb2c2..0d5b7c7 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_0b0a1b() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_0b0a1b();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl
index 046acf8..5e4ad86 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: i32, level: f32) -> vec4<f32>
 fn textureSampleLevel_0bdd9a() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.dxc.hlsl
index 3062bda..53e4c25 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_0bdd9a() {
   float4 res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.fxc.hlsl
index 3062bda..53e4c25 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_0bdd9a() {
   float4 res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.msl
index 7a8b340..1600b80 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_0bdd9a(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_0bdd9a(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), 1, level(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_0bdd9a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_0bdd9a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_0bdd9a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_0bdd9a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_0bdd9a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_0bdd9a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
index c38f645..7f6b5cb 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_0bdd9a "textureSampleLevel_0bdd9a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleLevel_0bdd9a = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureSampleLevel_0bdd9a = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Lod %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Lod %float_1
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleLevel_0bdd9a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_0bdd9a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_0bdd9a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
index 96d9d06..bc56a89 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_0bdd9a() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_0bdd9a();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl
index 3c03f3f..45308fe 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>, level: i32) -> f32
 fn textureSampleLevel_1b0291() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.dxc.hlsl
index 43340f6..ca3379c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_1b0291() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.fxc.hlsl
index 43340f6..ca3379c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_1b0291() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.msl
index 85b398cb..7306415 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_1b0291(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_1b0291(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), level(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_1b0291(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_1b0291(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_1b0291(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_1b0291(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_1b0291(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_1b0291(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.spvasm
index 313063a..7caf437 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_1b0291 "textureSampleLevel_1b0291"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,56 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %30 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpTypeFunction %v4float
-%textureSampleLevel_1b0291 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %41 = OpTypeFunction %v4float
+%textureSampleLevel_1b0291 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %27 Lod %28
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %30 Lod %31
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %39 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %40 = OpLoad %float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleLevel_1b0291
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSampleLevel_1b0291
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleLevel_1b0291
+%fragment_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_1b0291
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_1b0291
+%compute_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_1b0291
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.wgsl
index ce70fc6..c677fb9 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_1b0291() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_1b0291();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl
index 05f8d4d..397fff8 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32, level: i32) -> f32
 fn textureSampleLevel_1bf73e() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.dxc.hlsl
index acc99fc..6a07457 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_1bf73e() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.fxc.hlsl
index acc99fc..6a07457 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_1bf73e() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.msl
index 9206cee..8ba09a0 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_1bf73e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_1bf73e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1, level(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_1bf73e(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_1bf73e(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_1bf73e(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_1bf73e(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_1bf73e(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_1bf73e(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.spvasm
index 2d0c309..d024182 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_1bf73e "textureSampleLevel_1bf73e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %38 = OpTypeFunction %v4float
-%textureSampleLevel_1bf73e = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %46 = OpTypeFunction %v4float
+%textureSampleLevel_1bf73e = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v3float %29 %30 %31
-         %35 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod %35
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v3float %32 %33 %34
+         %38 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod %38
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %44 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %45 = OpLoad %float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleLevel_1bf73e
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleLevel_1bf73e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureSampleLevel_1bf73e
+%fragment_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleLevel_1bf73e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_1bf73e
+%compute_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_1bf73e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.wgsl
index a0cfa86..5c5f51f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_1bf73e() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_1bf73e();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl
index 0acaaac..18f6a19 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, level: f32) -> vec4<f32>
 fn textureSampleLevel_265cc7() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.dxc.hlsl
index 5a8cae5..7a5abc1 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_265cc7() {
   float4 res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.fxc.hlsl
index 5a8cae5..7a5abc1 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_265cc7() {
   float4 res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.glsl
index 12caf9b..50b4c76 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_265cc7() {
   vec4 res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_265cc7() {
   vec4 res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_265cc7() {
   vec4 res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.msl
index d3fa969..d8a2fbc 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_265cc7(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_265cc7(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1u, level(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_265cc7(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_265cc7(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_265cc7(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_265cc7(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_265cc7(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_265cc7(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.spvasm
index a9b4a82..020e40a 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_265cc7 "textureSampleLevel_265cc7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,50 +47,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleLevel_265cc7 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureSampleLevel_265cc7 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Lod %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Lod %float_1
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleLevel_265cc7
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleLevel_265cc7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_265cc7
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_265cc7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleLevel_265cc7
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleLevel_265cc7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.wgsl
index bbd333b..1fa80ae 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/265cc7.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_265cc7() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_265cc7();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl
index 7be0912..1ad6253 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32, level: u32) -> f32
 fn textureSampleLevel_2974eb() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl
index 40a8222..7cba36f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_2974eb() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl
index 40a8222..7cba36f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_2974eb() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.msl
index 5d25c30..8119cc3 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_2974eb(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_2974eb(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1, level(1u));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_2974eb(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_2974eb(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_2974eb(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_2974eb(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_2974eb(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_2974eb(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.spvasm
index c418b62..6da294f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_2974eb "textureSampleLevel_2974eb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %40 = OpTypeFunction %v4float
-%textureSampleLevel_2974eb = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %47 = OpTypeFunction %v4float
+%textureSampleLevel_2974eb = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v3float %29 %30 %31
-         %35 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod %35
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v3float %32 %33 %34
+         %38 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod %38
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleLevel_2974eb
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_2974eb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_2974eb
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_2974eb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_2974eb
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleLevel_2974eb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.wgsl
index 660393e..46d3cd1 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_2974eb() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_2974eb();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl
index 4a67499..2d7199f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, level: f32) -> vec4<f32>
 fn textureSampleLevel_302be4() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.dxc.hlsl
index 07474bc..0219212 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_302be4() {
   float4 res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.fxc.hlsl
index 07474bc..0219212 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_302be4() {
   float4 res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.glsl
index f69611e..1ee4465 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_302be4() {
   vec4 res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_302be4() {
   vec4 res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_302be4() {
   vec4 res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.msl
index cb2e2ab..60b9ccf 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_302be4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_302be4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1, level(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_302be4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_302be4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_302be4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_302be4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_302be4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_302be4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.spvasm
index 3607b90..e20df77 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_302be4 "textureSampleLevel_302be4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,50 +47,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleLevel_302be4 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureSampleLevel_302be4 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Lod %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Lod %float_1
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleLevel_302be4
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleLevel_302be4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_302be4
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_302be4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleLevel_302be4
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_302be4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.wgsl
index 106bdbd..1feeb6c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_302be4() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_302be4();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl
index d1713ea3..c1f4796 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32, level: i32, @const offset: vec2<i32>) -> f32
 fn textureSampleLevel_36780e() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.dxc.hlsl
index c8a9ccc..241c64c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_36780e() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_36780e();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.fxc.hlsl
index c8a9ccc..a7dc783 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_36780e() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.msl
index ed1e29e..a665afa 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_36780e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_36780e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1, level(1), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_36780e(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_36780e(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_36780e(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_36780e(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_36780e(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_36780e(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.spvasm
index cc74784..070a7fe 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_36780e "textureSampleLevel_36780e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,63 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %40 = OpTypeFunction %v4float
-%textureSampleLevel_36780e = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %48 = OpTypeFunction %v4float
+%textureSampleLevel_36780e = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v3float %29 %30 %31
-         %35 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod|ConstOffset %35 %37
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v3float %32 %33 %34
+         %38 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod|ConstOffset %38 %40
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleLevel_36780e
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleLevel_36780e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_36780e
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_36780e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_36780e
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleLevel_36780e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.wgsl
index b079b1d..26f1ec2 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_36780e() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_36780e();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl
index fd7d10b..48421a6 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: i32, level: u32, @const offset: vec2<i32>) -> f32
 fn textureSampleLevel_36f0d3() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl
index e8395d5..e6e07c1 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_36f0d3() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1u, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_36f0d3();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl
index e8395d5..b6851ae 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_36f0d3() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1u, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.msl
index c52850d..4b2b1dc 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_36f0d3(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_36f0d3(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1, level(1u), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_36f0d3(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_36f0d3(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_36f0d3(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_36f0d3(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_36f0d3(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_36f0d3(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.spvasm
index aaca286..cf5afd7 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_36f0d3 "textureSampleLevel_36f0d3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,56 +47,64 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
-         %39 = OpConstantComposite %v2int %int_1 %int_1
+         %42 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %42 = OpTypeFunction %v4float
-%textureSampleLevel_36f0d3 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %49 = OpTypeFunction %v4float
+%textureSampleLevel_36f0d3 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v3float %29 %30 %31
-         %35 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod|ConstOffset %35 %39
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v3float %32 %33 %34
+         %38 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod|ConstOffset %38 %42
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %47 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %48 = OpLoad %float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_36f0d3
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_36f0d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleLevel_36f0d3
+%fragment_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_36f0d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureSampleLevel_36f0d3
+%compute_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleLevel_36f0d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.wgsl
index ae7e18a..5b35eca 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_36f0d3() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_36f0d3();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl
index 1e317bd..30c8d21 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32, level: i32) -> f32
 fn textureSampleLevel_3c3442() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl
index f66c85a..a3521db 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_3c3442() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl
index f66c85a..a3521db 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_3c3442() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.msl
index 32dbc41..ecc5c77 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_3c3442(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_3c3442(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1u, level(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_3c3442(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_3c3442(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_3c3442(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_3c3442(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_3c3442(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_3c3442(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.spvasm
index 3e0fb12..cb63687 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_3c3442 "textureSampleLevel_3c3442"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %40 = OpTypeFunction %v4float
-%textureSampleLevel_3c3442 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %47 = OpTypeFunction %v4float
+%textureSampleLevel_3c3442 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v3float %29 %30 %31
-         %35 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod %35
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v3float %32 %33 %34
+         %38 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod %38
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleLevel_3c3442
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_3c3442
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_3c3442
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_3c3442
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_3c3442
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleLevel_3c3442
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.wgsl
index a9c602c..bed8ddc 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_3c3442() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_3c3442();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl
index 886c480..a723b1c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32, level: u32) -> f32
 fn textureSampleLevel_615583() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.dxc.hlsl
index d758f54..351cb93 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_615583() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.fxc.hlsl
index d758f54..351cb93 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_615583() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.msl
index ec871ef..9ffe8e4 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_615583(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_615583(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1u, level(1u));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_615583(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_615583(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_615583(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_615583(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_615583(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_615583(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.spvasm
index 3110bc1..b10100f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_615583 "textureSampleLevel_615583"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %38 = OpTypeFunction %v4float
-%textureSampleLevel_615583 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %45 = OpTypeFunction %v4float
+%textureSampleLevel_615583 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v3float %29 %30 %31
-         %35 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod %35
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v3float %32 %33 %34
+         %38 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod %38
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %44 = OpLoad %float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleLevel_615583
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSampleLevel_615583
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureSampleLevel_615583
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleLevel_615583
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_615583
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_615583
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.wgsl
index 87e11d1..ac51b49 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_615583() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_615583();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl
index ba930c6..55314d9 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: u32) -> f32
 fn textureSampleLevel_73e892() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.dxc.hlsl
index 3a307b4..5aa3d7d 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_73e892() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.fxc.hlsl
index 3a307b4..5aa3d7d 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_73e892() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.glsl
index bc67215..4a2c3f6 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_73e892() {
   float res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_73e892() {
   float res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_73e892() {
   float res = textureLod(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.msl
index 976edd5..a8c1e57 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_73e892(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_73e892(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), level(1u));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_73e892(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_73e892(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_73e892(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_73e892(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_73e892(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_73e892(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.spvasm
index c3d7743..e90bf98 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_73e892 "textureSampleLevel_73e892"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,55 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpTypeFunction %v4float
-%textureSampleLevel_73e892 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %40 = OpTypeFunction %v4float
+%textureSampleLevel_73e892 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %27 Lod %28
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %30 Lod %31
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %38 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %39 = OpLoad %float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleLevel_73e892
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureSampleLevel_73e892
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleLevel_73e892
+%fragment_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleLevel_73e892
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_73e892
+%compute_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_73e892
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.wgsl
index 86e1fe5..341d528 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/73e892.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_73e892() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_73e892();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl
index 04f0fc8..581ba08 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: i32, @const offset: vec2<i32>) -> f32
 fn textureSampleLevel_749baf() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.dxc.hlsl
index c269b22..99e240e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_749baf() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_749baf();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.fxc.hlsl
index c269b22..3b794be 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_749baf() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.glsl
index dffb2b4..eb099ad 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_749baf() {
   float res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_749baf() {
   float res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_749baf() {
   float res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.msl
index 4dbec7a..5fd6d21 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_749baf(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_749baf(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), level(1), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_749baf(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_749baf(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_749baf(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_749baf(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_749baf(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_749baf(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.spvasm
index ff468d3..984f7fc 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_749baf "textureSampleLevel_749baf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,49 +47,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %32 = OpConstantComposite %v2int %int_1 %int_1
+         %35 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeFunction %v4float
-%textureSampleLevel_749baf = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %43 = OpTypeFunction %v4float
+%textureSampleLevel_749baf = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %27 Lod|ConstOffset %28 %32
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %30 Lod|ConstOffset %31 %35
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %42 = OpLoad %float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleLevel_749baf
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleLevel_749baf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleLevel_749baf
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_749baf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureSampleLevel_749baf
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleLevel_749baf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.wgsl
index e529df8..2ce712b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_749baf() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_749baf();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl
index ff080e1..9fa2bd9 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: u32, level: u32) -> f32
 fn textureSampleLevel_941a53() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1u, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.dxc.hlsl
index b69f521..e0b9821 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_941a53() {
   float res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1u)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.fxc.hlsl
index b69f521..e0b9821 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_941a53() {
   float res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1u)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.msl
index ae0a450..3f5e752 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_941a53(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_941a53(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), 1u, level(1u));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_941a53(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_941a53(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_941a53(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_941a53(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_941a53(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_941a53(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.spvasm
index 30fc42f..b19137c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_941a53 "textureSampleLevel_941a53"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,52 +48,60 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %30 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %38 = OpTypeFunction %v4float
-%textureSampleLevel_941a53 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %45 = OpTypeFunction %v4float
+%textureSampleLevel_941a53 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpCompositeExtract %float %27 2
-         %31 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v4float %28 %29 %30 %31
-         %35 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod %35
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpCompositeExtract %float %30 2
+         %34 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v4float %31 %32 %33 %34
+         %38 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod %38
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %43 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %44 = OpLoad %float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleLevel_941a53
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSampleLevel_941a53
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureSampleLevel_941a53
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleLevel_941a53
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_941a53
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_941a53
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.wgsl
index 719add1..a90542c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_941a53() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1u, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_941a53();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl
index 00c7285..faf9309 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: i32, level: u32) -> f32
 fn textureSampleLevel_a12142() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1i, 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl
index e4c44df..3cafc0a 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_a12142() {
   float res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl
index e4c44df..3cafc0a 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_a12142() {
   float res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1)), 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.msl
index f97f541..9473c33 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_a12142(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_a12142(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), 1, level(1u));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_a12142(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_a12142(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_a12142(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_a12142(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_a12142(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_a12142(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.spvasm
index 2122eec..e8d4908 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_a12142 "textureSampleLevel_a12142"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,54 +48,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %30 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %40 = OpTypeFunction %v4float
-%textureSampleLevel_a12142 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %47 = OpTypeFunction %v4float
+%textureSampleLevel_a12142 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpCompositeExtract %float %27 2
-         %31 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v4float %28 %29 %30 %31
-         %35 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod %35
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpCompositeExtract %float %30 2
+         %34 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v4float %31 %32 %33 %34
+         %38 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod %38
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleLevel_a12142
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_a12142
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_a12142
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_a12142
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_a12142
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleLevel_a12142
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.wgsl
index 4e2fc47..6a87415 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_a12142() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1i, 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_a12142();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl
index 1bf1c31..f88da93 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: u32, level: f32) -> vec4<f32>
 fn textureSampleLevel_aab3b9() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1u, 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.dxc.hlsl
index f7a6308..156fb2e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_aab3b9() {
   float4 res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.fxc.hlsl
index f7a6308..156fb2e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_aab3b9() {
   float4 res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1u)), 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.msl
index 4fa3fa2..a2017d3 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_aab3b9(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_aab3b9(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), 1u, level(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_aab3b9(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_aab3b9(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_aab3b9(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_aab3b9(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_aab3b9(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_aab3b9(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.spvasm
index 0eb8e9d..77544d3 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_aab3b9 "textureSampleLevel_aab3b9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleLevel_aab3b9 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureSampleLevel_aab3b9 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %27 = OpCompositeExtract %float %26 0
-         %28 = OpCompositeExtract %float %26 1
-         %29 = OpCompositeExtract %float %26 2
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v4float %27 %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Lod %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %30 = OpCompositeExtract %float %29 0
+         %31 = OpCompositeExtract %float %29 1
+         %32 = OpCompositeExtract %float %29 2
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v4float %30 %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Lod %float_1
+               OpStore %res %22
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleLevel_aab3b9
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleLevel_aab3b9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_aab3b9
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_aab3b9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleLevel_aab3b9
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleLevel_aab3b9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.wgsl
index 3de46ba..7ea98f8 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_aab3b9() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1u, 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_aab3b9();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl
index 1a5dae4..a8aa025 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: f32) -> vec4<f32>
 fn textureSampleLevel_abfcc0() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.dxc.hlsl
index b6d9aa9..b39ead0 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_abfcc0() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.fxc.hlsl
index b6d9aa9..b39ead0 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_abfcc0() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.glsl
index 709cf7e..9d2a56a 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_abfcc0() {
   vec4 res = textureLod(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_abfcc0() {
   vec4 res = textureLod(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_abfcc0() {
   vec4 res = textureLod(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.msl
index c5b55d1..3985f37 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_abfcc0(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_abfcc0(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), level(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_abfcc0(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_abfcc0(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_abfcc0(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_abfcc0(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_abfcc0(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_abfcc0(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.spvasm
index f1c7a85..6959a1e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_abfcc0 "textureSampleLevel_abfcc0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,43 +47,52 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %29 = OpTypeFunction %v4float
-%textureSampleLevel_abfcc0 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%textureSampleLevel_abfcc0 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Lod %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Lod %float_1
+               OpStore %res %22
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureSampleLevel_abfcc0
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleLevel_abfcc0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleLevel_abfcc0
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleLevel_abfcc0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleLevel_abfcc0
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleLevel_abfcc0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.wgsl
index adffde9..3aca978 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_abfcc0() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_abfcc0();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl
index 4e72aec..0a7255e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: i32, level: i32) -> f32
 fn textureSampleLevel_ae5e39() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1i, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.dxc.hlsl
index 5515700..247f8e9 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ae5e39() {
   float res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.fxc.hlsl
index 5515700..247f8e9 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ae5e39() {
   float res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.msl
index 1e48987..8abb703 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_ae5e39(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_ae5e39(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), 1, level(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_ae5e39(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_ae5e39(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_ae5e39(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_ae5e39(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_ae5e39(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_ae5e39(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.spvasm
index 68f32e3..1842c1b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_ae5e39 "textureSampleLevel_ae5e39"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,52 +48,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %30 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %38 = OpTypeFunction %v4float
-%textureSampleLevel_ae5e39 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %46 = OpTypeFunction %v4float
+%textureSampleLevel_ae5e39 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpCompositeExtract %float %27 2
-         %31 = OpConvertSToF %float %int_1
-         %34 = OpCompositeConstruct %v4float %28 %29 %30 %31
-         %35 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod %35
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpCompositeExtract %float %30 2
+         %34 = OpConvertSToF %float %int_1
+         %37 = OpCompositeConstruct %v4float %31 %32 %33 %34
+         %38 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod %38
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %44 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %45 = OpLoad %float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleLevel_ae5e39
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleLevel_ae5e39
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureSampleLevel_ae5e39
+%fragment_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleLevel_ae5e39
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_ae5e39
+%compute_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_ae5e39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.wgsl
index 30a48b2..03e9294 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_ae5e39() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1i, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_ae5e39();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl
index 5360c5e..cd18f1c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>, level: u32) -> f32
 fn textureSampleLevel_ae92a2() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.dxc.hlsl
index fee35d5..8439331 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ae92a2() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.fxc.hlsl
index fee35d5..8439331 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ae92a2() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1u).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.msl
index 46e2a3e..80564fe 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_ae92a2(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_ae92a2(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), level(1u));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_ae92a2(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_ae92a2(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_ae92a2(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_ae92a2(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_ae92a2(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_ae92a2(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.spvasm
index d6313a8..cafbe1e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_ae92a2 "textureSampleLevel_ae92a2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,55 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %30 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpTypeFunction %v4float
-%textureSampleLevel_ae92a2 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %40 = OpTypeFunction %v4float
+%textureSampleLevel_ae92a2 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %27 Lod %28
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %30 Lod %31
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %38 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %39 = OpLoad %float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleLevel_ae92a2
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureSampleLevel_ae92a2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleLevel_ae92a2
+%fragment_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleLevel_ae92a2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_ae92a2
+%compute_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_ae92a2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.wgsl
index 674aea2..fcd5847 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_ae92a2() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_ae92a2();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl
index 911fd7f..116b601 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: i32, level: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleLevel_b7c55c() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1i, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.dxc.hlsl
index 040aa64..2eceded 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_b7c55c() {
   float4 res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_b7c55c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.fxc.hlsl
index 040aa64..432d948 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_b7c55c() {
   float4 res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.glsl
index 90dbca9..2bf8b5f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_b7c55c() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_b7c55c() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_b7c55c() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.msl
index c0c5d55..8bb9b12 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_b7c55c(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_b7c55c(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1, level(1.0f), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_b7c55c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_b7c55c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_b7c55c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_b7c55c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_b7c55c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_b7c55c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.spvasm
index da6f290..905eb8d 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_b7c55c "textureSampleLevel_b7c55c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,52 +47,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %35 = OpConstantComposite %v2int %int_1 %int_1
+         %38 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureSampleLevel_b7c55c = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %46 = OpTypeFunction %v4float
+%textureSampleLevel_b7c55c = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertSToF %float %int_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Lod|ConstOffset %float_1 %35
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertSToF %float %int_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Lod|ConstOffset %float_1 %38
+               OpStore %res %22
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleLevel_b7c55c
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleLevel_b7c55c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureSampleLevel_b7c55c
+%fragment_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleLevel_b7c55c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_b7c55c
+%compute_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_b7c55c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.wgsl
index b156633..f41a462 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_b7c55c() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1i, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_b7c55c();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl
index dcb31e4..c420edb 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, level: f32) -> vec4<f32>
 fn textureSampleLevel_c32df7() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.dxc.hlsl
index aabe9e4..ddaa3ee 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_c32df7() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.fxc.hlsl
index aabe9e4..ddaa3ee 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_c32df7() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.glsl
index 4d75927..b0438a7 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c32df7() {
   vec4 res = textureLod(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c32df7() {
   vec4 res = textureLod(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c32df7() {
   vec4 res = textureLod(arg_0_arg_1, vec3(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.msl
index bafe9af..25709b9 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_c32df7(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_c32df7(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), level(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_c32df7(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_c32df7(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_c32df7(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_c32df7(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_c32df7(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_c32df7(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.spvasm
index d76fe25..12f8fde 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_c32df7 "textureSampleLevel_c32df7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,43 +47,52 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %29 = OpTypeFunction %v4float
-%textureSampleLevel_c32df7 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%textureSampleLevel_c32df7 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Lod %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Lod %float_1
+               OpStore %res %22
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureSampleLevel_c32df7
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleLevel_c32df7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleLevel_c32df7
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleLevel_c32df7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleLevel_c32df7
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleLevel_c32df7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.wgsl
index 83ec451..2a8ce61 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_c32df7() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_c32df7();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl
index 8017850..c5d0561 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: f32) -> vec4<f32>
 fn textureSampleLevel_c6aca6() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1.f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.dxc.hlsl
index 7fe645b..7421a08 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_c6aca6() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.fxc.hlsl
index 7fe645b..7421a08 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_c6aca6() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.glsl
index 62c64c1..3ac431e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c6aca6() {
   vec4 res = textureLod(arg_0_arg_1, vec2(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c6aca6() {
   vec4 res = textureLod(arg_0_arg_1, vec2(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c6aca6() {
   vec4 res = textureLod(arg_0_arg_1, vec2(1.0f), 1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.msl
index 4797165..60b2be0 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_c6aca6(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_c6aca6(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), level(1.0f));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_c6aca6(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_c6aca6(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_c6aca6(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_c6aca6(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_c6aca6(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_c6aca6(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.spvasm
index 9dd42e1..db60486 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_c6aca6 "textureSampleLevel_c6aca6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,43 +47,52 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v2float %float_1 %float_1
+         %29 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %29 = OpTypeFunction %v4float
-%textureSampleLevel_c6aca6 = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%textureSampleLevel_c6aca6 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Lod %float_1
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Lod %float_1
+               OpStore %res %22
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureSampleLevel_c6aca6
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureSampleLevel_c6aca6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleLevel_c6aca6
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleLevel_c6aca6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSampleLevel_c6aca6
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleLevel_c6aca6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.wgsl
index 256eda0..a867120 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_c6aca6() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1.0f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_c6aca6();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl
index 218f8be..b41d4b4 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32, level: u32, @const offset: vec2<i32>) -> f32
 fn textureSampleLevel_cdfe0f() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.dxc.hlsl
index d9b4c1e..ac5c741 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_cdfe0f() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1u, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_cdfe0f();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.fxc.hlsl
index d9b4c1e..b1a792d 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_cdfe0f() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1u, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.msl
index 5c73085..9e0aaa4 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_cdfe0f(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_cdfe0f(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1u, level(1u), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_cdfe0f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_cdfe0f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_cdfe0f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_cdfe0f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_cdfe0f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_cdfe0f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.spvasm
index 9af914c..c20a879 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_cdfe0f "textureSampleLevel_cdfe0f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,56 +47,64 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %39 = OpConstantComposite %v2int %int_1 %int_1
+         %42 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %42 = OpTypeFunction %v4float
-%textureSampleLevel_cdfe0f = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %49 = OpTypeFunction %v4float
+%textureSampleLevel_cdfe0f = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v3float %29 %30 %31
-         %35 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod|ConstOffset %35 %39
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v3float %32 %33 %34
+         %38 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod|ConstOffset %38 %42
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %47 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %48 = OpLoad %float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_cdfe0f
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_cdfe0f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleLevel_cdfe0f
+%fragment_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_cdfe0f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureSampleLevel_cdfe0f
+%compute_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleLevel_cdfe0f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.wgsl
index afdb69d..b861c1c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_cdfe0f() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_cdfe0f();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl
index f6ea285..c3c2873 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: f32, @const offset: vec3<i32>) -> vec4<f32>
 fn textureSampleLevel_dcbecb() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1.f, vec3<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.dxc.hlsl
index 044f68a..751c56a 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_dcbecb() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1.0f, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_dcbecb();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.fxc.hlsl
index 044f68a..ca88081 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_dcbecb() {
   float4 res = arg_0.SampleLevel(arg_1, (1.0f).xxx, 1.0f, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.glsl
index 148bef4..8f575e4 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_dcbecb() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(1.0f), 1.0f, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_dcbecb() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(1.0f), 1.0f, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_dcbecb() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(1.0f), 1.0f, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.msl
index 47f3e27..06fc620 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_dcbecb(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_dcbecb(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), level(1.0f), int3(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_dcbecb(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_dcbecb(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_dcbecb(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_dcbecb(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_dcbecb(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_dcbecb(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.spvasm
index 9a1e533..cac2d79 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_dcbecb "textureSampleLevel_dcbecb"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,47 +47,56 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %29 = OpConstantComposite %v3float %float_1 %float_1 %float_1
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %33 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %33 = OpTypeFunction %v4float
-%textureSampleLevel_dcbecb = OpFunction %void None %15
-         %18 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
+%textureSampleLevel_dcbecb = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %19 = OpImageSampleExplicitLod %v4float %23 %26 Lod|ConstOffset %float_1 %30
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %22 = OpImageSampleExplicitLod %v4float %26 %29 Lod|ConstOffset %float_1 %33
+               OpStore %res %22
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureSampleLevel_dcbecb
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureSampleLevel_dcbecb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleLevel_dcbecb
+%fragment_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_dcbecb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_dcbecb
+%compute_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_dcbecb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.wgsl
index e4610ad..083f861 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_dcbecb() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1.0f, vec3<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_dcbecb();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl
index 9135882..7b1b39e 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: u32, level: i32, @const offset: vec2<i32>) -> f32
 fn textureSampleLevel_e6ce9e() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl
index 9b08da0..1075e8b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_e6ce9e() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_e6ce9e();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl
index 9b08da0..cbf31a0 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_e6ce9e() {
   float res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.msl
index 42a5ff3..61f3ae8 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_e6ce9e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_e6ce9e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1u, level(1), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_e6ce9e(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_e6ce9e(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_e6ce9e(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_e6ce9e(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_e6ce9e(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_e6ce9e(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.spvasm
index 558fb64..4b109df 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_e6ce9e "textureSampleLevel_e6ce9e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,56 +47,64 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %28 = OpConstantComposite %v2float %float_1 %float_1
+         %31 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %39 = OpConstantComposite %v2int %int_1 %int_1
+         %42 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %42 = OpTypeFunction %v4float
-%textureSampleLevel_e6ce9e = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %49 = OpTypeFunction %v4float
+%textureSampleLevel_e6ce9e = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %29 = OpCompositeExtract %float %28 0
-         %30 = OpCompositeExtract %float %28 1
-         %31 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v3float %29 %30 %31
-         %35 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod|ConstOffset %35 %39
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %32 = OpCompositeExtract %float %31 0
+         %33 = OpCompositeExtract %float %31 1
+         %34 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v3float %32 %33 %34
+         %38 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod|ConstOffset %38 %42
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %47 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %48 = OpLoad %float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_e6ce9e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+%fragment_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_e6ce9e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+%compute_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleLevel_e6ce9e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.wgsl
index 3936c9c..f91175f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_e6ce9e() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1i, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_e6ce9e();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl
index ee35dd7..47d9b36 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: u32, @const offset: vec2<i32>) -> f32
 fn textureSampleLevel_f3b2c8() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.dxc.hlsl
index 7b839f1..cd43f80 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_f3b2c8() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1u, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_f3b2c8();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.fxc.hlsl
index 7b839f1..a35a7e9 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_f3b2c8() {
   float res = arg_0.SampleLevel(arg_1, (1.0f).xx, 1u, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.glsl
index eab0c1b..b353b55 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_f3b2c8() {
   float res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1u), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_f3b2c8() {
   float res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1u), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_f3b2c8() {
   float res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), 0.0f), float(1u), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.msl
index 6028f54..603a889 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_f3b2c8(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_f3b2c8(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), level(1u), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_f3b2c8(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_f3b2c8(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_f3b2c8(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_f3b2c8(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_f3b2c8(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_f3b2c8(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.spvasm
index f20fef6..f7e39ad 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_f3b2c8 "textureSampleLevel_f3b2c8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,51 +47,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %34 = OpConstantComposite %v2int %int_1 %int_1
+         %37 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %37 = OpTypeFunction %v4float
-%textureSampleLevel_f3b2c8 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %44 = OpTypeFunction %v4float
+%textureSampleLevel_f3b2c8 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpConvertSToF %float %uint_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %27 Lod|ConstOffset %28 %34
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpConvertSToF %float %uint_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %30 Lod|ConstOffset %31 %37
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %42 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %43 = OpLoad %float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureSampleLevel_f3b2c8
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleLevel_f3b2c8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleLevel_f3b2c8
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_f3b2c8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_f3b2c8
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_f3b2c8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.wgsl
index 8057db7..b5a5637 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/f3b2c8.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_f3b2c8() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_f3b2c8();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl
index 4d9e464..c93a646 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: u32, level: f32, @const offset: vec2<i32>) -> vec4<f32>
 fn textureSampleLevel_faa6d7() {
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.f), 1u, 1.f, vec2<i32>(1i));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.dxc.hlsl
index f5a020b..9edea38 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.dxc.hlsl
@@ -1,8 +1,12 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_faa6d7() {
   float4 res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -31,3 +35,40 @@
   textureSampleLevel_faa6d7();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.fxc.hlsl
index f5a020b..acc6a06 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_faa6d7() {
   float4 res = arg_0.SampleLevel(arg_1, float3((1.0f).xx, float(1u)), 1.0f, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.glsl
index b272e8f..077c479 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.glsl
@@ -2,8 +2,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_faa6d7() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,8 +29,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_faa6d7() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,8 +50,13 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_faa6d7() {
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(vec2(1.0f), float(1u)), 1.0f, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.msl
index 795ca06..9bdefc5 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_faa6d7(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_faa6d7(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float4 res = tint_symbol_1.sample(tint_symbol_2, float2(1.0f), 1u, level(1.0f), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_faa6d7(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_faa6d7(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_faa6d7(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_faa6d7(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_faa6d7(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_faa6d7(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.spvasm
index 08a0c14..d9193cb 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_faa6d7 "textureSampleLevel_faa6d7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,54 +47,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %22 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %25 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureSampleLevel_faa6d7 = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %47 = OpTypeFunction %v4float
+%textureSampleLevel_faa6d7 = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %20 = OpLoad %14 %arg_1
-         %21 = OpLoad %11 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpConvertUToF %float %uint_1
-         %33 = OpCompositeConstruct %v3float %28 %29 %30
-         %19 = OpImageSampleExplicitLod %v4float %23 %33 Lod|ConstOffset %float_1 %37
-               OpStore %res %19
+         %23 = OpLoad %14 %arg_1
+         %24 = OpLoad %11 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpConvertUToF %float %uint_1
+         %36 = OpCompositeConstruct %v3float %31 %32 %33
+         %22 = OpImageSampleExplicitLod %v4float %26 %36 Lod|ConstOffset %float_1 %40
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleLevel_faa6d7
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_faa6d7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_faa6d7
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_faa6d7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_faa6d7
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleLevel_faa6d7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.wgsl
index 6799d8b..73fcb75 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/faa6d7.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_faa6d7() {
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, vec2<f32>(1.0f), 1u, 1.0f, vec2<i32>(1i));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_faa6d7();
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl
index c7af820..2a09b62 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl
@@ -26,7 +26,9 @@
 // fn textureSampleLevel(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: u32, level: i32) -> f32
 fn textureSampleLevel_ff11bc() {
   var res: f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.f), 1u, 1i);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl
index 4a5f8d1..1f5fc54 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ff11bc() {
   float res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1u)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl
index 4a5f8d1..1f5fc54 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl
@@ -1,8 +1,10 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ff11bc() {
   float res = arg_0.SampleLevel(arg_1, float4((1.0f).xxx, float(1u)), 1).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.msl
index 03bdbc0..381bd97 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_ff11bc(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_ff11bc(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float res = tint_symbol_1.sample(tint_symbol_2, float3(1.0f), 1u, level(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_ff11bc(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_ff11bc(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_ff11bc(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_ff11bc(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_ff11bc(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_ff11bc(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.spvasm
index 64f921e..382fb36 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_ff11bc "textureSampleLevel_ff11bc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,54 +48,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
-         %23 = OpTypeSampledImage %11
+         %18 = OpTypeFunction %void
+         %26 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %30 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %40 = OpTypeFunction %v4float
-%textureSampleLevel_ff11bc = OpFunction %void None %15
-         %18 = OpLabel
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %47 = OpTypeFunction %v4float
+%textureSampleLevel_ff11bc = OpFunction %void None %18
+         %21 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %21 = OpLoad %14 %arg_1
-         %22 = OpLoad %11 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %28 = OpCompositeExtract %float %27 0
-         %29 = OpCompositeExtract %float %27 1
-         %30 = OpCompositeExtract %float %27 2
-         %31 = OpConvertUToF %float %uint_1
-         %34 = OpCompositeConstruct %v4float %28 %29 %30 %31
-         %35 = OpConvertSToF %float %int_1
-         %20 = OpImageSampleExplicitLod %v4float %24 %34 Lod %35
-         %19 = OpCompositeExtract %float %20 0
-               OpStore %res %19
+         %24 = OpLoad %14 %arg_1
+         %25 = OpLoad %11 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %31 = OpCompositeExtract %float %30 0
+         %32 = OpCompositeExtract %float %30 1
+         %33 = OpCompositeExtract %float %30 2
+         %34 = OpConvertUToF %float %uint_1
+         %37 = OpCompositeConstruct %v4float %31 %32 %33 %34
+         %38 = OpConvertSToF %float %int_1
+         %23 = OpImageSampleExplicitLod %v4float %27 %37 Lod %38
+         %22 = OpCompositeExtract %float %23 0
+               OpStore %res %22
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleLevel_ff11bc
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleLevel_ff11bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_ff11bc
+%fragment_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_ff11bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_ff11bc
+%compute_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleLevel_ff11bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.wgsl
index eff31bb..ef9fa91 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn textureSampleLevel_ff11bc() {
   var res : f32 = textureSampleLevel(arg_0, arg_1, vec3<f32>(1.0f), 1u, 1i);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_ff11bc();
diff --git a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl
index 6de2b09..8ced522 100644
--- a/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/00ca64.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_00ca64() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_00ca64();
diff --git a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl
index b77e65e..205da4a 100644
--- a/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/0148bd.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_0148bd() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0148bd();
diff --git a/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl b/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl
index a03c257..d0586ab 100644
--- a/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_05ce15() {
   textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_05ce15();
diff --git a/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl b/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl
index 91a9450..a7112d5 100644
--- a/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_064c7f() {
   textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_064c7f();
diff --git a/test/tint/builtins/gen/literal/textureStore/068641.wgsl b/test/tint/builtins/gen/literal/textureStore/068641.wgsl
index b97cd2c..7cecda3 100644
--- a/test/tint/builtins/gen/literal/textureStore/068641.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/068641.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_068641() {
   textureStore(arg_0, vec3<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_068641();
diff --git a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl
index fbea4f3..20246c2 100644
--- a/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/06e49c.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_06e49c() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_06e49c();
diff --git a/test/tint/builtins/gen/literal/textureStore/07548b.wgsl b/test/tint/builtins/gen/literal/textureStore/07548b.wgsl
index 56705f9..632976f 100644
--- a/test/tint/builtins/gen/literal/textureStore/07548b.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/07548b.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_07548b() {
   textureStore(arg_0, vec3<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_07548b();
diff --git a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl
index 0d7bd6a..db51616 100644
--- a/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/0a1a79.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_0a1a79() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0a1a79();
diff --git a/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl b/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl
index c77fc88..6e249ee 100644
--- a/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_0af6b5() {
   textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0af6b5();
diff --git a/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl b/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl
index 6323dab..4ebc87e 100644
--- a/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_0c3dff() {
   textureStore(arg_0, vec2<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0c3dff();
diff --git a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl
index 1895c53..bfee947 100644
--- a/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/0cc825.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_0cc825() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0cc825();
diff --git a/test/tint/builtins/gen/literal/textureStore/102722.wgsl b/test/tint/builtins/gen/literal/textureStore/102722.wgsl
index 5f88023..f8c696b 100644
--- a/test/tint/builtins/gen/literal/textureStore/102722.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/102722.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_102722() {
   textureStore(arg_0, 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_102722();
diff --git a/test/tint/builtins/gen/literal/textureStore/158cf0.wgsl b/test/tint/builtins/gen/literal/textureStore/158cf0.wgsl
index 5e852dc..d6cfb982 100644
--- a/test/tint/builtins/gen/literal/textureStore/158cf0.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/158cf0.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_158cf0() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_158cf0();
diff --git a/test/tint/builtins/gen/literal/textureStore/1839f2.wgsl b/test/tint/builtins/gen/literal/textureStore/1839f2.wgsl
index b339550..d48709f 100644
--- a/test/tint/builtins/gen/literal/textureStore/1839f2.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1839f2.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_1839f2() {
   textureStore(arg_0, vec2<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1839f2();
diff --git a/test/tint/builtins/gen/literal/textureStore/1a7d35.wgsl b/test/tint/builtins/gen/literal/textureStore/1a7d35.wgsl
index 7382854..3161465 100644
--- a/test/tint/builtins/gen/literal/textureStore/1a7d35.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1a7d35.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_1a7d35() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1a7d35();
diff --git a/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl b/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl
index 4ea9716..3a217b7 100644
--- a/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_1bbd08() {
   textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1bbd08();
diff --git a/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl b/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl
index ee0cfd9..ab30fbb 100644
--- a/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_1c02e7() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1c02e7();
diff --git a/test/tint/builtins/gen/literal/textureStore/1dc954.wgsl b/test/tint/builtins/gen/literal/textureStore/1dc954.wgsl
index 6817caa..c487dc2 100644
--- a/test/tint/builtins/gen/literal/textureStore/1dc954.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1dc954.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_1dc954() {
   textureStore(arg_0, 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1dc954();
diff --git a/test/tint/builtins/gen/literal/textureStore/1e20f2.wgsl b/test/tint/builtins/gen/literal/textureStore/1e20f2.wgsl
index 743981b..b6df061 100644
--- a/test/tint/builtins/gen/literal/textureStore/1e20f2.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1e20f2.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_1e20f2() {
   textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1e20f2();
diff --git a/test/tint/builtins/gen/literal/textureStore/1efc36.wgsl b/test/tint/builtins/gen/literal/textureStore/1efc36.wgsl
index cdd5a30..ea8a931 100644
--- a/test/tint/builtins/gen/literal/textureStore/1efc36.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1efc36.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_1efc36() {
   textureStore(arg_0, vec3<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1efc36();
diff --git a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl
index eb0ff77..a6b1795 100644
--- a/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1f1ef8.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_1f1ef8() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1f1ef8();
diff --git a/test/tint/builtins/gen/literal/textureStore/207fdd.wgsl b/test/tint/builtins/gen/literal/textureStore/207fdd.wgsl
index 409e57b..5e94cfa 100644
--- a/test/tint/builtins/gen/literal/textureStore/207fdd.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/207fdd.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_207fdd() {
   textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_207fdd();
diff --git a/test/tint/builtins/gen/literal/textureStore/22d955.wgsl b/test/tint/builtins/gen/literal/textureStore/22d955.wgsl
index 12fdc66..74baeef 100644
--- a/test/tint/builtins/gen/literal/textureStore/22d955.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/22d955.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_22d955() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_22d955();
diff --git a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl
index d9c15d2..0c8ca9a 100644
--- a/test/tint/builtins/gen/literal/textureStore/22f045.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/22f045.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_22f045() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_22f045();
diff --git a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl
index 6b799cf..37609fc 100644
--- a/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2383fc.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_2383fc() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2383fc();
diff --git a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl
index a9ce3e0..66e618d 100644
--- a/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/258ab0.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_258ab0() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_258ab0();
diff --git a/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl b/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl
index ad36c53..7a6b13c 100644
--- a/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_26bf70() {
   textureStore(arg_0, vec2<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_26bf70();
diff --git a/test/tint/builtins/gen/literal/textureStore/27063a.wgsl b/test/tint/builtins/gen/literal/textureStore/27063a.wgsl
index 75a0f9c..fd278f1 100644
--- a/test/tint/builtins/gen/literal/textureStore/27063a.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/27063a.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_27063a() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_27063a();
diff --git a/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl b/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl
index 16dcbf6..e55c01b 100644
--- a/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_2796b4() {
   textureStore(arg_0, vec3<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2796b4();
diff --git a/test/tint/builtins/gen/literal/textureStore/285218.wgsl b/test/tint/builtins/gen/literal/textureStore/285218.wgsl
index 19a48c3..61b2bc0 100644
--- a/test/tint/builtins/gen/literal/textureStore/285218.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/285218.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_285218() {
   textureStore(arg_0, 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_285218();
diff --git a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl
index 51efb58..75325dd 100644
--- a/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/28a7ec.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_28a7ec() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_28a7ec();
diff --git a/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl b/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl
index 0fae6bb..18e92b5 100644
--- a/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_2ac6c7() {
   textureStore(arg_0, 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2ac6c7();
diff --git a/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl b/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl
index 9bc1cb5..1499e23 100644
--- a/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_2d2835() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2d2835();
diff --git a/test/tint/builtins/gen/literal/textureStore/2e4245.wgsl b/test/tint/builtins/gen/literal/textureStore/2e4245.wgsl
index 2156fa5..4df30eb 100644
--- a/test/tint/builtins/gen/literal/textureStore/2e4245.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2e4245.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_2e4245() {
   textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2e4245();
diff --git a/test/tint/builtins/gen/literal/textureStore/2e6102.wgsl b/test/tint/builtins/gen/literal/textureStore/2e6102.wgsl
index 9b4969a..50974c0 100644
--- a/test/tint/builtins/gen/literal/textureStore/2e6102.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2e6102.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_2e6102() {
   textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2e6102();
diff --git a/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl b/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl
index cd85730..8c85cbd 100644
--- a/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_2eb2a4() {
   textureStore(arg_0, 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2eb2a4();
diff --git a/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl b/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl
index 2c3f288..dfd7e0e 100644
--- a/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_2ed2a3() {
   textureStore(arg_0, 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2ed2a3();
diff --git a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl
index 70fa904..b22b84c 100644
--- a/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/30b0b0.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_30b0b0() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_30b0b0();
diff --git a/test/tint/builtins/gen/literal/textureStore/31745b.wgsl b/test/tint/builtins/gen/literal/textureStore/31745b.wgsl
index c215a35..2c84fbe 100644
--- a/test/tint/builtins/gen/literal/textureStore/31745b.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/31745b.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_31745b() {
   textureStore(arg_0, vec2<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_31745b();
diff --git a/test/tint/builtins/gen/literal/textureStore/319029.wgsl b/test/tint/builtins/gen/literal/textureStore/319029.wgsl
index ca5609f..1dff085 100644
--- a/test/tint/builtins/gen/literal/textureStore/319029.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/319029.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_319029() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_319029();
diff --git a/test/tint/builtins/gen/literal/textureStore/32f368.wgsl b/test/tint/builtins/gen/literal/textureStore/32f368.wgsl
index 092d9bc..4df21b4 100644
--- a/test/tint/builtins/gen/literal/textureStore/32f368.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/32f368.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_32f368() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_32f368();
diff --git a/test/tint/builtins/gen/literal/textureStore/330b7c.wgsl b/test/tint/builtins/gen/literal/textureStore/330b7c.wgsl
index 4135564..2b63d8a 100644
--- a/test/tint/builtins/gen/literal/textureStore/330b7c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/330b7c.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_330b7c() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_330b7c();
diff --git a/test/tint/builtins/gen/literal/textureStore/331aee.wgsl b/test/tint/builtins/gen/literal/textureStore/331aee.wgsl
index 40d5811..293b804 100644
--- a/test/tint/builtins/gen/literal/textureStore/331aee.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/331aee.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_331aee() {
   textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_331aee();
diff --git a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl
index 32257a3..54e2be3 100644
--- a/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/33cec0.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_33cec0() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_33cec0();
diff --git a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl
index f83d1fc..3328c2c 100644
--- a/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/37ffd4.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_37ffd4() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_37ffd4();
diff --git a/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl b/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl
index 681e37c..f076371 100644
--- a/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_38e8d7() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_38e8d7();
diff --git a/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl b/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl
index cb12161..c3d5437 100644
--- a/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_3a52ac() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3a52ac();
diff --git a/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl b/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl
index febc992..ddd9243 100644
--- a/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_3bb7a1() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3bb7a1();
diff --git a/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl b/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl
index 3db2638..7263f98 100644
--- a/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_3bec15() {
   textureStore(arg_0, 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3bec15();
diff --git a/test/tint/builtins/gen/literal/textureStore/3c1937.wgsl b/test/tint/builtins/gen/literal/textureStore/3c1937.wgsl
index 2d6cdca..630b2a9 100644
--- a/test/tint/builtins/gen/literal/textureStore/3c1937.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3c1937.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_3c1937() {
   textureStore(arg_0, 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3c1937();
diff --git a/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl b/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl
index 5e013cc..fc15f22 100644
--- a/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_3d6f01() {
   textureStore(arg_0, 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3d6f01();
diff --git a/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl b/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl
index eabdb19..83f5863 100644
--- a/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_3fb31f() {
   textureStore(arg_0, vec3<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3fb31f();
diff --git a/test/tint/builtins/gen/literal/textureStore/40c455.wgsl b/test/tint/builtins/gen/literal/textureStore/40c455.wgsl
index 7ea64eb..9f8c17e 100644
--- a/test/tint/builtins/gen/literal/textureStore/40c455.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/40c455.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_40c455() {
   textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_40c455();
diff --git a/test/tint/builtins/gen/literal/textureStore/4288fc.wgsl b/test/tint/builtins/gen/literal/textureStore/4288fc.wgsl
index b54bc38..2e2a20b 100644
--- a/test/tint/builtins/gen/literal/textureStore/4288fc.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/4288fc.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_4288fc() {
   textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_4288fc();
diff --git a/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl b/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl
index 7f2af68..576bd49 100644
--- a/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_441ba8() {
   textureStore(arg_0, vec3<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_441ba8();
diff --git a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl
index 072c3f6..535d5f1 100644
--- a/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/44daa7.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_44daa7() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_44daa7();
diff --git a/test/tint/builtins/gen/literal/textureStore/486500.wgsl b/test/tint/builtins/gen/literal/textureStore/486500.wgsl
index baeedc4..d7dc923 100644
--- a/test/tint/builtins/gen/literal/textureStore/486500.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/486500.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_486500() {
   textureStore(arg_0, vec3<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_486500();
diff --git a/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl b/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl
index 3fad484..608af38 100644
--- a/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_4c454f() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_4c454f();
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl
index bde5c95..6321c3b 100644
--- a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_4d359d() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_4d359d();
diff --git a/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl b/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl
index 14faea8..5ea8d51 100644
--- a/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_4fc057() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_4fc057();
diff --git a/test/tint/builtins/gen/literal/textureStore/506a71.wgsl b/test/tint/builtins/gen/literal/textureStore/506a71.wgsl
index 5ae5d4c..c02fa92 100644
--- a/test/tint/builtins/gen/literal/textureStore/506a71.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/506a71.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_506a71() {
   textureStore(arg_0, vec2<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_506a71();
diff --git a/test/tint/builtins/gen/literal/textureStore/52f503.wgsl b/test/tint/builtins/gen/literal/textureStore/52f503.wgsl
index cdcebf9..a7977b4 100644
--- a/test/tint/builtins/gen/literal/textureStore/52f503.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/52f503.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_52f503() {
   textureStore(arg_0, vec2<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_52f503();
diff --git a/test/tint/builtins/gen/literal/textureStore/5841f8.wgsl b/test/tint/builtins/gen/literal/textureStore/5841f8.wgsl
index 4b376a5..ae1fd9d 100644
--- a/test/tint/builtins/gen/literal/textureStore/5841f8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/5841f8.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_5841f8() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5841f8();
diff --git a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl
index f3eef94..f56c46e 100644
--- a/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/59a0ab.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_59a0ab() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_59a0ab();
diff --git a/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl b/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl
index f45005d..982981a 100644
--- a/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_5a2f8f() {
   textureStore(arg_0, 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5a2f8f();
diff --git a/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl b/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl
index e6d8690..dbb3fe9 100644
--- a/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_5bc4f3() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5bc4f3();
diff --git a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl
index 5dd56c6..b3ecb86 100644
--- a/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/5ddc61.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_5ddc61() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5ddc61();
diff --git a/test/tint/builtins/gen/literal/textureStore/5f9a49.wgsl b/test/tint/builtins/gen/literal/textureStore/5f9a49.wgsl
index 3353cbf..0be124e 100644
--- a/test/tint/builtins/gen/literal/textureStore/5f9a49.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/5f9a49.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_5f9a49() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5f9a49();
diff --git a/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl b/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl
index 3a27370..9ca1dae 100644
--- a/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_602b5a() {
   textureStore(arg_0, 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_602b5a();
diff --git a/test/tint/builtins/gen/literal/textureStore/60975f.wgsl b/test/tint/builtins/gen/literal/textureStore/60975f.wgsl
index 57bbc65..d20ec32 100644
--- a/test/tint/builtins/gen/literal/textureStore/60975f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/60975f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_60975f() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_60975f();
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl
index f97502d..1de9f9b 100644
--- a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_658a74() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_658a74();
diff --git a/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl b/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl
index 90a24f3..4f9b571 100644
--- a/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_682fd6() {
   textureStore(arg_0, vec2<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_682fd6();
diff --git a/test/tint/builtins/gen/literal/textureStore/699a1b.wgsl b/test/tint/builtins/gen/literal/textureStore/699a1b.wgsl
index f9d3b89..d2eaa5b 100644
--- a/test/tint/builtins/gen/literal/textureStore/699a1b.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/699a1b.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_699a1b() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_699a1b();
diff --git a/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl b/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl
index 36cf30c..b0f503f 100644
--- a/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_6b75c3() {
   textureStore(arg_0, 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6b75c3();
diff --git a/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl b/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl
index 01c9531..2ba4ff8 100644
--- a/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_6b80d2() {
   textureStore(arg_0, 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6b80d2();
diff --git a/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl b/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl
index a24470c..4b49f01 100644
--- a/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_6cff2e() {
   textureStore(arg_0, vec2<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6cff2e();
diff --git a/test/tint/builtins/gen/literal/textureStore/6da692.wgsl b/test/tint/builtins/gen/literal/textureStore/6da692.wgsl
index a517a3b..1c776f3 100644
--- a/test/tint/builtins/gen/literal/textureStore/6da692.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6da692.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_6da692() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6da692();
diff --git a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl
index 5007c92..d308b0c 100644
--- a/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6f8642.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_6f8642() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6f8642();
diff --git a/test/tint/builtins/gen/literal/textureStore/726472.wgsl b/test/tint/builtins/gen/literal/textureStore/726472.wgsl
index 7066bfd..41f03b5 100644
--- a/test/tint/builtins/gen/literal/textureStore/726472.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/726472.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_726472() {
   textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_726472();
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl
index 33cd067..640160f 100644
--- a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_72fa64() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_72fa64();
diff --git a/test/tint/builtins/gen/literal/textureStore/731349.wgsl b/test/tint/builtins/gen/literal/textureStore/731349.wgsl
index b931dcd..f92df23 100644
--- a/test/tint/builtins/gen/literal/textureStore/731349.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/731349.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_731349() {
   textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_731349();
diff --git a/test/tint/builtins/gen/literal/textureStore/73bbbc.wgsl b/test/tint/builtins/gen/literal/textureStore/73bbbc.wgsl
index 38fcded..98009b6 100644
--- a/test/tint/builtins/gen/literal/textureStore/73bbbc.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/73bbbc.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_73bbbc() {
   textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_73bbbc();
diff --git a/test/tint/builtins/gen/literal/textureStore/752da6.wgsl b/test/tint/builtins/gen/literal/textureStore/752da6.wgsl
index a9c9a47..8af31ea 100644
--- a/test/tint/builtins/gen/literal/textureStore/752da6.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/752da6.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_752da6() {
   textureStore(arg_0, vec2<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_752da6();
diff --git a/test/tint/builtins/gen/literal/textureStore/76affd.wgsl b/test/tint/builtins/gen/literal/textureStore/76affd.wgsl
index 7c96646..0b772b2 100644
--- a/test/tint/builtins/gen/literal/textureStore/76affd.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/76affd.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_76affd() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_76affd();
diff --git a/test/tint/builtins/gen/literal/textureStore/779d14.wgsl b/test/tint/builtins/gen/literal/textureStore/779d14.wgsl
index 0d358c9..5c3f2ec 100644
--- a/test/tint/builtins/gen/literal/textureStore/779d14.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/779d14.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_779d14() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_779d14();
diff --git a/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl b/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl
index d3629f3e..aef1c6b 100644
--- a/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_77c0ae() {
   textureStore(arg_0, vec2<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_77c0ae();
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl
index 685eb9f..fd6800c 100644
--- a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_7bb211() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_7bb211();
diff --git a/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl b/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl
index a3533ae..2eaf225 100644
--- a/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_7cec8d() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_7cec8d();
diff --git a/test/tint/builtins/gen/literal/textureStore/7cf6e7.wgsl b/test/tint/builtins/gen/literal/textureStore/7cf6e7.wgsl
index a900407..f4f663f 100644
--- a/test/tint/builtins/gen/literal/textureStore/7cf6e7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/7cf6e7.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_7cf6e7() {
   textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_7cf6e7();
diff --git a/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl b/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl
index 984453f..be30293 100644
--- a/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_7f7fae() {
   textureStore(arg_0, 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_7f7fae();
diff --git a/test/tint/builtins/gen/literal/textureStore/804942.wgsl b/test/tint/builtins/gen/literal/textureStore/804942.wgsl
index 81e4032..c6dedbb 100644
--- a/test/tint/builtins/gen/literal/textureStore/804942.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/804942.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_804942() {
   textureStore(arg_0, vec2<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_804942();
diff --git a/test/tint/builtins/gen/literal/textureStore/805dae.wgsl b/test/tint/builtins/gen/literal/textureStore/805dae.wgsl
index c71296c..2b5143a 100644
--- a/test/tint/builtins/gen/literal/textureStore/805dae.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/805dae.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_805dae() {
   textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_805dae();
diff --git a/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl b/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl
index 1876a36..a4f0be5 100644
--- a/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_83bcc1() {
   textureStore(arg_0, 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_83bcc1();
diff --git a/test/tint/builtins/gen/literal/textureStore/872747.wgsl b/test/tint/builtins/gen/literal/textureStore/872747.wgsl
index bb90202..52b99d9 100644
--- a/test/tint/builtins/gen/literal/textureStore/872747.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/872747.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_872747() {
   textureStore(arg_0, 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_872747();
diff --git a/test/tint/builtins/gen/literal/textureStore/8b9310.wgsl b/test/tint/builtins/gen/literal/textureStore/8b9310.wgsl
index e6e6f59..572286b 100644
--- a/test/tint/builtins/gen/literal/textureStore/8b9310.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8b9310.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_8b9310() {
   textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8b9310();
diff --git a/test/tint/builtins/gen/literal/textureStore/8bb287.wgsl b/test/tint/builtins/gen/literal/textureStore/8bb287.wgsl
index fc96428..449ffc7 100644
--- a/test/tint/builtins/gen/literal/textureStore/8bb287.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8bb287.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_8bb287() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8bb287();
diff --git a/test/tint/builtins/gen/literal/textureStore/8c76e9.wgsl b/test/tint/builtins/gen/literal/textureStore/8c76e9.wgsl
index 4b54c88..2ef836c 100644
--- a/test/tint/builtins/gen/literal/textureStore/8c76e9.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8c76e9.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_8c76e9() {
   textureStore(arg_0, 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8c76e9();
diff --git a/test/tint/builtins/gen/literal/textureStore/8dc54f.wgsl b/test/tint/builtins/gen/literal/textureStore/8dc54f.wgsl
index 0b2ba1e..5c83938 100644
--- a/test/tint/builtins/gen/literal/textureStore/8dc54f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8dc54f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_8dc54f() {
   textureStore(arg_0, vec2<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8dc54f();
diff --git a/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl b/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl
index b44640c..d52d9da 100644
--- a/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_8e0479() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8e0479();
diff --git a/test/tint/builtins/gen/literal/textureStore/8ed9f8.wgsl b/test/tint/builtins/gen/literal/textureStore/8ed9f8.wgsl
index a480331..5694d6d 100644
--- a/test/tint/builtins/gen/literal/textureStore/8ed9f8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8ed9f8.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_8ed9f8() {
   textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8ed9f8();
diff --git a/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl b/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl
index 46e19fe..5f8c36d 100644
--- a/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_8f71a1() {
   textureStore(arg_0, vec3<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8f71a1();
diff --git a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl
index 67c5919..d2c9e15 100644
--- a/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8ff674.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_8ff674() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8ff674();
diff --git a/test/tint/builtins/gen/literal/textureStore/958353.wgsl b/test/tint/builtins/gen/literal/textureStore/958353.wgsl
index 975f7af8..cdb270d 100644
--- a/test/tint/builtins/gen/literal/textureStore/958353.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/958353.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_958353() {
   textureStore(arg_0, 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_958353();
diff --git a/test/tint/builtins/gen/literal/textureStore/959d94.wgsl b/test/tint/builtins/gen/literal/textureStore/959d94.wgsl
index 7bd958b..e6763b2 100644
--- a/test/tint/builtins/gen/literal/textureStore/959d94.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/959d94.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_959d94() {
   textureStore(arg_0, 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_959d94();
diff --git a/test/tint/builtins/gen/literal/textureStore/95e452.wgsl b/test/tint/builtins/gen/literal/textureStore/95e452.wgsl
index a75661c..1a2baf5 100644
--- a/test/tint/builtins/gen/literal/textureStore/95e452.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/95e452.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_95e452() {
   textureStore(arg_0, vec2<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_95e452();
diff --git a/test/tint/builtins/gen/literal/textureStore/969534.wgsl b/test/tint/builtins/gen/literal/textureStore/969534.wgsl
index 21dfadf..6ebe576 100644
--- a/test/tint/builtins/gen/literal/textureStore/969534.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/969534.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_969534() {
   textureStore(arg_0, 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_969534();
diff --git a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl
index 0441d2e..ccadf21 100644
--- a/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9938b7.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_9938b7() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9938b7();
diff --git a/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl b/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl
index 82ddcfd..62ccd2d 100644
--- a/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_9a3ecc() {
   textureStore(arg_0, vec3<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9a3ecc();
diff --git a/test/tint/builtins/gen/literal/textureStore/9aedd3.wgsl b/test/tint/builtins/gen/literal/textureStore/9aedd3.wgsl
index 5d581b6..dce5c40 100644
--- a/test/tint/builtins/gen/literal/textureStore/9aedd3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9aedd3.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_9aedd3() {
   textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9aedd3();
diff --git a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl
index 2151746..d9470ec 100644
--- a/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9d8668.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_9d8668() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9d8668();
diff --git a/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl b/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl
index b7ffc63..8d79c97 100644
--- a/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_9d9cd5() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9d9cd5();
diff --git a/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl b/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl
index 426ca06..09c678f 100644
--- a/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_9e3ec5() {
   textureStore(arg_0, vec2<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9e3ec5();
diff --git a/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl b/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl
index 2a4613f..767a1b1 100644
--- a/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_9f5318() {
   textureStore(arg_0, vec2<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9f5318();
diff --git a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl
index 5f1421e..3d3b102 100644
--- a/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9f7cea.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_9f7cea() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9f7cea();
diff --git a/test/tint/builtins/gen/literal/textureStore/a0f96e.wgsl b/test/tint/builtins/gen/literal/textureStore/a0f96e.wgsl
index 36452ea..7b49371 100644
--- a/test/tint/builtins/gen/literal/textureStore/a0f96e.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/a0f96e.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_a0f96e() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a0f96e();
diff --git a/test/tint/builtins/gen/literal/textureStore/a1352c.wgsl b/test/tint/builtins/gen/literal/textureStore/a1352c.wgsl
index a52b228..a5a7970 100644
--- a/test/tint/builtins/gen/literal/textureStore/a1352c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/a1352c.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_a1352c() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a1352c();
diff --git a/test/tint/builtins/gen/literal/textureStore/a165b8.wgsl b/test/tint/builtins/gen/literal/textureStore/a165b8.wgsl
index 0494254..2a98fab 100644
--- a/test/tint/builtins/gen/literal/textureStore/a165b8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/a165b8.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_a165b8() {
   textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a165b8();
diff --git a/test/tint/builtins/gen/literal/textureStore/a4c338.wgsl b/test/tint/builtins/gen/literal/textureStore/a4c338.wgsl
index f05d977..ba3917d 100644
--- a/test/tint/builtins/gen/literal/textureStore/a4c338.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/a4c338.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_a4c338() {
   textureStore(arg_0, 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a4c338();
diff --git a/test/tint/builtins/gen/literal/textureStore/a5e80d.wgsl b/test/tint/builtins/gen/literal/textureStore/a5e80d.wgsl
index a433269..9213adb 100644
--- a/test/tint/builtins/gen/literal/textureStore/a5e80d.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/a5e80d.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_a5e80d() {
   textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a5e80d();
diff --git a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl
index 88d4427..9287171 100644
--- a/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/a6a986.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_a6a986() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a6a986();
diff --git a/test/tint/builtins/gen/literal/textureStore/a6e78f.wgsl b/test/tint/builtins/gen/literal/textureStore/a6e78f.wgsl
index af252c6..25fe071 100644
--- a/test/tint/builtins/gen/literal/textureStore/a6e78f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/a6e78f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_a6e78f() {
   textureStore(arg_0, 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a6e78f();
diff --git a/test/tint/builtins/gen/literal/textureStore/a9426c.wgsl b/test/tint/builtins/gen/literal/textureStore/a9426c.wgsl
index 2f4a346..21b4279 100644
--- a/test/tint/builtins/gen/literal/textureStore/a9426c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/a9426c.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_a9426c() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a9426c();
diff --git a/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl b/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl
index 50fe83b..bc4a276 100644
--- a/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_ac67aa() {
   textureStore(arg_0, vec3<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_ac67aa();
diff --git a/test/tint/builtins/gen/literal/textureStore/aeb38a.wgsl b/test/tint/builtins/gen/literal/textureStore/aeb38a.wgsl
index 76ebe28..d7f64e3 100644
--- a/test/tint/builtins/gen/literal/textureStore/aeb38a.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/aeb38a.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_aeb38a() {
   textureStore(arg_0, vec2<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_aeb38a();
diff --git a/test/tint/builtins/gen/literal/textureStore/b42fd3.wgsl b/test/tint/builtins/gen/literal/textureStore/b42fd3.wgsl
index 48348e86..b894338 100644
--- a/test/tint/builtins/gen/literal/textureStore/b42fd3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/b42fd3.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_b42fd3() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b42fd3();
diff --git a/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl b/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl
index b4b450d..d5400e6 100644
--- a/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_b706b1() {
   textureStore(arg_0, vec3<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b706b1();
diff --git a/test/tint/builtins/gen/literal/textureStore/b70ded.wgsl b/test/tint/builtins/gen/literal/textureStore/b70ded.wgsl
index b4c02c6..b1581f0 100644
--- a/test/tint/builtins/gen/literal/textureStore/b70ded.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/b70ded.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_b70ded() {
   textureStore(arg_0, 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b70ded();
diff --git a/test/tint/builtins/gen/literal/textureStore/b76ff3.wgsl b/test/tint/builtins/gen/literal/textureStore/b76ff3.wgsl
index d560e0f..5e58fb5 100644
--- a/test/tint/builtins/gen/literal/textureStore/b76ff3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/b76ff3.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_b76ff3() {
   textureStore(arg_0, vec2<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b76ff3();
diff --git a/test/tint/builtins/gen/literal/textureStore/b77161.wgsl b/test/tint/builtins/gen/literal/textureStore/b77161.wgsl
index 701e100..7260cdd 100644
--- a/test/tint/builtins/gen/literal/textureStore/b77161.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/b77161.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_b77161() {
   textureStore(arg_0, 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b77161();
diff --git a/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl b/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl
index 5729ba5..f9b1630 100644
--- a/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_bbcb7f() {
   textureStore(arg_0, vec2<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_bbcb7f();
diff --git a/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl b/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl
index 792576a..d77affe 100644
--- a/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_be6e30() {
   textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_be6e30();
diff --git a/test/tint/builtins/gen/literal/textureStore/bedbfc.wgsl b/test/tint/builtins/gen/literal/textureStore/bedbfc.wgsl
index e1a17ca..f9104e8 100644
--- a/test/tint/builtins/gen/literal/textureStore/bedbfc.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/bedbfc.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_bedbfc() {
   textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_bedbfc();
diff --git a/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl b/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl
index a3405b4..139c5a1 100644
--- a/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_bf775c() {
   textureStore(arg_0, 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_bf775c();
diff --git a/test/tint/builtins/gen/literal/textureStore/c1f29e.wgsl b/test/tint/builtins/gen/literal/textureStore/c1f29e.wgsl
index 2b11e1d..238193b 100644
--- a/test/tint/builtins/gen/literal/textureStore/c1f29e.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/c1f29e.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_c1f29e() {
   textureStore(arg_0, 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c1f29e();
diff --git a/test/tint/builtins/gen/literal/textureStore/c2ca46.wgsl b/test/tint/builtins/gen/literal/textureStore/c2ca46.wgsl
index 851fa1b..b9caa13 100644
--- a/test/tint/builtins/gen/literal/textureStore/c2ca46.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/c2ca46.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_c2ca46() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c2ca46();
diff --git a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl
index 2fd65bd..16ed969 100644
--- a/test/tint/builtins/gen/literal/textureStore/c32905.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/c32905.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_c32905() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c32905();
diff --git a/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl b/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl
index 5eb1877..ca876e7 100644
--- a/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_c5af1e() {
   textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c5af1e();
diff --git a/test/tint/builtins/gen/literal/textureStore/c863be.wgsl b/test/tint/builtins/gen/literal/textureStore/c863be.wgsl
index 52c9c3a..24d11b2 100644
--- a/test/tint/builtins/gen/literal/textureStore/c863be.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/c863be.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_c863be() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c863be();
diff --git a/test/tint/builtins/gen/literal/textureStore/c9d780.wgsl b/test/tint/builtins/gen/literal/textureStore/c9d780.wgsl
index 77b1843..ca23f1d 100644
--- a/test/tint/builtins/gen/literal/textureStore/c9d780.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/c9d780.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_c9d780() {
   textureStore(arg_0, 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c9d780();
diff --git a/test/tint/builtins/gen/literal/textureStore/cb3b0b.wgsl b/test/tint/builtins/gen/literal/textureStore/cb3b0b.wgsl
index 6b297eb..2c2b58a 100644
--- a/test/tint/builtins/gen/literal/textureStore/cb3b0b.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/cb3b0b.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_cb3b0b() {
   textureStore(arg_0, vec3<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_cb3b0b();
diff --git a/test/tint/builtins/gen/literal/textureStore/cd6755.wgsl b/test/tint/builtins/gen/literal/textureStore/cd6755.wgsl
index 2c7ef4f..c5e769a 100644
--- a/test/tint/builtins/gen/literal/textureStore/cd6755.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/cd6755.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_cd6755() {
   textureStore(arg_0, vec3<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_cd6755();
diff --git a/test/tint/builtins/gen/literal/textureStore/d26166.wgsl b/test/tint/builtins/gen/literal/textureStore/d26166.wgsl
index d81dc9f..d205312 100644
--- a/test/tint/builtins/gen/literal/textureStore/d26166.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/d26166.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_d26166() {
   textureStore(arg_0, 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d26166();
diff --git a/test/tint/builtins/gen/literal/textureStore/d2b565.wgsl b/test/tint/builtins/gen/literal/textureStore/d2b565.wgsl
index 5406923..e5ad342 100644
--- a/test/tint/builtins/gen/literal/textureStore/d2b565.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/d2b565.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_d2b565() {
   textureStore(arg_0, vec3<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d2b565();
diff --git a/test/tint/builtins/gen/literal/textureStore/d4aa95.wgsl b/test/tint/builtins/gen/literal/textureStore/d4aa95.wgsl
index 5dadc3f..0e31f25 100644
--- a/test/tint/builtins/gen/literal/textureStore/d4aa95.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/d4aa95.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_d4aa95() {
   textureStore(arg_0, vec3<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d4aa95();
diff --git a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl
index bfeba0d..86a1bdf 100644
--- a/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/d55e65.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_d55e65() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d55e65();
diff --git a/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl b/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl
index ab49aa8..190c3c8 100644
--- a/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_d73b5c() {
   textureStore(arg_0, 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d73b5c();
diff --git a/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl b/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl
index 7988b6a..af88e77 100644
--- a/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_d82b0a() {
   textureStore(arg_0, vec3<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d82b0a();
diff --git a/test/tint/builtins/gen/literal/textureStore/db92a2.wgsl b/test/tint/builtins/gen/literal/textureStore/db92a2.wgsl
index 2d38fb3..bf083ec 100644
--- a/test/tint/builtins/gen/literal/textureStore/db92a2.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/db92a2.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_db92a2() {
   textureStore(arg_0, vec2<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_db92a2();
diff --git a/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl b/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl
index 522cf94..6a91084 100644
--- a/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_dd7d81() {
   textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_dd7d81();
diff --git a/test/tint/builtins/gen/literal/textureStore/dde364.wgsl b/test/tint/builtins/gen/literal/textureStore/dde364.wgsl
index fcae4f7..27c9044 100644
--- a/test/tint/builtins/gen/literal/textureStore/dde364.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/dde364.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_dde364() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_dde364();
diff --git a/test/tint/builtins/gen/literal/textureStore/de4b94.wgsl b/test/tint/builtins/gen/literal/textureStore/de4b94.wgsl
index 40f235e..0beb99a 100644
--- a/test/tint/builtins/gen/literal/textureStore/de4b94.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/de4b94.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_de4b94() {
   textureStore(arg_0, 1u, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_de4b94();
diff --git a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl
index aa0c6bd..47cc837 100644
--- a/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/df2ca4.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_df2ca4() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_df2ca4();
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl
index d84183f..4118b7f 100644
--- a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_dfa9a1() {
   textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_dfa9a1();
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl
index abc13b1..9af800c 100644
--- a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_dffb13() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_dffb13();
diff --git a/test/tint/builtins/gen/literal/textureStore/e0b666.wgsl b/test/tint/builtins/gen/literal/textureStore/e0b666.wgsl
index 69d5907..487e61b 100644
--- a/test/tint/builtins/gen/literal/textureStore/e0b666.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/e0b666.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_e0b666() {
   textureStore(arg_0, 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e0b666();
diff --git a/test/tint/builtins/gen/literal/textureStore/e38281.wgsl b/test/tint/builtins/gen/literal/textureStore/e38281.wgsl
index 020ff43..75d7c8c 100644
--- a/test/tint/builtins/gen/literal/textureStore/e38281.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/e38281.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_e38281() {
   textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e38281();
diff --git a/test/tint/builtins/gen/literal/textureStore/e7c6d8.wgsl b/test/tint/builtins/gen/literal/textureStore/e7c6d8.wgsl
index 9c47a30..e779300 100644
--- a/test/tint/builtins/gen/literal/textureStore/e7c6d8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/e7c6d8.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_e7c6d8() {
   textureStore(arg_0, 1u, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e7c6d8();
diff --git a/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl b/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl
index 293ba3c..094588f 100644
--- a/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_e885e8() {
   textureStore(arg_0, 1i, vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e885e8();
diff --git a/test/tint/builtins/gen/literal/textureStore/e8cbf7.wgsl b/test/tint/builtins/gen/literal/textureStore/e8cbf7.wgsl
index c6af8b8..ff1d137 100644
--- a/test/tint/builtins/gen/literal/textureStore/e8cbf7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/e8cbf7.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_e8cbf7() {
   textureStore(arg_0, vec2<u32>(1u), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e8cbf7();
diff --git a/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl b/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl
index 93b133c..79b708f 100644
--- a/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_eb702f() {
   textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_eb702f();
diff --git a/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl b/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl
index 8f44b9f..55aa17e 100644
--- a/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_eb78b9() {
   textureStore(arg_0, vec3<i32>(1i), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_eb78b9();
diff --git a/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl b/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl
index a238c3a..7a76f4f 100644
--- a/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_ee6acc() {
   textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_ee6acc();
diff --git a/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl b/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl
index c5f3264..6f8edec 100644
--- a/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_ef9f2f() {
   textureStore(arg_0, vec3<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_ef9f2f();
diff --git a/test/tint/builtins/gen/literal/textureStore/f1e6d3.wgsl b/test/tint/builtins/gen/literal/textureStore/f1e6d3.wgsl
index d342458..1bbaf6b 100644
--- a/test/tint/builtins/gen/literal/textureStore/f1e6d3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/f1e6d3.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_f1e6d3() {
   textureStore(arg_0, vec3<u32>(1u), vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_f1e6d3();
diff --git a/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl b/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl
index 5ed24d4..22abf23 100644
--- a/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_f8dead() {
   textureStore(arg_0, vec3<i32>(1i), vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_f8dead();
diff --git a/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl b/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl
index 47a44c9..7cef298 100644
--- a/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_f9be83() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_f9be83();
diff --git a/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl b/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl
index b26baa2..f2f6fd7 100644
--- a/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_fb9a8f() {
   textureStore(arg_0, 1i, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_fb9a8f();
diff --git a/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl b/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl
index dbb8a6b..d62ee1d 100644
--- a/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_fbf53f() {
   textureStore(arg_0, vec2<i32>(1i), 1i, vec4<i32>(1i));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_fbf53f();
diff --git a/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl b/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl
index f6107e8..da286eb 100644
--- a/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_fcbe66() {
   textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_fcbe66();
diff --git a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl
index 382f7f3..8744d78 100644
--- a/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/fd350c.wgsl
@@ -26,7 +26,6 @@
 fn textureStore_fd350c() {
   textureStore(arg_0, vec2<i32>(1i), 1u, vec4<u32>(1u));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_fd350c();
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl
index 53a99be..c9e2f62 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<3, 3, f16>) -> mat<3, 3, f16>
 fn transpose_06794e() {
   var res: mat3x3<f16> = transpose(mat3x3<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.dxc.hlsl
index 3977313..eb13a3a 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 16u), value[2u]);
+}
+
 void transpose_06794e() {
   matrix<float16_t, 3, 3> res = matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.fxc.hlsl
index 5d50e02..80d5ee1 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,16 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 16u), value[2u]);
+}
+
 void transpose_06794e() {
   matrix<float16_t, 3, 3> res = matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.glsl
index bceb985..7b06a26 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.glsl
@@ -1,8 +1,19 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_06794e() {
   f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -22,8 +33,19 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_06794e() {
   f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -37,8 +59,19 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_06794e() {
   f16mat3 res = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.msl
index e11011f..20b2ccf 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.msl
@@ -1,33 +1,58 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_06794e() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f16_array_element {
+  /* 0x0000 */ packed_half3 elements;
+  /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 3>* const dest, half3x3 value) {
+  (*(dest))[0u].elements = packed_half3(value[0u]);
+  (*(dest))[1u].elements = packed_half3(value[1u]);
+  (*(dest))[2u].elements = packed_half3(value[2u]);
+}
+
+void transpose_06794e(device tint_array<tint_packed_vec3_f16_array_element, 3>* const tint_symbol_1) {
   half3x3 res = half3x3(half3(1.0h), half3(1.0h), half3(1.0h));
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_06794e();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f16_array_element, 3>* const tint_symbol_2) {
+  transpose_06794e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f16_array_element, 3>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_06794e();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f16_array_element, 3>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_06794e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_06794e();
+kernel void compute_main(device tint_array<tint_packed_vec3_f16_array_element, 3>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_06794e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.spvasm
index 03c5725..a227368 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -9,66 +9,107 @@
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_06794e "transpose_06794e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
  %mat3v3half = OpTypeMatrix %v3half 3
+%prevent_dce_block = OpTypeStruct %mat3v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void %mat3v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+      %int_2 = OpConstant %int 2
+     %uint_2 = OpConstant %uint 2
+         %36 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat3v3half %17 %17 %17
+         %40 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %41 = OpConstantComposite %mat3v3half %40 %40 %40
 %_ptr_Function_mat3v3half = OpTypePointer Function %mat3v3half
-         %21 = OpConstantNull %mat3v3half
-         %22 = OpTypeFunction %v4float
+         %44 = OpConstantNull %mat3v3half
+         %47 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_06794e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v3half Function %21
-               OpStore %res %18
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %15
+      %value = OpFunctionParameter %mat3v3half
+         %19 = OpLabel
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %23
+         %27 = OpCompositeExtract %v3half %value 0
+               OpStore %25 %27
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_1
+         %31 = OpCompositeExtract %v3half %value 1
+               OpStore %29 %31
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_2
+         %35 = OpCompositeExtract %v3half %value 2
+               OpStore %33 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_06794e
+%transpose_06794e = OpFunction %void None %36
+         %38 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v3half Function %44
+               OpStore %res %41
+         %46 = OpLoad %mat3v3half %res
+         %45 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %46
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %transpose_06794e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %36
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_06794e
+%fragment_main = OpFunction %void None %36
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %transpose_06794e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_06794e
+%compute_main = OpFunction %void None %36
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %transpose_06794e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.wgsl
index b1ba096..5025574 100644
--- a/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/06794e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_06794e() {
   var res : mat3x3<f16> = transpose(mat3x3<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_06794e();
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl
index 944e58d..95d65e9 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<4, 3, f32>) -> mat<3, 4, f32>
 fn transpose_2585cd() {
   var res: mat3x4<f32> = transpose(mat4x3<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.dxc.hlsl
index d86773b..00be678 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store4((offset + 32u), asuint(value[2u]));
+}
+
 void transpose_2585cd() {
   float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.fxc.hlsl
index d86773b..00be678 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.fxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store4((offset + 32u), asuint(value[2u]));
+}
+
 void transpose_2585cd() {
   float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.glsl
index 60836cf..6d632f3 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x4 inner;
+} prevent_dce;
+
 void transpose_2585cd() {
   mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x4 inner;
+} prevent_dce;
+
 void transpose_2585cd() {
   mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x4 inner;
+} prevent_dce;
+
 void transpose_2585cd() {
   mat3x4 res = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.msl
index f0936d5..e2fd1af 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_2585cd() {
+void transpose_2585cd(device float3x4* const tint_symbol_1) {
   float3x4 res = float3x4(float4(1.0f), float4(1.0f), float4(1.0f));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_2585cd();
+float4 vertex_main_inner(device float3x4* const tint_symbol_2) {
+  transpose_2585cd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float3x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_2585cd();
+fragment void fragment_main(device float3x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_2585cd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_2585cd();
+kernel void compute_main(device float3x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_2585cd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.spvasm
index 4925227..a1ea658 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_2585cd "transpose_2585cd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
 %mat3v4float = OpTypeMatrix %v4float 3
+%prevent_dce_block = OpTypeStruct %mat3v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %16 = OpConstantComposite %mat3v4float %15 %15 %15
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %19 = OpConstantComposite %mat3v4float %18 %18 %18
 %_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
-         %19 = OpConstantNull %mat3v4float
-         %20 = OpTypeFunction %v4float
-%transpose_2585cd = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v4float Function %19
-               OpStore %res %16
+         %22 = OpConstantNull %mat3v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat3v4float = OpTypePointer StorageBuffer %mat3v4float
+         %28 = OpTypeFunction %v4float
+%transpose_2585cd = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v4float Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_mat3v4float %prevent_dce %uint_0
+         %27 = OpLoad %mat3v4float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %transpose_2585cd
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %transpose_2585cd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %transpose_2585cd
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %transpose_2585cd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_2585cd
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_2585cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.wgsl
index ca39b02..f254d65 100644
--- a/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/2585cd.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_2585cd() {
   var res : mat3x4<f32> = transpose(mat4x3<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_2585cd();
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl
index 3f15b9d..cec2b32 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<2, 2, f32>) -> mat<2, 2, f32>
 fn transpose_31d679() {
   var res: mat2x2<f32> = transpose(mat2x2<f32>(1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.dxc.hlsl
index efb6810..3972cd4 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.dxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+}
+
 void transpose_31d679() {
   float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.fxc.hlsl
index efb6810..3972cd4 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.fxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+}
+
 void transpose_31d679() {
   float2x2 res = float2x2((1.0f).xx, (1.0f).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.glsl
index 6e858e6..5948d0b 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2 inner;
+} prevent_dce;
+
 void transpose_31d679() {
   mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2 inner;
+} prevent_dce;
+
 void transpose_31d679() {
   mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2 inner;
+} prevent_dce;
+
 void transpose_31d679() {
   mat2 res = mat2(vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.msl
index 6170477..27eae81 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_31d679() {
+void transpose_31d679(device float2x2* const tint_symbol_1) {
   float2x2 res = float2x2(float2(1.0f), float2(1.0f));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_31d679();
+float4 vertex_main_inner(device float2x2* const tint_symbol_2) {
+  transpose_31d679(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_31d679();
+fragment void fragment_main(device float2x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_31d679(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_31d679();
+kernel void compute_main(device float2x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_31d679(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.spvasm
index 0c2a9ca..e6b5c2f 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_31d679 "transpose_31d679"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat2v2float = OpTypeMatrix %v2float 2
+%prevent_dce_block = OpTypeStruct %mat2v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
-         %17 = OpConstantComposite %mat2v2float %16 %16
+         %19 = OpConstantComposite %v2float %float_1 %float_1
+         %20 = OpConstantComposite %mat2v2float %19 %19
 %_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
-         %20 = OpConstantNull %mat2v2float
-         %21 = OpTypeFunction %v4float
-%transpose_31d679 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v2float Function %20
-               OpStore %res %17
+         %23 = OpConstantNull %mat2v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat2v2float = OpTypePointer StorageBuffer %mat2v2float
+         %29 = OpTypeFunction %v4float
+%transpose_31d679 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v2float Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_mat2v2float %prevent_dce %uint_0
+         %28 = OpLoad %mat2v2float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %transpose_31d679
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_31d679
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_31d679
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %transpose_31d679
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_31d679
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %transpose_31d679
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.wgsl
index 32267a1..e2d0c07 100644
--- a/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/31d679.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_31d679() {
   var res : mat2x2<f32> = transpose(mat2x2<f32>(1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_31d679();
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl
index ec41dcb..5e27ba1 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<4, 2, f32>) -> mat<2, 4, f32>
 fn transpose_31e37e() {
   var res: mat2x4<f32> = transpose(mat4x2<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.dxc.hlsl
index 387bd69..9c0f8bb 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+}
+
 void transpose_31e37e() {
   float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.fxc.hlsl
index 387bd69..9c0f8bb 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+}
+
 void transpose_31e37e() {
   float2x4 res = float2x4((1.0f).xxxx, (1.0f).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.glsl
index 031e2ab..c1dd309 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x4 inner;
+} prevent_dce;
+
 void transpose_31e37e() {
   mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x4 inner;
+} prevent_dce;
+
 void transpose_31e37e() {
   mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x4 inner;
+} prevent_dce;
+
 void transpose_31e37e() {
   mat2x4 res = mat2x4(vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.msl
index 8cbf0ed..6c5f1d8 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_31e37e() {
+void transpose_31e37e(device float2x4* const tint_symbol_1) {
   float2x4 res = float2x4(float4(1.0f), float4(1.0f));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_31e37e();
+float4 vertex_main_inner(device float2x4* const tint_symbol_2) {
+  transpose_31e37e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_31e37e();
+fragment void fragment_main(device float2x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_31e37e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_31e37e();
+kernel void compute_main(device float2x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_31e37e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.spvasm
index 3f0ece2..d2bdc93 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_31e37e "transpose_31e37e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
 %mat2v4float = OpTypeMatrix %v4float 2
+%prevent_dce_block = OpTypeStruct %mat2v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %16 = OpConstantComposite %mat2v4float %15 %15
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %19 = OpConstantComposite %mat2v4float %18 %18
 %_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
-         %19 = OpConstantNull %mat2v4float
-         %20 = OpTypeFunction %v4float
-%transpose_31e37e = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v4float Function %19
-               OpStore %res %16
+         %22 = OpConstantNull %mat2v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat2v4float = OpTypePointer StorageBuffer %mat2v4float
+         %28 = OpTypeFunction %v4float
+%transpose_31e37e = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v4float Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_mat2v4float %prevent_dce %uint_0
+         %27 = OpLoad %mat2v4float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %transpose_31e37e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %transpose_31e37e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %transpose_31e37e
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %transpose_31e37e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_31e37e
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_31e37e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.wgsl
index 31e0e1c..06a0782 100644
--- a/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/31e37e.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_31e37e() {
   var res : mat2x4<f32> = transpose(mat4x2<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_31e37e();
diff --git a/test/tint/builtins/gen/literal/transpose/32dd64.wgsl b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl
index 3efd9cc..2fa4efe 100644
--- a/test/tint/builtins/gen/literal/transpose/32dd64.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/32dd64.wgsl
@@ -25,7 +25,6 @@
 fn transpose_32dd64() {
   var res = transpose(mat3x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_32dd64();
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl
index 40502b7..396f7bb 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<2, 4, f32>) -> mat<4, 2, f32>
 fn transpose_4ce359() {
   var res: mat4x2<f32> = transpose(mat2x4<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.dxc.hlsl
index a3c33b4..7bc6aa4 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.dxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+  prevent_dce.Store2((offset + 16u), asuint(value[2u]));
+  prevent_dce.Store2((offset + 24u), asuint(value[3u]));
+}
+
 void transpose_4ce359() {
   float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.fxc.hlsl
index a3c33b4..7bc6aa4 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.fxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+  prevent_dce.Store2((offset + 16u), asuint(value[2u]));
+  prevent_dce.Store2((offset + 24u), asuint(value[3u]));
+}
+
 void transpose_4ce359() {
   float4x2 res = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.glsl
index 101eec8..6c40d55 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x2 inner;
+} prevent_dce;
+
 void transpose_4ce359() {
   mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x2 inner;
+} prevent_dce;
+
 void transpose_4ce359() {
   mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x2 inner;
+} prevent_dce;
+
 void transpose_4ce359() {
   mat4x2 res = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.msl
index 150821f..2cf1364 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_4ce359() {
+void transpose_4ce359(device float4x2* const tint_symbol_1) {
   float4x2 res = float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_4ce359();
+float4 vertex_main_inner(device float4x2* const tint_symbol_2) {
+  transpose_4ce359(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_4ce359();
+fragment void fragment_main(device float4x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_4ce359(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_4ce359();
+kernel void compute_main(device float4x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_4ce359(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.spvasm
index 96c31a9..63a3fa8 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_4ce359 "transpose_4ce359"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat4v2float = OpTypeMatrix %v2float 4
+%prevent_dce_block = OpTypeStruct %mat4v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
-         %17 = OpConstantComposite %mat4v2float %16 %16 %16 %16
+         %19 = OpConstantComposite %v2float %float_1 %float_1
+         %20 = OpConstantComposite %mat4v2float %19 %19 %19 %19
 %_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
-         %20 = OpConstantNull %mat4v2float
-         %21 = OpTypeFunction %v4float
-%transpose_4ce359 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v2float Function %20
-               OpStore %res %17
+         %23 = OpConstantNull %mat4v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat4v2float = OpTypePointer StorageBuffer %mat4v2float
+         %29 = OpTypeFunction %v4float
+%transpose_4ce359 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v2float Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_mat4v2float %prevent_dce %uint_0
+         %28 = OpLoad %mat4v2float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %transpose_4ce359
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_4ce359
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_4ce359
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %transpose_4ce359
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_4ce359
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %transpose_4ce359
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.wgsl
index 47e4a28..32e6a5e 100644
--- a/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/4ce359.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_4ce359() {
   var res : mat4x2<f32> = transpose(mat2x4<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_4ce359();
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl
index d9e4eed..e65e895 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<2, 3, f32>) -> mat<3, 2, f32>
 fn transpose_4dc9a1() {
   var res: mat3x2<f32> = transpose(mat2x3<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.dxc.hlsl
index 2f3ba72..8e37587 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+  prevent_dce.Store2((offset + 16u), asuint(value[2u]));
+}
+
 void transpose_4dc9a1() {
   float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.fxc.hlsl
index 2f3ba72..8e37587 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+  prevent_dce.Store2((offset + 16u), asuint(value[2u]));
+}
+
 void transpose_4dc9a1() {
   float3x2 res = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.glsl
index 81feae0..70de138 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x2 inner;
+} prevent_dce;
+
 void transpose_4dc9a1() {
   mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x2 inner;
+} prevent_dce;
+
 void transpose_4dc9a1() {
   mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x2 inner;
+} prevent_dce;
+
 void transpose_4dc9a1() {
   mat3x2 res = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.msl
index b1d4d7a..1aa279e 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_4dc9a1() {
+void transpose_4dc9a1(device float3x2* const tint_symbol_1) {
   float3x2 res = float3x2(float2(1.0f), float2(1.0f), float2(1.0f));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_4dc9a1();
+float4 vertex_main_inner(device float3x2* const tint_symbol_2) {
+  transpose_4dc9a1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float3x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_4dc9a1();
+fragment void fragment_main(device float3x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_4dc9a1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_4dc9a1();
+kernel void compute_main(device float3x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_4dc9a1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.spvasm
index 725a125..77ec602 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_4dc9a1 "transpose_4dc9a1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat3v2float = OpTypeMatrix %v2float 3
+%prevent_dce_block = OpTypeStruct %mat3v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
-         %17 = OpConstantComposite %mat3v2float %16 %16 %16
+         %19 = OpConstantComposite %v2float %float_1 %float_1
+         %20 = OpConstantComposite %mat3v2float %19 %19 %19
 %_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
-         %20 = OpConstantNull %mat3v2float
-         %21 = OpTypeFunction %v4float
-%transpose_4dc9a1 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v2float Function %20
-               OpStore %res %17
+         %23 = OpConstantNull %mat3v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat3v2float = OpTypePointer StorageBuffer %mat3v2float
+         %29 = OpTypeFunction %v4float
+%transpose_4dc9a1 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v2float Function %23
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_mat3v2float %prevent_dce %uint_0
+         %28 = OpLoad %mat3v2float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %transpose_4dc9a1
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %transpose_4dc9a1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %14
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_4dc9a1
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %transpose_4dc9a1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_4dc9a1
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %transpose_4dc9a1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.wgsl
index 5db00a5..494d81f 100644
--- a/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/4dc9a1.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_4dc9a1() {
   var res : mat3x2<f32> = transpose(mat2x3<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_4dc9a1();
diff --git a/test/tint/builtins/gen/literal/transpose/553e90.wgsl b/test/tint/builtins/gen/literal/transpose/553e90.wgsl
index 5eb0ace..ac448b0 100644
--- a/test/tint/builtins/gen/literal/transpose/553e90.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/553e90.wgsl
@@ -25,7 +25,6 @@
 fn transpose_553e90() {
   var res = transpose(mat4x2(1., 1., 1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_553e90();
diff --git a/test/tint/builtins/gen/literal/transpose/5c133c.wgsl b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl
index 487aad8..e477412 100644
--- a/test/tint/builtins/gen/literal/transpose/5c133c.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/5c133c.wgsl
@@ -25,7 +25,6 @@
 fn transpose_5c133c() {
   var res = transpose(mat4x3(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_5c133c();
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl
index ca694d5..f526477 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<4, 2, f16>) -> mat<2, 4, f16>
 fn transpose_5edd96() {
   var res: mat2x4<f16> = transpose(mat4x2<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.dxc.hlsl
index 736166a..5ebd512 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.dxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+}
+
 void transpose_5edd96() {
   matrix<float16_t, 2, 4> res = matrix<float16_t, 2, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.fxc.hlsl
index 1011d3c..8b775e9 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.fxc.hlsl
@@ -1,7 +1,15 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+}
+
 void transpose_5edd96() {
   matrix<float16_t, 2, 4> res = matrix<float16_t, 2, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.glsl
index f2c3448..2968eda 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x4 inner;
+} prevent_dce;
+
 void transpose_5edd96() {
   f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x4 inner;
+} prevent_dce;
+
 void transpose_5edd96() {
   f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x4 inner;
+} prevent_dce;
+
 void transpose_5edd96() {
   f16mat2x4 res = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.msl
index 9e612d6..75e2d46 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_5edd96() {
+void transpose_5edd96(device half2x4* const tint_symbol_1) {
   half2x4 res = half2x4(half4(1.0h), half4(1.0h));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_5edd96();
+float4 vertex_main_inner(device half2x4* const tint_symbol_2) {
+  transpose_5edd96(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_5edd96();
+fragment void fragment_main(device half2x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_5edd96(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_5edd96();
+kernel void compute_main(device half2x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_5edd96(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.spvasm
index 603fe36..11b39f6 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_5edd96 "transpose_5edd96"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
  %mat2v4half = OpTypeMatrix %v4half 2
+%prevent_dce_block = OpTypeStruct %mat2v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat2v4half %17 %17
+         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat2v4half %20 %20
 %_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
-         %21 = OpConstantNull %mat2v4half
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %mat2v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat2v4half = OpTypePointer StorageBuffer %mat2v4half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_5edd96 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v4half Function %21
-               OpStore %res %18
+%transpose_5edd96 = OpFunction %void None %15
+         %18 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v4half Function %24
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_mat2v4half %prevent_dce %uint_0
+         %29 = OpLoad %mat2v4half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_5edd96
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_5edd96
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %15
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_5edd96
+%fragment_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_5edd96
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_5edd96
+%compute_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_5edd96
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.wgsl
index 3edbfa2..5ff72d3 100644
--- a/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/5edd96.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_5edd96() {
   var res : mat2x4<f16> = transpose(mat4x2<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_5edd96();
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl
index f5992a4..109d13c 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<4, 3, f16>) -> mat<3, 4, f16>
 fn transpose_5f36bf() {
   var res: mat3x4<f16> = transpose(mat4x3<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.dxc.hlsl
index 6bef090..8fa5fe7 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 16u), value[2u]);
+}
+
 void transpose_5f36bf() {
   matrix<float16_t, 3, 4> res = matrix<float16_t, 3, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.fxc.hlsl
index 6336c52..6d2e6f4 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.fxc.hlsl
@@ -1,7 +1,16 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 16u), value[2u]);
+}
+
 void transpose_5f36bf() {
   matrix<float16_t, 3, 4> res = matrix<float16_t, 3, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.glsl
index 6e78f07..7bf364b 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x4 inner;
+} prevent_dce;
+
 void transpose_5f36bf() {
   f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x4 inner;
+} prevent_dce;
+
 void transpose_5f36bf() {
   f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x4 inner;
+} prevent_dce;
+
 void transpose_5f36bf() {
   f16mat3x4 res = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.msl
index 7e141f9..8d19bfe 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_5f36bf() {
+void transpose_5f36bf(device half3x4* const tint_symbol_1) {
   half3x4 res = half3x4(half4(1.0h), half4(1.0h), half4(1.0h));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_5f36bf();
+float4 vertex_main_inner(device half3x4* const tint_symbol_2) {
+  transpose_5f36bf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half3x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_5f36bf();
+fragment void fragment_main(device half3x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_5f36bf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_5f36bf();
+kernel void compute_main(device half3x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_5f36bf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.spvasm
index 08bc2fd..5e7050c 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_5f36bf "transpose_5f36bf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
  %mat3v4half = OpTypeMatrix %v4half 3
+%prevent_dce_block = OpTypeStruct %mat3v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat3v4half %17 %17 %17
+         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat3v4half %20 %20 %20
 %_ptr_Function_mat3v4half = OpTypePointer Function %mat3v4half
-         %21 = OpConstantNull %mat3v4half
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %mat3v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat3v4half = OpTypePointer StorageBuffer %mat3v4half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_5f36bf = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v4half Function %21
-               OpStore %res %18
+%transpose_5f36bf = OpFunction %void None %15
+         %18 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v4half Function %24
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_mat3v4half %prevent_dce %uint_0
+         %29 = OpLoad %mat3v4half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_5f36bf
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_5f36bf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %15
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_5f36bf
+%fragment_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_5f36bf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_5f36bf
+%compute_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_5f36bf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.wgsl
index 374302e..eba7377 100644
--- a/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/5f36bf.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_5f36bf() {
   var res : mat3x4<f16> = transpose(mat4x3<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_5f36bf();
diff --git a/test/tint/builtins/gen/literal/transpose/66fce8.wgsl b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl
index 51e7da6..7eed3a2 100644
--- a/test/tint/builtins/gen/literal/transpose/66fce8.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/66fce8.wgsl
@@ -25,7 +25,6 @@
 fn transpose_66fce8() {
   var res = transpose(mat3x3(1., 1., 1., 1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_66fce8();
diff --git a/test/tint/builtins/gen/literal/transpose/70ca11.wgsl b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl
index 7ef92e5..430acf3 100644
--- a/test/tint/builtins/gen/literal/transpose/70ca11.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/70ca11.wgsl
@@ -25,7 +25,6 @@
 fn transpose_70ca11() {
   var res = transpose(mat2x3(1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_70ca11();
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl
index bd62bb3..eee4741 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<2, 2, f16>) -> mat<2, 2, f16>
 fn transpose_7be8b2() {
   var res: mat2x2<f16> = transpose(mat2x2<f16>(1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.dxc.hlsl
index 08cac08..fa38c79 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+}
+
 void transpose_7be8b2() {
   matrix<float16_t, 2, 2> res = matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.fxc.hlsl
index ed432d6..f9f1c02 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.fxc.hlsl
@@ -1,7 +1,15 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+}
+
 void transpose_7be8b2() {
   matrix<float16_t, 2, 2> res = matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.glsl
index db2a179..76b1843 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2 inner;
+} prevent_dce;
+
 void transpose_7be8b2() {
   f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2 inner;
+} prevent_dce;
+
 void transpose_7be8b2() {
   f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2 inner;
+} prevent_dce;
+
 void transpose_7be8b2() {
   f16mat2 res = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.msl
index 90e5d8a..aa428f6 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_7be8b2() {
+void transpose_7be8b2(device half2x2* const tint_symbol_1) {
   half2x2 res = half2x2(half2(1.0h), half2(1.0h));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_7be8b2();
+float4 vertex_main_inner(device half2x2* const tint_symbol_2) {
+  transpose_7be8b2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_7be8b2();
+fragment void fragment_main(device half2x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_7be8b2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_7be8b2();
+kernel void compute_main(device half2x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_7be8b2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.spvasm
index 05c185c..fd02dd4 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_7be8b2 "transpose_7be8b2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 4
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
  %mat2v2half = OpTypeMatrix %v2half 2
+%prevent_dce_block = OpTypeStruct %mat2v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat2v2half %17 %17
+         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat2v2half %20 %20
 %_ptr_Function_mat2v2half = OpTypePointer Function %mat2v2half
-         %21 = OpConstantNull %mat2v2half
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %mat2v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat2v2half = OpTypePointer StorageBuffer %mat2v2half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_7be8b2 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v2half Function %21
-               OpStore %res %18
+%transpose_7be8b2 = OpFunction %void None %15
+         %18 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v2half Function %24
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_mat2v2half %prevent_dce %uint_0
+         %29 = OpLoad %mat2v2half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_7be8b2
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_7be8b2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %15
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_7be8b2
+%fragment_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_7be8b2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_7be8b2
+%compute_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_7be8b2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.wgsl
index 9b4281f..2985afa 100644
--- a/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/7be8b2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_7be8b2() {
   var res : mat2x2<f16> = transpose(mat2x2<f16>(1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_7be8b2();
diff --git a/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl
index 84f0709..e55fc8a 100644
--- a/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/7eb2c5.wgsl
@@ -25,7 +25,6 @@
 fn transpose_7eb2c5() {
   var res = transpose(mat2x2(1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_7eb2c5();
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl b/test/tint/builtins/gen/literal/transpose/844869.wgsl
index 0548c1b..60f4010 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<4, 4, f16>) -> mat<4, 4, f16>
 fn transpose_844869() {
   var res: mat4x4<f16> = transpose(mat4x4<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.dxc.hlsl
index ec32137..f38fa90 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.dxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 16u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 24u), value[3u]);
+}
+
 void transpose_844869() {
   matrix<float16_t, 4, 4> res = matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.fxc.hlsl
index 2a2a2b4..ec0bb48 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.fxc.hlsl
@@ -1,7 +1,17 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 16u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 24u), value[3u]);
+}
+
 void transpose_844869() {
   matrix<float16_t, 4, 4> res = matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.glsl
index 6fd102a..f077991 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4 inner;
+} prevent_dce;
+
 void transpose_844869() {
   f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4 inner;
+} prevent_dce;
+
 void transpose_844869() {
   f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4 inner;
+} prevent_dce;
+
 void transpose_844869() {
   f16mat4 res = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.msl
index fe21910..9d757f4 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_844869() {
+void transpose_844869(device half4x4* const tint_symbol_1) {
   half4x4 res = half4x4(half4(1.0h), half4(1.0h), half4(1.0h), half4(1.0h));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_844869();
+float4 vertex_main_inner(device half4x4* const tint_symbol_2) {
+  transpose_844869(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_844869();
+fragment void fragment_main(device half4x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_844869(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_844869();
+kernel void compute_main(device half4x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_844869(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.spvasm
index 3364395..1fe7f8e 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_844869 "transpose_844869"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
  %mat4v4half = OpTypeMatrix %v4half 4
+%prevent_dce_block = OpTypeStruct %mat4v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat4v4half %17 %17 %17 %17
+         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat4v4half %20 %20 %20 %20
 %_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
-         %21 = OpConstantNull %mat4v4half
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %mat4v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat4v4half = OpTypePointer StorageBuffer %mat4v4half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_844869 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v4half Function %21
-               OpStore %res %18
+%transpose_844869 = OpFunction %void None %15
+         %18 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v4half Function %24
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_mat4v4half %prevent_dce %uint_0
+         %29 = OpLoad %mat4v4half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_844869
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_844869
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %15
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_844869
+%fragment_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_844869
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_844869
+%compute_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_844869
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.wgsl
index 8f36149..e5637e9 100644
--- a/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/844869.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_844869() {
   var res : mat4x4<f16> = transpose(mat4x4<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_844869();
diff --git a/test/tint/builtins/gen/literal/transpose/84a763.wgsl b/test/tint/builtins/gen/literal/transpose/84a763.wgsl
index a965485..0851133 100644
--- a/test/tint/builtins/gen/literal/transpose/84a763.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/84a763.wgsl
@@ -25,7 +25,6 @@
 fn transpose_84a763() {
   var res = transpose(mat2x4(1., 1., 1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_84a763();
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl b/test/tint/builtins/gen/literal/transpose/854336.wgsl
index 68d9306..30adea2 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<3, 3, f32>) -> mat<3, 3, f32>
 fn transpose_854336() {
   var res: mat3x3<f32> = transpose(mat3x3<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.dxc.hlsl
index b094732..ec5e8e19 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.dxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store3((offset + 32u), asuint(value[2u]));
+}
+
 void transpose_854336() {
   float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.fxc.hlsl
index b094732..ec5e8e19 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.fxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store3((offset + 32u), asuint(value[2u]));
+}
+
 void transpose_854336() {
   float3x3 res = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.glsl
index 5092a2e..c33db6b 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.glsl
@@ -1,7 +1,18 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_854336() {
   mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -20,8 +31,19 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_854336() {
   mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -34,8 +56,19 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_854336() {
   mat3 res = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.msl
index 13b5c65..ca7a6d1 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.msl
@@ -1,33 +1,58 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_854336() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f32_array_element {
+  /* 0x0000 */ packed_float3 elements;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 3>* const dest, float3x3 value) {
+  (*(dest))[0u].elements = packed_float3(value[0u]);
+  (*(dest))[1u].elements = packed_float3(value[1u]);
+  (*(dest))[2u].elements = packed_float3(value[2u]);
+}
+
+void transpose_854336(device tint_array<tint_packed_vec3_f32_array_element, 3>* const tint_symbol_1) {
   float3x3 res = float3x3(float3(1.0f), float3(1.0f), float3(1.0f));
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_854336();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f32_array_element, 3>* const tint_symbol_2) {
+  transpose_854336(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_854336();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_854336(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_854336();
+kernel void compute_main(device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_854336(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.spvasm
index 3d93f98..02fb272 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.spvasm
@@ -1,68 +1,109 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_854336 "transpose_854336"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat3v3float = OpTypeMatrix %v3float 3
+%prevent_dce_block = OpTypeStruct %mat3v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void %mat3v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %22 = OpConstantNull %int
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+      %int_2 = OpConstant %int 2
+     %uint_2 = OpConstant %uint 2
+         %35 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %17 = OpConstantComposite %mat3v3float %16 %16 %16
+         %39 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %40 = OpConstantComposite %mat3v3float %39 %39 %39
 %_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
-         %20 = OpConstantNull %mat3v3float
-         %21 = OpTypeFunction %v4float
-%transpose_854336 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v3float Function %20
-               OpStore %res %17
+         %43 = OpConstantNull %mat3v3float
+         %46 = OpTypeFunction %v4float
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %14
+      %value = OpFunctionParameter %mat3v3float
+         %18 = OpLabel
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %22
+         %26 = OpCompositeExtract %v3float %value 0
+               OpStore %24 %26
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_1
+         %30 = OpCompositeExtract %v3float %value 1
+               OpStore %28 %30
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_2
+         %34 = OpCompositeExtract %v3float %value 2
+               OpStore %32 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %transpose_854336
+%transpose_854336 = OpFunction %void None %35
+         %37 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v3float Function %43
+               OpStore %res %40
+         %45 = OpLoad %mat3v3float %res
+         %44 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %45
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %transpose_854336
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %35
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_854336
+%fragment_main = OpFunction %void None %35
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %transpose_854336
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_854336
+%compute_main = OpFunction %void None %35
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %transpose_854336
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.wgsl
index f5aaa29..da84300 100644
--- a/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/854336.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_854336() {
   var res : mat3x3<f32> = transpose(mat3x3<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_854336();
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl
index b755bbd..1d2affa 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<3, 4, f16>) -> mat<4, 3, f16>
 fn transpose_8c06ce() {
   var res: mat4x3<f16> = transpose(mat3x4<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.dxc.hlsl
index fbbd86d..2fb3562 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.dxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 16u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 24u), value[3u]);
+}
+
 void transpose_8c06ce() {
   matrix<float16_t, 4, 3> res = matrix<float16_t, 4, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.fxc.hlsl
index 34277a0..11937a1 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.fxc.hlsl
@@ -1,7 +1,17 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 16u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 24u), value[3u]);
+}
+
 void transpose_8c06ce() {
   matrix<float16_t, 4, 3> res = matrix<float16_t, 4, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.glsl
index 439264c..8e9363a 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.glsl
@@ -1,8 +1,20 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_8c06ce() {
   f16mat4x3 res = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -22,8 +34,20 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_8c06ce() {
   f16mat4x3 res = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -37,8 +61,20 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_8c06ce() {
   f16mat4x3 res = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.msl
index 3144e11..8715fbe 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.msl
@@ -1,33 +1,59 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_8c06ce() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f16_array_element {
+  /* 0x0000 */ packed_half3 elements;
+  /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 4>* const dest, half4x3 value) {
+  (*(dest))[0u].elements = packed_half3(value[0u]);
+  (*(dest))[1u].elements = packed_half3(value[1u]);
+  (*(dest))[2u].elements = packed_half3(value[2u]);
+  (*(dest))[3u].elements = packed_half3(value[3u]);
+}
+
+void transpose_8c06ce(device tint_array<tint_packed_vec3_f16_array_element, 4>* const tint_symbol_1) {
   half4x3 res = half4x3(half3(1.0h), half3(1.0h), half3(1.0h), half3(1.0h));
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_8c06ce();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f16_array_element, 4>* const tint_symbol_2) {
+  transpose_8c06ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f16_array_element, 4>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_8c06ce();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f16_array_element, 4>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_8c06ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_8c06ce();
+kernel void compute_main(device tint_array<tint_packed_vec3_f16_array_element, 4>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_8c06ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.spvasm
index ef9708c..29ee10e 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -9,66 +9,112 @@
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_8c06ce "transpose_8c06ce"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
  %mat4v3half = OpTypeMatrix %v3half 4
+%prevent_dce_block = OpTypeStruct %mat4v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void %mat4v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+      %int_2 = OpConstant %int 2
+     %uint_2 = OpConstant %uint 2
+      %int_3 = OpConstant %int 3
+     %uint_3 = OpConstant %uint 3
+         %40 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat4v3half %17 %17 %17 %17
+         %44 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %45 = OpConstantComposite %mat4v3half %44 %44 %44 %44
 %_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
-         %21 = OpConstantNull %mat4v3half
-         %22 = OpTypeFunction %v4float
+         %48 = OpConstantNull %mat4v3half
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_8c06ce = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v3half Function %21
-               OpStore %res %18
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %15
+      %value = OpFunctionParameter %mat4v3half
+         %19 = OpLabel
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %23
+         %27 = OpCompositeExtract %v3half %value 0
+               OpStore %25 %27
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_1
+         %31 = OpCompositeExtract %v3half %value 1
+               OpStore %29 %31
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_2
+         %35 = OpCompositeExtract %v3half %value 2
+               OpStore %33 %35
+         %37 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_3
+         %39 = OpCompositeExtract %v3half %value 3
+               OpStore %37 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_8c06ce
+%transpose_8c06ce = OpFunction %void None %40
+         %42 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v3half Function %48
+               OpStore %res %45
+         %50 = OpLoad %mat4v3half %res
+         %49 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %50
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %transpose_8c06ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %40
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_8c06ce
+%fragment_main = OpFunction %void None %40
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %transpose_8c06ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_8c06ce
+%compute_main = OpFunction %void None %40
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %transpose_8c06ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.wgsl
index f2b4dc4..1335df4 100644
--- a/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/8c06ce.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_8c06ce() {
   var res : mat4x3<f16> = transpose(mat3x4<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_8c06ce();
diff --git a/test/tint/builtins/gen/literal/transpose/ace596.wgsl b/test/tint/builtins/gen/literal/transpose/ace596.wgsl
index b55c252..b75a104 100644
--- a/test/tint/builtins/gen/literal/transpose/ace596.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/ace596.wgsl
@@ -25,7 +25,6 @@
 fn transpose_ace596() {
   var res = transpose(mat3x2(1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_ace596();
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl
index d2e4c2b..1a750f6 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<3, 2, f16>) -> mat<2, 3, f16>
 fn transpose_b9ad1f() {
   var res: mat2x3<f16> = transpose(mat3x2<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.dxc.hlsl
index 126d8cb..7eb6c0c 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+}
+
 void transpose_b9ad1f() {
   matrix<float16_t, 2, 3> res = matrix<float16_t, 2, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.fxc.hlsl
index 7b35fe7..df8512e 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,15 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+}
+
 void transpose_b9ad1f() {
   matrix<float16_t, 2, 3> res = matrix<float16_t, 2, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.glsl
index 82e02e7..e59d4ad 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.glsl
@@ -1,8 +1,18 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_b9ad1f() {
   f16mat2x3 res = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -22,8 +32,18 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_b9ad1f() {
   f16mat2x3 res = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -37,8 +57,18 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_b9ad1f() {
   f16mat2x3 res = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.msl
index 9d97e55..9752e51 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.msl
@@ -1,33 +1,57 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_b9ad1f() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f16_array_element {
+  /* 0x0000 */ packed_half3 elements;
+  /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 2>* const dest, half2x3 value) {
+  (*(dest))[0u].elements = packed_half3(value[0u]);
+  (*(dest))[1u].elements = packed_half3(value[1u]);
+}
+
+void transpose_b9ad1f(device tint_array<tint_packed_vec3_f16_array_element, 2>* const tint_symbol_1) {
   half2x3 res = half2x3(half3(1.0h), half3(1.0h));
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_b9ad1f();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f16_array_element, 2>* const tint_symbol_2) {
+  transpose_b9ad1f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f16_array_element, 2>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_b9ad1f();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f16_array_element, 2>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_b9ad1f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_b9ad1f();
+kernel void compute_main(device tint_array<tint_packed_vec3_f16_array_element, 2>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_b9ad1f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.spvasm
index 63db7d8..08aa33c 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -9,66 +9,102 @@
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_b9ad1f "transpose_b9ad1f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
  %mat2v3half = OpTypeMatrix %v3half 2
+%prevent_dce_block = OpTypeStruct %mat2v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void %mat2v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+         %32 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat2v3half %17 %17
+         %36 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %37 = OpConstantComposite %mat2v3half %36 %36
 %_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
-         %21 = OpConstantNull %mat2v3half
-         %22 = OpTypeFunction %v4float
+         %40 = OpConstantNull %mat2v3half
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_b9ad1f = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v3half Function %21
-               OpStore %res %18
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %15
+      %value = OpFunctionParameter %mat2v3half
+         %19 = OpLabel
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %23
+         %27 = OpCompositeExtract %v3half %value 0
+               OpStore %25 %27
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_1
+         %31 = OpCompositeExtract %v3half %value 1
+               OpStore %29 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_b9ad1f
+%transpose_b9ad1f = OpFunction %void None %32
+         %34 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v3half Function %40
+               OpStore %res %37
+         %42 = OpLoad %mat2v3half %res
+         %41 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %42
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %transpose_b9ad1f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %32
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_b9ad1f
+%fragment_main = OpFunction %void None %32
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %transpose_b9ad1f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_b9ad1f
+%compute_main = OpFunction %void None %32
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %transpose_b9ad1f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.wgsl
index 3d06432..8265d11 100644
--- a/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/b9ad1f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_b9ad1f() {
   var res : mat2x3<f16> = transpose(mat3x2<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_b9ad1f();
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl
index 888b2f4..e540291 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<4, 4, f32>) -> mat<4, 4, f32>
 fn transpose_c1b600() {
   var res: mat4x4<f32> = transpose(mat4x4<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.dxc.hlsl
index d06f52d..5411696 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.dxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store4((offset + 32u), asuint(value[2u]));
+  prevent_dce.Store4((offset + 48u), asuint(value[3u]));
+}
+
 void transpose_c1b600() {
   float4x4 res = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.fxc.hlsl
index d06f52d..5411696 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.fxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store4((offset + 32u), asuint(value[2u]));
+  prevent_dce.Store4((offset + 48u), asuint(value[3u]));
+}
+
 void transpose_c1b600() {
   float4x4 res = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.glsl
index 088adc7..697f42c 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4 inner;
+} prevent_dce;
+
 void transpose_c1b600() {
   mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4 inner;
+} prevent_dce;
+
 void transpose_c1b600() {
   mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4 inner;
+} prevent_dce;
+
 void transpose_c1b600() {
   mat4 res = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.msl
index eedd9e4..719f723 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_c1b600() {
+void transpose_c1b600(device float4x4* const tint_symbol_1) {
   float4x4 res = float4x4(float4(1.0f), float4(1.0f), float4(1.0f), float4(1.0f));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_c1b600();
+float4 vertex_main_inner(device float4x4* const tint_symbol_2) {
+  transpose_c1b600(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_c1b600();
+fragment void fragment_main(device float4x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_c1b600(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_c1b600();
+kernel void compute_main(device float4x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_c1b600(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.spvasm
index 8b8bf4e..803e526 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_c1b600 "transpose_c1b600"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
 %mat4v4float = OpTypeMatrix %v4float 4
+%prevent_dce_block = OpTypeStruct %mat4v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %16 = OpConstantComposite %mat4v4float %15 %15 %15 %15
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %19 = OpConstantComposite %mat4v4float %18 %18 %18 %18
 %_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
-         %19 = OpConstantNull %mat4v4float
-         %20 = OpTypeFunction %v4float
-%transpose_c1b600 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v4float Function %19
-               OpStore %res %16
+         %22 = OpConstantNull %mat4v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat4v4float = OpTypePointer StorageBuffer %mat4v4float
+         %28 = OpTypeFunction %v4float
+%transpose_c1b600 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v4float Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_mat4v4float %prevent_dce %uint_0
+         %27 = OpLoad %mat4v4float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %transpose_c1b600
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %transpose_c1b600
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %transpose_c1b600
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %transpose_c1b600
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_c1b600
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_c1b600
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.wgsl
index bf9bbea..2f63028 100644
--- a/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/c1b600.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_c1b600() {
   var res : mat4x4<f32> = transpose(mat4x4<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_c1b600();
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl
index ebaa669..c61c862 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<2, 3, f16>) -> mat<3, 2, f16>
 fn transpose_d6faec() {
   var res: mat3x2<f16> = transpose(mat2x3<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.dxc.hlsl
index 85b78fd..1196440 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.dxc.hlsl
@@ -1,5 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 8u), value[2u]);
+}
+
 void transpose_d6faec() {
   matrix<float16_t, 3, 2> res = matrix<float16_t, 3, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.fxc.hlsl
index 961226e..5852f9e 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.fxc.hlsl
@@ -1,7 +1,16 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 8u), value[2u]);
+}
+
 void transpose_d6faec() {
   matrix<float16_t, 3, 2> res = matrix<float16_t, 3, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.glsl
index 6028fb6a..d4dff64 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x2 inner;
+} prevent_dce;
+
 void transpose_d6faec() {
   f16mat3x2 res = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x2 inner;
+} prevent_dce;
+
 void transpose_d6faec() {
   f16mat3x2 res = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x2 inner;
+} prevent_dce;
+
 void transpose_d6faec() {
   f16mat3x2 res = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.msl
index 8b55e1a..1904769 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_d6faec() {
+void transpose_d6faec(device half3x2* const tint_symbol_1) {
   half3x2 res = half3x2(half2(1.0h), half2(1.0h), half2(1.0h));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_d6faec();
+float4 vertex_main_inner(device half3x2* const tint_symbol_2) {
+  transpose_d6faec(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half3x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_d6faec();
+fragment void fragment_main(device half3x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_d6faec(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_d6faec();
+kernel void compute_main(device half3x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_d6faec(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.spvasm
index d5c2f0a..2c380d7 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_d6faec "transpose_d6faec"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 4
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
  %mat3v2half = OpTypeMatrix %v2half 3
+%prevent_dce_block = OpTypeStruct %mat3v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat3v2half %17 %17 %17
+         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat3v2half %20 %20 %20
 %_ptr_Function_mat3v2half = OpTypePointer Function %mat3v2half
-         %21 = OpConstantNull %mat3v2half
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %mat3v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat3v2half = OpTypePointer StorageBuffer %mat3v2half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_d6faec = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat3v2half Function %21
-               OpStore %res %18
+%transpose_d6faec = OpFunction %void None %15
+         %18 = OpLabel
+        %res = OpVariable %_ptr_Function_mat3v2half Function %24
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_mat3v2half %prevent_dce %uint_0
+         %29 = OpLoad %mat3v2half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_d6faec
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_d6faec
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %15
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_d6faec
+%fragment_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_d6faec
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_d6faec
+%compute_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_d6faec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.wgsl
index 2bf363a..671562d 100644
--- a/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/d6faec.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_d6faec() {
   var res : mat3x2<f16> = transpose(mat2x3<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_d6faec();
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl
index 2d38478..15e0379 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<3, 4, f32>) -> mat<4, 3, f32>
 fn transpose_d8f8ba() {
   var res: mat4x3<f32> = transpose(mat3x4<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.dxc.hlsl
index 2c8bd5d..2efae76 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.dxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store3((offset + 32u), asuint(value[2u]));
+  prevent_dce.Store3((offset + 48u), asuint(value[3u]));
+}
+
 void transpose_d8f8ba() {
   float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.fxc.hlsl
index 2c8bd5d..2efae76 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.fxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store3((offset + 32u), asuint(value[2u]));
+  prevent_dce.Store3((offset + 48u), asuint(value[3u]));
+}
+
 void transpose_d8f8ba() {
   float4x3 res = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.glsl
index 58df856..afe4b08 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.glsl
@@ -1,7 +1,19 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_d8f8ba() {
   mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -20,8 +32,20 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_d8f8ba() {
   mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -34,8 +58,20 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_d8f8ba() {
   mat4x3 res = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.msl
index fa01e0a..e016106 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.msl
@@ -1,33 +1,59 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_d8f8ba() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f32_array_element {
+  /* 0x0000 */ packed_float3 elements;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 4>* const dest, float4x3 value) {
+  (*(dest))[0u].elements = packed_float3(value[0u]);
+  (*(dest))[1u].elements = packed_float3(value[1u]);
+  (*(dest))[2u].elements = packed_float3(value[2u]);
+  (*(dest))[3u].elements = packed_float3(value[3u]);
+}
+
+void transpose_d8f8ba(device tint_array<tint_packed_vec3_f32_array_element, 4>* const tint_symbol_1) {
   float4x3 res = float4x3(float3(1.0f), float3(1.0f), float3(1.0f), float3(1.0f));
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_d8f8ba();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f32_array_element, 4>* const tint_symbol_2) {
+  transpose_d8f8ba(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f32_array_element, 4>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_d8f8ba();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f32_array_element, 4>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_d8f8ba(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_d8f8ba();
+kernel void compute_main(device tint_array<tint_packed_vec3_f32_array_element, 4>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_d8f8ba(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.spvasm
index 61e237e..9884f48 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.spvasm
@@ -1,68 +1,114 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_d8f8ba "transpose_d8f8ba"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat4v3float = OpTypeMatrix %v3float 4
+%prevent_dce_block = OpTypeStruct %mat4v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void %mat4v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %22 = OpConstantNull %int
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+      %int_2 = OpConstant %int 2
+     %uint_2 = OpConstant %uint 2
+      %int_3 = OpConstant %int 3
+     %uint_3 = OpConstant %uint 3
+         %39 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %17 = OpConstantComposite %mat4v3float %16 %16 %16 %16
+         %43 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %44 = OpConstantComposite %mat4v3float %43 %43 %43 %43
 %_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
-         %20 = OpConstantNull %mat4v3float
-         %21 = OpTypeFunction %v4float
-%transpose_d8f8ba = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v3float Function %20
-               OpStore %res %17
+         %47 = OpConstantNull %mat4v3float
+         %50 = OpTypeFunction %v4float
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %14
+      %value = OpFunctionParameter %mat4v3float
+         %18 = OpLabel
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %22
+         %26 = OpCompositeExtract %v3float %value 0
+               OpStore %24 %26
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_1
+         %30 = OpCompositeExtract %v3float %value 1
+               OpStore %28 %30
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_2
+         %34 = OpCompositeExtract %v3float %value 2
+               OpStore %32 %34
+         %36 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_3
+         %38 = OpCompositeExtract %v3float %value 3
+               OpStore %36 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %transpose_d8f8ba
+%transpose_d8f8ba = OpFunction %void None %39
+         %41 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v3float Function %47
+               OpStore %res %44
+         %49 = OpLoad %mat4v3float %res
+         %48 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %49
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %transpose_d8f8ba
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %39
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_d8f8ba
+%fragment_main = OpFunction %void None %39
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %transpose_d8f8ba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_d8f8ba
+%compute_main = OpFunction %void None %39
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %transpose_d8f8ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.wgsl
index c08b152..cca9ee2 100644
--- a/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/d8f8ba.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_d8f8ba() {
   var res : mat4x3<f32> = transpose(mat3x4<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_d8f8ba();
diff --git a/test/tint/builtins/gen/literal/transpose/dc671a.wgsl b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl
index 7ce8237..f2feaa7 100644
--- a/test/tint/builtins/gen/literal/transpose/dc671a.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/dc671a.wgsl
@@ -25,7 +25,6 @@
 fn transpose_dc671a() {
   var res = transpose(mat4x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_dc671a();
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl
index 101c03d..567ae33 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl
@@ -24,7 +24,9 @@
 // fn transpose(mat<3, 2, f32>) -> mat<2, 3, f32>
 fn transpose_ed4bdc() {
   var res: mat2x3<f32> = transpose(mat3x2<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.dxc.hlsl
index 47e3175..ffef122 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.dxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+}
+
 void transpose_ed4bdc() {
   float2x3 res = float2x3((1.0f).xxx, (1.0f).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.fxc.hlsl
index 47e3175..ffef122 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.fxc.hlsl
@@ -1,5 +1,13 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+}
+
 void transpose_ed4bdc() {
   float2x3 res = float2x3((1.0f).xxx, (1.0f).xxx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.glsl
index 3179df8..f3e9088 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.glsl
@@ -1,7 +1,17 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_ed4bdc() {
   mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -20,8 +30,18 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_ed4bdc() {
   mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -34,8 +54,18 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_ed4bdc() {
   mat2x3 res = mat2x3(vec3(1.0f), vec3(1.0f));
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.msl
index 1f9c1a8..1be5ac3 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.msl
@@ -1,33 +1,57 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_ed4bdc() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f32_array_element {
+  /* 0x0000 */ packed_float3 elements;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, float2x3 value) {
+  (*(dest))[0u].elements = packed_float3(value[0u]);
+  (*(dest))[1u].elements = packed_float3(value[1u]);
+}
+
+void transpose_ed4bdc(device tint_array<tint_packed_vec3_f32_array_element, 2>* const tint_symbol_1) {
   float2x3 res = float2x3(float3(1.0f), float3(1.0f));
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_ed4bdc();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f32_array_element, 2>* const tint_symbol_2) {
+  transpose_ed4bdc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f32_array_element, 2>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_ed4bdc();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f32_array_element, 2>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_ed4bdc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_ed4bdc();
+kernel void compute_main(device tint_array<tint_packed_vec3_f32_array_element, 2>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_ed4bdc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.spvasm
index 434bdee..fa85b25 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.spvasm
@@ -1,68 +1,104 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_ed4bdc "transpose_ed4bdc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat2v3float = OpTypeMatrix %v3float 2
+%prevent_dce_block = OpTypeStruct %mat2v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void %mat2v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %22 = OpConstantNull %int
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+         %31 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %17 = OpConstantComposite %mat2v3float %16 %16
+         %35 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %36 = OpConstantComposite %mat2v3float %35 %35
 %_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
-         %20 = OpConstantNull %mat2v3float
-         %21 = OpTypeFunction %v4float
-%transpose_ed4bdc = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat2v3float Function %20
-               OpStore %res %17
+         %39 = OpConstantNull %mat2v3float
+         %42 = OpTypeFunction %v4float
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %14
+      %value = OpFunctionParameter %mat2v3float
+         %18 = OpLabel
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %22
+         %26 = OpCompositeExtract %v3float %value 0
+               OpStore %24 %26
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_1
+         %30 = OpCompositeExtract %v3float %value 1
+               OpStore %28 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %transpose_ed4bdc
+%transpose_ed4bdc = OpFunction %void None %31
+         %33 = OpLabel
+        %res = OpVariable %_ptr_Function_mat2v3float Function %39
+               OpStore %res %36
+         %41 = OpLoad %mat2v3float %res
+         %40 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %41
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %transpose_ed4bdc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %31
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_ed4bdc
+%fragment_main = OpFunction %void None %31
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %transpose_ed4bdc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_ed4bdc
+%compute_main = OpFunction %void None %31
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %transpose_ed4bdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.wgsl
index f8d73e8..f9da29e 100644
--- a/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/ed4bdc.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn transpose_ed4bdc() {
   var res : mat2x3<f32> = transpose(mat3x2<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_ed4bdc();
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl
index 71346b0..0551fa8 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl
@@ -26,7 +26,9 @@
 // fn transpose(mat<2, 4, f16>) -> mat<4, 2, f16>
 fn transpose_faeb05() {
   var res: mat4x2<f16> = transpose(mat2x4<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.dxc.hlsl
index 9be9430..2f55e37 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.dxc.hlsl
@@ -1,5 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 8u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 12u), value[3u]);
+}
+
 void transpose_faeb05() {
   matrix<float16_t, 4, 2> res = matrix<float16_t, 4, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.fxc.hlsl
index 32820e1..ab5a3c4 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.fxc.hlsl
@@ -1,7 +1,17 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 8u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 12u), value[3u]);
+}
+
 void transpose_faeb05() {
   matrix<float16_t, 4, 2> res = matrix<float16_t, 4, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.glsl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.glsl
index 07ae2dd..6725813 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x2 inner;
+} prevent_dce;
+
 void transpose_faeb05() {
   f16mat4x2 res = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x2 inner;
+} prevent_dce;
+
 void transpose_faeb05() {
   f16mat4x2 res = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x2 inner;
+} prevent_dce;
+
 void transpose_faeb05() {
   f16mat4x2 res = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.msl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.msl
index 845b1bc..3aa5ea3 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_faeb05() {
+void transpose_faeb05(device half4x2* const tint_symbol_1) {
   half4x2 res = half4x2(half2(1.0h), half2(1.0h), half2(1.0h), half2(1.0h));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_faeb05();
+float4 vertex_main_inner(device half4x2* const tint_symbol_2) {
+  transpose_faeb05(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_faeb05();
+fragment void fragment_main(device half4x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_faeb05(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_faeb05();
+kernel void compute_main(device half4x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_faeb05(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.spvasm
index 0d70272..e18ed7b 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_faeb05 "transpose_faeb05"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 4
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
  %mat4v2half = OpTypeMatrix %v2half 4
+%prevent_dce_block = OpTypeStruct %mat4v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat4v2half %17 %17 %17 %17
+         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat4v2half %20 %20 %20 %20
 %_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-         %21 = OpConstantNull %mat4v2half
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %mat4v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat4v2half = OpTypePointer StorageBuffer %mat4v2half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_faeb05 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_mat4v2half Function %21
-               OpStore %res %18
+%transpose_faeb05 = OpFunction %void None %15
+         %18 = OpLabel
+        %res = OpVariable %_ptr_Function_mat4v2half Function %24
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_mat4v2half %prevent_dce %uint_0
+         %29 = OpLoad %mat4v2half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %transpose_faeb05
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %transpose_faeb05
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %15
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_faeb05
+%fragment_main = OpFunction %void None %15
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_faeb05
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_faeb05
+%compute_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_faeb05
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.wgsl
index 364abc3..7cff494 100644
--- a/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/transpose/faeb05.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn transpose_faeb05() {
   var res : mat4x2<f16> = transpose(mat2x4<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_faeb05();
diff --git a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl
index 1f706a8..0f117ab 100644
--- a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl
@@ -26,7 +26,9 @@
 // fn trunc(vec<3, f16>) -> vec<3, f16>
 fn trunc_103ab8() {
   var res: vec3<f16> = trunc(vec3<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.dxc.hlsl
index 6d8f7b3..e30b617 100644
--- a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_103ab8() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.fxc.hlsl
index 11c629d..f2745f4 100644
--- a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_103ab8() {
   vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.glsl
index fc8d55c..3cbb238 100644
--- a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void trunc_103ab8() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void trunc_103ab8() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void trunc_103ab8() {
   f16vec3 res = f16vec3(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.msl b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.msl
index 0714cab..2d7086f 100644
--- a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_103ab8() {
+void trunc_103ab8(device packed_half3* const tint_symbol_1) {
   half3 res = half3(1.0h);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_103ab8();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  trunc_103ab8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_103ab8();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  trunc_103ab8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_103ab8();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  trunc_103ab8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.spvasm
index 883bfc3..fe28167 100644
--- a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_103ab8 "trunc_103ab8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_103ab8 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %res %16
+%trunc_103ab8 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %27 = OpLoad %v3half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %trunc_103ab8
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %trunc_103ab8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %trunc_103ab8
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %trunc_103ab8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %trunc_103ab8
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %trunc_103ab8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.wgsl
index 664c63b..89be40a 100644
--- a/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/103ab8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn trunc_103ab8() {
   var res : vec3<f16> = trunc(vec3<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_103ab8();
diff --git a/test/tint/builtins/gen/literal/trunc/117396.wgsl b/test/tint/builtins/gen/literal/trunc/117396.wgsl
index 04ee090..ffba823 100644
--- a/test/tint/builtins/gen/literal/trunc/117396.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/117396.wgsl
@@ -25,7 +25,6 @@
 fn trunc_117396() {
   var res = trunc(vec3(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_117396();
diff --git a/test/tint/builtins/gen/literal/trunc/562d05.wgsl b/test/tint/builtins/gen/literal/trunc/562d05.wgsl
index df7c2c5..9e1b8f2 100644
--- a/test/tint/builtins/gen/literal/trunc/562d05.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/562d05.wgsl
@@ -24,7 +24,9 @@
 // fn trunc(vec<3, f32>) -> vec<3, f32>
 fn trunc_562d05() {
   var res: vec3<f32> = trunc(vec3<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.dxc.hlsl
index 23fbea5..c8a11b0 100644
--- a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_562d05() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.fxc.hlsl
index 23fbea5..c8a11b0 100644
--- a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_562d05() {
   float3 res = (1.0f).xxx;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.glsl b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.glsl
index 96d2070..d14f434 100644
--- a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void trunc_562d05() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void trunc_562d05() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void trunc_562d05() {
   vec3 res = vec3(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.msl b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.msl
index d7d1b1c..b6db5b7 100644
--- a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_562d05() {
+void trunc_562d05(device packed_float3* const tint_symbol_1) {
   float3 res = float3(1.0f);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_562d05();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  trunc_562d05(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_562d05();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  trunc_562d05(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_562d05();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  trunc_562d05(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.spvasm
index bee444b..a699b69 100644
--- a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_562d05 "trunc_562d05"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %19 = OpTypeFunction %v4float
-%trunc_562d05 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %27 = OpTypeFunction %v4float
+%trunc_562d05 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %26 = OpLoad %v3float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %trunc_562d05
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %trunc_562d05
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %trunc_562d05
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %trunc_562d05
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %trunc_562d05
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %trunc_562d05
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.wgsl
index b47c581..a6bd0a9 100644
--- a/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/562d05.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn trunc_562d05() {
   var res : vec3<f32> = trunc(vec3<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_562d05();
diff --git a/test/tint/builtins/gen/literal/trunc/7d6ded.wgsl b/test/tint/builtins/gen/literal/trunc/7d6ded.wgsl
index c57af89..f19625a 100644
--- a/test/tint/builtins/gen/literal/trunc/7d6ded.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/7d6ded.wgsl
@@ -25,7 +25,6 @@
 fn trunc_7d6ded() {
   var res = trunc(1.5);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_7d6ded();
diff --git a/test/tint/builtins/gen/literal/trunc/a56109.wgsl b/test/tint/builtins/gen/literal/trunc/a56109.wgsl
index 56f4c98..999232c 100644
--- a/test/tint/builtins/gen/literal/trunc/a56109.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/a56109.wgsl
@@ -26,7 +26,9 @@
 // fn trunc(vec<2, f16>) -> vec<2, f16>
 fn trunc_a56109() {
   var res: vec2<f16> = trunc(vec2<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.dxc.hlsl
index 0500406..082281a 100644
--- a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_a56109() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.fxc.hlsl
index c1cef7b..ff5ba4b 100644
--- a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_a56109() {
   vector<float16_t, 2> res = (float16_t(1.0h)).xx;
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.glsl b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.glsl
index 7ad257c..55d3c0c 100644
--- a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void trunc_a56109() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void trunc_a56109() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void trunc_a56109() {
   f16vec2 res = f16vec2(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.msl b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.msl
index 78261cc..36fd15f 100644
--- a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_a56109() {
+void trunc_a56109(device half2* const tint_symbol_1) {
   half2 res = half2(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_a56109();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  trunc_a56109(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_a56109();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  trunc_a56109(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_a56109();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  trunc_a56109(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.spvasm
index 636608a..94d42d3 100644
--- a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_a56109 "trunc_a56109"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_a56109 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %res %16
+%trunc_a56109 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %27 = OpLoad %v2half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %trunc_a56109
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %trunc_a56109
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %trunc_a56109
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %trunc_a56109
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %trunc_a56109
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %trunc_a56109
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.wgsl
index 06337eb..b388333 100644
--- a/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/a56109.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn trunc_a56109() {
   var res : vec2<f16> = trunc(vec2<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_a56109();
diff --git a/test/tint/builtins/gen/literal/trunc/c12555.wgsl b/test/tint/builtins/gen/literal/trunc/c12555.wgsl
index 870882c..1505b71 100644
--- a/test/tint/builtins/gen/literal/trunc/c12555.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/c12555.wgsl
@@ -25,7 +25,6 @@
 fn trunc_c12555() {
   var res = trunc(vec2(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_c12555();
diff --git a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl
index bd92fb7..cca9c8a 100644
--- a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl
@@ -26,7 +26,9 @@
 // fn trunc(f16) -> f16
 fn trunc_cc2b0d() {
   var res: f16 = trunc(1.5h);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.dxc.hlsl
index 800b327..e687490 100644
--- a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_cc2b0d() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.fxc.hlsl
index 1d4f549..11c8a53 100644
--- a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_cc2b0d() {
   float16_t res = float16_t(1.0h);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.glsl
index 5dec4bf..e88c5b9 100644
--- a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void trunc_cc2b0d() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void trunc_cc2b0d() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void trunc_cc2b0d() {
   float16_t res = 1.0hf;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.msl b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.msl
index 3982531..629cb6c 100644
--- a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_cc2b0d() {
+void trunc_cc2b0d(device half* const tint_symbol_1) {
   half res = 1.0h;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_cc2b0d();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  trunc_cc2b0d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_cc2b0d();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  trunc_cc2b0d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_cc2b0d();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  trunc_cc2b0d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.spvasm
index d6020f2..5b42512 100644
--- a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_cc2b0d "trunc_cc2b0d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,39 +39,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %18 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %26 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_cc2b0d = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %17
+%trunc_cc2b0d = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %res %half_0x1p_0
+         %24 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %25 = OpLoad %half %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %trunc_cc2b0d
+%vertex_main_inner = OpFunction %v4float None %26
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %trunc_cc2b0d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %23 = OpLabel
-         %24 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %24
+%vertex_main = OpFunction %void None %13
+         %31 = OpLabel
+         %32 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %32
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %trunc_cc2b0d
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %trunc_cc2b0d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %trunc_cc2b0d
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %trunc_cc2b0d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.wgsl
index ab1f7ad..64ed643 100644
--- a/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/cc2b0d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn trunc_cc2b0d() {
   var res : f16 = trunc(1.5h);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_cc2b0d();
diff --git a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl
index 33f08ad..ca3701d 100644
--- a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl
@@ -26,7 +26,9 @@
 // fn trunc(vec<4, f16>) -> vec<4, f16>
 fn trunc_ce7c17() {
   var res: vec4<f16> = trunc(vec4<f16>(1.5h));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.dxc.hlsl
index de7a7a1..2d4a915 100644
--- a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_ce7c17() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.fxc.hlsl
index 3c1b601..72dc6fd 100644
--- a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_ce7c17() {
   vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.glsl b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.glsl
index 58a3ba8..4c94d35 100644
--- a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void trunc_ce7c17() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void trunc_ce7c17() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void trunc_ce7c17() {
   f16vec4 res = f16vec4(1.0hf);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.msl b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.msl
index b5e7109..d485ce3 100644
--- a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_ce7c17() {
+void trunc_ce7c17(device half4* const tint_symbol_1) {
   half4 res = half4(1.0h);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_ce7c17();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  trunc_ce7c17(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_ce7c17();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  trunc_ce7c17(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_ce7c17();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  trunc_ce7c17(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.spvasm
index 4e38066..c753614 100644
--- a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_ce7c17 "trunc_ce7c17"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %20 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_ce7c17 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %res %16
+%trunc_ce7c17 = OpFunction %void None %14
+         %17 = OpLabel
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %27 = OpLoad %v4half %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %trunc_ce7c17
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %trunc_ce7c17
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %14
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %trunc_ce7c17
+%fragment_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %trunc_ce7c17
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %trunc_ce7c17
+%compute_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %trunc_ce7c17
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.wgsl
index 4aa5e83..6c2f31d 100644
--- a/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/ce7c17.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn trunc_ce7c17() {
   var res : vec4<f16> = trunc(vec4<f16>(1.5h));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_ce7c17();
diff --git a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl
index 77ccdb2..43de445 100644
--- a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl
@@ -24,7 +24,9 @@
 // fn trunc(vec<4, f32>) -> vec<4, f32>
 fn trunc_e183aa() {
   var res: vec4<f32> = trunc(vec4<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.dxc.hlsl
index a9a6547..62d4ec9 100644
--- a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_e183aa() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.fxc.hlsl
index a9a6547..62d4ec9 100644
--- a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_e183aa() {
   float4 res = (1.0f).xxxx;
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.glsl
index f820c16..c138dd5 100644
--- a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void trunc_e183aa() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void trunc_e183aa() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void trunc_e183aa() {
   vec4 res = vec4(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.msl b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.msl
index b801d81..3ccc38e 100644
--- a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_e183aa() {
+void trunc_e183aa(device float4* const tint_symbol_1) {
   float4 res = float4(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_e183aa();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  trunc_e183aa(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_e183aa();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  trunc_e183aa(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_e183aa();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  trunc_e183aa(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.spvasm
index 5ed2379..dcb7347 100644
--- a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 38
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_e183aa "trunc_e183aa"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,37 +35,46 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
-%trunc_e183aa = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
+%trunc_e183aa = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %trunc_e183aa
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %trunc_e183aa
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %trunc_e183aa
+%fragment_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %trunc_e183aa
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %trunc_e183aa
+%compute_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %trunc_e183aa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.wgsl
index b3d734b..e9a20ee 100644
--- a/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/e183aa.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn trunc_e183aa() {
   var res : vec4<f32> = trunc(vec4<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_e183aa();
diff --git a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl
index 9d3490f..53d51fe 100644
--- a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl
@@ -24,7 +24,9 @@
 // fn trunc(f32) -> f32
 fn trunc_eb83df() {
   var res: f32 = trunc(1.5f);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.dxc.hlsl
index a539009..83d54dc 100644
--- a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_eb83df() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.fxc.hlsl
index a539009..83d54dc 100644
--- a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_eb83df() {
   float res = 1.0f;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.glsl b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.glsl
index dbe86ab..83b839f 100644
--- a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void trunc_eb83df() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void trunc_eb83df() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void trunc_eb83df() {
   float res = 1.0f;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.msl b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.msl
index da544f9..7fea623 100644
--- a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_eb83df() {
+void trunc_eb83df(device float* const tint_symbol_1) {
   float res = 1.0f;
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_eb83df();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  trunc_eb83df(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_eb83df();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  trunc_eb83df(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_eb83df();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  trunc_eb83df(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.spvasm
index 42b2976..651aa84 100644
--- a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_eb83df "trunc_eb83df"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,36 +35,45 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %16 = OpTypeFunction %v4float
-%trunc_eb83df = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %24 = OpTypeFunction %v4float
+%trunc_eb83df = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %res %float_1
+         %22 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %23 = OpLoad %float %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %16
-         %18 = OpLabel
-         %19 = OpFunctionCall %void %trunc_eb83df
+%vertex_main_inner = OpFunction %v4float None %24
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %trunc_eb83df
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %21 = OpLabel
-         %22 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %22
+%vertex_main = OpFunction %void None %12
+         %29 = OpLabel
+         %30 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %30
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %trunc_eb83df
+%fragment_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %trunc_eb83df
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %trunc_eb83df
+%compute_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %trunc_eb83df
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.wgsl
index b5f6d6e..f8edbcc 100644
--- a/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/eb83df.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn trunc_eb83df() {
   var res : f32 = trunc(1.5f);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_eb83df();
diff --git a/test/tint/builtins/gen/literal/trunc/f0f1a1.wgsl b/test/tint/builtins/gen/literal/trunc/f0f1a1.wgsl
index 80c37aa..3b055b9 100644
--- a/test/tint/builtins/gen/literal/trunc/f0f1a1.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/f0f1a1.wgsl
@@ -25,7 +25,6 @@
 fn trunc_f0f1a1() {
   var res = trunc(vec4(1.5));
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_f0f1a1();
diff --git a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl
index 6853256..1b2611b 100644
--- a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl
@@ -24,7 +24,9 @@
 // fn trunc(vec<2, f32>) -> vec<2, f32>
 fn trunc_f370d3() {
   var res: vec2<f32> = trunc(vec2<f32>(1.5f));
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.dxc.hlsl
index 76ca41a..740a861 100644
--- a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_f370d3() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.fxc.hlsl
index 76ca41a..740a861 100644
--- a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_f370d3() {
   float2 res = (1.0f).xx;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.glsl
index 1e4aaf9..e3adf65 100644
--- a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void trunc_f370d3() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void trunc_f370d3() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void trunc_f370d3() {
   vec2 res = vec2(1.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.msl b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.msl
index ceac6e4..7e2d164 100644
--- a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_f370d3() {
+void trunc_f370d3(device float2* const tint_symbol_1) {
   float2 res = float2(1.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_f370d3();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  trunc_f370d3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_f370d3();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  trunc_f370d3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_f370d3();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  trunc_f370d3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.spvasm
index 2f2f61a..dd3699a 100644
--- a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_f370d3 "trunc_f370d3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,39 +35,48 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
-%trunc_f370d3 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
+%trunc_f370d3 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %trunc_f370d3
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %trunc_f370d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %trunc_f370d3
+%fragment_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %trunc_f370d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %trunc_f370d3
+%compute_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %trunc_f370d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.wgsl
index 8dad61f..674fb63 100644
--- a/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/trunc/f370d3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn trunc_f370d3() {
   var res : vec2<f32> = trunc(vec2<f32>(1.5f));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_f370d3();
diff --git a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl
index cd44527..fa3679f 100644
--- a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl
+++ b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl
@@ -24,7 +24,9 @@
 // fn unpack2x16float(u32) -> vec2<f32>
 fn unpack2x16float_32a5cf() {
   var res: vec2<f32> = unpack2x16float(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.dxc.hlsl
index 725b54d..647fe67 100644
--- a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16float_32a5cf() {
   float2 res = float2(0.00000005960464477539f, 0.0f);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.fxc.hlsl
index 725b54d..647fe67 100644
--- a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16float_32a5cf() {
   float2 res = float2(0.00000005960464477539f, 0.0f);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.glsl
index 443a36f..f1ed3c3 100644
--- a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16float_32a5cf() {
   vec2 res = vec2(0.00000005960464477539f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16float_32a5cf() {
   vec2 res = vec2(0.00000005960464477539f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16float_32a5cf() {
   vec2 res = vec2(0.00000005960464477539f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.msl
index f70f80a..ef5a513 100644
--- a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack2x16float_32a5cf() {
+void unpack2x16float_32a5cf(device float2* const tint_symbol_1) {
   float2 res = float2(0.00000005960464477539f, 0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack2x16float_32a5cf();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  unpack2x16float_32a5cf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack2x16float_32a5cf();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  unpack2x16float_32a5cf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack2x16float_32a5cf();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  unpack2x16float_32a5cf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.spvasm
index 13553fd..927829d 100644
--- a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack2x16float_32a5cf "unpack2x16float_32a5cf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_5_96046448en08 = OpConstant %float 5.96046448e-08
-         %15 = OpConstantComposite %v2float %float_5_96046448en08 %8
+         %18 = OpConstantComposite %v2float %float_5_96046448en08 %8
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack2x16float_32a5cf = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%unpack2x16float_32a5cf = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %unpack2x16float_32a5cf
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %unpack2x16float_32a5cf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %unpack2x16float_32a5cf
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %unpack2x16float_32a5cf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %unpack2x16float_32a5cf
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %unpack2x16float_32a5cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.wgsl
index 76d821a..dfbbc3e 100644
--- a/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/unpack2x16float/32a5cf.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn unpack2x16float_32a5cf() {
   var res : vec2<f32> = unpack2x16float(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack2x16float_32a5cf();
diff --git a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl
index 12006be..a064763 100644
--- a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl
+++ b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl
@@ -24,7 +24,9 @@
 // fn unpack2x16snorm(u32) -> vec2<f32>
 fn unpack2x16snorm_b4aea6() {
   var res: vec2<f32> = unpack2x16snorm(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.dxc.hlsl
index 3e34800..16f861c 100644
--- a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16snorm_b4aea6() {
   float2 res = float2(0.00003051850944757462f, 0.0f);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.fxc.hlsl
index 3e34800..16f861c 100644
--- a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16snorm_b4aea6() {
   float2 res = float2(0.00003051850944757462f, 0.0f);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.glsl
index 96060f5..363f90b 100644
--- a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16snorm_b4aea6() {
   vec2 res = vec2(0.00003051850944757462f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16snorm_b4aea6() {
   vec2 res = vec2(0.00003051850944757462f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16snorm_b4aea6() {
   vec2 res = vec2(0.00003051850944757462f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.msl b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.msl
index 6db7776..004b885 100644
--- a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack2x16snorm_b4aea6() {
+void unpack2x16snorm_b4aea6(device float2* const tint_symbol_1) {
   float2 res = float2(0.00003051850944757462f, 0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack2x16snorm_b4aea6();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  unpack2x16snorm_b4aea6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack2x16snorm_b4aea6();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  unpack2x16snorm_b4aea6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack2x16snorm_b4aea6();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  unpack2x16snorm_b4aea6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
index ca1785f..196db7b 100644
--- a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack2x16snorm_b4aea6 "unpack2x16snorm_b4aea6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_3_05185094en05 = OpConstant %float 3.05185094e-05
-         %15 = OpConstantComposite %v2float %float_3_05185094en05 %8
+         %18 = OpConstantComposite %v2float %float_3_05185094en05 %8
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack2x16snorm_b4aea6 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%unpack2x16snorm_b4aea6 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %unpack2x16snorm_b4aea6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %unpack2x16snorm_b4aea6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %unpack2x16snorm_b4aea6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
index 24d8b1d..ed1a976 100644
--- a/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn unpack2x16snorm_b4aea6() {
   var res : vec2<f32> = unpack2x16snorm(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack2x16snorm_b4aea6();
diff --git a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl
index 88b5c59..28e4a56 100644
--- a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl
+++ b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl
@@ -24,7 +24,9 @@
 // fn unpack2x16unorm(u32) -> vec2<f32>
 fn unpack2x16unorm_7699c0() {
   var res: vec2<f32> = unpack2x16unorm(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.dxc.hlsl
index 2933570..0ed5bb5 100644
--- a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16unorm_7699c0() {
   float2 res = float2(0.00001525902189314365f, 0.0f);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.fxc.hlsl
index 2933570..0ed5bb5 100644
--- a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16unorm_7699c0() {
   float2 res = float2(0.00001525902189314365f, 0.0f);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.glsl
index c14494f..c775d61 100644
--- a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16unorm_7699c0() {
   vec2 res = vec2(0.00001525902189314365f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16unorm_7699c0() {
   vec2 res = vec2(0.00001525902189314365f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16unorm_7699c0() {
   vec2 res = vec2(0.00001525902189314365f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.msl b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.msl
index 2d3303a..0e14ca5 100644
--- a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack2x16unorm_7699c0() {
+void unpack2x16unorm_7699c0(device float2* const tint_symbol_1) {
   float2 res = float2(0.00001525902189314365f, 0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack2x16unorm_7699c0();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  unpack2x16unorm_7699c0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack2x16unorm_7699c0();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  unpack2x16unorm_7699c0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack2x16unorm_7699c0();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  unpack2x16unorm_7699c0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.spvasm
index ed7e8b4..c92dc84 100644
--- a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack2x16unorm_7699c0 "unpack2x16unorm_7699c0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,40 +35,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_1_52590219en05 = OpConstant %float 1.52590219e-05
-         %15 = OpConstantComposite %v2float %float_1_52590219en05 %8
+         %18 = OpConstantComposite %v2float %float_1_52590219en05 %8
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %19 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack2x16unorm_7699c0 = OpFunction %void None %9
-         %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %res %15
+%unpack2x16unorm_7699c0 = OpFunction %void None %13
+         %16 = OpLabel
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %26 = OpLoad %v2float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %unpack2x16unorm_7699c0
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %unpack2x16unorm_7699c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %13
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %unpack2x16unorm_7699c0
+%fragment_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %unpack2x16unorm_7699c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %unpack2x16unorm_7699c0
+%compute_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %unpack2x16unorm_7699c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.wgsl
index 46b5d02..fb7cf7e 100644
--- a/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/unpack2x16unorm/7699c0.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn unpack2x16unorm_7699c0() {
   var res : vec2<f32> = unpack2x16unorm(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack2x16unorm_7699c0();
diff --git a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl
index 55d0df3..5a4a2ef 100644
--- a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl
+++ b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl
@@ -24,7 +24,9 @@
 // fn unpack4x8snorm(u32) -> vec4<f32>
 fn unpack4x8snorm_523fb3() {
   var res: vec4<f32> = unpack4x8snorm(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.dxc.hlsl
index c4befc5..f52a00b 100644
--- a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack4x8snorm_523fb3() {
   float4 res = float4(0.00787401571869850159f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.fxc.hlsl
index c4befc5..f52a00b 100644
--- a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack4x8snorm_523fb3() {
   float4 res = float4(0.00787401571869850159f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.glsl
index 5366556..5c919e1 100644
--- a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8snorm_523fb3() {
   vec4 res = vec4(0.00787401571869850159f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8snorm_523fb3() {
   vec4 res = vec4(0.00787401571869850159f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8snorm_523fb3() {
   vec4 res = vec4(0.00787401571869850159f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.msl b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.msl
index 2a8dbba..7981fce 100644
--- a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack4x8snorm_523fb3() {
+void unpack4x8snorm_523fb3(device float4* const tint_symbol_1) {
   float4 res = float4(0.00787401571869850159f, 0.0f, 0.0f, 0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack4x8snorm_523fb3();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  unpack4x8snorm_523fb3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack4x8snorm_523fb3();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  unpack4x8snorm_523fb3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack4x8snorm_523fb3();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  unpack4x8snorm_523fb3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.spvasm
index 990eef8..c1aa196 100644
--- a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack4x8snorm_523fb3 "unpack4x8snorm_523fb3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_00787401572 = OpConstant %float 0.00787401572
-         %14 = OpConstantComposite %v4float %float_0_00787401572 %8 %8 %8
+         %17 = OpConstantComposite %v4float %float_0_00787401572 %8 %8 %8
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack4x8snorm_523fb3 = OpFunction %void None %9
-         %12 = OpLabel
+%unpack4x8snorm_523fb3 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %unpack4x8snorm_523fb3
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %unpack4x8snorm_523fb3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %unpack4x8snorm_523fb3
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %unpack4x8snorm_523fb3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %unpack4x8snorm_523fb3
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %unpack4x8snorm_523fb3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.wgsl
index fc1452d..5e1d088 100644
--- a/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/unpack4x8snorm/523fb3.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn unpack4x8snorm_523fb3() {
   var res : vec4<f32> = unpack4x8snorm(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack4x8snorm_523fb3();
diff --git a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl
index d41eb9c..e37b44a 100644
--- a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl
+++ b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl
@@ -24,7 +24,9 @@
 // fn unpack4x8unorm(u32) -> vec4<f32>
 fn unpack4x8unorm_750c74() {
   var res: vec4<f32> = unpack4x8unorm(1u);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.dxc.hlsl
index 17a3f97..b39a5bb 100644
--- a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack4x8unorm_750c74() {
   float4 res = float4(0.0039215688593685627f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.fxc.hlsl
index 17a3f97..b39a5bb 100644
--- a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.fxc.hlsl
@@ -1,5 +1,8 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack4x8unorm_750c74() {
   float4 res = float4(0.0039215688593685627f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.glsl
index 418b297..f4aaf38 100644
--- a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.glsl
@@ -1,7 +1,12 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8unorm_750c74() {
   vec4 res = vec4(0.0039215688593685627f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -20,8 +25,13 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8unorm_750c74() {
   vec4 res = vec4(0.0039215688593685627f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -34,8 +44,13 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8unorm_750c74() {
   vec4 res = vec4(0.0039215688593685627f, 0.0f, 0.0f, 0.0f);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.msl b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.msl
index 6127018..759abee 100644
--- a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack4x8unorm_750c74() {
+void unpack4x8unorm_750c74(device float4* const tint_symbol_1) {
   float4 res = float4(0.0039215688593685627f, 0.0f, 0.0f, 0.0f);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack4x8unorm_750c74();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  unpack4x8unorm_750c74(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack4x8unorm_750c74();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  unpack4x8unorm_750c74(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack4x8unorm_750c74();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  unpack4x8unorm_750c74(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.spvasm
index e3fa37d..67fe414 100644
--- a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack4x8unorm_750c74 "unpack4x8unorm_750c74"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -20,6 +23,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -28,38 +35,47 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_00392156886 = OpConstant %float 0.00392156886
-         %14 = OpConstantComposite %v4float %float_0_00392156886 %8 %8 %8
+         %17 = OpConstantComposite %v4float %float_0_00392156886 %8 %8 %8
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %17 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %25 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack4x8unorm_750c74 = OpFunction %void None %9
-         %12 = OpLabel
+%unpack4x8unorm_750c74 = OpFunction %void None %12
+         %15 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %res %14
+               OpStore %res %17
+         %23 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %24 = OpLoad %v4float %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %17
-         %19 = OpLabel
-         %20 = OpFunctionCall %void %unpack4x8unorm_750c74
+%vertex_main_inner = OpFunction %v4float None %25
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %unpack4x8unorm_750c74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %22 = OpLabel
-         %23 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %23
+%vertex_main = OpFunction %void None %12
+         %30 = OpLabel
+         %31 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %31
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %unpack4x8unorm_750c74
+%fragment_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %unpack4x8unorm_750c74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %unpack4x8unorm_750c74
+%compute_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %unpack4x8unorm_750c74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.wgsl
index eeb5aa8..f51cdc3 100644
--- a/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/unpack4x8unorm/750c74.wgsl.expected.wgsl
@@ -1,7 +1,10 @@
 fn unpack4x8unorm_750c74() {
   var res : vec4<f32> = unpack4x8unorm(1u);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack4x8unorm_750c74();
diff --git a/test/tint/builtins/gen/literal/workgroupBarrier/a17f7f.wgsl b/test/tint/builtins/gen/literal/workgroupBarrier/a17f7f.wgsl
index e493337..8dca1bd 100644
--- a/test/tint/builtins/gen/literal/workgroupBarrier/a17f7f.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupBarrier/a17f7f.wgsl
@@ -25,7 +25,6 @@
 fn workgroupBarrier_a17f7f() {
   workgroupBarrier();
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupBarrier_a17f7f();
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl
index ff17877..2700b1f 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl
@@ -25,7 +25,9 @@
 // fn workgroupUniformLoad(ptr<workgroup, u32, read_write>) -> u32
 fn workgroupUniformLoad_37307c() {
   var res: u32 = workgroupUniformLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
index 9324574..7db1f5c 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_37307c() {
   uint res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
index 9324574..7db1f5c 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_37307c() {
   uint res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.glsl
index 061ebab..08650d7 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.glsl
@@ -8,8 +8,13 @@
 }
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void workgroupUniformLoad_37307c() {
   uint res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.msl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.msl
index 3553390..8f560f8 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.msl
@@ -8,21 +8,22 @@
   return result;
 }
 
-void workgroupUniformLoad_37307c(threadgroup uint* const tint_symbol) {
+void workgroupUniformLoad_37307c(threadgroup uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = tint_workgroupUniformLoad(tint_symbol);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    *(tint_symbol_1) = 0u;
+    *(tint_symbol_2) = 0u;
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  workgroupUniformLoad_37307c(tint_symbol_1);
+  workgroupUniformLoad_37307c(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.spvasm
index b3755dc..c898890 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_workgroupUniformLoad_arg_0 "tint_workgroupUniformLoad_arg_0"
                OpName %workgroupUniformLoad_37307c "workgroupUniformLoad_37307c"
                OpName %res "res"
@@ -16,44 +19,56 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
-          %6 = OpTypeFunction %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+          %9 = OpTypeFunction %uint
        %void = OpTypeVoid
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %void %uint
-%tint_workgroupUniformLoad_arg_0 = OpFunction %uint None %6
-          %8 = OpLabel
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %void %uint
+%tint_workgroupUniformLoad_arg_0 = OpFunction %uint None %9
+         %11 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %13 = OpLoad %uint %arg_0
+         %16 = OpLoad %uint %arg_0
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpReturnValue %13
+               OpReturnValue %16
                OpFunctionEnd
-%workgroupUniformLoad_37307c = OpFunction %void None %15
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpFunctionCall %uint %tint_workgroupUniformLoad_arg_0
-               OpStore %res %18
+%workgroupUniformLoad_37307c = OpFunction %void None %18
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpFunctionCall %uint %tint_workgroupUniformLoad_arg_0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %22
+%compute_main_inner = OpFunction %void None %29
 %local_invocation_index = OpFunctionParameter %uint
-         %25 = OpLabel
-               OpStore %arg_0 %21
+         %32 = OpLabel
+               OpStore %arg_0 %24
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %workgroupUniformLoad_37307c
+         %34 = OpFunctionCall %void %workgroupUniformLoad_37307c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %18
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.wgsl
index f4d48fa..ce426be 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn workgroupUniformLoad_37307c() {
   var res : u32 = workgroupUniformLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupUniformLoad_37307c();
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl
index c5cf95e..f571cec 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl
@@ -25,7 +25,9 @@
 // fn workgroupUniformLoad(ptr<workgroup, f32, read_write>) -> f32
 fn workgroupUniformLoad_7a857c() {
   var res: f32 = workgroupUniformLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
index 0bd3512..31bcd63 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared float arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_7a857c() {
   float res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
index 0bd3512..31bcd63 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared float arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_7a857c() {
   float res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.glsl
index dcde824..b0d7db3 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.glsl
@@ -8,8 +8,13 @@
 }
 
 shared float arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void workgroupUniformLoad_7a857c() {
   float res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.msl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.msl
index 7637172..d207300 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.msl
@@ -8,21 +8,22 @@
   return result;
 }
 
-void workgroupUniformLoad_7a857c(threadgroup float* const tint_symbol) {
+void workgroupUniformLoad_7a857c(threadgroup float* const tint_symbol, device float* const tint_symbol_1) {
   float res = tint_workgroupUniformLoad(tint_symbol);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup float* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup float* const tint_symbol_2, device float* const tint_symbol_3) {
   {
-    *(tint_symbol_1) = 0.0f;
+    *(tint_symbol_2) = 0.0f;
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  workgroupUniformLoad_7a857c(tint_symbol_1);
+  workgroupUniformLoad_7a857c(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup float tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup float tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
index abd0f6a..27b66d3 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_workgroupUniformLoad_arg_0 "tint_workgroupUniformLoad_arg_0"
                OpName %workgroupUniformLoad_7a857c "workgroupUniformLoad_7a857c"
                OpName %res "res"
@@ -16,45 +19,57 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
       %float = OpTypeFloat 32
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
       %arg_0 = OpVariable %_ptr_Workgroup_float Workgroup
-          %7 = OpTypeFunction %float
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %10 = OpTypeFunction %float
        %void = OpTypeVoid
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
-         %16 = OpTypeFunction %void
+         %19 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpConstantNull %float
-         %23 = OpTypeFunction %void %uint
-%tint_workgroupUniformLoad_arg_0 = OpFunction %float None %7
-          %9 = OpLabel
+         %25 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %void %uint
+%tint_workgroupUniformLoad_arg_0 = OpFunction %float None %10
+         %12 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %14 = OpLoad %float %arg_0
+         %17 = OpLoad %float %arg_0
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpReturnValue %14
+               OpReturnValue %17
                OpFunctionEnd
-%workgroupUniformLoad_7a857c = OpFunction %void None %16
-         %18 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %22
-         %19 = OpFunctionCall %float %tint_workgroupUniformLoad_arg_0
-               OpStore %res %19
+%workgroupUniformLoad_7a857c = OpFunction %void None %19
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %25
+         %22 = OpFunctionCall %float %tint_workgroupUniformLoad_arg_0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %23
+%compute_main_inner = OpFunction %void None %30
 %local_invocation_index = OpFunctionParameter %uint
-         %26 = OpLabel
-               OpStore %arg_0 %22
+         %33 = OpLabel
+               OpStore %arg_0 %25
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %workgroupUniformLoad_7a857c
+         %35 = OpFunctionCall %void %workgroupUniformLoad_7a857c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %19
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.wgsl
index 2fd46aa..6df5674 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn workgroupUniformLoad_7a857c() {
   var res : f32 = workgroupUniformLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupUniformLoad_7a857c();
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl
index 6ebb067..852d72d 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl
@@ -25,7 +25,9 @@
 // fn workgroupUniformLoad(ptr<workgroup, i32, read_write>) -> i32
 fn workgroupUniformLoad_9d33de() {
   var res: i32 = workgroupUniformLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
index 5bce24b..c495ebc 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_9d33de() {
   int res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
index 5bce24b..c495ebc 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_9d33de() {
   int res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.glsl
index 10874b5..8d3a9e6 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.glsl
@@ -8,8 +8,13 @@
 }
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void workgroupUniformLoad_9d33de() {
   int res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.msl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.msl
index 4ef9721..9916a7c 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.msl
@@ -8,21 +8,22 @@
   return result;
 }
 
-void workgroupUniformLoad_9d33de(threadgroup int* const tint_symbol) {
+void workgroupUniformLoad_9d33de(threadgroup int* const tint_symbol, device int* const tint_symbol_1) {
   int res = tint_workgroupUniformLoad(tint_symbol);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    *(tint_symbol_1) = 0;
+    *(tint_symbol_2) = 0;
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  workgroupUniformLoad_9d33de(tint_symbol_1);
+  workgroupUniformLoad_9d33de(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
index 50b0e3f..2a3afbb 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_workgroupUniformLoad_arg_0 "tint_workgroupUniformLoad_arg_0"
                OpName %workgroupUniformLoad_9d33de "workgroupUniformLoad_9d33de"
                OpName %res "res"
@@ -16,45 +19,57 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
-          %7 = OpTypeFunction %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %10 = OpTypeFunction %int
        %void = OpTypeVoid
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
-         %16 = OpTypeFunction %void
+         %19 = OpTypeFunction %void
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
-         %23 = OpTypeFunction %void %uint
-%tint_workgroupUniformLoad_arg_0 = OpFunction %int None %7
-          %9 = OpLabel
+         %25 = OpConstantNull %int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %30 = OpTypeFunction %void %uint
+%tint_workgroupUniformLoad_arg_0 = OpFunction %int None %10
+         %12 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %14 = OpLoad %int %arg_0
+         %17 = OpLoad %int %arg_0
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpReturnValue %14
+               OpReturnValue %17
                OpFunctionEnd
-%workgroupUniformLoad_9d33de = OpFunction %void None %16
-         %18 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %22
-         %19 = OpFunctionCall %int %tint_workgroupUniformLoad_arg_0
-               OpStore %res %19
+%workgroupUniformLoad_9d33de = OpFunction %void None %19
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %25
+         %22 = OpFunctionCall %int %tint_workgroupUniformLoad_arg_0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %29 = OpLoad %int %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %23
+%compute_main_inner = OpFunction %void None %30
 %local_invocation_index = OpFunctionParameter %uint
-         %26 = OpLabel
-               OpStore %arg_0 %22
+         %33 = OpLabel
+               OpStore %arg_0 %25
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %workgroupUniformLoad_9d33de
+         %35 = OpFunctionCall %void %workgroupUniformLoad_9d33de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %19
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.wgsl
index 5228ac7..26a2cef 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn workgroupUniformLoad_9d33de() {
   var res : i32 = workgroupUniformLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupUniformLoad_9d33de();
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl
index a0820bb..767f48a 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl
@@ -27,7 +27,9 @@
 // fn workgroupUniformLoad(ptr<workgroup, f16, read_write>) -> f16
 fn workgroupUniformLoad_e07d08() {
   var res: f16 = workgroupUniformLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
index 96fb735..ed848f2 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared float16_t arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_e07d08() {
   float16_t res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.fxc.hlsl
index 3f0f269..9fe9c3e 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.fxc.hlsl
@@ -1,16 +1,18 @@
 SKIP: FAILED
 
-groupshared float16_t arg_0;
-
-float16_t tint_workgroupUniformLoad_arg_0() {
+float16_t tint_workgroupUniformLoad(inout float16_t p) {
   GroupMemoryBarrierWithGroupSync();
-  const float16_t result = arg_0;
+  const float16_t result = p;
   GroupMemoryBarrierWithGroupSync();
   return result;
 }
 
+groupshared float16_t arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void workgroupUniformLoad_e07d08() {
-  float16_t res = tint_workgroupUniformLoad_arg_0();
+  float16_t res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.glsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.glsl
index 33a9a40..9d804d4 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.glsl
@@ -9,8 +9,13 @@
 }
 
 shared float16_t arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void workgroupUniformLoad_e07d08() {
   float16_t res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.msl b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.msl
index c4c40c9..cec8325 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.msl
@@ -8,21 +8,22 @@
   return result;
 }
 
-void workgroupUniformLoad_e07d08(threadgroup half* const tint_symbol) {
+void workgroupUniformLoad_e07d08(threadgroup half* const tint_symbol, device half* const tint_symbol_1) {
   half res = tint_workgroupUniformLoad(tint_symbol);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup half* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup half* const tint_symbol_2, device half* const tint_symbol_3) {
   {
-    *(tint_symbol_1) = 0.0h;
+    *(tint_symbol_2) = 0.0h;
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  workgroupUniformLoad_e07d08(tint_symbol_1);
+  workgroupUniformLoad_e07d08(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup half tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup half tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
index 9c5cf13..40fe77d 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_workgroupUniformLoad_arg_0 "tint_workgroupUniformLoad_arg_0"
                OpName %workgroupUniformLoad_e07d08 "workgroupUniformLoad_e07d08"
                OpName %res "res"
@@ -20,45 +23,57 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
        %half = OpTypeFloat 16
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
       %arg_0 = OpVariable %_ptr_Workgroup_half Workgroup
-          %7 = OpTypeFunction %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %10 = OpTypeFunction %half
        %void = OpTypeVoid
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
-         %16 = OpTypeFunction %void
+         %19 = OpTypeFunction %void
 %_ptr_Function_half = OpTypePointer Function %half
-         %22 = OpConstantNull %half
-         %23 = OpTypeFunction %void %uint
-%tint_workgroupUniformLoad_arg_0 = OpFunction %half None %7
-          %9 = OpLabel
+         %25 = OpConstantNull %half
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %void %uint
+%tint_workgroupUniformLoad_arg_0 = OpFunction %half None %10
+         %12 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %14 = OpLoad %half %arg_0
+         %17 = OpLoad %half %arg_0
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpReturnValue %14
+               OpReturnValue %17
                OpFunctionEnd
-%workgroupUniformLoad_e07d08 = OpFunction %void None %16
-         %18 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %22
-         %19 = OpFunctionCall %half %tint_workgroupUniformLoad_arg_0
-               OpStore %res %19
+%workgroupUniformLoad_e07d08 = OpFunction %void None %19
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %25
+         %22 = OpFunctionCall %half %tint_workgroupUniformLoad_arg_0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %23
+%compute_main_inner = OpFunction %void None %30
 %local_invocation_index = OpFunctionParameter %uint
-         %26 = OpLabel
-               OpStore %arg_0 %22
+         %33 = OpLabel
+               OpStore %arg_0 %25
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %workgroupUniformLoad_e07d08
+         %35 = OpFunctionCall %void %workgroupUniformLoad_e07d08
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %19
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.wgsl
index 79b6a47..ce938f9 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn workgroupUniformLoad_e07d08() {
   var res : f16 = workgroupUniformLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupUniformLoad_e07d08();
diff --git a/test/tint/builtins/gen/var/abs/002533.wgsl b/test/tint/builtins/gen/var/abs/002533.wgsl
index c1d7213..cc17fc2 100644
--- a/test/tint/builtins/gen/var/abs/002533.wgsl
+++ b/test/tint/builtins/gen/var/abs/002533.wgsl
@@ -25,7 +25,9 @@
 fn abs_002533() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.dxc.hlsl
index 6b6f00c..17ee831 100644
--- a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_002533() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = abs(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.fxc.hlsl
index 6b6f00c..17ee831 100644
--- a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_002533() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = abs(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.glsl
index b2b0c1e..572e56f 100644
--- a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void abs_002533() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void abs_002533() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void abs_002533() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.msl
index ecdc7ee..c132a52 100644
--- a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_002533() {
+void abs_002533(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = fabs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_002533();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  abs_002533(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_002533();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  abs_002533(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_002533();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  abs_002533(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.spvasm
index db4456d..2cf6f47 100644
--- a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_002533 "abs_002533"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
- %abs_002533 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+ %abs_002533 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 FAbs %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 FAbs %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %abs_002533
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %abs_002533
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %abs_002533
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_002533
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_002533
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %abs_002533
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.wgsl
index 267fb80..12675db 100644
--- a/test/tint/builtins/gen/var/abs/002533.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/002533.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_002533() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_002533();
diff --git a/test/tint/builtins/gen/var/abs/005174.wgsl b/test/tint/builtins/gen/var/abs/005174.wgsl
index 3158995..106a18d 100644
--- a/test/tint/builtins/gen/var/abs/005174.wgsl
+++ b/test/tint/builtins/gen/var/abs/005174.wgsl
@@ -25,7 +25,9 @@
 fn abs_005174() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.dxc.hlsl
index 8124003..daa65d6 100644
--- a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_005174() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = abs(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.fxc.hlsl
index 8124003..daa65d6 100644
--- a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_005174() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = abs(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.glsl
index eafcd88..853d2af 100644
--- a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void abs_005174() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void abs_005174() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void abs_005174() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.msl
index c87ee07..a26d49c 100644
--- a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_005174() {
+void abs_005174(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = fabs(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_005174();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  abs_005174(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_005174();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  abs_005174(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_005174();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  abs_005174(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.spvasm
index 62a7852..ec045f7 100644
--- a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_005174 "abs_005174"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
- %abs_005174 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 FAbs %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+ %abs_005174 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 FAbs %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %abs_005174
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %abs_005174
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_005174
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_005174
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %abs_005174
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %abs_005174
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.wgsl
index 2ac6dff..03eb572 100644
--- a/test/tint/builtins/gen/var/abs/005174.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/005174.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_005174() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_005174();
diff --git a/test/tint/builtins/gen/var/abs/1ce782.wgsl b/test/tint/builtins/gen/var/abs/1ce782.wgsl
index b962332..5170288 100644
--- a/test/tint/builtins/gen/var/abs/1ce782.wgsl
+++ b/test/tint/builtins/gen/var/abs/1ce782.wgsl
@@ -25,7 +25,9 @@
 fn abs_1ce782() {
   var arg_0 = vec4<u32>(1u);
   var res: vec4<u32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.dxc.hlsl
index 636bde5..5b2ed50 100644
--- a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_1ce782() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = abs(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.fxc.hlsl
index 636bde5..5b2ed50 100644
--- a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_1ce782() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = abs(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.glsl
index 118f0ff..2835b0d 100644
--- a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void abs_1ce782() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void abs_1ce782() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void abs_1ce782() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.msl
index 18c3c5a..803370d 100644
--- a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_1ce782() {
+void abs_1ce782(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 res = abs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_1ce782();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  abs_1ce782(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_1ce782();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  abs_1ce782(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_1ce782();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  abs_1ce782(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.spvasm
index e08a560..fa0113e 100644
--- a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_1ce782 "abs_1ce782"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,44 +36,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_1ce782 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %19
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v4uint %arg_0
-               OpStore %res %21
+ %abs_1ce782 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %22
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v4uint %arg_0
+               OpStore %res %24
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %29 = OpLoad %v4uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %abs_1ce782
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_1ce782
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_1ce782
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_1ce782
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %abs_1ce782
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %abs_1ce782
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.wgsl
index 92b0f35..b1697e5 100644
--- a/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/1ce782.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_1ce782() {
   var arg_0 = vec4<u32>(1u);
   var res : vec4<u32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_1ce782();
diff --git a/test/tint/builtins/gen/var/abs/1e9d53.wgsl b/test/tint/builtins/gen/var/abs/1e9d53.wgsl
index afc65bf..de6bbf8 100644
--- a/test/tint/builtins/gen/var/abs/1e9d53.wgsl
+++ b/test/tint/builtins/gen/var/abs/1e9d53.wgsl
@@ -25,7 +25,9 @@
 fn abs_1e9d53() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.dxc.hlsl
index 8ae3d40..132d2e7 100644
--- a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_1e9d53() {
   float2 arg_0 = (1.0f).xx;
   float2 res = abs(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.fxc.hlsl
index 8ae3d40..132d2e7 100644
--- a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_1e9d53() {
   float2 arg_0 = (1.0f).xx;
   float2 res = abs(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.glsl
index edb76d6..16a39f2 100644
--- a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void abs_1e9d53() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void abs_1e9d53() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void abs_1e9d53() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.msl
index 87a6a67..442e55f 100644
--- a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_1e9d53() {
+void abs_1e9d53(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = fabs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_1e9d53();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  abs_1e9d53(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_1e9d53();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  abs_1e9d53(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_1e9d53();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  abs_1e9d53(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.spvasm
index 43daf5d..96bf7ec 100644
--- a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_1e9d53 "abs_1e9d53"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
- %abs_1e9d53 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 FAbs %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+ %abs_1e9d53 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 FAbs %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %abs_1e9d53
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %abs_1e9d53
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_1e9d53
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_1e9d53
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %abs_1e9d53
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %abs_1e9d53
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.wgsl
index 92d84c3..e79ee7d 100644
--- a/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/1e9d53.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_1e9d53() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_1e9d53();
diff --git a/test/tint/builtins/gen/var/abs/2f861b.wgsl b/test/tint/builtins/gen/var/abs/2f861b.wgsl
index ce953f8..faa11d8 100644
--- a/test/tint/builtins/gen/var/abs/2f861b.wgsl
+++ b/test/tint/builtins/gen/var/abs/2f861b.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = abs(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_2f861b();
diff --git a/test/tint/builtins/gen/var/abs/421ca3.wgsl b/test/tint/builtins/gen/var/abs/421ca3.wgsl
index a035251..a28dbb5 100644
--- a/test/tint/builtins/gen/var/abs/421ca3.wgsl
+++ b/test/tint/builtins/gen/var/abs/421ca3.wgsl
@@ -27,7 +27,9 @@
 fn abs_421ca3() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.dxc.hlsl
index 3154eb2..9f43ec8 100644
--- a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_421ca3() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = abs(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.fxc.hlsl
index 45aedfc..ca9cc56 100644
--- a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_421ca3() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = abs(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.glsl
index 88d0689..09828f8 100644
--- a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void abs_421ca3() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void abs_421ca3() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void abs_421ca3() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.msl
index 798b96e..7b60a61 100644
--- a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_421ca3() {
+void abs_421ca3(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = fabs(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_421ca3();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  abs_421ca3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_421ca3();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  abs_421ca3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_421ca3();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  abs_421ca3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.spvasm
index 3e44894..bc2626a 100644
--- a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_421ca3 "abs_421ca3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_421ca3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 FAbs %22
-               OpStore %res %20
+ %abs_421ca3 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 FAbs %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %abs_421ca3
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %abs_421ca3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_421ca3
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %abs_421ca3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %abs_421ca3
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %abs_421ca3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.wgsl
index 9835002..4cea11b 100644
--- a/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/421ca3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn abs_421ca3() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_421ca3();
diff --git a/test/tint/builtins/gen/var/abs/467cd1.wgsl b/test/tint/builtins/gen/var/abs/467cd1.wgsl
index 6c1b5d4..197d145 100644
--- a/test/tint/builtins/gen/var/abs/467cd1.wgsl
+++ b/test/tint/builtins/gen/var/abs/467cd1.wgsl
@@ -25,7 +25,9 @@
 fn abs_467cd1() {
   var arg_0 = 1u;
   var res: u32 = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.dxc.hlsl
index 1843aff..b2bc9d0 100644
--- a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_467cd1() {
   uint arg_0 = 1u;
   uint res = abs(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.fxc.hlsl
index 1843aff..b2bc9d0 100644
--- a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_467cd1() {
   uint arg_0 = 1u;
   uint res = abs(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.glsl
index 14629ec..f47a14c 100644
--- a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void abs_467cd1() {
   uint arg_0 = 1u;
   uint res = arg_0;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void abs_467cd1() {
   uint arg_0 = 1u;
   uint res = arg_0;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void abs_467cd1() {
   uint arg_0 = 1u;
   uint res = arg_0;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.msl
index 2185834..1b7e795 100644
--- a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_467cd1() {
+void abs_467cd1(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint res = abs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_467cd1();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  abs_467cd1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_467cd1();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  abs_467cd1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_467cd1();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  abs_467cd1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.spvasm
index 0c22f42..b15b69b 100644
--- a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_467cd1 "abs_467cd1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,42 +36,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %21 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_467cd1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %abs_467cd1 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
-         %19 = OpLoad %uint %arg_0
-               OpStore %res %19
+         %22 = OpLoad %uint %arg_0
+               OpStore %res %22
+         %26 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %27 = OpLoad %uint %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %abs_467cd1
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_467cd1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %abs_467cd1
+%fragment_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %abs_467cd1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_467cd1
+%compute_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %abs_467cd1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.wgsl
index 1384688..34919d8 100644
--- a/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/467cd1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_467cd1() {
   var arg_0 = 1u;
   var res : u32 = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_467cd1();
diff --git a/test/tint/builtins/gen/var/abs/4ad288.wgsl b/test/tint/builtins/gen/var/abs/4ad288.wgsl
index f61c428..e806cac 100644
--- a/test/tint/builtins/gen/var/abs/4ad288.wgsl
+++ b/test/tint/builtins/gen/var/abs/4ad288.wgsl
@@ -25,7 +25,9 @@
 fn abs_4ad288() {
   var arg_0 = 1i;
   var res: i32 = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.dxc.hlsl
index 4b75546..9c23e8a 100644
--- a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_4ad288() {
   int arg_0 = 1;
   int res = abs(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.fxc.hlsl
index 4b75546..9c23e8a 100644
--- a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_4ad288() {
   int arg_0 = 1;
   int res = abs(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.glsl
index cf24591..1d9d9c8 100644
--- a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void abs_4ad288() {
   int arg_0 = 1;
   int res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void abs_4ad288() {
   int arg_0 = 1;
   int res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void abs_4ad288() {
   int arg_0 = 1;
   int res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.msl
index a721e91..a3c09eb 100644
--- a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_4ad288() {
+void abs_4ad288(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int res = abs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_4ad288();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  abs_4ad288(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_4ad288();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  abs_4ad288(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_4ad288();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  abs_4ad288(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.spvasm
index 2de82a8..f4db64b 100644
--- a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_4ad288 "abs_4ad288"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_4ad288 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %17
-        %res = OpVariable %_ptr_Function_int Function %17
+ %abs_4ad288 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %20
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %arg_0 %int_1
-         %20 = OpLoad %int %arg_0
-         %18 = OpExtInst %int %19 SAbs %20
-               OpStore %res %18
+         %23 = OpLoad %int %arg_0
+         %21 = OpExtInst %int %22 SAbs %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %29 = OpLoad %int %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %abs_4ad288
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_4ad288
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_4ad288
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_4ad288
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %abs_4ad288
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %abs_4ad288
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.wgsl
index aa36453..de69fb0 100644
--- a/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/4ad288.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_4ad288() {
   var arg_0 = 1i;
   var res : i32 = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_4ad288();
diff --git a/test/tint/builtins/gen/var/abs/538d29.wgsl b/test/tint/builtins/gen/var/abs/538d29.wgsl
index 8537d25..edf7e66 100644
--- a/test/tint/builtins/gen/var/abs/538d29.wgsl
+++ b/test/tint/builtins/gen/var/abs/538d29.wgsl
@@ -27,7 +27,9 @@
 fn abs_538d29() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.dxc.hlsl
index f22efbc..2d7e6a3 100644
--- a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_538d29() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = abs(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.fxc.hlsl
index ec16a90..090c711 100644
--- a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_538d29() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = abs(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.glsl
index 48fa2e3..9a02e7b 100644
--- a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void abs_538d29() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void abs_538d29() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void abs_538d29() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.msl
index 09b242b..5560c11 100644
--- a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_538d29() {
+void abs_538d29(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = fabs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_538d29();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  abs_538d29(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_538d29();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  abs_538d29(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_538d29();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  abs_538d29(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.spvasm
index dad09f3..7effa0c 100644
--- a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_538d29 "abs_538d29"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_538d29 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 FAbs %22
-               OpStore %res %20
+ %abs_538d29 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 FAbs %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %abs_538d29
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %abs_538d29
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_538d29
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %abs_538d29
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %abs_538d29
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %abs_538d29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.wgsl
index 4fe6e8e..fcfae0b 100644
--- a/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/538d29.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn abs_538d29() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_538d29();
diff --git a/test/tint/builtins/gen/var/abs/577d6e.wgsl b/test/tint/builtins/gen/var/abs/577d6e.wgsl
index c974324..aa60735 100644
--- a/test/tint/builtins/gen/var/abs/577d6e.wgsl
+++ b/test/tint/builtins/gen/var/abs/577d6e.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1);
   var res = abs(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_577d6e();
diff --git a/test/tint/builtins/gen/var/abs/5a8af1.wgsl b/test/tint/builtins/gen/var/abs/5a8af1.wgsl
index d8ca2bd..3afdbba 100644
--- a/test/tint/builtins/gen/var/abs/5a8af1.wgsl
+++ b/test/tint/builtins/gen/var/abs/5a8af1.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1;
   var res = abs(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_5a8af1();
diff --git a/test/tint/builtins/gen/var/abs/5ad50a.wgsl b/test/tint/builtins/gen/var/abs/5ad50a.wgsl
index 05288fa..35ef47f 100644
--- a/test/tint/builtins/gen/var/abs/5ad50a.wgsl
+++ b/test/tint/builtins/gen/var/abs/5ad50a.wgsl
@@ -25,7 +25,9 @@
 fn abs_5ad50a() {
   var arg_0 = vec3<i32>(1i);
   var res: vec3<i32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.dxc.hlsl
index c9db60b..e79d4f9 100644
--- a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_5ad50a() {
   int3 arg_0 = (1).xxx;
   int3 res = abs(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.fxc.hlsl
index c9db60b..e79d4f9 100644
--- a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_5ad50a() {
   int3 arg_0 = (1).xxx;
   int3 res = abs(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.glsl
index a3976e9..ca0c00c 100644
--- a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void abs_5ad50a() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void abs_5ad50a() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void abs_5ad50a() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.msl
index 1ff6dc4..f82def4 100644
--- a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_5ad50a() {
+void abs_5ad50a(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 res = abs(arg_0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_5ad50a();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  abs_5ad50a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_5ad50a();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  abs_5ad50a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_5ad50a();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  abs_5ad50a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.spvasm
index 160d442..0718728 100644
--- a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_5ad50a "abs_5ad50a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_5ad50a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3int %arg_0
-         %20 = OpExtInst %v3int %21 SAbs %22
-               OpStore %res %20
+ %abs_5ad50a = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3int %arg_0
+         %23 = OpExtInst %v3int %24 SAbs %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %31 = OpLoad %v3int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %abs_5ad50a
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %abs_5ad50a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_5ad50a
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %abs_5ad50a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %abs_5ad50a
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %abs_5ad50a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.wgsl
index 94f8dbb..32d2f83 100644
--- a/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/5ad50a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_5ad50a() {
   var arg_0 = vec3<i32>(1i);
   var res : vec3<i32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_5ad50a();
diff --git a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl
index 470e133..4923ede 100644
--- a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl
+++ b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl
@@ -27,7 +27,9 @@
 fn abs_5ae4fe() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.dxc.hlsl
index 326415e..76c5cc7 100644
--- a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_5ae4fe() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = abs(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.fxc.hlsl
index 7aa056e..8fa6325 100644
--- a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_5ae4fe() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = abs(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.glsl
index 65938a3..a8b9dcf 100644
--- a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void abs_5ae4fe() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void abs_5ae4fe() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void abs_5ae4fe() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.msl
index 965d1c9..a14441c 100644
--- a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_5ae4fe() {
+void abs_5ae4fe(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = fabs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_5ae4fe();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  abs_5ae4fe(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_5ae4fe();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  abs_5ae4fe(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_5ae4fe();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  abs_5ae4fe(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.spvasm
index 297ad45..8e9739b 100644
--- a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_5ae4fe "abs_5ae4fe"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_5ae4fe = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 FAbs %22
-               OpStore %res %20
+ %abs_5ae4fe = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 FAbs %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %abs_5ae4fe
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %abs_5ae4fe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_5ae4fe
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %abs_5ae4fe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %abs_5ae4fe
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %abs_5ae4fe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.wgsl
index 31475e6..3388ba6 100644
--- a/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/5ae4fe.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn abs_5ae4fe() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_5ae4fe();
diff --git a/test/tint/builtins/gen/var/abs/7326de.wgsl b/test/tint/builtins/gen/var/abs/7326de.wgsl
index 7405e00..9c27ce4 100644
--- a/test/tint/builtins/gen/var/abs/7326de.wgsl
+++ b/test/tint/builtins/gen/var/abs/7326de.wgsl
@@ -25,7 +25,9 @@
 fn abs_7326de() {
   var arg_0 = vec3<u32>(1u);
   var res: vec3<u32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.dxc.hlsl
index d0ae4a5..f786923 100644
--- a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7326de() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = abs(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.fxc.hlsl
index d0ae4a5..f786923 100644
--- a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7326de() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = abs(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.glsl
index 52ac50a..d557b5b 100644
--- a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void abs_7326de() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void abs_7326de() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void abs_7326de() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.msl
index 07f3f44..141be0c 100644
--- a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_7326de() {
+void abs_7326de(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 res = abs(arg_0);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_7326de();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  abs_7326de(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_7326de();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  abs_7326de(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_7326de();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  abs_7326de(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.spvasm
index fddef64..62b9e9d 100644
--- a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_7326de "abs_7326de"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,44 +36,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_7326de = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %19
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v3uint %arg_0
-               OpStore %res %21
+ %abs_7326de = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %22
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v3uint %arg_0
+               OpStore %res %24
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %abs_7326de
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_7326de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_7326de
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_7326de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %abs_7326de
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %abs_7326de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.wgsl
index 3b2089d..0580bc7 100644
--- a/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/7326de.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_7326de() {
   var arg_0 = vec3<u32>(1u);
   var res : vec3<u32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_7326de();
diff --git a/test/tint/builtins/gen/var/abs/7f28e6.wgsl b/test/tint/builtins/gen/var/abs/7f28e6.wgsl
index 35e5893..756e42b 100644
--- a/test/tint/builtins/gen/var/abs/7f28e6.wgsl
+++ b/test/tint/builtins/gen/var/abs/7f28e6.wgsl
@@ -25,7 +25,9 @@
 fn abs_7f28e6() {
   var arg_0 = vec2<u32>(1u);
   var res: vec2<u32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.dxc.hlsl
index c311d9a..7708451 100644
--- a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7f28e6() {
   uint2 arg_0 = (1u).xx;
   uint2 res = abs(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.fxc.hlsl
index c311d9a..7708451 100644
--- a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7f28e6() {
   uint2 arg_0 = (1u).xx;
   uint2 res = abs(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.glsl
index 58a3941..678ed03e 100644
--- a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void abs_7f28e6() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void abs_7f28e6() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void abs_7f28e6() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = arg_0;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.msl
index 3a1d4a5..7b41010 100644
--- a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_7f28e6() {
+void abs_7f28e6(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 res = abs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_7f28e6();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  abs_7f28e6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_7f28e6();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  abs_7f28e6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_7f28e6();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  abs_7f28e6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.spvasm
index ead810c..d634b92 100644
--- a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_7f28e6 "abs_7f28e6"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,44 +36,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_7f28e6 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %19
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v2uint %arg_0
-               OpStore %res %21
+ %abs_7f28e6 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %22
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v2uint %arg_0
+               OpStore %res %24
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %abs_7f28e6
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_7f28e6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %abs_7f28e6
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_7f28e6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %abs_7f28e6
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %abs_7f28e6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.wgsl
index 076f526..836b9d5 100644
--- a/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/7f28e6.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_7f28e6() {
   var arg_0 = vec2<u32>(1u);
   var res : vec2<u32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_7f28e6();
diff --git a/test/tint/builtins/gen/var/abs/7faa9e.wgsl b/test/tint/builtins/gen/var/abs/7faa9e.wgsl
index 9cc973d..c099d46 100644
--- a/test/tint/builtins/gen/var/abs/7faa9e.wgsl
+++ b/test/tint/builtins/gen/var/abs/7faa9e.wgsl
@@ -25,7 +25,9 @@
 fn abs_7faa9e() {
   var arg_0 = vec2<i32>(1i);
   var res: vec2<i32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.dxc.hlsl
index e3d0de9..3c01738 100644
--- a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7faa9e() {
   int2 arg_0 = (1).xx;
   int2 res = abs(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.fxc.hlsl
index e3d0de9..3c01738 100644
--- a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_7faa9e() {
   int2 arg_0 = (1).xx;
   int2 res = abs(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.glsl
index ee15182..08ed773 100644
--- a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void abs_7faa9e() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void abs_7faa9e() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void abs_7faa9e() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.msl
index 94be3da..73b2bcd 100644
--- a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_7faa9e() {
+void abs_7faa9e(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 res = abs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_7faa9e();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  abs_7faa9e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_7faa9e();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  abs_7faa9e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_7faa9e();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  abs_7faa9e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.spvasm
index d9187ec..bf6c2ff 100644
--- a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_7faa9e "abs_7faa9e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_7faa9e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2int %arg_0
-         %20 = OpExtInst %v2int %21 SAbs %22
-               OpStore %res %20
+ %abs_7faa9e = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2int %arg_0
+         %23 = OpExtInst %v2int %24 SAbs %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %31 = OpLoad %v2int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %abs_7faa9e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %abs_7faa9e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_7faa9e
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %abs_7faa9e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %abs_7faa9e
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %abs_7faa9e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.wgsl
index 05f2097..a95c22d 100644
--- a/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/7faa9e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_7faa9e() {
   var arg_0 = vec2<i32>(1i);
   var res : vec2<i32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_7faa9e();
diff --git a/test/tint/builtins/gen/var/abs/82ff9d.wgsl b/test/tint/builtins/gen/var/abs/82ff9d.wgsl
index 60bc479..74e0f67 100644
--- a/test/tint/builtins/gen/var/abs/82ff9d.wgsl
+++ b/test/tint/builtins/gen/var/abs/82ff9d.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = abs(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_82ff9d();
diff --git a/test/tint/builtins/gen/var/abs/8ca9b1.wgsl b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl
index b1fcb7b..92f00cc 100644
--- a/test/tint/builtins/gen/var/abs/8ca9b1.wgsl
+++ b/test/tint/builtins/gen/var/abs/8ca9b1.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1);
   var res = abs(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_8ca9b1();
diff --git a/test/tint/builtins/gen/var/abs/9c80a6.wgsl b/test/tint/builtins/gen/var/abs/9c80a6.wgsl
index 7b2b6d8..58b6b31 100644
--- a/test/tint/builtins/gen/var/abs/9c80a6.wgsl
+++ b/test/tint/builtins/gen/var/abs/9c80a6.wgsl
@@ -25,7 +25,9 @@
 fn abs_9c80a6() {
   var arg_0 = vec4<i32>(1i);
   var res: vec4<i32> = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.dxc.hlsl
index 64b41fc..35a841d 100644
--- a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_9c80a6() {
   int4 arg_0 = (1).xxxx;
   int4 res = abs(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.fxc.hlsl
index 64b41fc..35a841d 100644
--- a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_9c80a6() {
   int4 arg_0 = (1).xxxx;
   int4 res = abs(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.glsl
index 4a05134..52fbdd0 100644
--- a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void abs_9c80a6() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void abs_9c80a6() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void abs_9c80a6() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.msl
index dc91c5e..0bef14b 100644
--- a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_9c80a6() {
+void abs_9c80a6(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 res = abs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_9c80a6();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  abs_9c80a6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_9c80a6();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  abs_9c80a6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_9c80a6();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  abs_9c80a6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.spvasm
index 2948a66..ce723cc 100644
--- a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_9c80a6 "abs_9c80a6"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_9c80a6 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4int %arg_0
-         %20 = OpExtInst %v4int %21 SAbs %22
-               OpStore %res %20
+ %abs_9c80a6 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4int %arg_0
+         %23 = OpExtInst %v4int %24 SAbs %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %31 = OpLoad %v4int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %abs_9c80a6
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %abs_9c80a6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %abs_9c80a6
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %abs_9c80a6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %abs_9c80a6
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %abs_9c80a6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.wgsl
index 5a6bdf0..ad2db4a 100644
--- a/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/9c80a6.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_9c80a6() {
   var arg_0 = vec4<i32>(1i);
   var res : vec4<i32> = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_9c80a6();
diff --git a/test/tint/builtins/gen/var/abs/aedb6d.wgsl b/test/tint/builtins/gen/var/abs/aedb6d.wgsl
index 3d332c2..3d1f9f7 100644
--- a/test/tint/builtins/gen/var/abs/aedb6d.wgsl
+++ b/test/tint/builtins/gen/var/abs/aedb6d.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = abs(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_aedb6d();
diff --git a/test/tint/builtins/gen/var/abs/b96037.wgsl b/test/tint/builtins/gen/var/abs/b96037.wgsl
index 88b177d..8fa5427 100644
--- a/test/tint/builtins/gen/var/abs/b96037.wgsl
+++ b/test/tint/builtins/gen/var/abs/b96037.wgsl
@@ -25,7 +25,9 @@
 fn abs_b96037() {
   var arg_0 = 1.f;
   var res: f32 = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.dxc.hlsl
index b19d55f..f6b23fe 100644
--- a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_b96037() {
   float arg_0 = 1.0f;
   float res = abs(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.fxc.hlsl
index b19d55f..f6b23fe 100644
--- a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_b96037() {
   float arg_0 = 1.0f;
   float res = abs(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.glsl
index 0c3a364..37c2cbb 100644
--- a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void abs_b96037() {
   float arg_0 = 1.0f;
   float res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void abs_b96037() {
   float arg_0 = 1.0f;
   float res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void abs_b96037() {
   float arg_0 = 1.0f;
   float res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.msl
index ad39e75..02ef7ac 100644
--- a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_b96037() {
+void abs_b96037(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = fabs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_b96037();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  abs_b96037(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_b96037();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  abs_b96037(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_b96037();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  abs_b96037(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.spvasm
index 419d3a1..091b0dd 100644
--- a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_b96037 "abs_b96037"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
- %abs_b96037 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+ %abs_b96037 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 FAbs %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 FAbs %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %abs_b96037
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %abs_b96037
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %abs_b96037
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %abs_b96037
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_b96037
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_b96037
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.wgsl
index 0c6d5dc..332d523 100644
--- a/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/b96037.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn abs_b96037() {
   var arg_0 = 1.0f;
   var res : f32 = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_b96037();
diff --git a/test/tint/builtins/gen/var/abs/c3321c.wgsl b/test/tint/builtins/gen/var/abs/c3321c.wgsl
index 009e3aa..c395c72 100644
--- a/test/tint/builtins/gen/var/abs/c3321c.wgsl
+++ b/test/tint/builtins/gen/var/abs/c3321c.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1);
   var res = abs(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_c3321c();
diff --git a/test/tint/builtins/gen/var/abs/e28785.wgsl b/test/tint/builtins/gen/var/abs/e28785.wgsl
index 23e125d..2de2a21 100644
--- a/test/tint/builtins/gen/var/abs/e28785.wgsl
+++ b/test/tint/builtins/gen/var/abs/e28785.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = abs(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_e28785();
diff --git a/test/tint/builtins/gen/var/abs/fd247f.wgsl b/test/tint/builtins/gen/var/abs/fd247f.wgsl
index eddb271..310afbe 100644
--- a/test/tint/builtins/gen/var/abs/fd247f.wgsl
+++ b/test/tint/builtins/gen/var/abs/fd247f.wgsl
@@ -27,7 +27,9 @@
 fn abs_fd247f() {
   var arg_0 = 1.h;
   var res: f16 = abs(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.dxc.hlsl
index b5f616a..8032a82 100644
--- a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_fd247f() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = abs(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.fxc.hlsl
index 300c017..70c1c47 100644
--- a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void abs_fd247f() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = abs(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.glsl b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.glsl
index 2310d41..2f42b39 100644
--- a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void abs_fd247f() {
   float16_t arg_0 = 1.0hf;
   float16_t res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void abs_fd247f() {
   float16_t arg_0 = 1.0hf;
   float16_t res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void abs_fd247f() {
   float16_t arg_0 = 1.0hf;
   float16_t res = abs(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.msl b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.msl
index 41c1bdc..c8d63da 100644
--- a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void abs_fd247f() {
+void abs_fd247f(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = fabs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  abs_fd247f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  abs_fd247f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  abs_fd247f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  abs_fd247f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  abs_fd247f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  abs_fd247f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.spvasm
index 20cfa7c..233b91a 100644
--- a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %abs_fd247f "abs_fd247f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %abs_fd247f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %abs_fd247f = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 FAbs %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 FAbs %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %abs_fd247f
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %abs_fd247f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %abs_fd247f
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %abs_fd247f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %abs_fd247f
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %abs_fd247f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.wgsl
index 0bf843a..bf7a50e 100644
--- a/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/abs/fd247f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn abs_fd247f() {
   var arg_0 = 1.0h;
   var res : f16 = abs(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   abs_fd247f();
diff --git a/test/tint/builtins/gen/var/acos/004aff.wgsl b/test/tint/builtins/gen/var/acos/004aff.wgsl
index a9301ff..61f0054 100644
--- a/test/tint/builtins/gen/var/acos/004aff.wgsl
+++ b/test/tint/builtins/gen/var/acos/004aff.wgsl
@@ -27,7 +27,9 @@
 fn acos_004aff() {
   var arg_0 = vec2<f16>(0.96891242171h);
   var res: vec2<f16> = acos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.dxc.hlsl
index 069aa4e..b35c23c 100644
--- a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_004aff() {
   vector<float16_t, 2> arg_0 = (float16_t(0.96875h)).xx;
   vector<float16_t, 2> res = acos(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.fxc.hlsl
index a4ea8c8..cf77412 100644
--- a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_004aff() {
   vector<float16_t, 2> arg_0 = (float16_t(0.96875h)).xx;
   vector<float16_t, 2> res = acos(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.glsl b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.glsl
index bfd00d5..4c3430b 100644
--- a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acos_004aff() {
   f16vec2 arg_0 = f16vec2(0.96875hf);
   f16vec2 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acos_004aff() {
   f16vec2 arg_0 = f16vec2(0.96875hf);
   f16vec2 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acos_004aff() {
   f16vec2 arg_0 = f16vec2(0.96875hf);
   f16vec2 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.msl b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.msl
index f4fe636..7d465ac 100644
--- a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_004aff() {
+void acos_004aff(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(0.96875h);
   half2 res = acos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_004aff();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  acos_004aff(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_004aff();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  acos_004aff(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_004aff();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  acos_004aff(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.spvasm
index a76aa23..59ea6f0 100644
--- a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_004aff "acos_004aff"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_fpn1 = OpConstant %half 0x1.fp-1
-         %16 = OpConstantComposite %v2half %half_0x1_fpn1 %half_0x1_fpn1
+         %19 = OpConstantComposite %v2half %half_0x1_fpn1 %half_0x1_fpn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_004aff = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Acos %22
-               OpStore %res %20
+%acos_004aff = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Acos %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %acos_004aff
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %acos_004aff
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %acos_004aff
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %acos_004aff
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %acos_004aff
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %acos_004aff
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.wgsl
index 0c0757f..7a3bf49 100644
--- a/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acos/004aff.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn acos_004aff() {
   var arg_0 = vec2<f16>(0.96875h);
   var res : vec2<f16> = acos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_004aff();
diff --git a/test/tint/builtins/gen/var/acos/069188.wgsl b/test/tint/builtins/gen/var/acos/069188.wgsl
index 1d42feb..5dabc85 100644
--- a/test/tint/builtins/gen/var/acos/069188.wgsl
+++ b/test/tint/builtins/gen/var/acos/069188.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(0.96891242171);
   var res = acos(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_069188();
diff --git a/test/tint/builtins/gen/var/acos/15d35b.wgsl b/test/tint/builtins/gen/var/acos/15d35b.wgsl
index 8337528..4291ad0 100644
--- a/test/tint/builtins/gen/var/acos/15d35b.wgsl
+++ b/test/tint/builtins/gen/var/acos/15d35b.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(0.96891242171);
   var res = acos(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_15d35b();
diff --git a/test/tint/builtins/gen/var/acos/203628.wgsl b/test/tint/builtins/gen/var/acos/203628.wgsl
index 190ed6b..3c4343b 100644
--- a/test/tint/builtins/gen/var/acos/203628.wgsl
+++ b/test/tint/builtins/gen/var/acos/203628.wgsl
@@ -27,7 +27,9 @@
 fn acos_203628() {
   var arg_0 = vec4<f16>(0.96891242171h);
   var res: vec4<f16> = acos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.dxc.hlsl
index 0f78eff..3cfc18b 100644
--- a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_203628() {
   vector<float16_t, 4> arg_0 = (float16_t(0.96875h)).xxxx;
   vector<float16_t, 4> res = acos(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.fxc.hlsl
index f6e45e5..5a87888 100644
--- a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_203628() {
   vector<float16_t, 4> arg_0 = (float16_t(0.96875h)).xxxx;
   vector<float16_t, 4> res = acos(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.glsl b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.glsl
index d02ae5f..b229caf 100644
--- a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acos_203628() {
   f16vec4 arg_0 = f16vec4(0.96875hf);
   f16vec4 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acos_203628() {
   f16vec4 arg_0 = f16vec4(0.96875hf);
   f16vec4 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acos_203628() {
   f16vec4 arg_0 = f16vec4(0.96875hf);
   f16vec4 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.msl b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.msl
index de37dfc..1c27829 100644
--- a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_203628() {
+void acos_203628(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(0.96875h);
   half4 res = acos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_203628();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  acos_203628(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_203628();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  acos_203628(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_203628();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  acos_203628(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.spvasm
index 32f8934..380639a 100644
--- a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_203628 "acos_203628"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_fpn1 = OpConstant %half 0x1.fp-1
-         %16 = OpConstantComposite %v4half %half_0x1_fpn1 %half_0x1_fpn1 %half_0x1_fpn1 %half_0x1_fpn1
+         %19 = OpConstantComposite %v4half %half_0x1_fpn1 %half_0x1_fpn1 %half_0x1_fpn1 %half_0x1_fpn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_203628 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Acos %22
-               OpStore %res %20
+%acos_203628 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Acos %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %acos_203628
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %acos_203628
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %acos_203628
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %acos_203628
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %acos_203628
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %acos_203628
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.wgsl
index 7ae7a2f..203fba1 100644
--- a/test/tint/builtins/gen/var/acos/203628.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acos/203628.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn acos_203628() {
   var arg_0 = vec4<f16>(0.96875h);
   var res : vec4<f16> = acos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_203628();
diff --git a/test/tint/builtins/gen/var/acos/303e3d.wgsl b/test/tint/builtins/gen/var/acos/303e3d.wgsl
index 2ab53bf..d4490df 100644
--- a/test/tint/builtins/gen/var/acos/303e3d.wgsl
+++ b/test/tint/builtins/gen/var/acos/303e3d.wgsl
@@ -27,7 +27,9 @@
 fn acos_303e3d() {
   var arg_0 = 0.96891242171h;
   var res: f16 = acos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.dxc.hlsl
index 109dc17..18c9919 100644
--- a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_303e3d() {
   float16_t arg_0 = float16_t(0.96875h);
   float16_t res = acos(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.fxc.hlsl
index a6fcea8..eee0889 100644
--- a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_303e3d() {
   float16_t arg_0 = float16_t(0.96875h);
   float16_t res = acos(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.glsl b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.glsl
index aec686c..d35159c 100644
--- a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acos_303e3d() {
   float16_t arg_0 = 0.96875hf;
   float16_t res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acos_303e3d() {
   float16_t arg_0 = 0.96875hf;
   float16_t res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acos_303e3d() {
   float16_t arg_0 = 0.96875hf;
   float16_t res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.msl b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.msl
index 7964861..f98cd67 100644
--- a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_303e3d() {
+void acos_303e3d(device half* const tint_symbol_1) {
   half arg_0 = 0.96875h;
   half res = acos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_303e3d();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  acos_303e3d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_303e3d();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  acos_303e3d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_303e3d();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  acos_303e3d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.spvasm
index 4f35f22..69091d8 100644
--- a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_303e3d "acos_303e3d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_fpn1 = OpConstant %half 0x1.fp-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_303e3d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%acos_303e3d = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1_fpn1
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Acos %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Acos %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %acos_303e3d
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %acos_303e3d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %acos_303e3d
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %acos_303e3d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %acos_303e3d
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %acos_303e3d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.wgsl
index 624382b..10956eb 100644
--- a/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acos/303e3d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn acos_303e3d() {
   var arg_0 = 0.96875h;
   var res : f16 = acos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_303e3d();
diff --git a/test/tint/builtins/gen/var/acos/489247.wgsl b/test/tint/builtins/gen/var/acos/489247.wgsl
index 9b79dc0..9876336 100644
--- a/test/tint/builtins/gen/var/acos/489247.wgsl
+++ b/test/tint/builtins/gen/var/acos/489247.wgsl
@@ -25,7 +25,9 @@
 fn acos_489247() {
   var arg_0 = 0.96891242171f;
   var res: f32 = acos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.dxc.hlsl
index 4981ad4..50cbdf8 100644
--- a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_489247() {
   float arg_0 = 0.96891242265701293945f;
   float res = acos(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.fxc.hlsl
index 4981ad4..50cbdf8 100644
--- a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_489247() {
   float arg_0 = 0.96891242265701293945f;
   float res = acos(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.glsl b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.glsl
index a3df677..37715e7 100644
--- a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acos_489247() {
   float arg_0 = 0.96891242265701293945f;
   float res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acos_489247() {
   float arg_0 = 0.96891242265701293945f;
   float res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acos_489247() {
   float arg_0 = 0.96891242265701293945f;
   float res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.msl b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.msl
index 58bb57f..5232df4 100644
--- a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_489247() {
+void acos_489247(device float* const tint_symbol_1) {
   float arg_0 = 0.96891242265701293945f;
   float res = acos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_489247();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  acos_489247(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_489247();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  acos_489247(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_489247();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  acos_489247(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.spvasm
index 50c3f6b..3487257 100644
--- a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_489247 "acos_489247"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_968912423 = OpConstant %float 0.968912423
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_489247 = OpFunction %void None %9
-         %12 = OpLabel
+%acos_489247 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_0_968912423
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Acos %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Acos %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %acos_489247
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %acos_489247
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %acos_489247
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %acos_489247
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acos_489247
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acos_489247
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.wgsl
index f24aa65..3eeb742 100644
--- a/test/tint/builtins/gen/var/acos/489247.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acos/489247.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn acos_489247() {
   var arg_0 = 0.96891242265701293945f;
   var res : f32 = acos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_489247();
diff --git a/test/tint/builtins/gen/var/acos/4dac75.wgsl b/test/tint/builtins/gen/var/acos/4dac75.wgsl
index d2d1a6d..b9cb103 100644
--- a/test/tint/builtins/gen/var/acos/4dac75.wgsl
+++ b/test/tint/builtins/gen/var/acos/4dac75.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(0.96891242171);
   var res = acos(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_4dac75();
diff --git a/test/tint/builtins/gen/var/acos/5e9ad2.wgsl b/test/tint/builtins/gen/var/acos/5e9ad2.wgsl
index fd3125c..228a448 100644
--- a/test/tint/builtins/gen/var/acos/5e9ad2.wgsl
+++ b/test/tint/builtins/gen/var/acos/5e9ad2.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 0.96891242171;
   var res = acos(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_5e9ad2();
diff --git a/test/tint/builtins/gen/var/acos/8e2acf.wgsl b/test/tint/builtins/gen/var/acos/8e2acf.wgsl
index b9c211b..1900bce 100644
--- a/test/tint/builtins/gen/var/acos/8e2acf.wgsl
+++ b/test/tint/builtins/gen/var/acos/8e2acf.wgsl
@@ -25,7 +25,9 @@
 fn acos_8e2acf() {
   var arg_0 = vec4<f32>(0.96891242171f);
   var res: vec4<f32> = acos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.dxc.hlsl
index 132d051..b2cdfd2 100644
--- a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_8e2acf() {
   float4 arg_0 = (0.96891242265701293945f).xxxx;
   float4 res = acos(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.fxc.hlsl
index 132d051..b2cdfd2 100644
--- a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_8e2acf() {
   float4 arg_0 = (0.96891242265701293945f).xxxx;
   float4 res = acos(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.glsl b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.glsl
index e38ef29..a37bcd3 100644
--- a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acos_8e2acf() {
   vec4 arg_0 = vec4(0.96891242265701293945f);
   vec4 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acos_8e2acf() {
   vec4 arg_0 = vec4(0.96891242265701293945f);
   vec4 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acos_8e2acf() {
   vec4 arg_0 = vec4(0.96891242265701293945f);
   vec4 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.msl b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.msl
index cb5678b..2397bcc 100644
--- a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_8e2acf() {
+void acos_8e2acf(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(0.96891242265701293945f);
   float4 res = acos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_8e2acf();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  acos_8e2acf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_8e2acf();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  acos_8e2acf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_8e2acf();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  acos_8e2acf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.spvasm
index 4e788d3..c0959e6 100644
--- a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_8e2acf "acos_8e2acf"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_968912423 = OpConstant %float 0.968912423
-         %14 = OpConstantComposite %v4float %float_0_968912423 %float_0_968912423 %float_0_968912423 %float_0_968912423
+         %17 = OpConstantComposite %v4float %float_0_968912423 %float_0_968912423 %float_0_968912423 %float_0_968912423
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_8e2acf = OpFunction %void None %9
-         %12 = OpLabel
+%acos_8e2acf = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Acos %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Acos %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %acos_8e2acf
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %acos_8e2acf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %acos_8e2acf
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %acos_8e2acf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %acos_8e2acf
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %acos_8e2acf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.wgsl
index 382a167..02d1b67 100644
--- a/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acos/8e2acf.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn acos_8e2acf() {
   var arg_0 = vec4<f32>(0.96891242265701293945f);
   var res : vec4<f32> = acos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_8e2acf();
diff --git a/test/tint/builtins/gen/var/acos/a610c4.wgsl b/test/tint/builtins/gen/var/acos/a610c4.wgsl
index bbab89a..395bbe1 100644
--- a/test/tint/builtins/gen/var/acos/a610c4.wgsl
+++ b/test/tint/builtins/gen/var/acos/a610c4.wgsl
@@ -25,7 +25,9 @@
 fn acos_a610c4() {
   var arg_0 = vec3<f32>(0.96891242171f);
   var res: vec3<f32> = acos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.dxc.hlsl
index f58321b..991d4b0 100644
--- a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_a610c4() {
   float3 arg_0 = (0.96891242265701293945f).xxx;
   float3 res = acos(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.fxc.hlsl
index f58321b..991d4b0 100644
--- a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_a610c4() {
   float3 arg_0 = (0.96891242265701293945f).xxx;
   float3 res = acos(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.glsl b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.glsl
index 8ac0fa0..b0bee1a 100644
--- a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acos_a610c4() {
   vec3 arg_0 = vec3(0.96891242265701293945f);
   vec3 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acos_a610c4() {
   vec3 arg_0 = vec3(0.96891242265701293945f);
   vec3 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acos_a610c4() {
   vec3 arg_0 = vec3(0.96891242265701293945f);
   vec3 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.msl b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.msl
index 1da585a..9b816f0 100644
--- a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_a610c4() {
+void acos_a610c4(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(0.96891242265701293945f);
   float3 res = acos(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_a610c4();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  acos_a610c4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_a610c4();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  acos_a610c4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_a610c4();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  acos_a610c4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.spvasm
index 250b4e3..6fac561 100644
--- a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_a610c4 "acos_a610c4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_968912423 = OpConstant %float 0.968912423
-         %15 = OpConstantComposite %v3float %float_0_968912423 %float_0_968912423 %float_0_968912423
+         %18 = OpConstantComposite %v3float %float_0_968912423 %float_0_968912423 %float_0_968912423
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_a610c4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Acos %21
-               OpStore %res %19
+%acos_a610c4 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Acos %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %acos_a610c4
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %acos_a610c4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acos_a610c4
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acos_a610c4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %acos_a610c4
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %acos_a610c4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.wgsl
index 5407c8f..2b86906 100644
--- a/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acos/a610c4.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn acos_a610c4() {
   var arg_0 = vec3<f32>(0.96891242265701293945f);
   var res : vec3<f32> = acos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_a610c4();
diff --git a/test/tint/builtins/gen/var/acos/dfc915.wgsl b/test/tint/builtins/gen/var/acos/dfc915.wgsl
index cda3b83..27961f2 100644
--- a/test/tint/builtins/gen/var/acos/dfc915.wgsl
+++ b/test/tint/builtins/gen/var/acos/dfc915.wgsl
@@ -25,7 +25,9 @@
 fn acos_dfc915() {
   var arg_0 = vec2<f32>(0.96891242171f);
   var res: vec2<f32> = acos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.dxc.hlsl
index b375306..4a1b371 100644
--- a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_dfc915() {
   float2 arg_0 = (0.96891242265701293945f).xx;
   float2 res = acos(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.fxc.hlsl
index b375306..4a1b371 100644
--- a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_dfc915() {
   float2 arg_0 = (0.96891242265701293945f).xx;
   float2 res = acos(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.glsl b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.glsl
index 3cc6415..32c732e 100644
--- a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acos_dfc915() {
   vec2 arg_0 = vec2(0.96891242265701293945f);
   vec2 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acos_dfc915() {
   vec2 arg_0 = vec2(0.96891242265701293945f);
   vec2 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acos_dfc915() {
   vec2 arg_0 = vec2(0.96891242265701293945f);
   vec2 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.msl b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.msl
index 32e6662..66ff289 100644
--- a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_dfc915() {
+void acos_dfc915(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(0.96891242265701293945f);
   float2 res = acos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_dfc915();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  acos_dfc915(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_dfc915();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  acos_dfc915(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_dfc915();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  acos_dfc915(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.spvasm
index 266b7db..938bbca 100644
--- a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_dfc915 "acos_dfc915"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_968912423 = OpConstant %float 0.968912423
-         %15 = OpConstantComposite %v2float %float_0_968912423 %float_0_968912423
+         %18 = OpConstantComposite %v2float %float_0_968912423 %float_0_968912423
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_dfc915 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Acos %21
-               OpStore %res %19
+%acos_dfc915 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Acos %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %acos_dfc915
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %acos_dfc915
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %acos_dfc915
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %acos_dfc915
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %acos_dfc915
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %acos_dfc915
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.wgsl
index 7af1a8c..6dadce1 100644
--- a/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acos/dfc915.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn acos_dfc915() {
   var arg_0 = vec2<f32>(0.96891242265701293945f);
   var res : vec2<f32> = acos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_dfc915();
diff --git a/test/tint/builtins/gen/var/acos/f47057.wgsl b/test/tint/builtins/gen/var/acos/f47057.wgsl
index cdd663d..10c5ffe 100644
--- a/test/tint/builtins/gen/var/acos/f47057.wgsl
+++ b/test/tint/builtins/gen/var/acos/f47057.wgsl
@@ -27,7 +27,9 @@
 fn acos_f47057() {
   var arg_0 = vec3<f16>(0.96891242171h);
   var res: vec3<f16> = acos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.dxc.hlsl
index 55cf89b..08f8b66 100644
--- a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_f47057() {
   vector<float16_t, 3> arg_0 = (float16_t(0.96875h)).xxx;
   vector<float16_t, 3> res = acos(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.fxc.hlsl
index d7cc816..38c2ae3 100644
--- a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acos_f47057() {
   vector<float16_t, 3> arg_0 = (float16_t(0.96875h)).xxx;
   vector<float16_t, 3> res = acos(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.glsl b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.glsl
index 1081143..2297a63 100644
--- a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acos_f47057() {
   f16vec3 arg_0 = f16vec3(0.96875hf);
   f16vec3 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acos_f47057() {
   f16vec3 arg_0 = f16vec3(0.96875hf);
   f16vec3 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acos_f47057() {
   f16vec3 arg_0 = f16vec3(0.96875hf);
   f16vec3 res = acos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.msl b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.msl
index f04f96e..db94a33 100644
--- a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void acos_f47057() {
+void acos_f47057(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(0.96875h);
   half3 res = acos(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acos_f47057();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  acos_f47057(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acos_f47057();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  acos_f47057(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acos_f47057();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  acos_f47057(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.spvasm
index e36b728..1ae5f44 100644
--- a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %acos_f47057 "acos_f47057"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_fpn1 = OpConstant %half 0x1.fp-1
-         %16 = OpConstantComposite %v3half %half_0x1_fpn1 %half_0x1_fpn1 %half_0x1_fpn1
+         %19 = OpConstantComposite %v3half %half_0x1_fpn1 %half_0x1_fpn1 %half_0x1_fpn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%acos_f47057 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Acos %22
-               OpStore %res %20
+%acos_f47057 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Acos %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %acos_f47057
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %acos_f47057
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %acos_f47057
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %acos_f47057
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %acos_f47057
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %acos_f47057
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.wgsl
index 06677ee..0865720 100644
--- a/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acos/f47057.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn acos_f47057() {
   var arg_0 = vec3<f16>(0.96875h);
   var res : vec3<f16> = acos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acos_f47057();
diff --git a/test/tint/builtins/gen/var/acosh/17260e.wgsl b/test/tint/builtins/gen/var/acosh/17260e.wgsl
index af65dcc..b68d91a 100644
--- a/test/tint/builtins/gen/var/acosh/17260e.wgsl
+++ b/test/tint/builtins/gen/var/acosh/17260e.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.5430806348);
   var res = acosh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_17260e();
diff --git a/test/tint/builtins/gen/var/acosh/3433e8.wgsl b/test/tint/builtins/gen/var/acosh/3433e8.wgsl
index e288842..fe3d0a6 100644
--- a/test/tint/builtins/gen/var/acosh/3433e8.wgsl
+++ b/test/tint/builtins/gen/var/acosh/3433e8.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.5430806348;
   var res = acosh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_3433e8();
diff --git a/test/tint/builtins/gen/var/acosh/490aae.wgsl b/test/tint/builtins/gen/var/acosh/490aae.wgsl
index 5217c72..59a26c2 100644
--- a/test/tint/builtins/gen/var/acosh/490aae.wgsl
+++ b/test/tint/builtins/gen/var/acosh/490aae.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.5430806348);
   var res = acosh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_490aae();
diff --git a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl
index 8d46b27..e878484 100644
--- a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl
+++ b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl
@@ -27,7 +27,9 @@
 fn acosh_5f49d8() {
   var arg_0 = vec2<f16>(1.5430806348h);
   var res: vec2<f16> = acosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.dxc.hlsl
index 9969e1b..c7b45bf 100644
--- a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_5f49d8() {
   vector<float16_t, 2> arg_0 = (float16_t(1.54296875h)).xx;
   vector<float16_t, 2> res = tint_acosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.fxc.hlsl
index 023b959..e184be3 100644
--- a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return log((x + sqrt(((x * x) - float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_5f49d8() {
-  vector<float16_t, 2> arg_0 = (float16_t(2.0h)).xx;
+  vector<float16_t, 2> arg_0 = (float16_t(1.54296875h)).xx;
   vector<float16_t, 2> res = tint_acosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.glsl b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.glsl
index 296064f..d27deec 100644
--- a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return mix(acosh(x), f16vec2(0.0hf), lessThan(x, f16vec2(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acosh_5f49d8() {
   f16vec2 arg_0 = f16vec2(1.54296875hf);
   f16vec2 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return mix(acosh(x), f16vec2(0.0hf), lessThan(x, f16vec2(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acosh_5f49d8() {
   f16vec2 arg_0 = f16vec2(1.54296875hf);
   f16vec2 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return mix(acosh(x), f16vec2(0.0hf), lessThan(x, f16vec2(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void acosh_5f49d8() {
   f16vec2 arg_0 = f16vec2(1.54296875hf);
   f16vec2 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.msl b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.msl
index 27b4676..43f158e 100644
--- a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(acosh(x), half2(0.0h), (x < half2(1.0h)));
 }
 
-void acosh_5f49d8() {
+void acosh_5f49d8(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.54296875h);
   half2 res = tint_acosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_5f49d8();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  acosh_5f49d8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_5f49d8();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  acosh_5f49d8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_5f49d8();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  acosh_5f49d8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.spvasm
index 11249cb..526e01d 100644
--- a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_acosh "tint_acosh"
                OpName %x "x"
                OpName %acosh_5f49d8 "acosh_5f49d8"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,56 +45,65 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-          %9 = OpTypeFunction %v2half %v2half
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2half %v2half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
-         %21 = OpConstantNull %v2half
+         %24 = OpConstantNull %v2half
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
 %half_0x1_8bp_0 = OpConstant %half 0x1.8bp+0
-         %29 = OpConstantComposite %v2half %half_0x1_8bp_0 %half_0x1_8bp_0
+         %32 = OpConstantComposite %v2half %half_0x1_8bp_0 %half_0x1_8bp_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %35 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_acosh = OpFunction %v2half None %9
+ %tint_acosh = OpFunction %v2half None %14
           %x = OpFunctionParameter %v2half
-         %14 = OpLabel
-         %18 = OpFOrdLessThan %v2bool %x %17
-         %22 = OpExtInst %v2half %23 Acosh %x
-         %15 = OpSelect %v2half %18 %21 %22
-               OpReturnValue %15
+         %17 = OpLabel
+         %21 = OpFOrdLessThan %v2bool %x %20
+         %25 = OpExtInst %v2half %26 Acosh %x
+         %18 = OpSelect %v2half %21 %24 %25
+               OpReturnValue %18
                OpFunctionEnd
-%acosh_5f49d8 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %21
-        %res = OpVariable %_ptr_Function_v2half Function %21
-               OpStore %arg_0 %29
-         %33 = OpLoad %v2half %arg_0
-         %32 = OpFunctionCall %v2half %tint_acosh %33
-               OpStore %res %32
+%acosh_5f49d8 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %24
+        %res = OpVariable %_ptr_Function_v2half Function %24
+               OpStore %arg_0 %32
+         %36 = OpLoad %v2half %arg_0
+         %35 = OpFunctionCall %v2half %tint_acosh %36
+               OpStore %res %35
+         %41 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %42 = OpLoad %v2half %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %acosh_5f49d8
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %acosh_5f49d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %27
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %acosh_5f49d8
+%fragment_main = OpFunction %void None %27
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %acosh_5f49d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %acosh_5f49d8
+%compute_main = OpFunction %void None %27
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %acosh_5f49d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.wgsl
index 8643906..fdaffeb 100644
--- a/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acosh/5f49d8.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn acosh_5f49d8() {
   var arg_0 = vec2<f16>(1.54296875h);
   var res : vec2<f16> = acosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_5f49d8();
diff --git a/test/tint/builtins/gen/var/acosh/640883.wgsl b/test/tint/builtins/gen/var/acosh/640883.wgsl
index 8f82ed6..d95c3c4 100644
--- a/test/tint/builtins/gen/var/acosh/640883.wgsl
+++ b/test/tint/builtins/gen/var/acosh/640883.wgsl
@@ -25,7 +25,9 @@
 fn acosh_640883() {
   var arg_0 = vec2<f32>(1.5430806348f);
   var res: vec2<f32> = acosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.dxc.hlsl
index 7cfdb66..595bd77 100644
--- a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_640883() {
   float2 arg_0 = (1.54308068752288818359f).xx;
   float2 res = tint_acosh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.fxc.hlsl
index 7cfdb66..595bd77 100644
--- a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_640883() {
   float2 arg_0 = (1.54308068752288818359f).xx;
   float2 res = tint_acosh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.glsl b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.glsl
index 106661e..3d6f927 100644
--- a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acosh_640883() {
   vec2 arg_0 = vec2(1.54308068752288818359f);
   vec2 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acosh_640883() {
   vec2 arg_0 = vec2(1.54308068752288818359f);
   vec2 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return mix(acosh(x), vec2(0.0f), lessThan(x, vec2(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void acosh_640883() {
   vec2 arg_0 = vec2(1.54308068752288818359f);
   vec2 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.msl b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.msl
index a91bd46..62f8cac 100644
--- a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(acosh(x), float2(0.0f), (x < float2(1.0f)));
 }
 
-void acosh_640883() {
+void acosh_640883(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.54308068752288818359f);
   float2 res = tint_acosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_640883();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  acosh_640883(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_640883();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  acosh_640883(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_640883();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  acosh_640883(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.spvasm
index 35311c8..3b6600a 100644
--- a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_acosh "tint_acosh"
                OpName %x "x"
                OpName %acosh_640883 "acosh_640883"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,55 +40,64 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
     %v2float = OpTypeVector %float 2
-          %9 = OpTypeFunction %v2float %v2float
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %v2float %v2float
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %19 = OpConstantComposite %v2float %float_1 %float_1
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
-         %20 = OpConstantNull %v2float
+         %23 = OpConstantNull %v2float
        %void = OpTypeVoid
-         %23 = OpTypeFunction %void
+         %26 = OpTypeFunction %void
 %float_1_54308069 = OpConstant %float 1.54308069
-         %28 = OpConstantComposite %v2float %float_1_54308069 %float_1_54308069
+         %31 = OpConstantComposite %v2float %float_1_54308069 %float_1_54308069
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %34 = OpTypeFunction %v4float
- %tint_acosh = OpFunction %v2float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %42 = OpTypeFunction %v4float
+ %tint_acosh = OpFunction %v2float None %13
           %x = OpFunctionParameter %v2float
-         %13 = OpLabel
-         %17 = OpFOrdLessThan %v2bool %x %16
-         %21 = OpExtInst %v2float %22 Acosh %x
-         %14 = OpSelect %v2float %17 %20 %21
-               OpReturnValue %14
+         %16 = OpLabel
+         %20 = OpFOrdLessThan %v2bool %x %19
+         %24 = OpExtInst %v2float %25 Acosh %x
+         %17 = OpSelect %v2float %20 %23 %24
+               OpReturnValue %17
                OpFunctionEnd
-%acosh_640883 = OpFunction %void None %23
-         %26 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %20
-        %res = OpVariable %_ptr_Function_v2float Function %20
-               OpStore %arg_0 %28
-         %32 = OpLoad %v2float %arg_0
-         %31 = OpFunctionCall %v2float %tint_acosh %32
-               OpStore %res %31
+%acosh_640883 = OpFunction %void None %26
+         %29 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %23
+        %res = OpVariable %_ptr_Function_v2float Function %23
+               OpStore %arg_0 %31
+         %35 = OpLoad %v2float %arg_0
+         %34 = OpFunctionCall %v2float %tint_acosh %35
+               OpStore %res %34
+         %40 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %41 = OpLoad %v2float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %acosh_640883
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %acosh_640883
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %23
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %26
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %23
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %acosh_640883
+%fragment_main = OpFunction %void None %26
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %acosh_640883
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %23
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %acosh_640883
+%compute_main = OpFunction %void None %26
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %acosh_640883
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.wgsl
index 78d4db8..22a4f2b 100644
--- a/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acosh/640883.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn acosh_640883() {
   var arg_0 = vec2<f32>(1.54308068752288818359f);
   var res : vec2<f32> = acosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_640883();
diff --git a/test/tint/builtins/gen/var/acosh/9f213e.wgsl b/test/tint/builtins/gen/var/acosh/9f213e.wgsl
index c37498c..420fac0 100644
--- a/test/tint/builtins/gen/var/acosh/9f213e.wgsl
+++ b/test/tint/builtins/gen/var/acosh/9f213e.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.5430806348);
   var res = acosh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_9f213e();
diff --git a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl
index 8c9057b..6bba46f 100644
--- a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl
+++ b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl
@@ -27,7 +27,9 @@
 fn acosh_a37dfe() {
   var arg_0 = 1.5430806348h;
   var res: f16 = acosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.dxc.hlsl
index ad9ca5b..fcf0bcf 100644
--- a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_a37dfe() {
   float16_t arg_0 = float16_t(1.54296875h);
   float16_t res = tint_acosh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.fxc.hlsl
index 43096d5..52fdae1 100644
--- a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return log((x + sqrt(((x * x) - float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_a37dfe() {
-  float16_t arg_0 = float16_t(2.0h);
+  float16_t arg_0 = float16_t(1.54296875h);
   float16_t res = tint_acosh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.glsl b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.glsl
index 67bcd2f..4dc597b 100644
--- a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return ((x < 1.0hf) ? 0.0hf : acosh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acosh_a37dfe() {
   float16_t arg_0 = 1.54296875hf;
   float16_t res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return ((x < 1.0hf) ? 0.0hf : acosh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acosh_a37dfe() {
   float16_t arg_0 = 1.54296875hf;
   float16_t res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return ((x < 1.0hf) ? 0.0hf : acosh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void acosh_a37dfe() {
   float16_t arg_0 = 1.54296875hf;
   float16_t res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.msl b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.msl
index f1fe88c..35c7476 100644
--- a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(acosh(x), 0.0h, (x < 1.0h));
 }
 
-void acosh_a37dfe() {
+void acosh_a37dfe(device half* const tint_symbol_1) {
   half arg_0 = 1.54296875h;
   half res = tint_acosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_a37dfe();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  acosh_a37dfe(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_a37dfe();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  acosh_a37dfe(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_a37dfe();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  acosh_a37dfe(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.spvasm
index eb82699..0b1e630 100644
--- a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_acosh "tint_acosh"
                OpName %x "x"
                OpName %acosh_a37dfe "acosh_a37dfe"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,53 +44,62 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
-          %9 = OpTypeFunction %half %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %half %half
 %half_0x1p_0 = OpConstant %half 0x1p+0
        %bool = OpTypeBool
-         %18 = OpConstantNull %half
+         %21 = OpConstantNull %half
        %void = OpTypeVoid
-         %21 = OpTypeFunction %void
+         %24 = OpTypeFunction %void
 %half_0x1_8bp_0 = OpConstant %half 0x1.8bp+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %31 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_acosh = OpFunction %half None %9
+ %tint_acosh = OpFunction %half None %13
           %x = OpFunctionParameter %half
-         %13 = OpLabel
-         %16 = OpFOrdLessThan %bool %x %half_0x1p_0
-         %19 = OpExtInst %half %20 Acosh %x
-         %14 = OpSelect %half %16 %18 %19
-               OpReturnValue %14
+         %16 = OpLabel
+         %19 = OpFOrdLessThan %bool %x %half_0x1p_0
+         %22 = OpExtInst %half %23 Acosh %x
+         %17 = OpSelect %half %19 %21 %22
+               OpReturnValue %17
                OpFunctionEnd
-%acosh_a37dfe = OpFunction %void None %21
-         %24 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %18
-        %res = OpVariable %_ptr_Function_half Function %18
+%acosh_a37dfe = OpFunction %void None %24
+         %27 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %21
+        %res = OpVariable %_ptr_Function_half Function %21
                OpStore %arg_0 %half_0x1_8bp_0
-         %29 = OpLoad %half %arg_0
-         %28 = OpFunctionCall %half %tint_acosh %29
-               OpStore %res %28
+         %32 = OpLoad %half %arg_0
+         %31 = OpFunctionCall %half %tint_acosh %32
+               OpStore %res %31
+         %37 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %38 = OpLoad %half %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %acosh_a37dfe
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %acosh_a37dfe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %21
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %24
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %21
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %acosh_a37dfe
+%fragment_main = OpFunction %void None %24
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %acosh_a37dfe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %21
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %acosh_a37dfe
+%compute_main = OpFunction %void None %24
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %acosh_a37dfe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.wgsl
index d826a72..d269a52 100644
--- a/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acosh/a37dfe.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn acosh_a37dfe() {
   var arg_0 = 1.54296875h;
   var res : f16 = acosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_a37dfe();
diff --git a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl
index efa3b30..4057518 100644
--- a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl
+++ b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl
@@ -25,7 +25,9 @@
 fn acosh_d51ccb() {
   var arg_0 = vec4<f32>(1.5430806348f);
   var res: vec4<f32> = acosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.dxc.hlsl
index ed07389..7348b46 100644
--- a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_d51ccb() {
   float4 arg_0 = (1.54308068752288818359f).xxxx;
   float4 res = tint_acosh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.fxc.hlsl
index ed07389..7348b46 100644
--- a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_d51ccb() {
   float4 arg_0 = (1.54308068752288818359f).xxxx;
   float4 res = tint_acosh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.glsl b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.glsl
index c9981d6..51cf439 100644
--- a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acosh_d51ccb() {
   vec4 arg_0 = vec4(1.54308068752288818359f);
   vec4 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acosh_d51ccb() {
   vec4 arg_0 = vec4(1.54308068752288818359f);
   vec4 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return mix(acosh(x), vec4(0.0f), lessThan(x, vec4(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void acosh_d51ccb() {
   vec4 arg_0 = vec4(1.54308068752288818359f);
   vec4 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.msl b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.msl
index 74fc9cf..e695138 100644
--- a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(acosh(x), float4(0.0f), (x < float4(1.0f)));
 }
 
-void acosh_d51ccb() {
+void acosh_d51ccb(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.54308068752288818359f);
   float4 res = tint_acosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_d51ccb();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  acosh_d51ccb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_d51ccb();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  acosh_d51ccb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_d51ccb();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  acosh_d51ccb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.spvasm
index 711d3b4..faaa599 100644
--- a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_acosh "tint_acosh"
                OpName %x "x"
                OpName %acosh_d51ccb "acosh_d51ccb"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,54 +39,63 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-          %9 = OpTypeFunction %v4float %v4float
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %12 = OpTypeFunction %v4float %v4float
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %void = OpTypeVoid
-         %21 = OpTypeFunction %void
+         %24 = OpTypeFunction %void
 %float_1_54308069 = OpConstant %float 1.54308069
-         %26 = OpConstantComposite %v4float %float_1_54308069 %float_1_54308069 %float_1_54308069 %float_1_54308069
+         %29 = OpConstantComposite %v4float %float_1_54308069 %float_1_54308069 %float_1_54308069 %float_1_54308069
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
- %tint_acosh = OpFunction %v4float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %40 = OpTypeFunction %v4float
+ %tint_acosh = OpFunction %v4float None %12
           %x = OpFunctionParameter %v4float
-         %12 = OpLabel
-         %16 = OpFOrdLessThan %v4bool %x %15
-         %19 = OpExtInst %v4float %20 Acosh %x
-         %13 = OpSelect %v4float %16 %5 %19
-               OpReturnValue %13
+         %15 = OpLabel
+         %19 = OpFOrdLessThan %v4bool %x %18
+         %22 = OpExtInst %v4float %23 Acosh %x
+         %16 = OpSelect %v4float %19 %5 %22
+               OpReturnValue %16
                OpFunctionEnd
-%acosh_d51ccb = OpFunction %void None %21
-         %24 = OpLabel
+%acosh_d51ccb = OpFunction %void None %24
+         %27 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %26
-         %30 = OpLoad %v4float %arg_0
-         %29 = OpFunctionCall %v4float %tint_acosh %30
-               OpStore %res %29
+               OpStore %arg_0 %29
+         %33 = OpLoad %v4float %arg_0
+         %32 = OpFunctionCall %v4float %tint_acosh %33
+               OpStore %res %32
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %acosh_d51ccb
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %acosh_d51ccb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %21
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %24
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %21
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %acosh_d51ccb
+%fragment_main = OpFunction %void None %24
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %acosh_d51ccb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %21
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %acosh_d51ccb
+%compute_main = OpFunction %void None %24
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %acosh_d51ccb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.wgsl
index 3807b09..80669f6 100644
--- a/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acosh/d51ccb.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn acosh_d51ccb() {
   var arg_0 = vec4<f32>(1.54308068752288818359f);
   var res : vec4<f32> = acosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_d51ccb();
diff --git a/test/tint/builtins/gen/var/acosh/de60d8.wgsl b/test/tint/builtins/gen/var/acosh/de60d8.wgsl
index 9586527..217942f 100644
--- a/test/tint/builtins/gen/var/acosh/de60d8.wgsl
+++ b/test/tint/builtins/gen/var/acosh/de60d8.wgsl
@@ -27,7 +27,9 @@
 fn acosh_de60d8() {
   var arg_0 = vec4<f16>(1.5430806348h);
   var res: vec4<f16> = acosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.dxc.hlsl
index 4e81214..db33e78 100644
--- a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_de60d8() {
   vector<float16_t, 4> arg_0 = (float16_t(1.54296875h)).xxxx;
   vector<float16_t, 4> res = tint_acosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.fxc.hlsl
index fc793ed..248a0d6 100644
--- a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return log((x + sqrt(((x * x) - float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_de60d8() {
-  vector<float16_t, 4> arg_0 = (float16_t(2.0h)).xxxx;
+  vector<float16_t, 4> arg_0 = (float16_t(1.54296875h)).xxxx;
   vector<float16_t, 4> res = tint_acosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.glsl b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.glsl
index 51ccc00..711447d 100644
--- a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return mix(acosh(x), f16vec4(0.0hf), lessThan(x, f16vec4(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acosh_de60d8() {
   f16vec4 arg_0 = f16vec4(1.54296875hf);
   f16vec4 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return mix(acosh(x), f16vec4(0.0hf), lessThan(x, f16vec4(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acosh_de60d8() {
   f16vec4 arg_0 = f16vec4(1.54296875hf);
   f16vec4 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return mix(acosh(x), f16vec4(0.0hf), lessThan(x, f16vec4(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void acosh_de60d8() {
   f16vec4 arg_0 = f16vec4(1.54296875hf);
   f16vec4 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.msl b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.msl
index 175621f..8d33ac2 100644
--- a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(acosh(x), half4(0.0h), (x < half4(1.0h)));
 }
 
-void acosh_de60d8() {
+void acosh_de60d8(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.54296875h);
   half4 res = tint_acosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_de60d8();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  acosh_de60d8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_de60d8();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  acosh_de60d8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_de60d8();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  acosh_de60d8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.spvasm
index 24431be..e3c7646 100644
--- a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_acosh "tint_acosh"
                OpName %x "x"
                OpName %acosh_de60d8 "acosh_de60d8"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,56 +45,65 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-          %9 = OpTypeFunction %v4half %v4half
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4half %v4half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
-         %21 = OpConstantNull %v4half
+         %24 = OpConstantNull %v4half
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
 %half_0x1_8bp_0 = OpConstant %half 0x1.8bp+0
-         %29 = OpConstantComposite %v4half %half_0x1_8bp_0 %half_0x1_8bp_0 %half_0x1_8bp_0 %half_0x1_8bp_0
+         %32 = OpConstantComposite %v4half %half_0x1_8bp_0 %half_0x1_8bp_0 %half_0x1_8bp_0 %half_0x1_8bp_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %35 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_acosh = OpFunction %v4half None %9
+ %tint_acosh = OpFunction %v4half None %14
           %x = OpFunctionParameter %v4half
-         %14 = OpLabel
-         %18 = OpFOrdLessThan %v4bool %x %17
-         %22 = OpExtInst %v4half %23 Acosh %x
-         %15 = OpSelect %v4half %18 %21 %22
-               OpReturnValue %15
+         %17 = OpLabel
+         %21 = OpFOrdLessThan %v4bool %x %20
+         %25 = OpExtInst %v4half %26 Acosh %x
+         %18 = OpSelect %v4half %21 %24 %25
+               OpReturnValue %18
                OpFunctionEnd
-%acosh_de60d8 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %21
-        %res = OpVariable %_ptr_Function_v4half Function %21
-               OpStore %arg_0 %29
-         %33 = OpLoad %v4half %arg_0
-         %32 = OpFunctionCall %v4half %tint_acosh %33
-               OpStore %res %32
+%acosh_de60d8 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %24
+        %res = OpVariable %_ptr_Function_v4half Function %24
+               OpStore %arg_0 %32
+         %36 = OpLoad %v4half %arg_0
+         %35 = OpFunctionCall %v4half %tint_acosh %36
+               OpStore %res %35
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %42 = OpLoad %v4half %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %acosh_de60d8
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %acosh_de60d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %27
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %acosh_de60d8
+%fragment_main = OpFunction %void None %27
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %acosh_de60d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %acosh_de60d8
+%compute_main = OpFunction %void None %27
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %acosh_de60d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.wgsl
index d281060..eddb91e 100644
--- a/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acosh/de60d8.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn acosh_de60d8() {
   var arg_0 = vec4<f16>(1.54296875h);
   var res : vec4<f16> = acosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_de60d8();
diff --git a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl
index 5f0312e..58fb5b4 100644
--- a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl
+++ b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl
@@ -25,7 +25,9 @@
 fn acosh_e38f5c() {
   var arg_0 = vec3<f32>(1.5430806348f);
   var res: vec3<f32> = acosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.dxc.hlsl
index be4b540..173fcc0 100644
--- a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_e38f5c() {
   float3 arg_0 = (1.54308068752288818359f).xxx;
   float3 res = tint_acosh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.fxc.hlsl
index be4b540..173fcc0 100644
--- a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_e38f5c() {
   float3 arg_0 = (1.54308068752288818359f).xxx;
   float3 res = tint_acosh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.glsl b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.glsl
index ec99a2d..fdf33f8 100644
--- a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acosh_e38f5c() {
   vec3 arg_0 = vec3(1.54308068752288818359f);
   vec3 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acosh_e38f5c() {
   vec3 arg_0 = vec3(1.54308068752288818359f);
   vec3 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return mix(acosh(x), vec3(0.0f), lessThan(x, vec3(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void acosh_e38f5c() {
   vec3 arg_0 = vec3(1.54308068752288818359f);
   vec3 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.msl b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.msl
index f31abf1..4554a60 100644
--- a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(acosh(x), float3(0.0f), (x < float3(1.0f)));
 }
 
-void acosh_e38f5c() {
+void acosh_e38f5c(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.54308068752288818359f);
   float3 res = tint_acosh(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_e38f5c();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  acosh_e38f5c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_e38f5c();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  acosh_e38f5c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_e38f5c();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  acosh_e38f5c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.spvasm
index ece41d9..2c85c14 100644
--- a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_acosh "tint_acosh"
                OpName %x "x"
                OpName %acosh_e38f5c "acosh_e38f5c"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,55 +40,64 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
     %v3float = OpTypeVector %float 3
-          %9 = OpTypeFunction %v3float %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %v3float %v3float
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %19 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
-         %20 = OpConstantNull %v3float
+         %23 = OpConstantNull %v3float
        %void = OpTypeVoid
-         %23 = OpTypeFunction %void
+         %26 = OpTypeFunction %void
 %float_1_54308069 = OpConstant %float 1.54308069
-         %28 = OpConstantComposite %v3float %float_1_54308069 %float_1_54308069 %float_1_54308069
+         %31 = OpConstantComposite %v3float %float_1_54308069 %float_1_54308069 %float_1_54308069
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %34 = OpTypeFunction %v4float
- %tint_acosh = OpFunction %v3float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %42 = OpTypeFunction %v4float
+ %tint_acosh = OpFunction %v3float None %13
           %x = OpFunctionParameter %v3float
-         %13 = OpLabel
-         %17 = OpFOrdLessThan %v3bool %x %16
-         %21 = OpExtInst %v3float %22 Acosh %x
-         %14 = OpSelect %v3float %17 %20 %21
-               OpReturnValue %14
+         %16 = OpLabel
+         %20 = OpFOrdLessThan %v3bool %x %19
+         %24 = OpExtInst %v3float %25 Acosh %x
+         %17 = OpSelect %v3float %20 %23 %24
+               OpReturnValue %17
                OpFunctionEnd
-%acosh_e38f5c = OpFunction %void None %23
-         %26 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %20
-        %res = OpVariable %_ptr_Function_v3float Function %20
-               OpStore %arg_0 %28
-         %32 = OpLoad %v3float %arg_0
-         %31 = OpFunctionCall %v3float %tint_acosh %32
-               OpStore %res %31
+%acosh_e38f5c = OpFunction %void None %26
+         %29 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %23
+        %res = OpVariable %_ptr_Function_v3float Function %23
+               OpStore %arg_0 %31
+         %35 = OpLoad %v3float %arg_0
+         %34 = OpFunctionCall %v3float %tint_acosh %35
+               OpStore %res %34
+         %40 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %41 = OpLoad %v3float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %acosh_e38f5c
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %acosh_e38f5c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %23
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %26
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %23
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %acosh_e38f5c
+%fragment_main = OpFunction %void None %26
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %acosh_e38f5c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %23
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %acosh_e38f5c
+%compute_main = OpFunction %void None %26
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %acosh_e38f5c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.wgsl
index 3be489e..3026fbe0 100644
--- a/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acosh/e38f5c.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn acosh_e38f5c() {
   var arg_0 = vec3<f32>(1.54308068752288818359f);
   var res : vec3<f32> = acosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_e38f5c();
diff --git a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl
index 47c2385..a46afb6 100644
--- a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl
+++ b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl
@@ -25,7 +25,9 @@
 fn acosh_ecf2d1() {
   var arg_0 = 1.5430806348f;
   var res: f32 = acosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.dxc.hlsl
index 548d620..088e79a 100644
--- a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_ecf2d1() {
   float arg_0 = 1.54308068752288818359f;
   float res = tint_acosh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.fxc.hlsl
index 548d620..088e79a 100644
--- a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_ecf2d1() {
   float arg_0 = 1.54308068752288818359f;
   float res = tint_acosh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.glsl b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.glsl
index df6d4ca..3ae9f059 100644
--- a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return ((x < 1.0f) ? 0.0f : acosh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acosh_ecf2d1() {
   float arg_0 = 1.54308068752288818359f;
   float res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return ((x < 1.0f) ? 0.0f : acosh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acosh_ecf2d1() {
   float arg_0 = 1.54308068752288818359f;
   float res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return ((x < 1.0f) ? 0.0f : acosh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void acosh_ecf2d1() {
   float arg_0 = 1.54308068752288818359f;
   float res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.msl b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.msl
index 356e2e2..5b72b08 100644
--- a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(acosh(x), 0.0f, (x < 1.0f));
 }
 
-void acosh_ecf2d1() {
+void acosh_ecf2d1(device float* const tint_symbol_1) {
   float arg_0 = 1.54308068752288818359f;
   float res = tint_acosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_ecf2d1();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  acosh_ecf2d1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_ecf2d1();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  acosh_ecf2d1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_ecf2d1();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  acosh_ecf2d1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.spvasm
index fc38b3b..dc5b4a2 100644
--- a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_acosh "tint_acosh"
                OpName %x "x"
                OpName %acosh_ecf2d1 "acosh_ecf2d1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,51 +39,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-          %9 = OpTypeFunction %float %float
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %12 = OpTypeFunction %float %float
     %float_1 = OpConstant %float 1
        %bool = OpTypeBool
        %void = OpTypeVoid
-         %19 = OpTypeFunction %void
+         %22 = OpTypeFunction %void
 %float_1_54308069 = OpConstant %float 1.54308069
 %_ptr_Function_float = OpTypePointer Function %float
-         %29 = OpTypeFunction %v4float
- %tint_acosh = OpFunction %float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %37 = OpTypeFunction %v4float
+ %tint_acosh = OpFunction %float None %12
           %x = OpFunctionParameter %float
-         %12 = OpLabel
-         %15 = OpFOrdLessThan %bool %x %float_1
-         %17 = OpExtInst %float %18 Acosh %x
-         %13 = OpSelect %float %15 %8 %17
-               OpReturnValue %13
+         %15 = OpLabel
+         %18 = OpFOrdLessThan %bool %x %float_1
+         %20 = OpExtInst %float %21 Acosh %x
+         %16 = OpSelect %float %18 %8 %20
+               OpReturnValue %16
                OpFunctionEnd
-%acosh_ecf2d1 = OpFunction %void None %19
-         %22 = OpLabel
+%acosh_ecf2d1 = OpFunction %void None %22
+         %25 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1_54308069
-         %27 = OpLoad %float %arg_0
-         %26 = OpFunctionCall %float %tint_acosh %27
-               OpStore %res %26
+         %30 = OpLoad %float %arg_0
+         %29 = OpFunctionCall %float %tint_acosh %30
+               OpStore %res %29
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %acosh_ecf2d1
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %acosh_ecf2d1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %19
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %22
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %19
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %acosh_ecf2d1
+%fragment_main = OpFunction %void None %22
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %acosh_ecf2d1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %19
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %acosh_ecf2d1
+%compute_main = OpFunction %void None %22
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %acosh_ecf2d1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.wgsl
index 422b069..75c03ff 100644
--- a/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acosh/ecf2d1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn acosh_ecf2d1() {
   var arg_0 = 1.54308068752288818359f;
   var res : f32 = acosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_ecf2d1();
diff --git a/test/tint/builtins/gen/var/acosh/f56574.wgsl b/test/tint/builtins/gen/var/acosh/f56574.wgsl
index ad936fa..ce62afa 100644
--- a/test/tint/builtins/gen/var/acosh/f56574.wgsl
+++ b/test/tint/builtins/gen/var/acosh/f56574.wgsl
@@ -27,7 +27,9 @@
 fn acosh_f56574() {
   var arg_0 = vec3<f16>(1.5430806348h);
   var res: vec3<f16> = acosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.dxc.hlsl
index c7f7ea6..f12aa11 100644
--- a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) - float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_f56574() {
   vector<float16_t, 3> arg_0 = (float16_t(1.54296875h)).xxx;
   vector<float16_t, 3> res = tint_acosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.fxc.hlsl
index dd5e672..56b75d9 100644
--- a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return log((x + sqrt(((x * x) - float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void acosh_f56574() {
-  vector<float16_t, 3> arg_0 = (float16_t(2.0h)).xxx;
+  vector<float16_t, 3> arg_0 = (float16_t(1.54296875h)).xxx;
   vector<float16_t, 3> res = tint_acosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.glsl b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.glsl
index e3b4cec..80c879a 100644
--- a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return mix(acosh(x), f16vec3(0.0hf), lessThan(x, f16vec3(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acosh_f56574() {
   f16vec3 arg_0 = f16vec3(1.54296875hf);
   f16vec3 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return mix(acosh(x), f16vec3(0.0hf), lessThan(x, f16vec3(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acosh_f56574() {
   f16vec3 arg_0 = f16vec3(1.54296875hf);
   f16vec3 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return mix(acosh(x), f16vec3(0.0hf), lessThan(x, f16vec3(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void acosh_f56574() {
   f16vec3 arg_0 = f16vec3(1.54296875hf);
   f16vec3 res = tint_acosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.msl b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.msl
index 67767ed..29f3253 100644
--- a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(acosh(x), half3(0.0h), (x < half3(1.0h)));
 }
 
-void acosh_f56574() {
+void acosh_f56574(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.54296875h);
   half3 res = tint_acosh(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  acosh_f56574();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  acosh_f56574(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  acosh_f56574();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  acosh_f56574(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  acosh_f56574();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  acosh_f56574(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.spvasm b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.spvasm
index 68a5b3e..193059b 100644
--- a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_acosh "tint_acosh"
                OpName %x "x"
                OpName %acosh_f56574 "acosh_f56574"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,56 +45,65 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-          %9 = OpTypeFunction %v3half %v3half
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3half %v3half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %20 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
-         %21 = OpConstantNull %v3half
+         %24 = OpConstantNull %v3half
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
 %half_0x1_8bp_0 = OpConstant %half 0x1.8bp+0
-         %29 = OpConstantComposite %v3half %half_0x1_8bp_0 %half_0x1_8bp_0 %half_0x1_8bp_0
+         %32 = OpConstantComposite %v3half %half_0x1_8bp_0 %half_0x1_8bp_0 %half_0x1_8bp_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %35 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_acosh = OpFunction %v3half None %9
+ %tint_acosh = OpFunction %v3half None %14
           %x = OpFunctionParameter %v3half
-         %14 = OpLabel
-         %18 = OpFOrdLessThan %v3bool %x %17
-         %22 = OpExtInst %v3half %23 Acosh %x
-         %15 = OpSelect %v3half %18 %21 %22
-               OpReturnValue %15
+         %17 = OpLabel
+         %21 = OpFOrdLessThan %v3bool %x %20
+         %25 = OpExtInst %v3half %26 Acosh %x
+         %18 = OpSelect %v3half %21 %24 %25
+               OpReturnValue %18
                OpFunctionEnd
-%acosh_f56574 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %21
-        %res = OpVariable %_ptr_Function_v3half Function %21
-               OpStore %arg_0 %29
-         %33 = OpLoad %v3half %arg_0
-         %32 = OpFunctionCall %v3half %tint_acosh %33
-               OpStore %res %32
+%acosh_f56574 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %24
+        %res = OpVariable %_ptr_Function_v3half Function %24
+               OpStore %arg_0 %32
+         %36 = OpLoad %v3half %arg_0
+         %35 = OpFunctionCall %v3half %tint_acosh %36
+               OpStore %res %35
+         %41 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %42 = OpLoad %v3half %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %acosh_f56574
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %acosh_f56574
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %27
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %acosh_f56574
+%fragment_main = OpFunction %void None %27
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %acosh_f56574
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %acosh_f56574
+%compute_main = OpFunction %void None %27
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %acosh_f56574
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.wgsl b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.wgsl
index d187d0d..a006e3b 100644
--- a/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/acosh/f56574.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn acosh_f56574() {
   var arg_0 = vec3<f16>(1.54296875h);
   var res : vec3<f16> = acosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   acosh_f56574();
diff --git a/test/tint/builtins/gen/var/all/353d6a.wgsl b/test/tint/builtins/gen/var/all/353d6a.wgsl
index 0b9fd52..7cb27d3 100644
--- a/test/tint/builtins/gen/var/all/353d6a.wgsl
+++ b/test/tint/builtins/gen/var/all/353d6a.wgsl
@@ -25,7 +25,10 @@
 fn all_353d6a() {
   var arg_0 = true;
   var res: bool = all(arg_0);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.dxc.hlsl
index 5a010ec..ccf8dc0 100644
--- a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_353d6a() {
   bool arg_0 = true;
   bool res = all(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.fxc.hlsl
index 5a010ec..ccf8dc0 100644
--- a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_353d6a() {
   bool arg_0 = true;
   bool res = all(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.glsl b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.glsl
index 483f75e..1b86d97 100644
--- a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_353d6a() {
   bool arg_0 = true;
   bool res = arg_0;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_353d6a() {
   bool arg_0 = true;
   bool res = arg_0;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_353d6a() {
   bool arg_0 = true;
   bool res = arg_0;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.msl b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.msl
index d58dd64..0e222ea 100644
--- a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void all_353d6a() {
+void all_353d6a(device int* const tint_symbol_1) {
   bool arg_0 = true;
   bool res = all(arg_0);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  all_353d6a();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  all_353d6a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  all_353d6a();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  all_353d6a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  all_353d6a();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  all_353d6a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.spvasm
index 11c5919..868ab22 100644
--- a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %all_353d6a "all_353d6a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,42 +36,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %21 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %34 = OpConstantNull %int
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %all_353d6a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_bool Function %17
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %all_353d6a = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_bool Function %21
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %arg_0 %true
-         %19 = OpLoad %bool %arg_0
-               OpStore %res %19
+         %23 = OpLoad %bool %arg_0
+               OpStore %res %23
+         %28 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %31 = OpLoad %bool %res
+         %32 = OpLogicalEqual %bool %31 %21
+         %29 = OpSelect %int %32 %int_1 %34
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %all_353d6a
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %all_353d6a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %all_353d6a
+%fragment_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %all_353d6a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %all_353d6a
+%compute_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %all_353d6a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.wgsl
index 52757a7..cee5e41 100644
--- a/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/all/353d6a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn all_353d6a() {
   var arg_0 = true;
   var res : bool = all(arg_0);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   all_353d6a();
diff --git a/test/tint/builtins/gen/var/all/986c7b.wgsl b/test/tint/builtins/gen/var/all/986c7b.wgsl
index a71dda2..e9dfeb8 100644
--- a/test/tint/builtins/gen/var/all/986c7b.wgsl
+++ b/test/tint/builtins/gen/var/all/986c7b.wgsl
@@ -25,7 +25,10 @@
 fn all_986c7b() {
   var arg_0 = vec4<bool>(true);
   var res: bool = all(arg_0);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.dxc.hlsl
index 35919a5..9822890 100644
--- a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_986c7b() {
   bool4 arg_0 = (true).xxxx;
   bool res = all(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.fxc.hlsl
index 35919a5..9822890 100644
--- a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_986c7b() {
   bool4 arg_0 = (true).xxxx;
   bool res = all(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.glsl b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.glsl
index a39a237..c9fbf8b 100644
--- a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_986c7b() {
   bvec4 arg_0 = bvec4(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_986c7b() {
   bvec4 arg_0 = bvec4(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_986c7b() {
   bvec4 arg_0 = bvec4(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.msl b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.msl
index b4328da..29d51b3 100644
--- a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void all_986c7b() {
+void all_986c7b(device int* const tint_symbol_1) {
   bool4 arg_0 = bool4(true);
   bool res = all(arg_0);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  all_986c7b();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  all_986c7b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  all_986c7b();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  all_986c7b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  all_986c7b();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  all_986c7b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.spvasm
index 5851658..7fef2cb 100644
--- a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %all_986c7b "all_986c7b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,47 +36,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v4bool %true %true %true %true
+         %20 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %19 = OpConstantNull %v4bool
+         %23 = OpConstantNull %v4bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %24 = OpConstantNull %bool
-         %25 = OpTypeFunction %v4float
+         %28 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %38 = OpConstantNull %int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %all_986c7b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4bool Function %19
-        %res = OpVariable %_ptr_Function_bool Function %24
-               OpStore %arg_0 %16
-         %21 = OpLoad %v4bool %arg_0
-         %20 = OpAll %bool %21
-               OpStore %res %20
+ %all_986c7b = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4bool Function %23
+        %res = OpVariable %_ptr_Function_bool Function %28
+               OpStore %arg_0 %20
+         %25 = OpLoad %v4bool %arg_0
+         %24 = OpAll %bool %25
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %35 = OpLoad %bool %res
+         %36 = OpLogicalEqual %bool %35 %28
+         %33 = OpSelect %int %36 %int_1 %38
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %all_986c7b
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %all_986c7b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %all_986c7b
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %all_986c7b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %all_986c7b
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %all_986c7b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.wgsl
index 8568959..efdeefe 100644
--- a/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/all/986c7b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn all_986c7b() {
   var arg_0 = vec4<bool>(true);
   var res : bool = all(arg_0);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   all_986c7b();
diff --git a/test/tint/builtins/gen/var/all/bd2dba.wgsl b/test/tint/builtins/gen/var/all/bd2dba.wgsl
index 93c301d..df501cc 100644
--- a/test/tint/builtins/gen/var/all/bd2dba.wgsl
+++ b/test/tint/builtins/gen/var/all/bd2dba.wgsl
@@ -25,7 +25,10 @@
 fn all_bd2dba() {
   var arg_0 = vec3<bool>(true);
   var res: bool = all(arg_0);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.dxc.hlsl
index 4723891..c8fcbbe 100644
--- a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_bd2dba() {
   bool3 arg_0 = (true).xxx;
   bool res = all(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.fxc.hlsl
index 4723891..c8fcbbe 100644
--- a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_bd2dba() {
   bool3 arg_0 = (true).xxx;
   bool res = all(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.glsl b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.glsl
index 82452d9..5861143 100644
--- a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_bd2dba() {
   bvec3 arg_0 = bvec3(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_bd2dba() {
   bvec3 arg_0 = bvec3(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_bd2dba() {
   bvec3 arg_0 = bvec3(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.msl b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.msl
index 31dbbfa..97bd96f 100644
--- a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void all_bd2dba() {
+void all_bd2dba(device int* const tint_symbol_1) {
   bool3 arg_0 = bool3(true);
   bool res = all(arg_0);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  all_bd2dba();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  all_bd2dba(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  all_bd2dba();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  all_bd2dba(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  all_bd2dba();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  all_bd2dba(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.spvasm b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.spvasm
index 2fd8300..8636e43 100644
--- a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %all_bd2dba "all_bd2dba"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,47 +36,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v3bool %true %true %true
+         %20 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %19 = OpConstantNull %v3bool
+         %23 = OpConstantNull %v3bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %24 = OpConstantNull %bool
-         %25 = OpTypeFunction %v4float
+         %28 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %38 = OpConstantNull %int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %all_bd2dba = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3bool Function %19
-        %res = OpVariable %_ptr_Function_bool Function %24
-               OpStore %arg_0 %16
-         %21 = OpLoad %v3bool %arg_0
-         %20 = OpAll %bool %21
-               OpStore %res %20
+ %all_bd2dba = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3bool Function %23
+        %res = OpVariable %_ptr_Function_bool Function %28
+               OpStore %arg_0 %20
+         %25 = OpLoad %v3bool %arg_0
+         %24 = OpAll %bool %25
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %35 = OpLoad %bool %res
+         %36 = OpLogicalEqual %bool %35 %28
+         %33 = OpSelect %int %36 %int_1 %38
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %all_bd2dba
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %all_bd2dba
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %all_bd2dba
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %all_bd2dba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %all_bd2dba
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %all_bd2dba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.wgsl b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.wgsl
index afd3009..6b85086 100644
--- a/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/all/bd2dba.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn all_bd2dba() {
   var arg_0 = vec3<bool>(true);
   var res : bool = all(arg_0);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   all_bd2dba();
diff --git a/test/tint/builtins/gen/var/all/f46790.wgsl b/test/tint/builtins/gen/var/all/f46790.wgsl
index b1845ae..671c1d1 100644
--- a/test/tint/builtins/gen/var/all/f46790.wgsl
+++ b/test/tint/builtins/gen/var/all/f46790.wgsl
@@ -25,7 +25,10 @@
 fn all_f46790() {
   var arg_0 = vec2<bool>(true);
   var res: bool = all(arg_0);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.dxc.hlsl
index 7b82698..964cda8 100644
--- a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_f46790() {
   bool2 arg_0 = (true).xx;
   bool res = all(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.fxc.hlsl
index 7b82698..964cda8 100644
--- a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void all_f46790() {
   bool2 arg_0 = (true).xx;
   bool res = all(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.glsl b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.glsl
index 4a0a015..3cfffef 100644
--- a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_f46790() {
   bvec2 arg_0 = bvec2(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_f46790() {
   bvec2 arg_0 = bvec2(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void all_f46790() {
   bvec2 arg_0 = bvec2(true);
   bool res = all(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.msl b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.msl
index 76fedd0..b504d56 100644
--- a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void all_f46790() {
+void all_f46790(device int* const tint_symbol_1) {
   bool2 arg_0 = bool2(true);
   bool res = all(arg_0);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  all_f46790();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  all_f46790(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  all_f46790();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  all_f46790(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  all_f46790();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  all_f46790(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.spvasm b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.spvasm
index 8582a6f..c721e33 100644
--- a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %all_f46790 "all_f46790"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,47 +36,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v2bool %true %true
+         %20 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %19 = OpConstantNull %v2bool
+         %23 = OpConstantNull %v2bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %24 = OpConstantNull %bool
-         %25 = OpTypeFunction %v4float
+         %28 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %38 = OpConstantNull %int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %all_f46790 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2bool Function %19
-        %res = OpVariable %_ptr_Function_bool Function %24
-               OpStore %arg_0 %16
-         %21 = OpLoad %v2bool %arg_0
-         %20 = OpAll %bool %21
-               OpStore %res %20
+ %all_f46790 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2bool Function %23
+        %res = OpVariable %_ptr_Function_bool Function %28
+               OpStore %arg_0 %20
+         %25 = OpLoad %v2bool %arg_0
+         %24 = OpAll %bool %25
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %35 = OpLoad %bool %res
+         %36 = OpLogicalEqual %bool %35 %28
+         %33 = OpSelect %int %36 %int_1 %38
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %all_f46790
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %all_f46790
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %all_f46790
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %all_f46790
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %all_f46790
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %all_f46790
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.wgsl b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.wgsl
index f8f1191..bc2407d 100644
--- a/test/tint/builtins/gen/var/all/f46790.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/all/f46790.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn all_f46790() {
   var arg_0 = vec2<bool>(true);
   var res : bool = all(arg_0);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   all_f46790();
diff --git a/test/tint/builtins/gen/var/any/083428.wgsl b/test/tint/builtins/gen/var/any/083428.wgsl
index e22ac40..42634b4 100644
--- a/test/tint/builtins/gen/var/any/083428.wgsl
+++ b/test/tint/builtins/gen/var/any/083428.wgsl
@@ -25,7 +25,10 @@
 fn any_083428() {
   var arg_0 = vec4<bool>(true);
   var res: bool = any(arg_0);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/any/083428.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/any/083428.wgsl.expected.dxc.hlsl
index f035314..47d554c 100644
--- a/test/tint/builtins/gen/var/any/083428.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/any/083428.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_083428() {
   bool4 arg_0 = (true).xxxx;
   bool res = any(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/any/083428.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/any/083428.wgsl.expected.fxc.hlsl
index f035314..47d554c 100644
--- a/test/tint/builtins/gen/var/any/083428.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/any/083428.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_083428() {
   bool4 arg_0 = (true).xxxx;
   bool res = any(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/any/083428.wgsl.expected.glsl b/test/tint/builtins/gen/var/any/083428.wgsl.expected.glsl
index 42f191f..5bab5e3 100644
--- a/test/tint/builtins/gen/var/any/083428.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/any/083428.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_083428() {
   bvec4 arg_0 = bvec4(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_083428() {
   bvec4 arg_0 = bvec4(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_083428() {
   bvec4 arg_0 = bvec4(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/any/083428.wgsl.expected.msl b/test/tint/builtins/gen/var/any/083428.wgsl.expected.msl
index 7d0c4c7..8981613 100644
--- a/test/tint/builtins/gen/var/any/083428.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/any/083428.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void any_083428() {
+void any_083428(device int* const tint_symbol_1) {
   bool4 arg_0 = bool4(true);
   bool res = any(arg_0);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  any_083428();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  any_083428(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  any_083428();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  any_083428(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  any_083428();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  any_083428(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/any/083428.wgsl.expected.spvasm b/test/tint/builtins/gen/var/any/083428.wgsl.expected.spvasm
index 39c3352..2e9feef 100644
--- a/test/tint/builtins/gen/var/any/083428.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/any/083428.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %any_083428 "any_083428"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,47 +36,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v4bool %true %true %true %true
+         %20 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %19 = OpConstantNull %v4bool
+         %23 = OpConstantNull %v4bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %24 = OpConstantNull %bool
-         %25 = OpTypeFunction %v4float
+         %28 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %38 = OpConstantNull %int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %any_083428 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4bool Function %19
-        %res = OpVariable %_ptr_Function_bool Function %24
-               OpStore %arg_0 %16
-         %21 = OpLoad %v4bool %arg_0
-         %20 = OpAny %bool %21
-               OpStore %res %20
+ %any_083428 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4bool Function %23
+        %res = OpVariable %_ptr_Function_bool Function %28
+               OpStore %arg_0 %20
+         %25 = OpLoad %v4bool %arg_0
+         %24 = OpAny %bool %25
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %35 = OpLoad %bool %res
+         %36 = OpLogicalEqual %bool %35 %28
+         %33 = OpSelect %int %36 %int_1 %38
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %any_083428
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %any_083428
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %any_083428
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %any_083428
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %any_083428
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %any_083428
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/any/083428.wgsl.expected.wgsl b/test/tint/builtins/gen/var/any/083428.wgsl.expected.wgsl
index a629246..54978e3 100644
--- a/test/tint/builtins/gen/var/any/083428.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/any/083428.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn any_083428() {
   var arg_0 = vec4<bool>(true);
   var res : bool = any(arg_0);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   any_083428();
diff --git a/test/tint/builtins/gen/var/any/0e3e58.wgsl b/test/tint/builtins/gen/var/any/0e3e58.wgsl
index 2dc9951..7ef84f9 100644
--- a/test/tint/builtins/gen/var/any/0e3e58.wgsl
+++ b/test/tint/builtins/gen/var/any/0e3e58.wgsl
@@ -25,7 +25,10 @@
 fn any_0e3e58() {
   var arg_0 = vec2<bool>(true);
   var res: bool = any(arg_0);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.dxc.hlsl
index 54cf0d3..148d6fd 100644
--- a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_0e3e58() {
   bool2 arg_0 = (true).xx;
   bool res = any(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.fxc.hlsl
index 54cf0d3..148d6fd 100644
--- a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_0e3e58() {
   bool2 arg_0 = (true).xx;
   bool res = any(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.glsl b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.glsl
index 45938a5..57f6658 100644
--- a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_0e3e58() {
   bvec2 arg_0 = bvec2(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_0e3e58() {
   bvec2 arg_0 = bvec2(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_0e3e58() {
   bvec2 arg_0 = bvec2(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.msl b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.msl
index 05e39b7..c1ae434 100644
--- a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void any_0e3e58() {
+void any_0e3e58(device int* const tint_symbol_1) {
   bool2 arg_0 = bool2(true);
   bool res = any(arg_0);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  any_0e3e58();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  any_0e3e58(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  any_0e3e58();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  any_0e3e58(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  any_0e3e58();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  any_0e3e58(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.spvasm b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.spvasm
index dd08859..0709692 100644
--- a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %any_0e3e58 "any_0e3e58"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,47 +36,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v2bool %true %true
+         %20 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %19 = OpConstantNull %v2bool
+         %23 = OpConstantNull %v2bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %24 = OpConstantNull %bool
-         %25 = OpTypeFunction %v4float
+         %28 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %38 = OpConstantNull %int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %any_0e3e58 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2bool Function %19
-        %res = OpVariable %_ptr_Function_bool Function %24
-               OpStore %arg_0 %16
-         %21 = OpLoad %v2bool %arg_0
-         %20 = OpAny %bool %21
-               OpStore %res %20
+ %any_0e3e58 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2bool Function %23
+        %res = OpVariable %_ptr_Function_bool Function %28
+               OpStore %arg_0 %20
+         %25 = OpLoad %v2bool %arg_0
+         %24 = OpAny %bool %25
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %35 = OpLoad %bool %res
+         %36 = OpLogicalEqual %bool %35 %28
+         %33 = OpSelect %int %36 %int_1 %38
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %any_0e3e58
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %any_0e3e58
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %any_0e3e58
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %any_0e3e58
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %any_0e3e58
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %any_0e3e58
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.wgsl b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.wgsl
index 512dd96..2682e3c 100644
--- a/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/any/0e3e58.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn any_0e3e58() {
   var arg_0 = vec2<bool>(true);
   var res : bool = any(arg_0);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   any_0e3e58();
diff --git a/test/tint/builtins/gen/var/any/2ab91a.wgsl b/test/tint/builtins/gen/var/any/2ab91a.wgsl
index bb31527..f9fb9de 100644
--- a/test/tint/builtins/gen/var/any/2ab91a.wgsl
+++ b/test/tint/builtins/gen/var/any/2ab91a.wgsl
@@ -25,7 +25,10 @@
 fn any_2ab91a() {
   var arg_0 = true;
   var res: bool = any(arg_0);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.dxc.hlsl
index 075ef67..39599a1 100644
--- a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_2ab91a() {
   bool arg_0 = true;
   bool res = any(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.fxc.hlsl
index 075ef67..39599a1 100644
--- a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_2ab91a() {
   bool arg_0 = true;
   bool res = any(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.glsl b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.glsl
index 4ace3e4..ab735df 100644
--- a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_2ab91a() {
   bool arg_0 = true;
   bool res = arg_0;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_2ab91a() {
   bool arg_0 = true;
   bool res = arg_0;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_2ab91a() {
   bool arg_0 = true;
   bool res = arg_0;
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.msl b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.msl
index 80537b5..75292f8 100644
--- a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void any_2ab91a() {
+void any_2ab91a(device int* const tint_symbol_1) {
   bool arg_0 = true;
   bool res = any(arg_0);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  any_2ab91a();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  any_2ab91a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  any_2ab91a();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  any_2ab91a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  any_2ab91a();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  any_2ab91a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.spvasm
index f28dbc8..dce9521 100644
--- a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %any_2ab91a "any_2ab91a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,42 +36,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %21 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %34 = OpConstantNull %int
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %any_2ab91a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_bool Function %17
-        %res = OpVariable %_ptr_Function_bool Function %17
+ %any_2ab91a = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_bool Function %21
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %arg_0 %true
-         %19 = OpLoad %bool %arg_0
-               OpStore %res %19
+         %23 = OpLoad %bool %arg_0
+               OpStore %res %23
+         %28 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %31 = OpLoad %bool %res
+         %32 = OpLogicalEqual %bool %31 %21
+         %29 = OpSelect %int %32 %int_1 %34
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %any_2ab91a
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %any_2ab91a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %any_2ab91a
+%fragment_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %any_2ab91a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %any_2ab91a
+%compute_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %any_2ab91a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.wgsl
index 578a262..cd3c168 100644
--- a/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/any/2ab91a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn any_2ab91a() {
   var arg_0 = true;
   var res : bool = any(arg_0);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   any_2ab91a();
diff --git a/test/tint/builtins/gen/var/any/e755c1.wgsl b/test/tint/builtins/gen/var/any/e755c1.wgsl
index 4d036b9..a84a964 100644
--- a/test/tint/builtins/gen/var/any/e755c1.wgsl
+++ b/test/tint/builtins/gen/var/any/e755c1.wgsl
@@ -25,7 +25,10 @@
 fn any_e755c1() {
   var arg_0 = vec3<bool>(true);
   var res: bool = any(arg_0);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.dxc.hlsl
index 11aa9b3..6ac79bf 100644
--- a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_e755c1() {
   bool3 arg_0 = (true).xxx;
   bool res = any(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.fxc.hlsl
index 11aa9b3..6ac79bf 100644
--- a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void any_e755c1() {
   bool3 arg_0 = (true).xxx;
   bool res = any(arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.glsl b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.glsl
index 37def14..8050906 100644
--- a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_e755c1() {
   bvec3 arg_0 = bvec3(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_e755c1() {
   bvec3 arg_0 = bvec3(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void any_e755c1() {
   bvec3 arg_0 = bvec3(true);
   bool res = any(arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.msl b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.msl
index 62caabf..c1fcbdc 100644
--- a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void any_e755c1() {
+void any_e755c1(device int* const tint_symbol_1) {
   bool3 arg_0 = bool3(true);
   bool res = any(arg_0);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  any_e755c1();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  any_e755c1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  any_e755c1();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  any_e755c1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  any_e755c1();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  any_e755c1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.spvasm
index 033d47f..fa3173e 100644
--- a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %any_e755c1 "any_e755c1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,47 +36,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v3bool %true %true %true
+         %20 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %19 = OpConstantNull %v3bool
+         %23 = OpConstantNull %v3bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %24 = OpConstantNull %bool
-         %25 = OpTypeFunction %v4float
+         %28 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %38 = OpConstantNull %int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %any_e755c1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3bool Function %19
-        %res = OpVariable %_ptr_Function_bool Function %24
-               OpStore %arg_0 %16
-         %21 = OpLoad %v3bool %arg_0
-         %20 = OpAny %bool %21
-               OpStore %res %20
+ %any_e755c1 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3bool Function %23
+        %res = OpVariable %_ptr_Function_bool Function %28
+               OpStore %arg_0 %20
+         %25 = OpLoad %v3bool %arg_0
+         %24 = OpAny %bool %25
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %35 = OpLoad %bool %res
+         %36 = OpLogicalEqual %bool %35 %28
+         %33 = OpSelect %int %36 %int_1 %38
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %any_e755c1
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %any_e755c1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %any_e755c1
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %any_e755c1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %any_e755c1
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %any_e755c1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.wgsl
index 8d532b5..47c1446 100644
--- a/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/any/e755c1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn any_e755c1() {
   var arg_0 = vec3<bool>(true);
   var res : bool = any(arg_0);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   any_e755c1();
diff --git a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl
index 66f7357..d40e6ae 100644
--- a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<i32>, read>) -> u32
 fn arrayLength_1588cd() {
   var res: u32 = arrayLength(&sb_ro.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.dxc.hlsl
index fabbad5..002fffb 100644
--- a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_1588cd() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.fxc.hlsl
index fabbad5..002fffb 100644
--- a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_1588cd() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.glsl b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.glsl
index 4f59c4b..b2d79ac 100644
--- a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   int arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_1588cd() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   int arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_1588cd() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   int arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_1588cd() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.msl b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.msl
index 8f9b209..b42f4ee 100644
--- a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<int, 1> arg_0;
 };
 
-void arrayLength_1588cd(const constant tint_symbol_1* const tint_symbol_3) {
-  uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+void arrayLength_1588cd(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
+  uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_1588cd(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_1588cd(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_1588cd(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  arrayLength_1588cd(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_1588cd(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
+  arrayLength_1588cd(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.spvasm
index 40b7f6e..0e3d963 100644
--- a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RO "SB_RO"
                OpMemberName %SB_RO 0 "arg_0"
                OpName %sb_ro "sb_ro"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_1588cd "arrayLength_1588cd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
                OpDecorate %sb_ro NonWritable
                OpDecorate %sb_ro DescriptorSet 0
                OpDecorate %sb_ro Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,39 +49,47 @@
       %SB_RO = OpTypeStruct %_runtimearr_int
 %_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
       %sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
-       %void = OpTypeVoid
-         %14 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_1588cd = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpArrayLength %uint %sb_ro 0
-               OpStore %res %18
+%arrayLength_1588cd = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpArrayLength %uint %sb_ro 0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %arrayLength_1588cd
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %arrayLength_1588cd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %18
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %arrayLength_1588cd
+%fragment_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %arrayLength_1588cd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %arrayLength_1588cd
+%compute_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %arrayLength_1588cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.wgsl
index 8b3b166..a20cf14 100644
--- a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_1588cd() {
   var res : u32 = arrayLength(&(sb_ro.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_1588cd();
diff --git a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl
index 1c2902a..4d8e890 100644
--- a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<i32>, read_write>) -> u32
 fn arrayLength_61b1c7() {
   var res: u32 = arrayLength(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.dxc.hlsl
index ba47339..b416e47 100644
--- a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_61b1c7() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.fxc.hlsl
index ba47339..b416e47 100644
--- a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_61b1c7() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.glsl b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.glsl
index d22edc1..8d77b8a 100644
--- a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   int arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_61b1c7() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   int arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_61b1c7() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   int arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_61b1c7() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.msl b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.msl
index a0b7187..21ebe2c 100644
--- a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<int, 1> arg_0;
 };
 
-void arrayLength_61b1c7(const constant tint_symbol_1* const tint_symbol_3) {
+void arrayLength_61b1c7(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
   uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_61b1c7(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_61b1c7(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_61b1c7(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
+  arrayLength_61b1c7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_61b1c7(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
+  arrayLength_61b1c7(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.spvasm
index 482bb98..21d2f4e 100644
--- a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_61b1c7 "arrayLength_61b1c7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
                OpDecorate %_runtimearr_int ArrayStride 4
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,39 +48,47 @@
       %SB_RW = OpTypeStruct %_runtimearr_int
 %_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
       %sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
-       %void = OpTypeVoid
-         %14 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_61b1c7 = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpArrayLength %uint %sb_rw 0
-               OpStore %res %18
+%arrayLength_61b1c7 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpArrayLength %uint %sb_rw 0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %arrayLength_61b1c7
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %arrayLength_61b1c7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %18
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %arrayLength_61b1c7
+%fragment_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %arrayLength_61b1c7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %arrayLength_61b1c7
+%compute_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %arrayLength_61b1c7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.wgsl
index b9b63ee..8719832 100644
--- a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_61b1c7() {
   var res : u32 = arrayLength(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_61b1c7();
diff --git a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl
index 0a04948..38a2bdb 100644
--- a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl
@@ -30,7 +30,9 @@
 // fn arrayLength(ptr<storage, array<f16>, read>) -> u32
 fn arrayLength_8421b9() {
   var res: u32 = arrayLength(&sb_ro.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.dxc.hlsl
index 2694283..1b2b867 100644
--- a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_8421b9() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.fxc.hlsl
index 2694283..1b2b867 100644
--- a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_8421b9() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.glsl b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.glsl
index 9375052..5bc4297 100644
--- a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.glsl
@@ -5,8 +5,13 @@
   float16_t arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_8421b9() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,8 +35,13 @@
   float16_t arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_8421b9() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -49,8 +59,13 @@
   float16_t arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_8421b9() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.msl b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.msl
index 3661b22..b59b772 100644
--- a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<half, 1> arg_0;
 };
 
-void arrayLength_8421b9(const constant tint_symbol_1* const tint_symbol_3) {
-  uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 2u);
+void arrayLength_8421b9(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
+  uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 2u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_8421b9(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_8421b9(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_8421b9(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  arrayLength_8421b9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_8421b9(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
+  arrayLength_8421b9(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.spvasm
index 485ba20..c71ea89 100644
--- a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -19,6 +19,9 @@
                OpName %SB_RO "SB_RO"
                OpMemberName %SB_RO 0 "arg_0"
                OpName %sb_ro "sb_ro"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_8421b9 "arrayLength_8421b9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -33,6 +36,10 @@
                OpDecorate %sb_ro NonWritable
                OpDecorate %sb_ro DescriptorSet 0
                OpDecorate %sb_ro Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -46,39 +53,47 @@
       %SB_RO = OpTypeStruct %_runtimearr_half
 %_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
       %sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
-       %void = OpTypeVoid
-         %14 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_8421b9 = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpArrayLength %uint %sb_ro 0
-               OpStore %res %18
+%arrayLength_8421b9 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpArrayLength %uint %sb_ro 0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %arrayLength_8421b9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %arrayLength_8421b9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %18
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %arrayLength_8421b9
+%fragment_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %arrayLength_8421b9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %arrayLength_8421b9
+%compute_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %arrayLength_8421b9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.wgsl
index 2d6dca3..6083de9 100644
--- a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
 
 fn arrayLength_8421b9() {
   var res : u32 = arrayLength(&(sb_ro.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_8421b9();
diff --git a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl
index e6d4863..2df882a 100644
--- a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<f32>, read>) -> u32
 fn arrayLength_a0f5ca() {
   var res: u32 = arrayLength(&sb_ro.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.dxc.hlsl
index cee7ff2..a826bd9 100644
--- a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_a0f5ca() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.fxc.hlsl
index cee7ff2..a826bd9 100644
--- a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_a0f5ca() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.glsl b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.glsl
index d7e4539..25343cb 100644
--- a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   float arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_a0f5ca() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   float arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_a0f5ca() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   float arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_a0f5ca() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.msl b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.msl
index b0aba71..a4dab46 100644
--- a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<float, 1> arg_0;
 };
 
-void arrayLength_a0f5ca(const constant tint_symbol_1* const tint_symbol_3) {
-  uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+void arrayLength_a0f5ca(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
+  uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_a0f5ca(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_a0f5ca(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_a0f5ca(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  arrayLength_a0f5ca(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_a0f5ca(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
+  arrayLength_a0f5ca(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.spvasm b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.spvasm
index 0af5f92..a21ffca 100644
--- a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RO "SB_RO"
                OpMemberName %SB_RO 0 "arg_0"
                OpName %sb_ro "sb_ro"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_a0f5ca "arrayLength_a0f5ca"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
                OpDecorate %sb_ro NonWritable
                OpDecorate %sb_ro DescriptorSet 0
                OpDecorate %sb_ro Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,39 +48,47 @@
       %SB_RO = OpTypeStruct %_runtimearr_float
 %_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
       %sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_a0f5ca = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %17 = OpArrayLength %uint %sb_ro 0
-               OpStore %res %17
+%arrayLength_a0f5ca = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpArrayLength %uint %sb_ro 0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %arrayLength_a0f5ca
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %arrayLength_a0f5ca
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %17
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %arrayLength_a0f5ca
+%fragment_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %arrayLength_a0f5ca
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %arrayLength_a0f5ca
+%compute_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %arrayLength_a0f5ca
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.wgsl b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.wgsl
index fa60a15..8feea09 100644
--- a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_a0f5ca() {
   var res : u32 = arrayLength(&(sb_ro.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_a0f5ca();
diff --git a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl
index e457a8a..9727618 100644
--- a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl
@@ -30,7 +30,9 @@
 // fn arrayLength(ptr<storage, array<f16>, read_write>) -> u32
 fn arrayLength_cbd6b5() {
   var res: u32 = arrayLength(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.dxc.hlsl
index c62bc23..56d16ac 100644
--- a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cbd6b5() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.fxc.hlsl
index c62bc23..56d16ac 100644
--- a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cbd6b5() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.glsl b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.glsl
index aeaf5a3..c155e09 100644
--- a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.glsl
@@ -5,8 +5,13 @@
   float16_t arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cbd6b5() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,8 +35,13 @@
   float16_t arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cbd6b5() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -49,8 +59,13 @@
   float16_t arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cbd6b5() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.msl b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.msl
index 86034e4..1d5314b 100644
--- a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<half, 1> arg_0;
 };
 
-void arrayLength_cbd6b5(const constant tint_symbol_1* const tint_symbol_3) {
+void arrayLength_cbd6b5(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
   uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 2u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_cbd6b5(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_cbd6b5(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_cbd6b5(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
+  arrayLength_cbd6b5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_cbd6b5(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
+  arrayLength_cbd6b5(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.spvasm
index 15031de..f07f373 100644
--- a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -19,6 +19,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_cbd6b5 "arrayLength_cbd6b5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -32,6 +35,10 @@
                OpDecorate %_runtimearr_half ArrayStride 2
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -45,39 +52,47 @@
       %SB_RW = OpTypeStruct %_runtimearr_half
 %_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
       %sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
-       %void = OpTypeVoid
-         %14 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_cbd6b5 = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %18 = OpArrayLength %uint %sb_rw 0
-               OpStore %res %18
+%arrayLength_cbd6b5 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpArrayLength %uint %sb_rw 0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %arrayLength_cbd6b5
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %arrayLength_cbd6b5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %18
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %arrayLength_cbd6b5
+%fragment_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %arrayLength_cbd6b5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %arrayLength_cbd6b5
+%compute_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %arrayLength_cbd6b5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.wgsl
index c025591..5320fc5 100644
--- a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
 
 fn arrayLength_cbd6b5() {
   var res : u32 = arrayLength(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_cbd6b5();
diff --git a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl
index c524ff6..01336ea 100644
--- a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<f32>, read_write>) -> u32
 fn arrayLength_cdd123() {
   var res: u32 = arrayLength(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.dxc.hlsl
index 2156844..fcc66f6 100644
--- a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cdd123() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.fxc.hlsl
index 2156844..fcc66f6 100644
--- a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cdd123() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.glsl b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.glsl
index 5d417ac..b8890f5 100644
--- a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   float arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cdd123() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   float arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cdd123() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   float arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cdd123() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.msl b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.msl
index b7fe50b..72bd980 100644
--- a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<float, 1> arg_0;
 };
 
-void arrayLength_cdd123(const constant tint_symbol_1* const tint_symbol_3) {
+void arrayLength_cdd123(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
   uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_cdd123(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_cdd123(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_cdd123(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
+  arrayLength_cdd123(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_cdd123(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
+  arrayLength_cdd123(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.spvasm b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.spvasm
index 4644796..22f08f8 100644
--- a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_cdd123 "arrayLength_cdd123"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
                OpDecorate %_runtimearr_float ArrayStride 4
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,39 +47,47 @@
       %SB_RW = OpTypeStruct %_runtimearr_float
 %_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
       %sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_cdd123 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %17 = OpArrayLength %uint %sb_rw 0
-               OpStore %res %17
+%arrayLength_cdd123 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpArrayLength %uint %sb_rw 0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %arrayLength_cdd123
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %arrayLength_cdd123
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %17
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %arrayLength_cdd123
+%fragment_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %arrayLength_cdd123
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %arrayLength_cdd123
+%compute_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %arrayLength_cdd123
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.wgsl b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.wgsl
index d792619..c949bb7 100644
--- a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_cdd123() {
   var res : u32 = arrayLength(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_cdd123();
diff --git a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl
index 9581e2e..a02d679 100644
--- a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<u32>, read>) -> u32
 fn arrayLength_cfca0a() {
   var res: u32 = arrayLength(&sb_ro.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.dxc.hlsl
index a6cf72c..ef42082 100644
--- a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cfca0a() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.fxc.hlsl
index a6cf72c..ef42082 100644
--- a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 ByteAddressBuffer sb_ro : register(t1, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_cfca0a() {
   uint tint_symbol_2 = 0u;
   sb_ro.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.glsl b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.glsl
index a605e06..57ed7ff 100644
--- a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   uint arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cfca0a() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   uint arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cfca0a() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   uint arg_0[];
 } sb_ro;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_cfca0a() {
   uint res = uint(sb_ro.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.msl b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.msl
index f62106e..039995a 100644
--- a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<uint, 1> arg_0;
 };
 
-void arrayLength_cfca0a(const constant tint_symbol_1* const tint_symbol_3) {
-  uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+void arrayLength_cfca0a(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
+  uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_cfca0a(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_cfca0a(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_cfca0a(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  arrayLength_cfca0a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_cfca0a(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
+  arrayLength_cfca0a(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.spvasm
index db230e9..bf72cad 100644
--- a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RO "SB_RO"
                OpMemberName %SB_RO 0 "arg_0"
                OpName %sb_ro "sb_ro"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_cfca0a "arrayLength_cfca0a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
                OpDecorate %sb_ro NonWritable
                OpDecorate %sb_ro DescriptorSet 0
                OpDecorate %sb_ro Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,38 +49,46 @@
       %SB_RO = OpTypeStruct %_runtimearr_uint
 %_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
       %sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %14 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_cfca0a = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpArrayLength %uint %sb_ro 0
-               OpStore %res %18
+%arrayLength_cfca0a = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpArrayLength %uint %sb_ro 0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %arrayLength_cfca0a
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %arrayLength_cfca0a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %17
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %arrayLength_cfca0a
+%fragment_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %arrayLength_cfca0a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %arrayLength_cfca0a
+%compute_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %arrayLength_cfca0a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.wgsl
index d741ef0..f1fa0e3 100644
--- a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_cfca0a() {
   var res : u32 = arrayLength(&(sb_ro.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_cfca0a();
diff --git a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl
index 5c2eca0..00cdbd5 100644
--- a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl
@@ -28,7 +28,9 @@
 // fn arrayLength(ptr<storage, array<u32>, read_write>) -> u32
 fn arrayLength_eb510f() {
   var res: u32 = arrayLength(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.dxc.hlsl
index 4b05a0f..6bc3dae 100644
--- a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_eb510f() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.fxc.hlsl
index 4b05a0f..6bc3dae 100644
--- a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 RWByteAddressBuffer sb_rw : register(u0, space0);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void arrayLength_eb510f() {
   uint tint_symbol_2 = 0u;
   sb_rw.GetDimensions(tint_symbol_2);
   const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
   uint res = tint_symbol_3;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.glsl b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.glsl
index 51f60de..d6c4cda 100644
--- a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.glsl
@@ -4,8 +4,13 @@
   uint arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_eb510f() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,8 +33,13 @@
   uint arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_eb510f() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,8 +56,13 @@
   uint arg_0[];
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void arrayLength_eb510f() {
   uint res = uint(sb_rw.arg_0.length());
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.msl b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.msl
index 05c3bc9..6838fcb 100644
--- a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.msl
@@ -22,33 +22,34 @@
   tint_array<uint, 1> arg_0;
 };
 
-void arrayLength_eb510f(const constant tint_symbol_1* const tint_symbol_3) {
+void arrayLength_eb510f(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
   uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
-  arrayLength_eb510f(tint_symbol_4);
+float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
+  arrayLength_eb510f(tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5);
+vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
-  arrayLength_eb510f(tint_symbol_6);
+fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
+  arrayLength_eb510f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
-kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
-  arrayLength_eb510f(tint_symbol_7);
+kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
+  arrayLength_eb510f(tint_symbol_11, tint_symbol_12);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.spvasm
index b165c3f..9acedf2 100644
--- a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %arrayLength_eb510f "arrayLength_eb510f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
                OpDecorate %_runtimearr_uint ArrayStride 4
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,38 +48,46 @@
       %SB_RW = OpTypeStruct %_runtimearr_uint
 %_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
       %sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %14 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%arrayLength_eb510f = OpFunction %void None %14
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpArrayLength %uint %sb_rw 0
-               OpStore %res %18
+%arrayLength_eb510f = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpArrayLength %uint %sb_rw 0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %arrayLength_eb510f
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %arrayLength_eb510f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %14
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %17
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %14
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %arrayLength_eb510f
+%fragment_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %arrayLength_eb510f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %14
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %arrayLength_eb510f
+%compute_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %arrayLength_eb510f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.wgsl
index a048944..0f20ea4 100644
--- a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn arrayLength_eb510f() {
   var res : u32 = arrayLength(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   arrayLength_eb510f();
diff --git a/test/tint/builtins/gen/var/asin/064953.wgsl b/test/tint/builtins/gen/var/asin/064953.wgsl
index 07deb14..5d4c606 100644
--- a/test/tint/builtins/gen/var/asin/064953.wgsl
+++ b/test/tint/builtins/gen/var/asin/064953.wgsl
@@ -25,7 +25,9 @@
 fn asin_064953() {
   var arg_0 = vec4<f32>(0.479425538604f);
   var res: vec4<f32> = asin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.dxc.hlsl
index a8e7300..a9d186f 100644
--- a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_064953() {
   float4 arg_0 = (0.47942554950714111328f).xxxx;
   float4 res = asin(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.fxc.hlsl
index a8e7300..a9d186f 100644
--- a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_064953() {
   float4 arg_0 = (0.47942554950714111328f).xxxx;
   float4 res = asin(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.glsl b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.glsl
index 13fad50..57d144b 100644
--- a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asin_064953() {
   vec4 arg_0 = vec4(0.47942554950714111328f);
   vec4 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asin_064953() {
   vec4 arg_0 = vec4(0.47942554950714111328f);
   vec4 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asin_064953() {
   vec4 arg_0 = vec4(0.47942554950714111328f);
   vec4 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.msl b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.msl
index 0d3926d..21a6eff 100644
--- a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_064953() {
+void asin_064953(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(0.47942554950714111328f);
   float4 res = asin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_064953();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  asin_064953(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_064953();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  asin_064953(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_064953();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  asin_064953(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.spvasm
index 0b9824c..47d749c 100644
--- a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_064953 "asin_064953"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_47942555 = OpConstant %float 0.47942555
-         %14 = OpConstantComposite %v4float %float_0_47942555 %float_0_47942555 %float_0_47942555 %float_0_47942555
+         %17 = OpConstantComposite %v4float %float_0_47942555 %float_0_47942555 %float_0_47942555 %float_0_47942555
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_064953 = OpFunction %void None %9
-         %12 = OpLabel
+%asin_064953 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Asin %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Asin %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %asin_064953
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %asin_064953
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %asin_064953
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %asin_064953
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %asin_064953
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %asin_064953
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.wgsl
index daa31fc..acff773 100644
--- a/test/tint/builtins/gen/var/asin/064953.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asin/064953.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn asin_064953() {
   var arg_0 = vec4<f32>(0.47942554950714111328f);
   var res : vec4<f32> = asin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_064953();
diff --git a/test/tint/builtins/gen/var/asin/0bac07.wgsl b/test/tint/builtins/gen/var/asin/0bac07.wgsl
index d1555eb..36729a2 100644
--- a/test/tint/builtins/gen/var/asin/0bac07.wgsl
+++ b/test/tint/builtins/gen/var/asin/0bac07.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(0.479425538604);
   var res = asin(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_0bac07();
diff --git a/test/tint/builtins/gen/var/asin/11dfda.wgsl b/test/tint/builtins/gen/var/asin/11dfda.wgsl
index 4e3eed7..de3765d 100644
--- a/test/tint/builtins/gen/var/asin/11dfda.wgsl
+++ b/test/tint/builtins/gen/var/asin/11dfda.wgsl
@@ -27,7 +27,9 @@
 fn asin_11dfda() {
   var arg_0 = 0.479425538604h;
   var res: f16 = asin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.dxc.hlsl
index 7910bc3..75c0ebe 100644
--- a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_11dfda() {
   float16_t arg_0 = float16_t(0.479248046875h);
   float16_t res = asin(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.fxc.hlsl
index 84a71b1..2aab206 100644
--- a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_11dfda() {
-  float16_t arg_0 = float16_t(0.479248047h);
+  float16_t arg_0 = float16_t(0.479248046875h);
   float16_t res = asin(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.glsl b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.glsl
index 466612a..a72fec2 100644
--- a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asin_11dfda() {
   float16_t arg_0 = 0.479248046875hf;
   float16_t res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asin_11dfda() {
   float16_t arg_0 = 0.479248046875hf;
   float16_t res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asin_11dfda() {
   float16_t arg_0 = 0.479248046875hf;
   float16_t res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.msl b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.msl
index ec03ff2..c2612eb 100644
--- a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_11dfda() {
+void asin_11dfda(device half* const tint_symbol_1) {
   half arg_0 = 0.479248046875h;
   half res = asin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_11dfda();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  asin_11dfda(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_11dfda();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  asin_11dfda(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_11dfda();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  asin_11dfda(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.spvasm
index c1fb650..a63962f 100644
--- a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_11dfda "asin_11dfda"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_eacpn2 = OpConstant %half 0x1.eacp-2
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_11dfda = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%asin_11dfda = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1_eacpn2
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Asin %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Asin %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %asin_11dfda
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %asin_11dfda
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asin_11dfda
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asin_11dfda
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %asin_11dfda
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %asin_11dfda
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.wgsl
index 4345a07..eebd9a4 100644
--- a/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asin/11dfda.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn asin_11dfda() {
   var arg_0 = 0.479248046875h;
   var res : f16 = asin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_11dfda();
diff --git a/test/tint/builtins/gen/var/asin/2d8e29.wgsl b/test/tint/builtins/gen/var/asin/2d8e29.wgsl
index 2aeaca0..aa8c171 100644
--- a/test/tint/builtins/gen/var/asin/2d8e29.wgsl
+++ b/test/tint/builtins/gen/var/asin/2d8e29.wgsl
@@ -27,7 +27,9 @@
 fn asin_2d8e29() {
   var arg_0 = vec3<f16>(0.479425538604h);
   var res: vec3<f16> = asin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.dxc.hlsl
index d29c74a..86d0934 100644
--- a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_2d8e29() {
   vector<float16_t, 3> arg_0 = (float16_t(0.479248046875h)).xxx;
   vector<float16_t, 3> res = asin(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.fxc.hlsl
index b9e8847..62de534 100644
--- a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_2d8e29() {
-  vector<float16_t, 3> arg_0 = (float16_t(0.479248047h)).xxx;
+  vector<float16_t, 3> arg_0 = (float16_t(0.479248046875h)).xxx;
   vector<float16_t, 3> res = asin(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.glsl b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.glsl
index 84c406a..8aa8a6f 100644
--- a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asin_2d8e29() {
   f16vec3 arg_0 = f16vec3(0.479248046875hf);
   f16vec3 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asin_2d8e29() {
   f16vec3 arg_0 = f16vec3(0.479248046875hf);
   f16vec3 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asin_2d8e29() {
   f16vec3 arg_0 = f16vec3(0.479248046875hf);
   f16vec3 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.msl b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.msl
index cebd4dc1..21578c0 100644
--- a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_2d8e29() {
+void asin_2d8e29(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(0.479248046875h);
   half3 res = asin(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_2d8e29();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  asin_2d8e29(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_2d8e29();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  asin_2d8e29(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_2d8e29();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  asin_2d8e29(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.spvasm
index 9882236..afe343d 100644
--- a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_2d8e29 "asin_2d8e29"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_eacpn2 = OpConstant %half 0x1.eacp-2
-         %16 = OpConstantComposite %v3half %half_0x1_eacpn2 %half_0x1_eacpn2 %half_0x1_eacpn2
+         %19 = OpConstantComposite %v3half %half_0x1_eacpn2 %half_0x1_eacpn2 %half_0x1_eacpn2
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_2d8e29 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Asin %22
-               OpStore %res %20
+%asin_2d8e29 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Asin %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %asin_2d8e29
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %asin_2d8e29
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %asin_2d8e29
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %asin_2d8e29
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %asin_2d8e29
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %asin_2d8e29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.wgsl
index a97b110..c17dea3 100644
--- a/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asin/2d8e29.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn asin_2d8e29() {
   var arg_0 = vec3<f16>(0.479248046875h);
   var res : vec3<f16> = asin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_2d8e29();
diff --git a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl
index 294f30c..ceade89 100644
--- a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl
+++ b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl
@@ -27,7 +27,9 @@
 fn asin_3cfbd4() {
   var arg_0 = vec4<f16>(0.479425538604h);
   var res: vec4<f16> = asin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.dxc.hlsl
index 344fe0f..ca1728d 100644
--- a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_3cfbd4() {
   vector<float16_t, 4> arg_0 = (float16_t(0.479248046875h)).xxxx;
   vector<float16_t, 4> res = asin(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.fxc.hlsl
index a33cc88..c35ae14 100644
--- a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_3cfbd4() {
-  vector<float16_t, 4> arg_0 = (float16_t(0.479248047h)).xxxx;
+  vector<float16_t, 4> arg_0 = (float16_t(0.479248046875h)).xxxx;
   vector<float16_t, 4> res = asin(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.glsl b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.glsl
index 6d7ce9f..49101fe 100644
--- a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asin_3cfbd4() {
   f16vec4 arg_0 = f16vec4(0.479248046875hf);
   f16vec4 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asin_3cfbd4() {
   f16vec4 arg_0 = f16vec4(0.479248046875hf);
   f16vec4 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asin_3cfbd4() {
   f16vec4 arg_0 = f16vec4(0.479248046875hf);
   f16vec4 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.msl b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.msl
index 2b0e213..d895a77 100644
--- a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_3cfbd4() {
+void asin_3cfbd4(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(0.479248046875h);
   half4 res = asin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_3cfbd4();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  asin_3cfbd4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_3cfbd4();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  asin_3cfbd4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_3cfbd4();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  asin_3cfbd4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.spvasm
index 6c6233d..9cd5050 100644
--- a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_3cfbd4 "asin_3cfbd4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_eacpn2 = OpConstant %half 0x1.eacp-2
-         %16 = OpConstantComposite %v4half %half_0x1_eacpn2 %half_0x1_eacpn2 %half_0x1_eacpn2 %half_0x1_eacpn2
+         %19 = OpConstantComposite %v4half %half_0x1_eacpn2 %half_0x1_eacpn2 %half_0x1_eacpn2 %half_0x1_eacpn2
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_3cfbd4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Asin %22
-               OpStore %res %20
+%asin_3cfbd4 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Asin %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %asin_3cfbd4
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %asin_3cfbd4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %asin_3cfbd4
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %asin_3cfbd4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %asin_3cfbd4
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %asin_3cfbd4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.wgsl
index 19fc5a4..afe982f 100644
--- a/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asin/3cfbd4.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn asin_3cfbd4() {
   var arg_0 = vec4<f16>(0.479248046875h);
   var res : vec4<f16> = asin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_3cfbd4();
diff --git a/test/tint/builtins/gen/var/asin/64bb1f.wgsl b/test/tint/builtins/gen/var/asin/64bb1f.wgsl
index acc71e2..5f14d5e 100644
--- a/test/tint/builtins/gen/var/asin/64bb1f.wgsl
+++ b/test/tint/builtins/gen/var/asin/64bb1f.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(0.479425538604);
   var res = asin(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_64bb1f();
diff --git a/test/tint/builtins/gen/var/asin/7b6a44.wgsl b/test/tint/builtins/gen/var/asin/7b6a44.wgsl
index b8b7348..9d99f03 100644
--- a/test/tint/builtins/gen/var/asin/7b6a44.wgsl
+++ b/test/tint/builtins/gen/var/asin/7b6a44.wgsl
@@ -25,7 +25,9 @@
 fn asin_7b6a44() {
   var arg_0 = vec2<f32>(0.479425538604f);
   var res: vec2<f32> = asin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.dxc.hlsl
index 4324a5e..14c240f 100644
--- a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_7b6a44() {
   float2 arg_0 = (0.47942554950714111328f).xx;
   float2 res = asin(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.fxc.hlsl
index 4324a5e..14c240f 100644
--- a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_7b6a44() {
   float2 arg_0 = (0.47942554950714111328f).xx;
   float2 res = asin(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.glsl b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.glsl
index fe7bcd3..276e078 100644
--- a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asin_7b6a44() {
   vec2 arg_0 = vec2(0.47942554950714111328f);
   vec2 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asin_7b6a44() {
   vec2 arg_0 = vec2(0.47942554950714111328f);
   vec2 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asin_7b6a44() {
   vec2 arg_0 = vec2(0.47942554950714111328f);
   vec2 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.msl b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.msl
index ff9eb5e..a7a2568 100644
--- a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_7b6a44() {
+void asin_7b6a44(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(0.47942554950714111328f);
   float2 res = asin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_7b6a44();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  asin_7b6a44(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_7b6a44();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  asin_7b6a44(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_7b6a44();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  asin_7b6a44(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.spvasm
index 05ddad5..790a031 100644
--- a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_7b6a44 "asin_7b6a44"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_47942555 = OpConstant %float 0.47942555
-         %15 = OpConstantComposite %v2float %float_0_47942555 %float_0_47942555
+         %18 = OpConstantComposite %v2float %float_0_47942555 %float_0_47942555
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_7b6a44 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Asin %21
-               OpStore %res %19
+%asin_7b6a44 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Asin %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %asin_7b6a44
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %asin_7b6a44
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asin_7b6a44
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asin_7b6a44
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %asin_7b6a44
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %asin_7b6a44
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.wgsl
index aea6a8b..fad13e7 100644
--- a/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asin/7b6a44.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn asin_7b6a44() {
   var arg_0 = vec2<f32>(0.47942554950714111328f);
   var res : vec2<f32> = asin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_7b6a44();
diff --git a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl
index 9ef585c..ba2d90b 100644
--- a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl
+++ b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl
@@ -25,7 +25,9 @@
 fn asin_8cd9c9() {
   var arg_0 = vec3<f32>(0.479425538604f);
   var res: vec3<f32> = asin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.dxc.hlsl
index 5224b56..bb3a6de8 100644
--- a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_8cd9c9() {
   float3 arg_0 = (0.47942554950714111328f).xxx;
   float3 res = asin(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.fxc.hlsl
index 5224b56..bb3a6de8 100644
--- a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_8cd9c9() {
   float3 arg_0 = (0.47942554950714111328f).xxx;
   float3 res = asin(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.glsl b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.glsl
index 30d9571..7330302 100644
--- a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asin_8cd9c9() {
   vec3 arg_0 = vec3(0.47942554950714111328f);
   vec3 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asin_8cd9c9() {
   vec3 arg_0 = vec3(0.47942554950714111328f);
   vec3 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asin_8cd9c9() {
   vec3 arg_0 = vec3(0.47942554950714111328f);
   vec3 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.msl b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.msl
index 4c4ee11..bfd4dcd 100644
--- a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_8cd9c9() {
+void asin_8cd9c9(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(0.47942554950714111328f);
   float3 res = asin(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_8cd9c9();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  asin_8cd9c9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_8cd9c9();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  asin_8cd9c9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_8cd9c9();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  asin_8cd9c9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.spvasm
index a3c46c6..e009ffc 100644
--- a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_8cd9c9 "asin_8cd9c9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_0_47942555 = OpConstant %float 0.47942555
-         %15 = OpConstantComposite %v3float %float_0_47942555 %float_0_47942555 %float_0_47942555
+         %18 = OpConstantComposite %v3float %float_0_47942555 %float_0_47942555 %float_0_47942555
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_8cd9c9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Asin %21
-               OpStore %res %19
+%asin_8cd9c9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Asin %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %asin_8cd9c9
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %asin_8cd9c9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asin_8cd9c9
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asin_8cd9c9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %asin_8cd9c9
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %asin_8cd9c9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.wgsl
index 7616b9a..9c3f6e3 100644
--- a/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asin/8cd9c9.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn asin_8cd9c9() {
   var arg_0 = vec3<f32>(0.47942554950714111328f);
   var res : vec3<f32> = asin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_8cd9c9();
diff --git a/test/tint/builtins/gen/var/asin/a5dd88.wgsl b/test/tint/builtins/gen/var/asin/a5dd88.wgsl
index bee2ee2..11ee74e 100644
--- a/test/tint/builtins/gen/var/asin/a5dd88.wgsl
+++ b/test/tint/builtins/gen/var/asin/a5dd88.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(0.479425538604);
   var res = asin(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_a5dd88();
diff --git a/test/tint/builtins/gen/var/asin/a6d73a.wgsl b/test/tint/builtins/gen/var/asin/a6d73a.wgsl
index f4b8390..8dcd774 100644
--- a/test/tint/builtins/gen/var/asin/a6d73a.wgsl
+++ b/test/tint/builtins/gen/var/asin/a6d73a.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 0.479425538604;
   var res = asin(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_a6d73a();
diff --git a/test/tint/builtins/gen/var/asin/b4aced.wgsl b/test/tint/builtins/gen/var/asin/b4aced.wgsl
index 988db7b..bcc6ccf 100644
--- a/test/tint/builtins/gen/var/asin/b4aced.wgsl
+++ b/test/tint/builtins/gen/var/asin/b4aced.wgsl
@@ -27,7 +27,9 @@
 fn asin_b4aced() {
   var arg_0 = vec2<f16>(0.479425538604h);
   var res: vec2<f16> = asin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.dxc.hlsl
index e15455e..54b8549 100644
--- a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_b4aced() {
   vector<float16_t, 2> arg_0 = (float16_t(0.479248046875h)).xx;
   vector<float16_t, 2> res = asin(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.fxc.hlsl
index ff28ff9..59476ed 100644
--- a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_b4aced() {
-  vector<float16_t, 2> arg_0 = (float16_t(0.479248047h)).xx;
+  vector<float16_t, 2> arg_0 = (float16_t(0.479248046875h)).xx;
   vector<float16_t, 2> res = asin(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.glsl b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.glsl
index 3886825..ec528c7 100644
--- a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asin_b4aced() {
   f16vec2 arg_0 = f16vec2(0.479248046875hf);
   f16vec2 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asin_b4aced() {
   f16vec2 arg_0 = f16vec2(0.479248046875hf);
   f16vec2 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asin_b4aced() {
   f16vec2 arg_0 = f16vec2(0.479248046875hf);
   f16vec2 res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.msl b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.msl
index 9557b78..cc60d5c 100644
--- a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_b4aced() {
+void asin_b4aced(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(0.479248046875h);
   half2 res = asin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_b4aced();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  asin_b4aced(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_b4aced();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  asin_b4aced(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_b4aced();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  asin_b4aced(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.spvasm
index d8048cc..0eb4076 100644
--- a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_b4aced "asin_b4aced"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_eacpn2 = OpConstant %half 0x1.eacp-2
-         %16 = OpConstantComposite %v2half %half_0x1_eacpn2 %half_0x1_eacpn2
+         %19 = OpConstantComposite %v2half %half_0x1_eacpn2 %half_0x1_eacpn2
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_b4aced = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Asin %22
-               OpStore %res %20
+%asin_b4aced = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Asin %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %asin_b4aced
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %asin_b4aced
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %asin_b4aced
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %asin_b4aced
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %asin_b4aced
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %asin_b4aced
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.wgsl
index 437847a..5523e0e 100644
--- a/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asin/b4aced.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn asin_b4aced() {
   var arg_0 = vec2<f16>(0.479248046875h);
   var res : vec2<f16> = asin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_b4aced();
diff --git a/test/tint/builtins/gen/var/asin/c0c272.wgsl b/test/tint/builtins/gen/var/asin/c0c272.wgsl
index 1acc09e..882c020 100644
--- a/test/tint/builtins/gen/var/asin/c0c272.wgsl
+++ b/test/tint/builtins/gen/var/asin/c0c272.wgsl
@@ -25,7 +25,9 @@
 fn asin_c0c272() {
   var arg_0 = 0.479425538604f;
   var res: f32 = asin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.dxc.hlsl
index e89c04c..8354e72 100644
--- a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_c0c272() {
   float arg_0 = 0.47942554950714111328f;
   float res = asin(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.fxc.hlsl
index e89c04c..8354e72 100644
--- a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asin_c0c272() {
   float arg_0 = 0.47942554950714111328f;
   float res = asin(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.glsl b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.glsl
index c1a3702..20f90c3 100644
--- a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asin_c0c272() {
   float arg_0 = 0.47942554950714111328f;
   float res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asin_c0c272() {
   float arg_0 = 0.47942554950714111328f;
   float res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asin_c0c272() {
   float arg_0 = 0.47942554950714111328f;
   float res = asin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.msl b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.msl
index 2c7a891..2914ac6 100644
--- a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asin_c0c272() {
+void asin_c0c272(device float* const tint_symbol_1) {
   float arg_0 = 0.47942554950714111328f;
   float res = asin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asin_c0c272();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  asin_c0c272(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asin_c0c272();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  asin_c0c272(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asin_c0c272();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  asin_c0c272(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.spvasm
index 0f46bd6..566f856 100644
--- a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asin_c0c272 "asin_c0c272"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_0_47942555 = OpConstant %float 0.47942555
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asin_c0c272 = OpFunction %void None %9
-         %12 = OpLabel
+%asin_c0c272 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_0_47942555
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Asin %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Asin %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %asin_c0c272
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %asin_c0c272
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asin_c0c272
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asin_c0c272
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asin_c0c272
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asin_c0c272
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.wgsl
index 1cb253d..04a0b86 100644
--- a/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asin/c0c272.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn asin_c0c272() {
   var arg_0 = 0.47942554950714111328f;
   var res : f32 = asin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asin_c0c272();
diff --git a/test/tint/builtins/gen/var/asinh/157447.wgsl b/test/tint/builtins/gen/var/asinh/157447.wgsl
index 607689f..4609f3e 100644
--- a/test/tint/builtins/gen/var/asinh/157447.wgsl
+++ b/test/tint/builtins/gen/var/asinh/157447.wgsl
@@ -25,7 +25,9 @@
 fn asinh_157447() {
   var arg_0 = 1.f;
   var res: f32 = asinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.dxc.hlsl
index a439a80..5bed946 100644
--- a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_157447() {
   float arg_0 = 1.0f;
   float res = tint_sinh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.fxc.hlsl
index a439a80..5bed946 100644
--- a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_157447() {
   float arg_0 = 1.0f;
   float res = tint_sinh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.glsl b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.glsl
index 80bac64..28da684 100644
--- a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asinh_157447() {
   float arg_0 = 1.0f;
   float res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asinh_157447() {
   float arg_0 = 1.0f;
   float res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void asinh_157447() {
   float arg_0 = 1.0f;
   float res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.msl b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.msl
index d7a90ee..637781e 100644
--- a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_157447() {
+void asinh_157447(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = asinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_157447();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  asinh_157447(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_157447();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  asinh_157447(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_157447();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  asinh_157447(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.spvasm
index 57a3ce4..cd2e5e8 100644
--- a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_157447 "asinh_157447"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%asinh_157447 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%asinh_157447 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Asinh %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Asinh %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %asinh_157447
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %asinh_157447
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %asinh_157447
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %asinh_157447
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asinh_157447
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asinh_157447
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.wgsl
index ba5660d..d108857 100644
--- a/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asinh/157447.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn asinh_157447() {
   var arg_0 = 1.0f;
   var res : f32 = asinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_157447();
diff --git a/test/tint/builtins/gen/var/asinh/16b543.wgsl b/test/tint/builtins/gen/var/asinh/16b543.wgsl
index ba6c2b8..fbc0e29 100644
--- a/test/tint/builtins/gen/var/asinh/16b543.wgsl
+++ b/test/tint/builtins/gen/var/asinh/16b543.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = asinh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_16b543();
diff --git a/test/tint/builtins/gen/var/asinh/180015.wgsl b/test/tint/builtins/gen/var/asinh/180015.wgsl
index ecb112b..eec5914 100644
--- a/test/tint/builtins/gen/var/asinh/180015.wgsl
+++ b/test/tint/builtins/gen/var/asinh/180015.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = asinh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_180015();
diff --git a/test/tint/builtins/gen/var/asinh/2265ee.wgsl b/test/tint/builtins/gen/var/asinh/2265ee.wgsl
index 245a89e..e1eefe0 100644
--- a/test/tint/builtins/gen/var/asinh/2265ee.wgsl
+++ b/test/tint/builtins/gen/var/asinh/2265ee.wgsl
@@ -25,7 +25,9 @@
 fn asinh_2265ee() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = asinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.dxc.hlsl
index 2e876fa..3402c08 100644
--- a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_2265ee() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tint_sinh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.fxc.hlsl
index 2e876fa..3402c08 100644
--- a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_2265ee() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tint_sinh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.glsl b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.glsl
index b9ed885..b608beb 100644
--- a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asinh_2265ee() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asinh_2265ee() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void asinh_2265ee() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.msl b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.msl
index 30f2f78..4cd7511 100644
--- a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_2265ee() {
+void asinh_2265ee(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = asinh(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_2265ee();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  asinh_2265ee(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_2265ee();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  asinh_2265ee(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_2265ee();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  asinh_2265ee(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.spvasm
index 96b36e6..b2de87b 100644
--- a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_2265ee "asinh_2265ee"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%asinh_2265ee = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Asinh %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%asinh_2265ee = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Asinh %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %asinh_2265ee
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %asinh_2265ee
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asinh_2265ee
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asinh_2265ee
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %asinh_2265ee
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %asinh_2265ee
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.wgsl
index 60d90c5..11fdbb9 100644
--- a/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asinh/2265ee.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn asinh_2265ee() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = asinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_2265ee();
diff --git a/test/tint/builtins/gen/var/asinh/468a48.wgsl b/test/tint/builtins/gen/var/asinh/468a48.wgsl
index 8123cef..4c1abf3 100644
--- a/test/tint/builtins/gen/var/asinh/468a48.wgsl
+++ b/test/tint/builtins/gen/var/asinh/468a48.wgsl
@@ -27,7 +27,9 @@
 fn asinh_468a48() {
   var arg_0 = 1.h;
   var res: f16 = asinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.dxc.hlsl
index 42b918e..dbfaa9c 100644
--- a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_468a48() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tint_sinh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.fxc.hlsl
index f353b74..d5de8b6 100644
--- a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return log((x + sqrt(((x * x) + float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_468a48() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tint_sinh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.glsl b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.glsl
index 3def2f9..d26e019 100644
--- a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asinh_468a48() {
   float16_t arg_0 = 1.0hf;
   float16_t res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asinh_468a48() {
   float16_t arg_0 = 1.0hf;
   float16_t res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void asinh_468a48() {
   float16_t arg_0 = 1.0hf;
   float16_t res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.msl b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.msl
index 7851a46..be82623 100644
--- a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_468a48() {
+void asinh_468a48(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = asinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_468a48();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  asinh_468a48(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_468a48();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  asinh_468a48(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_468a48();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  asinh_468a48(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.spvasm
index 827a8b4..49f316b 100644
--- a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_468a48 "asinh_468a48"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_468a48 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%asinh_468a48 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Asinh %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Asinh %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %asinh_468a48
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %asinh_468a48
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asinh_468a48
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asinh_468a48
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %asinh_468a48
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %asinh_468a48
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.wgsl
index 9992ba4..38b5c14 100644
--- a/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asinh/468a48.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn asinh_468a48() {
   var arg_0 = 1.0h;
   var res : f16 = asinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_468a48();
diff --git a/test/tint/builtins/gen/var/asinh/4a2226.wgsl b/test/tint/builtins/gen/var/asinh/4a2226.wgsl
index c59d2ec..c251cac 100644
--- a/test/tint/builtins/gen/var/asinh/4a2226.wgsl
+++ b/test/tint/builtins/gen/var/asinh/4a2226.wgsl
@@ -25,7 +25,9 @@
 fn asinh_4a2226() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = asinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.dxc.hlsl
index 5c1e542..8f4a49a 100644
--- a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_4a2226() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tint_sinh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.fxc.hlsl
index 5c1e542..8f4a49a 100644
--- a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_4a2226() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tint_sinh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.glsl b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.glsl
index 3b555dd..d7d838e 100644
--- a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asinh_4a2226() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asinh_4a2226() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void asinh_4a2226() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.msl b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.msl
index ebfb326..0e48c59 100644
--- a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_4a2226() {
+void asinh_4a2226(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = asinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_4a2226();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  asinh_4a2226(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_4a2226();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  asinh_4a2226(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_4a2226();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  asinh_4a2226(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.spvasm
index 4930373..f0b1cf1 100644
--- a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_4a2226 "asinh_4a2226"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%asinh_4a2226 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Asinh %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%asinh_4a2226 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Asinh %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %asinh_4a2226
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %asinh_4a2226
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %asinh_4a2226
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %asinh_4a2226
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %asinh_4a2226
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %asinh_4a2226
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.wgsl
index be7f9d4..b10d118 100644
--- a/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asinh/4a2226.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn asinh_4a2226() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = asinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_4a2226();
diff --git a/test/tint/builtins/gen/var/asinh/51079e.wgsl b/test/tint/builtins/gen/var/asinh/51079e.wgsl
index 3c55709..468fd89 100644
--- a/test/tint/builtins/gen/var/asinh/51079e.wgsl
+++ b/test/tint/builtins/gen/var/asinh/51079e.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = asinh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_51079e();
diff --git a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl
index 2683f52..9f48e57 100644
--- a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl
+++ b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl
@@ -25,7 +25,9 @@
 fn asinh_8d2e51() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = asinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.dxc.hlsl
index f0ec74a..16b329a 100644
--- a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_8d2e51() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tint_sinh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.fxc.hlsl
index f0ec74a..16b329a 100644
--- a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + 1.0f))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_8d2e51() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tint_sinh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.glsl b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.glsl
index 0cdcad1..e0d9602 100644
--- a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asinh_8d2e51() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asinh_8d2e51() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void asinh_8d2e51() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.msl b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.msl
index 9a20b10..6511760 100644
--- a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_8d2e51() {
+void asinh_8d2e51(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = asinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_8d2e51();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  asinh_8d2e51(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_8d2e51();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  asinh_8d2e51(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_8d2e51();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  asinh_8d2e51(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.spvasm
index b4d1182..b318087 100644
--- a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_8d2e51 "asinh_8d2e51"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%asinh_8d2e51 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%asinh_8d2e51 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Asinh %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Asinh %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %asinh_8d2e51
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %asinh_8d2e51
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %asinh_8d2e51
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %asinh_8d2e51
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %asinh_8d2e51
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %asinh_8d2e51
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.wgsl
index 865abf7..0672951 100644
--- a/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asinh/8d2e51.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn asinh_8d2e51() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = asinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_8d2e51();
diff --git a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl
index 3fbf508..76ed66e 100644
--- a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl
+++ b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl
@@ -27,7 +27,9 @@
 fn asinh_95ab2b() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = asinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.dxc.hlsl
index 5d7141d..107e652 100644
--- a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_95ab2b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tint_sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.fxc.hlsl
index a64d297..c86d1d1 100644
--- a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return log((x + sqrt(((x * x) + float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_95ab2b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tint_sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.glsl b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.glsl
index 2e9eee0..1d6c2b4 100644
--- a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asinh_95ab2b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asinh_95ab2b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void asinh_95ab2b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.msl b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.msl
index 46212a1..225cb4d 100644
--- a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_95ab2b() {
+void asinh_95ab2b(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = asinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_95ab2b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  asinh_95ab2b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_95ab2b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  asinh_95ab2b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_95ab2b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  asinh_95ab2b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.spvasm
index de21aad..20636fa 100644
--- a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_95ab2b "asinh_95ab2b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_95ab2b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Asinh %22
-               OpStore %res %20
+%asinh_95ab2b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Asinh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %asinh_95ab2b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %asinh_95ab2b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %asinh_95ab2b
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %asinh_95ab2b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %asinh_95ab2b
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %asinh_95ab2b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.wgsl
index e67b086..9cf3f81 100644
--- a/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asinh/95ab2b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn asinh_95ab2b() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = asinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_95ab2b();
diff --git a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl
index f293ed8..9516049 100644
--- a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl
+++ b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl
@@ -27,7 +27,9 @@
 fn asinh_ad8f8b() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = asinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.dxc.hlsl
index 8013ceb..fd042ca 100644
--- a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_ad8f8b() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tint_sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.fxc.hlsl
index 5729508..8973e5a 100644
--- a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return log((x + sqrt(((x * x) + float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_ad8f8b() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tint_sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.glsl b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.glsl
index 1186176..f29a4c7 100644
--- a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asinh_ad8f8b() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asinh_ad8f8b() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void asinh_ad8f8b() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.msl b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.msl
index 10e476a..5b426c4 100644
--- a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_ad8f8b() {
+void asinh_ad8f8b(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = asinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_ad8f8b();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  asinh_ad8f8b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_ad8f8b();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  asinh_ad8f8b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_ad8f8b();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  asinh_ad8f8b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.spvasm
index 12f4a4d..dc0af91 100644
--- a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_ad8f8b "asinh_ad8f8b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_ad8f8b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Asinh %22
-               OpStore %res %20
+%asinh_ad8f8b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Asinh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %asinh_ad8f8b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %asinh_ad8f8b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %asinh_ad8f8b
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %asinh_ad8f8b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %asinh_ad8f8b
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %asinh_ad8f8b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.wgsl
index 48b3931..0be2de6 100644
--- a/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asinh/ad8f8b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn asinh_ad8f8b() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = asinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_ad8f8b();
diff --git a/test/tint/builtins/gen/var/asinh/cf8603.wgsl b/test/tint/builtins/gen/var/asinh/cf8603.wgsl
index bfdccd2..68434dd 100644
--- a/test/tint/builtins/gen/var/asinh/cf8603.wgsl
+++ b/test/tint/builtins/gen/var/asinh/cf8603.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = asinh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_cf8603();
diff --git a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl
index cf01a22..95ba648 100644
--- a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl
+++ b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl
@@ -27,7 +27,9 @@
 fn asinh_fb5e8c() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = asinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.dxc.hlsl
index 8ab935d..586f8f8 100644
--- a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return log((x + sqrt(((x * x) + float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_fb5e8c() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tint_sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.fxc.hlsl
index d4653d7..907a61c 100644
--- a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return log((x + sqrt(((x * x) + float16_t(1.0h)))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void asinh_fb5e8c() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tint_sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.glsl b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.glsl
index 6abfbda..b16ef07 100644
--- a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asinh_fb5e8c() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asinh_fb5e8c() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void asinh_fb5e8c() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = asinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.msl b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.msl
index 28621d0..8aaa706 100644
--- a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void asinh_fb5e8c() {
+void asinh_fb5e8c(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = asinh(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  asinh_fb5e8c();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  asinh_fb5e8c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  asinh_fb5e8c();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  asinh_fb5e8c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  asinh_fb5e8c();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  asinh_fb5e8c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.spvasm
index cfef693..f046f2f 100644
--- a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %asinh_fb5e8c "asinh_fb5e8c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%asinh_fb5e8c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Asinh %22
-               OpStore %res %20
+%asinh_fb5e8c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Asinh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %asinh_fb5e8c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %asinh_fb5e8c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %asinh_fb5e8c
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %asinh_fb5e8c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %asinh_fb5e8c
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %asinh_fb5e8c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.wgsl
index 98a75ea..539cc0b 100644
--- a/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/asinh/fb5e8c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn asinh_fb5e8c() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = asinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   asinh_fb5e8c();
diff --git a/test/tint/builtins/gen/var/atan/02979a.wgsl b/test/tint/builtins/gen/var/atan/02979a.wgsl
index f768b7c..808cb52 100644
--- a/test/tint/builtins/gen/var/atan/02979a.wgsl
+++ b/test/tint/builtins/gen/var/atan/02979a.wgsl
@@ -25,7 +25,9 @@
 fn atan_02979a() {
   var arg_0 = 1.f;
   var res: f32 = atan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.dxc.hlsl
index 8b78942..f799fb8 100644
--- a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_02979a() {
   float arg_0 = 1.0f;
   float res = atan(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.fxc.hlsl
index 8b78942..f799fb8 100644
--- a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_02979a() {
   float arg_0 = 1.0f;
   float res = atan(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.glsl
index b228c08..b7ef9b1 100644
--- a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan_02979a() {
   float arg_0 = 1.0f;
   float res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan_02979a() {
   float arg_0 = 1.0f;
   float res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan_02979a() {
   float arg_0 = 1.0f;
   float res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.msl b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.msl
index 53002f4..4a2de14 100644
--- a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_02979a() {
+void atan_02979a(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = atan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_02979a();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  atan_02979a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_02979a();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  atan_02979a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_02979a();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  atan_02979a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.spvasm
index b405e4a..6e5326f 100644
--- a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_02979a "atan_02979a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%atan_02979a = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%atan_02979a = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Atan %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Atan %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atan_02979a
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atan_02979a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan_02979a
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan_02979a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan_02979a
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan_02979a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.wgsl
index b5dd9d0..6ff8c2e 100644
--- a/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan/02979a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn atan_02979a() {
   var arg_0 = 1.0f;
   var res : f32 = atan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_02979a();
diff --git a/test/tint/builtins/gen/var/atan/19faea.wgsl b/test/tint/builtins/gen/var/atan/19faea.wgsl
index a0e6e25..d9b3d5d 100644
--- a/test/tint/builtins/gen/var/atan/19faea.wgsl
+++ b/test/tint/builtins/gen/var/atan/19faea.wgsl
@@ -27,7 +27,9 @@
 fn atan_19faea() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = atan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.dxc.hlsl
index 0ee7b59..735d91a 100644
--- a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_19faea() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = atan(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.fxc.hlsl
index 015e0f1..37261be 100644
--- a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_19faea() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = atan(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.glsl
index c061757..0fe6b42 100644
--- a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan_19faea() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan_19faea() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan_19faea() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.msl b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.msl
index 9cdba27..fe43822 100644
--- a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_19faea() {
+void atan_19faea(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = atan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_19faea();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  atan_19faea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_19faea();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  atan_19faea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_19faea();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  atan_19faea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.spvasm
index eee05ac..cb3cc68 100644
--- a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_19faea "atan_19faea"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_19faea = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Atan %22
-               OpStore %res %20
+%atan_19faea = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Atan %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %atan_19faea
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %atan_19faea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %atan_19faea
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %atan_19faea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %atan_19faea
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %atan_19faea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.wgsl
index 4f67d35..c3678ef 100644
--- a/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan/19faea.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atan_19faea() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = atan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_19faea();
diff --git a/test/tint/builtins/gen/var/atan/1e1764.wgsl b/test/tint/builtins/gen/var/atan/1e1764.wgsl
index 0906855..42b84f4 100644
--- a/test/tint/builtins/gen/var/atan/1e1764.wgsl
+++ b/test/tint/builtins/gen/var/atan/1e1764.wgsl
@@ -27,7 +27,9 @@
 fn atan_1e1764() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = atan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.dxc.hlsl
index c9b4335..190b951 100644
--- a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_1e1764() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = atan(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.fxc.hlsl
index 6394ce3..1fa2af3 100644
--- a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_1e1764() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = atan(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.glsl
index 18121b6..c90fa66 100644
--- a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan_1e1764() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan_1e1764() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan_1e1764() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.msl b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.msl
index 3e8f50d..8ba5e73 100644
--- a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_1e1764() {
+void atan_1e1764(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = atan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_1e1764();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  atan_1e1764(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_1e1764();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  atan_1e1764(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_1e1764();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  atan_1e1764(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.spvasm
index fcc60e5..34af297 100644
--- a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_1e1764 "atan_1e1764"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_1e1764 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Atan %22
-               OpStore %res %20
+%atan_1e1764 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Atan %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %atan_1e1764
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %atan_1e1764
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %atan_1e1764
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %atan_1e1764
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %atan_1e1764
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %atan_1e1764
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.wgsl
index 2f1424f..dfe8c5e 100644
--- a/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan/1e1764.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atan_1e1764() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = atan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_1e1764();
diff --git a/test/tint/builtins/gen/var/atan/331e6d.wgsl b/test/tint/builtins/gen/var/atan/331e6d.wgsl
index ebe857e..e1725fc 100644
--- a/test/tint/builtins/gen/var/atan/331e6d.wgsl
+++ b/test/tint/builtins/gen/var/atan/331e6d.wgsl
@@ -25,7 +25,9 @@
 fn atan_331e6d() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = atan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.dxc.hlsl
index 7ab750d..fdbcda1 100644
--- a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_331e6d() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = atan(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.fxc.hlsl
index 7ab750d..fdbcda1 100644
--- a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_331e6d() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = atan(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.glsl
index b48d70d..350f3d3 100644
--- a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan_331e6d() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan_331e6d() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan_331e6d() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.msl b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.msl
index 964c412..7279c5c 100644
--- a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_331e6d() {
+void atan_331e6d(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = atan(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_331e6d();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  atan_331e6d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_331e6d();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  atan_331e6d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_331e6d();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  atan_331e6d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.spvasm
index cfd498d..b4731b1 100644
--- a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_331e6d "atan_331e6d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%atan_331e6d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Atan %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%atan_331e6d = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Atan %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atan_331e6d
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atan_331e6d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan_331e6d
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan_331e6d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %atan_331e6d
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %atan_331e6d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.wgsl
index 43496f2..bd7085a 100644
--- a/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan/331e6d.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn atan_331e6d() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = atan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_331e6d();
diff --git a/test/tint/builtins/gen/var/atan/5ca7b8.wgsl b/test/tint/builtins/gen/var/atan/5ca7b8.wgsl
index 10df7a2..80d1045 100644
--- a/test/tint/builtins/gen/var/atan/5ca7b8.wgsl
+++ b/test/tint/builtins/gen/var/atan/5ca7b8.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = atan(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_5ca7b8();
diff --git a/test/tint/builtins/gen/var/atan/749e1b.wgsl b/test/tint/builtins/gen/var/atan/749e1b.wgsl
index 82d41fe..ec37b0c 100644
--- a/test/tint/builtins/gen/var/atan/749e1b.wgsl
+++ b/test/tint/builtins/gen/var/atan/749e1b.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = atan(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_749e1b();
diff --git a/test/tint/builtins/gen/var/atan/7a2a75.wgsl b/test/tint/builtins/gen/var/atan/7a2a75.wgsl
index 4ec745c..728bddd 100644
--- a/test/tint/builtins/gen/var/atan/7a2a75.wgsl
+++ b/test/tint/builtins/gen/var/atan/7a2a75.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = atan(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_7a2a75();
diff --git a/test/tint/builtins/gen/var/atan/a5f421.wgsl b/test/tint/builtins/gen/var/atan/a5f421.wgsl
index 26f3358..4c0730a 100644
--- a/test/tint/builtins/gen/var/atan/a5f421.wgsl
+++ b/test/tint/builtins/gen/var/atan/a5f421.wgsl
@@ -27,7 +27,9 @@
 fn atan_a5f421() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = atan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.dxc.hlsl
index 880f20e..1874912 100644
--- a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a5f421() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = atan(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.fxc.hlsl
index 9efdf52..e758018 100644
--- a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a5f421() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = atan(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.glsl
index 4560059..4e353d0 100644
--- a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan_a5f421() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan_a5f421() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan_a5f421() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.msl b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.msl
index 3951381..b9bcd5c 100644
--- a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_a5f421() {
+void atan_a5f421(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = atan(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_a5f421();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  atan_a5f421(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_a5f421();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  atan_a5f421(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_a5f421();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  atan_a5f421(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.spvasm
index b620384..4c4da9f 100644
--- a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_a5f421 "atan_a5f421"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_a5f421 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Atan %22
-               OpStore %res %20
+%atan_a5f421 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Atan %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %atan_a5f421
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %atan_a5f421
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %atan_a5f421
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %atan_a5f421
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %atan_a5f421
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %atan_a5f421
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.wgsl
index f4230d0..c554e2f 100644
--- a/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan/a5f421.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atan_a5f421() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = atan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_a5f421();
diff --git a/test/tint/builtins/gen/var/atan/a7ba61.wgsl b/test/tint/builtins/gen/var/atan/a7ba61.wgsl
index 53fd0e4..4a5c143 100644
--- a/test/tint/builtins/gen/var/atan/a7ba61.wgsl
+++ b/test/tint/builtins/gen/var/atan/a7ba61.wgsl
@@ -27,7 +27,9 @@
 fn atan_a7ba61() {
   var arg_0 = 1.h;
   var res: f16 = atan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.dxc.hlsl
index 3bcfc82..929372c 100644
--- a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a7ba61() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = atan(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.fxc.hlsl
index b4c0e0d..6603778 100644
--- a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a7ba61() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = atan(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.glsl
index 45344ff..8f5979a 100644
--- a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan_a7ba61() {
   float16_t arg_0 = 1.0hf;
   float16_t res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan_a7ba61() {
   float16_t arg_0 = 1.0hf;
   float16_t res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan_a7ba61() {
   float16_t arg_0 = 1.0hf;
   float16_t res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.msl b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.msl
index 7cefaec..00ab5ab 100644
--- a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_a7ba61() {
+void atan_a7ba61(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = atan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_a7ba61();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  atan_a7ba61(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_a7ba61();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  atan_a7ba61(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_a7ba61();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  atan_a7ba61(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.spvasm
index 42fe3bc..0061d6b 100644
--- a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_a7ba61 "atan_a7ba61"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan_a7ba61 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%atan_a7ba61 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Atan %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Atan %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atan_a7ba61
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %atan_a7ba61
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan_a7ba61
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan_a7ba61
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %atan_a7ba61
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %atan_a7ba61
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.wgsl
index cbd8a89..4f41993 100644
--- a/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan/a7ba61.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atan_a7ba61() {
   var arg_0 = 1.0h;
   var res : f16 = atan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_a7ba61();
diff --git a/test/tint/builtins/gen/var/atan/a8b696.wgsl b/test/tint/builtins/gen/var/atan/a8b696.wgsl
index 5bb9e3e..6585af9 100644
--- a/test/tint/builtins/gen/var/atan/a8b696.wgsl
+++ b/test/tint/builtins/gen/var/atan/a8b696.wgsl
@@ -25,7 +25,9 @@
 fn atan_a8b696() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = atan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.dxc.hlsl
index 15a1926..4280c92 100644
--- a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a8b696() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = atan(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.fxc.hlsl
index 15a1926..4280c92 100644
--- a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_a8b696() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = atan(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.glsl
index 61e17dd..4ae1684 100644
--- a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan_a8b696() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan_a8b696() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan_a8b696() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.msl b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.msl
index 350a038..8d94e19 100644
--- a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_a8b696() {
+void atan_a8b696(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = atan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_a8b696();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  atan_a8b696(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_a8b696();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  atan_a8b696(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_a8b696();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  atan_a8b696(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.spvasm
index 694b6bf..ab482e4 100644
--- a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_a8b696 "atan_a8b696"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%atan_a8b696 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%atan_a8b696 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Atan %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Atan %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atan_a8b696
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atan_a8b696
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %atan_a8b696
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %atan_a8b696
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %atan_a8b696
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %atan_a8b696
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.wgsl
index 38016aa..1fd9634 100644
--- a/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan/a8b696.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn atan_a8b696() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = atan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_a8b696();
diff --git a/test/tint/builtins/gen/var/atan/ad96e4.wgsl b/test/tint/builtins/gen/var/atan/ad96e4.wgsl
index 82f3989..9478c24 100644
--- a/test/tint/builtins/gen/var/atan/ad96e4.wgsl
+++ b/test/tint/builtins/gen/var/atan/ad96e4.wgsl
@@ -25,7 +25,9 @@
 fn atan_ad96e4() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = atan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.dxc.hlsl
index 86c25dc..392f9ae 100644
--- a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_ad96e4() {
   float2 arg_0 = (1.0f).xx;
   float2 res = atan(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.fxc.hlsl
index 86c25dc..392f9ae 100644
--- a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan_ad96e4() {
   float2 arg_0 = (1.0f).xx;
   float2 res = atan(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.glsl
index 0c07baf..a1a9c54 100644
--- a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan_ad96e4() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan_ad96e4() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan_ad96e4() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = atan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.msl b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.msl
index 1928597..11a1e3f 100644
--- a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan_ad96e4() {
+void atan_ad96e4(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = atan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan_ad96e4();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  atan_ad96e4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan_ad96e4();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  atan_ad96e4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan_ad96e4();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  atan_ad96e4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.spvasm
index b6e0281..ff594ec 100644
--- a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan_ad96e4 "atan_ad96e4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%atan_ad96e4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Atan %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%atan_ad96e4 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Atan %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atan_ad96e4
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atan_ad96e4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan_ad96e4
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan_ad96e4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %atan_ad96e4
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %atan_ad96e4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.wgsl
index 35b3936..68b6837 100644
--- a/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan/ad96e4.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn atan_ad96e4() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = atan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_ad96e4();
diff --git a/test/tint/builtins/gen/var/atan/d17fb2.wgsl b/test/tint/builtins/gen/var/atan/d17fb2.wgsl
index 4098f4f..8bee3f5 100644
--- a/test/tint/builtins/gen/var/atan/d17fb2.wgsl
+++ b/test/tint/builtins/gen/var/atan/d17fb2.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = atan(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan_d17fb2();
diff --git a/test/tint/builtins/gen/var/atan2/034ace.wgsl b/test/tint/builtins/gen/var/atan2/034ace.wgsl
index 0c6fdaa..33300e3 100644
--- a/test/tint/builtins/gen/var/atan2/034ace.wgsl
+++ b/test/tint/builtins/gen/var/atan2/034ace.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1.;
   var res = atan2(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_034ace();
diff --git a/test/tint/builtins/gen/var/atan2/21dfea.wgsl b/test/tint/builtins/gen/var/atan2/21dfea.wgsl
index 636ca4a..2921427 100644
--- a/test/tint/builtins/gen/var/atan2/21dfea.wgsl
+++ b/test/tint/builtins/gen/var/atan2/21dfea.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: vec3<f16> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.dxc.hlsl
index 2e50bdd..5c30535 100644
--- a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_21dfea() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = atan2(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.fxc.hlsl
index 7e27ba3..94342e4 100644
--- a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_21dfea() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = atan2(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.glsl
index d5fdaa5..6a8fcc0 100644
--- a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan2_21dfea() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan2_21dfea() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atan2_21dfea() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.msl b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.msl
index dc7e8bc..2996f96 100644
--- a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_21dfea() {
+void atan2_21dfea(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 res = atan2(arg_0, arg_1);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_21dfea();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  atan2_21dfea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_21dfea();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  atan2_21dfea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_21dfea();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  atan2_21dfea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.spvasm
index 3fefd38..0bcd7a7 100644
--- a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_21dfea "atan2_21dfea"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_21dfea = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3half %arg_0
-         %24 = OpLoad %v3half %arg_1
-         %21 = OpExtInst %v3half %22 Atan2 %23 %24
-               OpStore %res %21
+%atan2_21dfea = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3half %arg_0
+         %27 = OpLoad %v3half %arg_1
+         %24 = OpExtInst %v3half %25 Atan2 %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %33 = OpLoad %v3half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan2_21dfea
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan2_21dfea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %atan2_21dfea
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %atan2_21dfea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %atan2_21dfea
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %atan2_21dfea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.wgsl
index 0ab468d..5296a2c 100644
--- a/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan2/21dfea.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : vec3<f16> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_21dfea();
diff --git a/test/tint/builtins/gen/var/atan2/3c2865.wgsl b/test/tint/builtins/gen/var/atan2/3c2865.wgsl
index 412205b..4f3ac16 100644
--- a/test/tint/builtins/gen/var/atan2/3c2865.wgsl
+++ b/test/tint/builtins/gen/var/atan2/3c2865.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = atan2(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_3c2865();
diff --git a/test/tint/builtins/gen/var/atan2/57fb13.wgsl b/test/tint/builtins/gen/var/atan2/57fb13.wgsl
index b96b973..b600c85 100644
--- a/test/tint/builtins/gen/var/atan2/57fb13.wgsl
+++ b/test/tint/builtins/gen/var/atan2/57fb13.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<f32>(1.f);
   var res: vec2<f32> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.dxc.hlsl
index 8056f7d..2cca7b2 100644
--- a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_57fb13() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = atan2(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.fxc.hlsl
index 8056f7d..2cca7b2 100644
--- a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_57fb13() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = atan2(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.glsl
index e763d96..55e2b3c 100644
--- a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan2_57fb13() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan2_57fb13() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atan2_57fb13() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.msl b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.msl
index e7a3592..e88a80a 100644
--- a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_57fb13() {
+void atan2_57fb13(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 res = atan2(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_57fb13();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  atan2_57fb13(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_57fb13();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  atan2_57fb13(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_57fb13();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  atan2_57fb13(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.spvasm
index 50706ea..b0a0f2ff 100644
--- a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_57fb13 "atan2_57fb13"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
-%atan2_57fb13 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v2float %arg_0
-         %23 = OpLoad %v2float %arg_1
-         %20 = OpExtInst %v2float %21 Atan2 %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %33 = OpTypeFunction %v4float
+%atan2_57fb13 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v2float %arg_0
+         %26 = OpLoad %v2float %arg_1
+         %23 = OpExtInst %v2float %24 Atan2 %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %32 = OpLoad %v2float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atan2_57fb13
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %atan2_57fb13
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %atan2_57fb13
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %atan2_57fb13
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %atan2_57fb13
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %atan2_57fb13
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.wgsl
index b9d5b33..ae1cfae 100644
--- a/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan2/57fb13.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<f32>(1.0f);
   var res : vec2<f32> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_57fb13();
diff --git a/test/tint/builtins/gen/var/atan2/93febc.wgsl b/test/tint/builtins/gen/var/atan2/93febc.wgsl
index 1b2c63b..d66a4c4 100644
--- a/test/tint/builtins/gen/var/atan2/93febc.wgsl
+++ b/test/tint/builtins/gen/var/atan2/93febc.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<f16>(1.h);
   var res: vec2<f16> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.dxc.hlsl
index fa686ae..921f79f 100644
--- a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_93febc() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = atan2(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.fxc.hlsl
index fbf9a01..64a185e 100644
--- a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_93febc() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = atan2(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.glsl
index c46a5d1..cd37c9b 100644
--- a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan2_93febc() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan2_93febc() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atan2_93febc() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.msl b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.msl
index 4da1248..bf7b507 100644
--- a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_93febc() {
+void atan2_93febc(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 res = atan2(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_93febc();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  atan2_93febc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_93febc();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  atan2_93febc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_93febc();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  atan2_93febc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.spvasm
index d9d1415..c0ce1a9 100644
--- a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_93febc "atan2_93febc"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_93febc = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2half %arg_0
-         %24 = OpLoad %v2half %arg_1
-         %21 = OpExtInst %v2half %22 Atan2 %23 %24
-               OpStore %res %21
+%atan2_93febc = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2half %arg_0
+         %27 = OpLoad %v2half %arg_1
+         %24 = OpExtInst %v2half %25 Atan2 %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %33 = OpLoad %v2half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan2_93febc
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan2_93febc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %atan2_93febc
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %atan2_93febc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %atan2_93febc
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %atan2_93febc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.wgsl
index 7516baa..2bed1df 100644
--- a/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan2/93febc.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<f16>(1.0h);
   var res : vec2<f16> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_93febc();
diff --git a/test/tint/builtins/gen/var/atan2/96057c.wgsl b/test/tint/builtins/gen/var/atan2/96057c.wgsl
index 4d8e682..91746b9 100644
--- a/test/tint/builtins/gen/var/atan2/96057c.wgsl
+++ b/test/tint/builtins/gen/var/atan2/96057c.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1.f;
   var arg_1 = 1.f;
   var res: f32 = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.dxc.hlsl
index 39bf0d5..fadcbb3 100644
--- a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_96057c() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = atan2(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.fxc.hlsl
index 39bf0d5..fadcbb3 100644
--- a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_96057c() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = atan2(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.glsl
index f1ea03a..ef5870b 100644
--- a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan2_96057c() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan2_96057c() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atan2_96057c() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.msl b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.msl
index 799efaa..148a3be 100644
--- a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_96057c() {
+void atan2_96057c(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = atan2(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_96057c();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  atan2_96057c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_96057c();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  atan2_96057c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_96057c();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  atan2_96057c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.spvasm
index 8a92d4b..614fb09 100644
--- a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_96057c "atan2_96057c"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,43 +38,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpTypeFunction %v4float
-%atan2_96057c = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
+%atan2_96057c = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
-         %19 = OpLoad %float %arg_0
-         %20 = OpLoad %float %arg_1
-         %17 = OpExtInst %float %18 Atan2 %19 %20
-               OpStore %res %17
+         %22 = OpLoad %float %arg_0
+         %23 = OpLoad %float %arg_1
+         %20 = OpExtInst %float %21 Atan2 %22 %23
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atan2_96057c
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %atan2_96057c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %atan2_96057c
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %atan2_96057c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %atan2_96057c
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %atan2_96057c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.wgsl
index 311e811..a2a77ef 100644
--- a/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan2/96057c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1.0f;
   var arg_1 = 1.0f;
   var res : f32 = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_96057c();
diff --git a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl
index 0ed20f4..74b9dfe 100644
--- a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl
+++ b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: vec3<f32> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.dxc.hlsl
index 6e544ee..5217d7d 100644
--- a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_a70d0d() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = atan2(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.fxc.hlsl
index 6e544ee..5217d7d 100644
--- a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_a70d0d() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = atan2(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.glsl
index a489410..db3b3e5 100644
--- a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan2_a70d0d() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan2_a70d0d() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atan2_a70d0d() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.msl b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.msl
index ec2a783..eb640cd 100644
--- a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_a70d0d() {
+void atan2_a70d0d(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 res = atan2(arg_0, arg_1);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_a70d0d();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  atan2_a70d0d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_a70d0d();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  atan2_a70d0d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_a70d0d();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  atan2_a70d0d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.spvasm
index 89d6641..bdb231c 100644
--- a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_a70d0d "atan2_a70d0d"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %25 = OpTypeFunction %v4float
-%atan2_a70d0d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v3float %arg_0
-         %23 = OpLoad %v3float %arg_1
-         %20 = OpExtInst %v3float %21 Atan2 %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %33 = OpTypeFunction %v4float
+%atan2_a70d0d = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v3float %arg_0
+         %26 = OpLoad %v3float %arg_1
+         %23 = OpExtInst %v3float %24 Atan2 %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %32 = OpLoad %v3float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atan2_a70d0d
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %atan2_a70d0d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %atan2_a70d0d
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %atan2_a70d0d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %atan2_a70d0d
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %atan2_a70d0d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.wgsl
index 3caf18d..432f5e2 100644
--- a/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan2/a70d0d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : vec3<f32> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_a70d0d();
diff --git a/test/tint/builtins/gen/var/atan2/ae713e.wgsl b/test/tint/builtins/gen/var/atan2/ae713e.wgsl
index 6fc425e..bd2b767 100644
--- a/test/tint/builtins/gen/var/atan2/ae713e.wgsl
+++ b/test/tint/builtins/gen/var/atan2/ae713e.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<f32>(1.f);
   var res: vec4<f32> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.dxc.hlsl
index e262cb4..b7dd251 100644
--- a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_ae713e() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = atan2(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.fxc.hlsl
index e262cb4..b7dd251 100644
--- a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_ae713e() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = atan2(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.glsl
index 80c808f6..806c9a6 100644
--- a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan2_ae713e() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan2_ae713e() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atan2_ae713e() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.msl b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.msl
index 100f2dc..5e8dd16 100644
--- a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_ae713e() {
+void atan2_ae713e(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 res = atan2(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_ae713e();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  atan2_ae713e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_ae713e();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  atan2_ae713e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_ae713e();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  atan2_ae713e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.spvasm
index b54fe82..fbf8d26 100644
--- a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_ae713e "atan2_ae713e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,44 +38,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpTypeFunction %v4float
-%atan2_ae713e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
+%atan2_ae713e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-         %20 = OpLoad %v4float %arg_0
-         %21 = OpLoad %v4float %arg_1
-         %18 = OpExtInst %v4float %19 Atan2 %20 %21
-               OpStore %res %18
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+         %23 = OpLoad %v4float %arg_0
+         %24 = OpLoad %v4float %arg_1
+         %21 = OpExtInst %v4float %22 Atan2 %23 %24
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atan2_ae713e
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atan2_ae713e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atan2_ae713e
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atan2_ae713e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %atan2_ae713e
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %atan2_ae713e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.wgsl
index cc0e1ff..37c3b75 100644
--- a/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan2/ae713e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<f32>(1.0f);
   var res : vec4<f32> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_ae713e();
diff --git a/test/tint/builtins/gen/var/atan2/c19683.wgsl b/test/tint/builtins/gen/var/atan2/c19683.wgsl
index 978154a..47414d5 100644
--- a/test/tint/builtins/gen/var/atan2/c19683.wgsl
+++ b/test/tint/builtins/gen/var/atan2/c19683.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1.);
   var res = atan2(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_c19683();
diff --git a/test/tint/builtins/gen/var/atan2/c4be45.wgsl b/test/tint/builtins/gen/var/atan2/c4be45.wgsl
index 446e1df..778b800 100644
--- a/test/tint/builtins/gen/var/atan2/c4be45.wgsl
+++ b/test/tint/builtins/gen/var/atan2/c4be45.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1.);
   var res = atan2(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_c4be45();
diff --git a/test/tint/builtins/gen/var/atan2/ca698e.wgsl b/test/tint/builtins/gen/var/atan2/ca698e.wgsl
index 1cc112e..1914f86 100644
--- a/test/tint/builtins/gen/var/atan2/ca698e.wgsl
+++ b/test/tint/builtins/gen/var/atan2/ca698e.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1.h;
   var arg_1 = 1.h;
   var res: f16 = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.dxc.hlsl
index 4fd16b6..b7d402d 100644
--- a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_ca698e() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = atan2(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.fxc.hlsl
index 001891c..0046f93 100644
--- a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_ca698e() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = atan2(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.glsl
index 72dfcd9..3560977 100644
--- a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan2_ca698e() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan2_ca698e() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atan2_ca698e() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.msl b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.msl
index 40641e9..9a4aa6c 100644
--- a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_ca698e() {
+void atan2_ca698e(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half res = atan2(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_ca698e();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  atan2_ca698e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_ca698e();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  atan2_ca698e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_ca698e();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  atan2_ca698e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.spvasm
index 64133e1..dbe6b8d 100644
--- a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_ca698e "atan2_ca698e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,46 +42,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_ca698e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%atan2_ca698e = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
-         %21 = OpLoad %half %arg_0
-         %22 = OpLoad %half %arg_1
-         %19 = OpExtInst %half %20 Atan2 %21 %22
-               OpStore %res %19
+         %24 = OpLoad %half %arg_0
+         %25 = OpLoad %half %arg_1
+         %22 = OpExtInst %half %23 Atan2 %24 %25
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %atan2_ca698e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %atan2_ca698e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %atan2_ca698e
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %atan2_ca698e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %atan2_ca698e
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %atan2_ca698e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.wgsl
index 68eaa92..ea687f2 100644
--- a/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan2/ca698e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1.0h;
   var arg_1 = 1.0h;
   var res : f16 = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_ca698e();
diff --git a/test/tint/builtins/gen/var/atan2/d983ab.wgsl b/test/tint/builtins/gen/var/atan2/d983ab.wgsl
index b538cf8..8517cae 100644
--- a/test/tint/builtins/gen/var/atan2/d983ab.wgsl
+++ b/test/tint/builtins/gen/var/atan2/d983ab.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<f16>(1.h);
   var res: vec4<f16> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.dxc.hlsl
index 50d70ea..c003e75 100644
--- a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_d983ab() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = atan2(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.fxc.hlsl
index c6ca754..85516dd 100644
--- a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atan2_d983ab() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = atan2(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.glsl
index 00eb85b..af1c849 100644
--- a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan2_d983ab() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan2_d983ab() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atan2_d983ab() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = atan(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.msl b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.msl
index ff2c655..219b953 100644
--- a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atan2_d983ab() {
+void atan2_d983ab(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 res = atan2(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atan2_d983ab();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  atan2_d983ab(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atan2_d983ab();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  atan2_d983ab(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atan2_d983ab();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  atan2_d983ab(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.spvasm
index 5e8d617..f0cbaf1 100644
--- a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atan2_d983ab "atan2_d983ab"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%atan2_d983ab = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4half %arg_0
-         %24 = OpLoad %v4half %arg_1
-         %21 = OpExtInst %v4half %22 Atan2 %23 %24
-               OpStore %res %21
+%atan2_d983ab = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4half %arg_0
+         %27 = OpLoad %v4half %arg_1
+         %24 = OpExtInst %v4half %25 Atan2 %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %33 = OpLoad %v4half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %atan2_d983ab
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %atan2_d983ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %atan2_d983ab
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %atan2_d983ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %atan2_d983ab
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %atan2_d983ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.wgsl
index b83cab2..6c50518 100644
--- a/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atan2/d983ab.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<f16>(1.0h);
   var res : vec4<f16> = atan2(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atan2_d983ab();
diff --git a/test/tint/builtins/gen/var/atanh/440cca.wgsl b/test/tint/builtins/gen/var/atanh/440cca.wgsl
index a0b4fb4..c89f950 100644
--- a/test/tint/builtins/gen/var/atanh/440cca.wgsl
+++ b/test/tint/builtins/gen/var/atanh/440cca.wgsl
@@ -25,7 +25,9 @@
 fn atanh_440cca() {
   var arg_0 = vec3<f32>(0.5f);
   var res: vec3<f32> = atanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.dxc.hlsl
index 6cfcd4c..9ab975c 100644
--- a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_440cca() {
   float3 arg_0 = (0.5f).xxx;
   float3 res = tint_atanh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.fxc.hlsl
index 6cfcd4c..9ab975c 100644
--- a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_440cca() {
   float3 arg_0 = (0.5f).xxx;
   float3 res = tint_atanh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.glsl b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.glsl
index 96f88b8..256f348 100644
--- a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atanh_440cca() {
   vec3 arg_0 = vec3(0.5f);
   vec3 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atanh_440cca() {
   vec3 arg_0 = vec3(0.5f);
   vec3 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return mix(atanh(x), vec3(0.0f), greaterThanEqual(x, vec3(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void atanh_440cca() {
   vec3 arg_0 = vec3(0.5f);
   vec3 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.msl b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.msl
index 24e275c..3300aab 100644
--- a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(atanh(x), float3(0.0f), (x >= float3(1.0f)));
 }
 
-void atanh_440cca() {
+void atanh_440cca(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(0.5f);
   float3 res = tint_atanh(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_440cca();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  atanh_440cca(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_440cca();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  atanh_440cca(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_440cca();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  atanh_440cca(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.spvasm
index 7e4e861..90b29fd 100644
--- a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_atanh "tint_atanh"
                OpName %x "x"
                OpName %atanh_440cca "atanh_440cca"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,55 +40,64 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
     %v3float = OpTypeVector %float 3
-          %9 = OpTypeFunction %v3float %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %v3float %v3float
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %19 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
-         %20 = OpConstantNull %v3float
+         %23 = OpConstantNull %v3float
        %void = OpTypeVoid
-         %23 = OpTypeFunction %void
+         %26 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %28 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
+         %31 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %34 = OpTypeFunction %v4float
- %tint_atanh = OpFunction %v3float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %42 = OpTypeFunction %v4float
+ %tint_atanh = OpFunction %v3float None %13
           %x = OpFunctionParameter %v3float
-         %13 = OpLabel
-         %17 = OpFOrdGreaterThanEqual %v3bool %x %16
-         %21 = OpExtInst %v3float %22 Atanh %x
-         %14 = OpSelect %v3float %17 %20 %21
-               OpReturnValue %14
+         %16 = OpLabel
+         %20 = OpFOrdGreaterThanEqual %v3bool %x %19
+         %24 = OpExtInst %v3float %25 Atanh %x
+         %17 = OpSelect %v3float %20 %23 %24
+               OpReturnValue %17
                OpFunctionEnd
-%atanh_440cca = OpFunction %void None %23
-         %26 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %20
-        %res = OpVariable %_ptr_Function_v3float Function %20
-               OpStore %arg_0 %28
-         %32 = OpLoad %v3float %arg_0
-         %31 = OpFunctionCall %v3float %tint_atanh %32
-               OpStore %res %31
+%atanh_440cca = OpFunction %void None %26
+         %29 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %23
+        %res = OpVariable %_ptr_Function_v3float Function %23
+               OpStore %arg_0 %31
+         %35 = OpLoad %v3float %arg_0
+         %34 = OpFunctionCall %v3float %tint_atanh %35
+               OpStore %res %34
+         %40 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %41 = OpLoad %v3float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %atanh_440cca
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %atanh_440cca
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %23
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %26
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %23
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %atanh_440cca
+%fragment_main = OpFunction %void None %26
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %atanh_440cca
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %23
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %atanh_440cca
+%compute_main = OpFunction %void None %26
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %atanh_440cca
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.wgsl
index 1c99e3b..0f65133 100644
--- a/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atanh/440cca.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn atanh_440cca() {
   var arg_0 = vec3<f32>(0.5f);
   var res : vec3<f32> = atanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_440cca();
diff --git a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl
index 7639019..abeff15 100644
--- a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl
+++ b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl
@@ -27,7 +27,9 @@
 fn atanh_5bf88d() {
   var arg_0 = vec2<f16>(0.5h);
   var res: vec2<f16> = atanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.dxc.hlsl
index e3fc26b..d1c685d 100644
--- a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_5bf88d() {
   vector<float16_t, 2> arg_0 = (float16_t(0.5h)).xx;
   vector<float16_t, 2> res = tint_atanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.fxc.hlsl
index 791dea5..099ba25 100644
--- a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_5bf88d() {
   vector<float16_t, 2> arg_0 = (float16_t(0.5h)).xx;
   vector<float16_t, 2> res = tint_atanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.glsl b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.glsl
index fb6f974..f8fd950 100644
--- a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return mix(atanh(x), f16vec2(0.0hf), greaterThanEqual(x, f16vec2(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atanh_5bf88d() {
   f16vec2 arg_0 = f16vec2(0.5hf);
   f16vec2 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return mix(atanh(x), f16vec2(0.0hf), greaterThanEqual(x, f16vec2(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atanh_5bf88d() {
   f16vec2 arg_0 = f16vec2(0.5hf);
   f16vec2 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return mix(atanh(x), f16vec2(0.0hf), greaterThanEqual(x, f16vec2(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void atanh_5bf88d() {
   f16vec2 arg_0 = f16vec2(0.5hf);
   f16vec2 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.msl b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.msl
index ffbe3da..64ae714 100644
--- a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(atanh(x), half2(0.0h), (x >= half2(1.0h)));
 }
 
-void atanh_5bf88d() {
+void atanh_5bf88d(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(0.5h);
   half2 res = tint_atanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_5bf88d();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  atanh_5bf88d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_5bf88d();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  atanh_5bf88d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_5bf88d();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  atanh_5bf88d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.spvasm
index 46a928a..92f5fa0 100644
--- a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_atanh "tint_atanh"
                OpName %x "x"
                OpName %atanh_5bf88d "atanh_5bf88d"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,56 +45,65 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-          %9 = OpTypeFunction %v2half %v2half
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2half %v2half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
-         %21 = OpConstantNull %v2half
+         %24 = OpConstantNull %v2half
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
-         %29 = OpConstantComposite %v2half %half_0x1pn1 %half_0x1pn1
+         %32 = OpConstantComposite %v2half %half_0x1pn1 %half_0x1pn1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %35 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_atanh = OpFunction %v2half None %9
+ %tint_atanh = OpFunction %v2half None %14
           %x = OpFunctionParameter %v2half
-         %14 = OpLabel
-         %18 = OpFOrdGreaterThanEqual %v2bool %x %17
-         %22 = OpExtInst %v2half %23 Atanh %x
-         %15 = OpSelect %v2half %18 %21 %22
-               OpReturnValue %15
+         %17 = OpLabel
+         %21 = OpFOrdGreaterThanEqual %v2bool %x %20
+         %25 = OpExtInst %v2half %26 Atanh %x
+         %18 = OpSelect %v2half %21 %24 %25
+               OpReturnValue %18
                OpFunctionEnd
-%atanh_5bf88d = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %21
-        %res = OpVariable %_ptr_Function_v2half Function %21
-               OpStore %arg_0 %29
-         %33 = OpLoad %v2half %arg_0
-         %32 = OpFunctionCall %v2half %tint_atanh %33
-               OpStore %res %32
+%atanh_5bf88d = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %24
+        %res = OpVariable %_ptr_Function_v2half Function %24
+               OpStore %arg_0 %32
+         %36 = OpLoad %v2half %arg_0
+         %35 = OpFunctionCall %v2half %tint_atanh %36
+               OpStore %res %35
+         %41 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %42 = OpLoad %v2half %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %atanh_5bf88d
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %atanh_5bf88d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %27
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %atanh_5bf88d
+%fragment_main = OpFunction %void None %27
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %atanh_5bf88d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %atanh_5bf88d
+%compute_main = OpFunction %void None %27
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %atanh_5bf88d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.wgsl
index 621b045..44583cc 100644
--- a/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atanh/5bf88d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atanh_5bf88d() {
   var arg_0 = vec2<f16>(0.5h);
   var res : vec2<f16> = atanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_5bf88d();
diff --git a/test/tint/builtins/gen/var/atanh/70d5bd.wgsl b/test/tint/builtins/gen/var/atanh/70d5bd.wgsl
index d625cc5..b4691f7 100644
--- a/test/tint/builtins/gen/var/atanh/70d5bd.wgsl
+++ b/test/tint/builtins/gen/var/atanh/70d5bd.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(0.5);
   var res = atanh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_70d5bd();
diff --git a/test/tint/builtins/gen/var/atanh/7997d8.wgsl b/test/tint/builtins/gen/var/atanh/7997d8.wgsl
index 45fcd80..90781f4 100644
--- a/test/tint/builtins/gen/var/atanh/7997d8.wgsl
+++ b/test/tint/builtins/gen/var/atanh/7997d8.wgsl
@@ -25,7 +25,9 @@
 fn atanh_7997d8() {
   var arg_0 = 0.5f;
   var res: f32 = atanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.dxc.hlsl
index 24fe178..61a3ba6 100644
--- a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_7997d8() {
   float arg_0 = 0.5f;
   float res = tint_atanh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.fxc.hlsl
index 24fe178..61a3ba6 100644
--- a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_7997d8() {
   float arg_0 = 0.5f;
   float res = tint_atanh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.glsl b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.glsl
index 44e3d5f..68f1e32 100644
--- a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return ((x >= 1.0f) ? 0.0f : atanh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atanh_7997d8() {
   float arg_0 = 0.5f;
   float res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return ((x >= 1.0f) ? 0.0f : atanh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atanh_7997d8() {
   float arg_0 = 0.5f;
   float res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return ((x >= 1.0f) ? 0.0f : atanh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void atanh_7997d8() {
   float arg_0 = 0.5f;
   float res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.msl b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.msl
index ef13bec..3ca2815 100644
--- a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(atanh(x), 0.0f, (x >= 1.0f));
 }
 
-void atanh_7997d8() {
+void atanh_7997d8(device float* const tint_symbol_1) {
   float arg_0 = 0.5f;
   float res = tint_atanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_7997d8();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  atanh_7997d8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_7997d8();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  atanh_7997d8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_7997d8();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  atanh_7997d8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.spvasm
index 95322a9..15893ec 100644
--- a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_atanh "tint_atanh"
                OpName %x "x"
                OpName %atanh_7997d8 "atanh_7997d8"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,51 +39,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-          %9 = OpTypeFunction %float %float
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %12 = OpTypeFunction %float %float
     %float_1 = OpConstant %float 1
        %bool = OpTypeBool
        %void = OpTypeVoid
-         %19 = OpTypeFunction %void
+         %22 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
 %_ptr_Function_float = OpTypePointer Function %float
-         %29 = OpTypeFunction %v4float
- %tint_atanh = OpFunction %float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %37 = OpTypeFunction %v4float
+ %tint_atanh = OpFunction %float None %12
           %x = OpFunctionParameter %float
-         %12 = OpLabel
-         %15 = OpFOrdGreaterThanEqual %bool %x %float_1
-         %17 = OpExtInst %float %18 Atanh %x
-         %13 = OpSelect %float %15 %8 %17
-               OpReturnValue %13
+         %15 = OpLabel
+         %18 = OpFOrdGreaterThanEqual %bool %x %float_1
+         %20 = OpExtInst %float %21 Atanh %x
+         %16 = OpSelect %float %18 %8 %20
+               OpReturnValue %16
                OpFunctionEnd
-%atanh_7997d8 = OpFunction %void None %19
-         %22 = OpLabel
+%atanh_7997d8 = OpFunction %void None %22
+         %25 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_0_5
-         %27 = OpLoad %float %arg_0
-         %26 = OpFunctionCall %float %tint_atanh %27
-               OpStore %res %26
+         %30 = OpLoad %float %arg_0
+         %29 = OpFunctionCall %float %tint_atanh %30
+               OpStore %res %29
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %atanh_7997d8
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %atanh_7997d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %19
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %22
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %19
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %atanh_7997d8
+%fragment_main = OpFunction %void None %22
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %atanh_7997d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %19
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %atanh_7997d8
+%compute_main = OpFunction %void None %22
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %atanh_7997d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.wgsl
index a375e93..6897440 100644
--- a/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atanh/7997d8.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn atanh_7997d8() {
   var arg_0 = 0.5f;
   var res : f32 = atanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_7997d8();
diff --git a/test/tint/builtins/gen/var/atanh/7f2874.wgsl b/test/tint/builtins/gen/var/atanh/7f2874.wgsl
index 2e310c7..ab3b443 100644
--- a/test/tint/builtins/gen/var/atanh/7f2874.wgsl
+++ b/test/tint/builtins/gen/var/atanh/7f2874.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(0.5);
   var res = atanh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_7f2874();
diff --git a/test/tint/builtins/gen/var/atanh/c0e634.wgsl b/test/tint/builtins/gen/var/atanh/c0e634.wgsl
index 11abbc8..5bd3123 100644
--- a/test/tint/builtins/gen/var/atanh/c0e634.wgsl
+++ b/test/tint/builtins/gen/var/atanh/c0e634.wgsl
@@ -25,7 +25,9 @@
 fn atanh_c0e634() {
   var arg_0 = vec2<f32>(0.5f);
   var res: vec2<f32> = atanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.dxc.hlsl
index 4c38c2d..20275e6 100644
--- a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_c0e634() {
   float2 arg_0 = (0.5f).xx;
   float2 res = tint_atanh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.fxc.hlsl
index 4c38c2d..20275e6 100644
--- a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_c0e634() {
   float2 arg_0 = (0.5f).xx;
   float2 res = tint_atanh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.glsl b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.glsl
index 8693caa..a4da60c 100644
--- a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atanh_c0e634() {
   vec2 arg_0 = vec2(0.5f);
   vec2 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atanh_c0e634() {
   vec2 arg_0 = vec2(0.5f);
   vec2 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return mix(atanh(x), vec2(0.0f), greaterThanEqual(x, vec2(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void atanh_c0e634() {
   vec2 arg_0 = vec2(0.5f);
   vec2 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.msl b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.msl
index 51cfc7a..5c70ab9 100644
--- a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(atanh(x), float2(0.0f), (x >= float2(1.0f)));
 }
 
-void atanh_c0e634() {
+void atanh_c0e634(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(0.5f);
   float2 res = tint_atanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_c0e634();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  atanh_c0e634(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_c0e634();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  atanh_c0e634(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_c0e634();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  atanh_c0e634(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.spvasm
index 8c6366e..8e61d09 100644
--- a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_atanh "tint_atanh"
                OpName %x "x"
                OpName %atanh_c0e634 "atanh_c0e634"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,55 +40,64 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
     %v2float = OpTypeVector %float 2
-          %9 = OpTypeFunction %v2float %v2float
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %v2float %v2float
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
+         %19 = OpConstantComposite %v2float %float_1 %float_1
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
-         %20 = OpConstantNull %v2float
+         %23 = OpConstantNull %v2float
        %void = OpTypeVoid
-         %23 = OpTypeFunction %void
+         %26 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %28 = OpConstantComposite %v2float %float_0_5 %float_0_5
+         %31 = OpConstantComposite %v2float %float_0_5 %float_0_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %34 = OpTypeFunction %v4float
- %tint_atanh = OpFunction %v2float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %42 = OpTypeFunction %v4float
+ %tint_atanh = OpFunction %v2float None %13
           %x = OpFunctionParameter %v2float
-         %13 = OpLabel
-         %17 = OpFOrdGreaterThanEqual %v2bool %x %16
-         %21 = OpExtInst %v2float %22 Atanh %x
-         %14 = OpSelect %v2float %17 %20 %21
-               OpReturnValue %14
+         %16 = OpLabel
+         %20 = OpFOrdGreaterThanEqual %v2bool %x %19
+         %24 = OpExtInst %v2float %25 Atanh %x
+         %17 = OpSelect %v2float %20 %23 %24
+               OpReturnValue %17
                OpFunctionEnd
-%atanh_c0e634 = OpFunction %void None %23
-         %26 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %20
-        %res = OpVariable %_ptr_Function_v2float Function %20
-               OpStore %arg_0 %28
-         %32 = OpLoad %v2float %arg_0
-         %31 = OpFunctionCall %v2float %tint_atanh %32
-               OpStore %res %31
+%atanh_c0e634 = OpFunction %void None %26
+         %29 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %23
+        %res = OpVariable %_ptr_Function_v2float Function %23
+               OpStore %arg_0 %31
+         %35 = OpLoad %v2float %arg_0
+         %34 = OpFunctionCall %v2float %tint_atanh %35
+               OpStore %res %34
+         %40 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %41 = OpLoad %v2float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %atanh_c0e634
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %atanh_c0e634
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %23
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %26
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %23
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %atanh_c0e634
+%fragment_main = OpFunction %void None %26
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %atanh_c0e634
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %23
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %atanh_c0e634
+%compute_main = OpFunction %void None %26
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %atanh_c0e634
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.wgsl
index fd266f3..5176a0b 100644
--- a/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atanh/c0e634.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn atanh_c0e634() {
   var arg_0 = vec2<f32>(0.5f);
   var res : vec2<f32> = atanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_c0e634();
diff --git a/test/tint/builtins/gen/var/atanh/c5dc32.wgsl b/test/tint/builtins/gen/var/atanh/c5dc32.wgsl
index 357cb77..887d1fc 100644
--- a/test/tint/builtins/gen/var/atanh/c5dc32.wgsl
+++ b/test/tint/builtins/gen/var/atanh/c5dc32.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 0.5;
   var res = atanh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_c5dc32();
diff --git a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl
index c2611e2..0d624fb 100644
--- a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl
+++ b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl
@@ -27,7 +27,9 @@
 fn atanh_d2d8cd() {
   var arg_0 = 0.5h;
   var res: f16 = atanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.dxc.hlsl
index 1d7ad2a..03b0b90 100644
--- a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_d2d8cd() {
   float16_t arg_0 = float16_t(0.5h);
   float16_t res = tint_atanh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.fxc.hlsl
index a25c266..82825aa 100644
--- a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_d2d8cd() {
   float16_t arg_0 = float16_t(0.5h);
   float16_t res = tint_atanh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.glsl b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.glsl
index f06eec3..f17b1cd 100644
--- a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return ((x >= 1.0hf) ? 0.0hf : atanh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atanh_d2d8cd() {
   float16_t arg_0 = 0.5hf;
   float16_t res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return ((x >= 1.0hf) ? 0.0hf : atanh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atanh_d2d8cd() {
   float16_t arg_0 = 0.5hf;
   float16_t res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return ((x >= 1.0hf) ? 0.0hf : atanh(x));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void atanh_d2d8cd() {
   float16_t arg_0 = 0.5hf;
   float16_t res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.msl b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.msl
index 69a4fd9..1544de9 100644
--- a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(atanh(x), 0.0h, (x >= 1.0h));
 }
 
-void atanh_d2d8cd() {
+void atanh_d2d8cd(device half* const tint_symbol_1) {
   half arg_0 = 0.5h;
   half res = tint_atanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_d2d8cd();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  atanh_d2d8cd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_d2d8cd();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  atanh_d2d8cd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_d2d8cd();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  atanh_d2d8cd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.spvasm
index 45273a1..c8da1db 100644
--- a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_atanh "tint_atanh"
                OpName %x "x"
                OpName %atanh_d2d8cd "atanh_d2d8cd"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,53 +44,62 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
-          %9 = OpTypeFunction %half %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %half %half
 %half_0x1p_0 = OpConstant %half 0x1p+0
        %bool = OpTypeBool
-         %18 = OpConstantNull %half
+         %21 = OpConstantNull %half
        %void = OpTypeVoid
-         %21 = OpTypeFunction %void
+         %24 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
 %_ptr_Function_half = OpTypePointer Function %half
-         %31 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_atanh = OpFunction %half None %9
+ %tint_atanh = OpFunction %half None %13
           %x = OpFunctionParameter %half
-         %13 = OpLabel
-         %16 = OpFOrdGreaterThanEqual %bool %x %half_0x1p_0
-         %19 = OpExtInst %half %20 Atanh %x
-         %14 = OpSelect %half %16 %18 %19
-               OpReturnValue %14
+         %16 = OpLabel
+         %19 = OpFOrdGreaterThanEqual %bool %x %half_0x1p_0
+         %22 = OpExtInst %half %23 Atanh %x
+         %17 = OpSelect %half %19 %21 %22
+               OpReturnValue %17
                OpFunctionEnd
-%atanh_d2d8cd = OpFunction %void None %21
-         %24 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %18
-        %res = OpVariable %_ptr_Function_half Function %18
+%atanh_d2d8cd = OpFunction %void None %24
+         %27 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %21
+        %res = OpVariable %_ptr_Function_half Function %21
                OpStore %arg_0 %half_0x1pn1
-         %29 = OpLoad %half %arg_0
-         %28 = OpFunctionCall %half %tint_atanh %29
-               OpStore %res %28
+         %32 = OpLoad %half %arg_0
+         %31 = OpFunctionCall %half %tint_atanh %32
+               OpStore %res %31
+         %37 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %38 = OpLoad %half %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %atanh_d2d8cd
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %atanh_d2d8cd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %21
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %24
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %21
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %atanh_d2d8cd
+%fragment_main = OpFunction %void None %24
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %atanh_d2d8cd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %21
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %atanh_d2d8cd
+%compute_main = OpFunction %void None %24
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %atanh_d2d8cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.wgsl
index c0e9513..bfce8d7 100644
--- a/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atanh/d2d8cd.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atanh_d2d8cd() {
   var arg_0 = 0.5h;
   var res : f16 = atanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_d2d8cd();
diff --git a/test/tint/builtins/gen/var/atanh/e3b450.wgsl b/test/tint/builtins/gen/var/atanh/e3b450.wgsl
index 0c2cc85..b75d761 100644
--- a/test/tint/builtins/gen/var/atanh/e3b450.wgsl
+++ b/test/tint/builtins/gen/var/atanh/e3b450.wgsl
@@ -27,7 +27,9 @@
 fn atanh_e3b450() {
   var arg_0 = vec4<f16>(0.5h);
   var res: vec4<f16> = atanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.dxc.hlsl
index d597786..47cc9ae 100644
--- a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_e3b450() {
   vector<float16_t, 4> arg_0 = (float16_t(0.5h)).xxxx;
   vector<float16_t, 4> res = tint_atanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.fxc.hlsl
index 335a4e8..7420037 100644
--- a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_e3b450() {
   vector<float16_t, 4> arg_0 = (float16_t(0.5h)).xxxx;
   vector<float16_t, 4> res = tint_atanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.glsl b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.glsl
index d8fb476..2c42b55 100644
--- a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return mix(atanh(x), f16vec4(0.0hf), greaterThanEqual(x, f16vec4(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atanh_e3b450() {
   f16vec4 arg_0 = f16vec4(0.5hf);
   f16vec4 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return mix(atanh(x), f16vec4(0.0hf), greaterThanEqual(x, f16vec4(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atanh_e3b450() {
   f16vec4 arg_0 = f16vec4(0.5hf);
   f16vec4 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return mix(atanh(x), f16vec4(0.0hf), greaterThanEqual(x, f16vec4(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void atanh_e3b450() {
   f16vec4 arg_0 = f16vec4(0.5hf);
   f16vec4 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.msl b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.msl
index be6587e..3415b7b 100644
--- a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(atanh(x), half4(0.0h), (x >= half4(1.0h)));
 }
 
-void atanh_e3b450() {
+void atanh_e3b450(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(0.5h);
   half4 res = tint_atanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_e3b450();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  atanh_e3b450(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_e3b450();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  atanh_e3b450(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_e3b450();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  atanh_e3b450(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.spvasm
index 28e9d79..3d8ed1a 100644
--- a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_atanh "tint_atanh"
                OpName %x "x"
                OpName %atanh_e3b450 "atanh_e3b450"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,56 +45,65 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-          %9 = OpTypeFunction %v4half %v4half
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4half %v4half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
-         %21 = OpConstantNull %v4half
+         %24 = OpConstantNull %v4half
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
-         %29 = OpConstantComposite %v4half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
+         %32 = OpConstantComposite %v4half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %35 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_atanh = OpFunction %v4half None %9
+ %tint_atanh = OpFunction %v4half None %14
           %x = OpFunctionParameter %v4half
-         %14 = OpLabel
-         %18 = OpFOrdGreaterThanEqual %v4bool %x %17
-         %22 = OpExtInst %v4half %23 Atanh %x
-         %15 = OpSelect %v4half %18 %21 %22
-               OpReturnValue %15
+         %17 = OpLabel
+         %21 = OpFOrdGreaterThanEqual %v4bool %x %20
+         %25 = OpExtInst %v4half %26 Atanh %x
+         %18 = OpSelect %v4half %21 %24 %25
+               OpReturnValue %18
                OpFunctionEnd
-%atanh_e3b450 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %21
-        %res = OpVariable %_ptr_Function_v4half Function %21
-               OpStore %arg_0 %29
-         %33 = OpLoad %v4half %arg_0
-         %32 = OpFunctionCall %v4half %tint_atanh %33
-               OpStore %res %32
+%atanh_e3b450 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %24
+        %res = OpVariable %_ptr_Function_v4half Function %24
+               OpStore %arg_0 %32
+         %36 = OpLoad %v4half %arg_0
+         %35 = OpFunctionCall %v4half %tint_atanh %36
+               OpStore %res %35
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %42 = OpLoad %v4half %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %atanh_e3b450
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %atanh_e3b450
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %27
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %atanh_e3b450
+%fragment_main = OpFunction %void None %27
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %atanh_e3b450
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %atanh_e3b450
+%compute_main = OpFunction %void None %27
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %atanh_e3b450
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.wgsl
index fe06f7c..8a9f0c8 100644
--- a/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atanh/e3b450.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atanh_e3b450() {
   var arg_0 = vec4<f16>(0.5h);
   var res : vec4<f16> = atanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_e3b450();
diff --git a/test/tint/builtins/gen/var/atanh/e431bb.wgsl b/test/tint/builtins/gen/var/atanh/e431bb.wgsl
index 175c60e..b4b527f 100644
--- a/test/tint/builtins/gen/var/atanh/e431bb.wgsl
+++ b/test/tint/builtins/gen/var/atanh/e431bb.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(0.5);
   var res = atanh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_e431bb();
diff --git a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl
index cad022d..7ac2ecf 100644
--- a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl
+++ b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl
@@ -27,7 +27,9 @@
 fn atanh_ec4b06() {
   var arg_0 = vec3<f16>(0.5h);
   var res: vec3<f16> = atanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.dxc.hlsl
index 308519b..90cd307 100644
--- a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_ec4b06() {
   vector<float16_t, 3> arg_0 = (float16_t(0.5h)).xxx;
   vector<float16_t, 3> res = tint_atanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.fxc.hlsl
index 7a8fb48..a547f07 100644
--- a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return (log(((float16_t(1.0h) + x) / (float16_t(1.0h) - x))) * float16_t(0.5h));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_ec4b06() {
   vector<float16_t, 3> arg_0 = (float16_t(0.5h)).xxx;
   vector<float16_t, 3> res = tint_atanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.glsl b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.glsl
index 7a85673..84c1bc5 100644
--- a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return mix(atanh(x), f16vec3(0.0hf), greaterThanEqual(x, f16vec3(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atanh_ec4b06() {
   f16vec3 arg_0 = f16vec3(0.5hf);
   f16vec3 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return mix(atanh(x), f16vec3(0.0hf), greaterThanEqual(x, f16vec3(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atanh_ec4b06() {
   f16vec3 arg_0 = f16vec3(0.5hf);
   f16vec3 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return mix(atanh(x), f16vec3(0.0hf), greaterThanEqual(x, f16vec3(1.0hf)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void atanh_ec4b06() {
   f16vec3 arg_0 = f16vec3(0.5hf);
   f16vec3 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.msl b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.msl
index 0f79076..80bdb8b 100644
--- a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(atanh(x), half3(0.0h), (x >= half3(1.0h)));
 }
 
-void atanh_ec4b06() {
+void atanh_ec4b06(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(0.5h);
   half3 res = tint_atanh(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_ec4b06();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  atanh_ec4b06(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_ec4b06();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  atanh_ec4b06(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_ec4b06();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  atanh_ec4b06(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.spvasm
index dea5136..3b8bdc4 100644
--- a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_atanh "tint_atanh"
                OpName %x "x"
                OpName %atanh_ec4b06 "atanh_ec4b06"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,56 +45,65 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-          %9 = OpTypeFunction %v3half %v3half
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3half %v3half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %20 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
-         %21 = OpConstantNull %v3half
+         %24 = OpConstantNull %v3half
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
 %half_0x1pn1 = OpConstant %half 0x1p-1
-         %29 = OpConstantComposite %v3half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
+         %32 = OpConstantComposite %v3half %half_0x1pn1 %half_0x1pn1 %half_0x1pn1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %35 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_atanh = OpFunction %v3half None %9
+ %tint_atanh = OpFunction %v3half None %14
           %x = OpFunctionParameter %v3half
-         %14 = OpLabel
-         %18 = OpFOrdGreaterThanEqual %v3bool %x %17
-         %22 = OpExtInst %v3half %23 Atanh %x
-         %15 = OpSelect %v3half %18 %21 %22
-               OpReturnValue %15
+         %17 = OpLabel
+         %21 = OpFOrdGreaterThanEqual %v3bool %x %20
+         %25 = OpExtInst %v3half %26 Atanh %x
+         %18 = OpSelect %v3half %21 %24 %25
+               OpReturnValue %18
                OpFunctionEnd
-%atanh_ec4b06 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %21
-        %res = OpVariable %_ptr_Function_v3half Function %21
-               OpStore %arg_0 %29
-         %33 = OpLoad %v3half %arg_0
-         %32 = OpFunctionCall %v3half %tint_atanh %33
-               OpStore %res %32
+%atanh_ec4b06 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %24
+        %res = OpVariable %_ptr_Function_v3half Function %24
+               OpStore %arg_0 %32
+         %36 = OpLoad %v3half %arg_0
+         %35 = OpFunctionCall %v3half %tint_atanh %36
+               OpStore %res %35
+         %41 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %42 = OpLoad %v3half %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %atanh_ec4b06
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %atanh_ec4b06
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %27
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %atanh_ec4b06
+%fragment_main = OpFunction %void None %27
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %atanh_ec4b06
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %atanh_ec4b06
+%compute_main = OpFunction %void None %27
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %atanh_ec4b06
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.wgsl
index 39c4b83..2f2f727 100644
--- a/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atanh/ec4b06.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atanh_ec4b06() {
   var arg_0 = vec3<f16>(0.5h);
   var res : vec3<f16> = atanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_ec4b06();
diff --git a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl
index 0f72799..c7b2c25 100644
--- a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl
+++ b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl
@@ -25,7 +25,9 @@
 fn atanh_f3e01b() {
   var arg_0 = vec4<f32>(0.5f);
   var res: vec4<f32> = atanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.dxc.hlsl
index 88b9078..d0a32a0 100644
--- a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_f3e01b() {
   float4 arg_0 = (0.5f).xxxx;
   float4 res = tint_atanh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.fxc.hlsl
index 88b9078..d0a32a0 100644
--- a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return (log(((1.0f + x) / (1.0f - x))) * 0.5f);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atanh_f3e01b() {
   float4 arg_0 = (0.5f).xxxx;
   float4 res = tint_atanh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.glsl b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.glsl
index cf63d64..480d3d3 100644
--- a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atanh_f3e01b() {
   vec4 arg_0 = vec4(0.5f);
   vec4 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atanh_f3e01b() {
   vec4 arg_0 = vec4(0.5f);
   vec4 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return mix(atanh(x), vec4(0.0f), greaterThanEqual(x, vec4(1.0f)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void atanh_f3e01b() {
   vec4 arg_0 = vec4(0.5f);
   vec4 res = tint_atanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.msl b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.msl
index ed733d4..bedfae0 100644
--- a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(atanh(x), float4(0.0f), (x >= float4(1.0f)));
 }
 
-void atanh_f3e01b() {
+void atanh_f3e01b(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(0.5f);
   float4 res = tint_atanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  atanh_f3e01b();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  atanh_f3e01b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  atanh_f3e01b();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  atanh_f3e01b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  atanh_f3e01b();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  atanh_f3e01b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.spvasm
index fb1f009..15b68ef 100644
--- a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_atanh "tint_atanh"
                OpName %x "x"
                OpName %atanh_f3e01b "atanh_f3e01b"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,54 +39,63 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-          %9 = OpTypeFunction %v4float %v4float
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %12 = OpTypeFunction %v4float %v4float
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %void = OpTypeVoid
-         %21 = OpTypeFunction %void
+         %24 = OpTypeFunction %void
   %float_0_5 = OpConstant %float 0.5
-         %26 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+         %29 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
- %tint_atanh = OpFunction %v4float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %40 = OpTypeFunction %v4float
+ %tint_atanh = OpFunction %v4float None %12
           %x = OpFunctionParameter %v4float
-         %12 = OpLabel
-         %16 = OpFOrdGreaterThanEqual %v4bool %x %15
-         %19 = OpExtInst %v4float %20 Atanh %x
-         %13 = OpSelect %v4float %16 %5 %19
-               OpReturnValue %13
+         %15 = OpLabel
+         %19 = OpFOrdGreaterThanEqual %v4bool %x %18
+         %22 = OpExtInst %v4float %23 Atanh %x
+         %16 = OpSelect %v4float %19 %5 %22
+               OpReturnValue %16
                OpFunctionEnd
-%atanh_f3e01b = OpFunction %void None %21
-         %24 = OpLabel
+%atanh_f3e01b = OpFunction %void None %24
+         %27 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %26
-         %30 = OpLoad %v4float %arg_0
-         %29 = OpFunctionCall %v4float %tint_atanh %30
-               OpStore %res %29
+               OpStore %arg_0 %29
+         %33 = OpLoad %v4float %arg_0
+         %32 = OpFunctionCall %v4float %tint_atanh %33
+               OpStore %res %32
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %atanh_f3e01b
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %atanh_f3e01b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %21
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %24
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %21
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %atanh_f3e01b
+%fragment_main = OpFunction %void None %24
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %atanh_f3e01b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %21
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %atanh_f3e01b
+%compute_main = OpFunction %void None %24
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %atanh_f3e01b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.wgsl
index 214386d..d63f376 100644
--- a/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atanh/f3e01b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn atanh_f3e01b() {
   var arg_0 = vec4<f32>(0.5f);
   var res : vec4<f32> = atanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   atanh_f3e01b();
diff --git a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl
index 28d02bd..1ab357b 100644
--- a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl
+++ b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl
@@ -26,7 +26,9 @@
 fn atomicAdd_794055() {
   var arg_1 = 1i;
   var res: i32 = atomicAdd(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.dxc.hlsl
index 94edce7..74e1dee 100644
--- a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAdd_794055() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedAdd(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.fxc.hlsl
index 94edce7..74e1dee 100644
--- a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAdd_794055() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedAdd(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.glsl
index 6e7ea7e..77c768f 100644
--- a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAdd_794055() {
   int arg_1 = 1;
   int res = atomicAdd(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.msl
index b84f508..a3c0ef3 100644
--- a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicAdd_794055(threadgroup atomic_int* const tint_symbol) {
+void atomicAdd_794055(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_add_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicAdd_794055(tint_symbol_1);
+  atomicAdd_794055(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.spvasm
index 9a311f1..034f04d 100644
--- a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAdd_794055 "atomicAdd_794055"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,42 +19,53 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %14 = OpConstantNull %int
+         %17 = OpConstantNull %int
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %21 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicAdd_794055 = OpFunction %void None %7
-         %10 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %14
-        %res = OpVariable %_ptr_Function_int Function %14
+%atomicAdd_794055 = OpFunction %void None %10
+         %13 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %17
+        %res = OpVariable %_ptr_Function_int Function %17
                OpStore %arg_1 %int_1
-         %19 = OpLoad %int %arg_1
-         %15 = OpAtomicIAdd %int %arg_0 %uint_2 %uint_0 %19
-               OpStore %res %15
+         %22 = OpLoad %int %arg_1
+         %18 = OpAtomicIAdd %int %arg_0 %uint_2 %uint_0 %22
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %21
+%compute_main_inner = OpFunction %void None %27
 %local_invocation_index = OpFunctionParameter %uint
-         %24 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %14
+         %30 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %atomicAdd_794055
+         %35 = OpFunctionCall %void %atomicAdd_794055
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %31 = OpLabel
-         %33 = OpLoad %uint %local_invocation_index_1
-         %32 = OpFunctionCall %void %compute_main_inner %33
+%compute_main = OpFunction %void None %10
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.wgsl
index 569553f..9fbe073 100644
--- a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicAdd_794055() {
   var arg_1 = 1i;
   var res : i32 = atomicAdd(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicAdd_794055();
diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl
index ff49cca..bdd8de3 100644
--- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl
+++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl
@@ -29,7 +29,9 @@
 fn atomicAdd_8a199a() {
   var arg_1 = 1u;
   var res: u32 = atomicAdd(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.dxc.hlsl
index d42be71..53c50ae 100644
--- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAdd_8a199a() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicAdd(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.fxc.hlsl
index d42be71..53c50ae 100644
--- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAdd_8a199a() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicAdd(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.glsl
index 97960c2..f0a19bf 100644
--- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAdd_8a199a() {
   uint arg_1 = 1u;
   uint res = atomicAdd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAdd_8a199a() {
   uint arg_1 = 1u;
   uint res = atomicAdd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.msl
index e1e7c61..90f9a8c 100644
--- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicAdd_8a199a(device SB_RW* const tint_symbol) {
+void atomicAdd_8a199a(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_add_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicAdd_8a199a(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicAdd_8a199a(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicAdd_8a199a(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicAdd_8a199a(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.spvasm
index 6a83c18..469800d 100644
--- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAdd_8a199a "atomicAdd_8a199a"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,36 +27,47 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-%atomicAdd_8a199a = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicAdd_8a199a = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %19 = OpLoad %uint %arg_1
-         %14 = OpAtomicIAdd %uint %18 %uint_1 %uint_0 %19
-               OpStore %res %14
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %22 = OpLoad %uint %arg_1
+         %17 = OpAtomicIAdd %uint %21 %uint_1 %uint_0 %22
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %26 = OpLoad %uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicAdd_8a199a
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicAdd_8a199a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicAdd_8a199a
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicAdd_8a199a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.wgsl
index 60690f0..e52b1d5 100644
--- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicAdd_8a199a() {
   var arg_1 = 1u;
   var res : u32 = atomicAdd(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicAdd_8a199a();
diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl
index f4e40b9..3750f1c 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl
@@ -29,7 +29,9 @@
 fn atomicAdd_d32fe4() {
   var arg_1 = 1i;
   var res: i32 = atomicAdd(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl
index dd5ded7..d49a368 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAdd_d32fe4() {
   int arg_1 = 1;
   int res = sb_rwatomicAdd(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl
index dd5ded7..d49a368 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAdd_d32fe4() {
   int arg_1 = 1;
   int res = sb_rwatomicAdd(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.glsl
index ca20468..4a92de8 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAdd_d32fe4() {
   int arg_1 = 1;
   int res = atomicAdd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAdd_d32fe4() {
   int arg_1 = 1;
   int res = atomicAdd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.msl
index 2ef2df3..c0cb941 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicAdd_d32fe4(device SB_RW* const tint_symbol) {
+void atomicAdd_d32fe4(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_add_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicAdd_d32fe4(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicAdd_d32fe4(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicAdd_d32fe4(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicAdd_d32fe4(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.spvasm
index 875f46b..799749d 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAdd_d32fe4 "atomicAdd_d32fe4"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,38 +27,49 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %13 = OpConstantNull %int
+         %16 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-%atomicAdd_d32fe4 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %13
-        %res = OpVariable %_ptr_Function_int Function %13
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicAdd_d32fe4 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %16
+        %res = OpVariable %_ptr_Function_int Function %16
                OpStore %arg_1 %int_1
-         %20 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %21 = OpLoad %int %arg_1
-         %14 = OpAtomicIAdd %int %20 %uint_1 %uint_0 %21
-               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %24 = OpLoad %int %arg_1
+         %17 = OpAtomicIAdd %int %23 %uint_1 %uint_0 %24
+               OpStore %res %17
+         %27 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicAdd_d32fe4
+%fragment_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicAdd_d32fe4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atomicAdd_d32fe4
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atomicAdd_d32fe4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.wgsl
index 6eeb30c..fb25922 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicAdd_d32fe4() {
   var arg_1 = 1i;
   var res : i32 = atomicAdd(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicAdd_d32fe4();
diff --git a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl
index 68a0d634..7f21eef 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl
@@ -26,7 +26,9 @@
 fn atomicAdd_d5db1d() {
   var arg_1 = 1u;
   var res: u32 = atomicAdd(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.dxc.hlsl
index c74e7bd..c0e184e 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAdd_d5db1d() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedAdd(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.fxc.hlsl
index c74e7bd..c0e184e 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAdd_d5db1d() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedAdd(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.glsl
index 4d92172..d71f224 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAdd_d5db1d() {
   uint arg_1 = 1u;
   uint res = atomicAdd(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.msl
index c05a45c..de017b1 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicAdd_d5db1d(threadgroup atomic_uint* const tint_symbol) {
+void atomicAdd_d5db1d(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_add_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicAdd_d5db1d(tint_symbol_1);
+  atomicAdd_d5db1d(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.spvasm
index 7ab1e8d..a7cdb65 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAdd_d5db1d "atomicAdd_d5db1d"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,41 +19,52 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %20 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicAdd_d5db1d = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%atomicAdd_d5db1d = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpLoad %uint %arg_1
-         %14 = OpAtomicIAdd %uint %arg_0 %uint_2 %uint_0 %18
-               OpStore %res %14
+         %21 = OpLoad %uint %arg_1
+         %17 = OpAtomicIAdd %uint %arg_0 %uint_2 %uint_0 %21
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %20
+%compute_main_inner = OpFunction %void None %26
 %local_invocation_index = OpFunctionParameter %uint
-         %23 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %13
+         %29 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicAdd_d5db1d
+         %34 = OpFunctionCall %void %atomicAdd_d5db1d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %9
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.wgsl
index e7ca6d0..e60e6e2 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicAdd_d5db1d() {
   var arg_1 = 1u;
   var res : u32 = atomicAdd(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicAdd_d5db1d();
diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl
index 37c1e94..cfc663a 100644
--- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl
+++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl
@@ -29,7 +29,9 @@
 fn atomicAnd_152966() {
   var arg_1 = 1i;
   var res: i32 = atomicAnd(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.dxc.hlsl
index b7847a3..225e14c 100644
--- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAnd_152966() {
   int arg_1 = 1;
   int res = sb_rwatomicAnd(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.fxc.hlsl
index b7847a3..225e14c 100644
--- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAnd_152966() {
   int arg_1 = 1;
   int res = sb_rwatomicAnd(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.glsl
index d0e90c4..1e3cad1 100644
--- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAnd_152966() {
   int arg_1 = 1;
   int res = atomicAnd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAnd_152966() {
   int arg_1 = 1;
   int res = atomicAnd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.msl
index c7bf4a8..bf94021 100644
--- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicAnd_152966(device SB_RW* const tint_symbol) {
+void atomicAnd_152966(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_and_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicAnd_152966(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicAnd_152966(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicAnd_152966(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicAnd_152966(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.spvasm
index 2fc09b4..341d92c 100644
--- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAnd_152966 "atomicAnd_152966"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,38 +27,49 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %13 = OpConstantNull %int
+         %16 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-%atomicAnd_152966 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %13
-        %res = OpVariable %_ptr_Function_int Function %13
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicAnd_152966 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %16
+        %res = OpVariable %_ptr_Function_int Function %16
                OpStore %arg_1 %int_1
-         %20 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %21 = OpLoad %int %arg_1
-         %14 = OpAtomicAnd %int %20 %uint_1 %uint_0 %21
-               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %24 = OpLoad %int %arg_1
+         %17 = OpAtomicAnd %int %23 %uint_1 %uint_0 %24
+               OpStore %res %17
+         %27 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicAnd_152966
+%fragment_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicAnd_152966
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atomicAnd_152966
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atomicAnd_152966
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.wgsl
index fe3cc0a..b859865 100644
--- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicAnd_152966() {
   var arg_1 = 1i;
   var res : i32 = atomicAnd(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicAnd_152966();
diff --git a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl
index 48e8764..5d27d35 100644
--- a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl
+++ b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl
@@ -26,7 +26,9 @@
 fn atomicAnd_34edd3() {
   var arg_1 = 1u;
   var res: u32 = atomicAnd(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.dxc.hlsl
index 9aca847..8b48004 100644
--- a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAnd_34edd3() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedAnd(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.fxc.hlsl
index 9aca847..8b48004 100644
--- a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAnd_34edd3() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedAnd(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.glsl
index 1233dc8..26cc415 100644
--- a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAnd_34edd3() {
   uint arg_1 = 1u;
   uint res = atomicAnd(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.msl
index ea6ba7e..6a19bbc 100644
--- a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicAnd_34edd3(threadgroup atomic_uint* const tint_symbol) {
+void atomicAnd_34edd3(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_and_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicAnd_34edd3(tint_symbol_1);
+  atomicAnd_34edd3(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.spvasm
index e6e94c1..94a6649 100644
--- a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAnd_34edd3 "atomicAnd_34edd3"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,41 +19,52 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %20 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicAnd_34edd3 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%atomicAnd_34edd3 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpLoad %uint %arg_1
-         %14 = OpAtomicAnd %uint %arg_0 %uint_2 %uint_0 %18
-               OpStore %res %14
+         %21 = OpLoad %uint %arg_1
+         %17 = OpAtomicAnd %uint %arg_0 %uint_2 %uint_0 %21
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %20
+%compute_main_inner = OpFunction %void None %26
 %local_invocation_index = OpFunctionParameter %uint
-         %23 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %13
+         %29 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicAnd_34edd3
+         %34 = OpFunctionCall %void %atomicAnd_34edd3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %9
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.wgsl
index 9515293..9d46695 100644
--- a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicAnd_34edd3() {
   var arg_1 = 1u;
   var res : u32 = atomicAnd(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicAnd_34edd3();
diff --git a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl
index 34d1b06..e3f32e3 100644
--- a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl
+++ b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl
@@ -26,7 +26,9 @@
 fn atomicAnd_45a819() {
   var arg_1 = 1i;
   var res: i32 = atomicAnd(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.dxc.hlsl
index 7bf2f53..5306293 100644
--- a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAnd_45a819() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedAnd(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.fxc.hlsl
index 7bf2f53..5306293 100644
--- a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicAnd_45a819() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedAnd(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.glsl
index 5f90d4a..c875e73 100644
--- a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicAnd_45a819() {
   int arg_1 = 1;
   int res = atomicAnd(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.msl
index ece0c9f..e4a48bd 100644
--- a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicAnd_45a819(threadgroup atomic_int* const tint_symbol) {
+void atomicAnd_45a819(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_and_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicAnd_45a819(tint_symbol_1);
+  atomicAnd_45a819(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.spvasm
index e0c9a7e..e99f3fd 100644
--- a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAnd_45a819 "atomicAnd_45a819"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,42 +19,53 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %14 = OpConstantNull %int
+         %17 = OpConstantNull %int
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %21 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicAnd_45a819 = OpFunction %void None %7
-         %10 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %14
-        %res = OpVariable %_ptr_Function_int Function %14
+%atomicAnd_45a819 = OpFunction %void None %10
+         %13 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %17
+        %res = OpVariable %_ptr_Function_int Function %17
                OpStore %arg_1 %int_1
-         %19 = OpLoad %int %arg_1
-         %15 = OpAtomicAnd %int %arg_0 %uint_2 %uint_0 %19
-               OpStore %res %15
+         %22 = OpLoad %int %arg_1
+         %18 = OpAtomicAnd %int %arg_0 %uint_2 %uint_0 %22
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %21
+%compute_main_inner = OpFunction %void None %27
 %local_invocation_index = OpFunctionParameter %uint
-         %24 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %14
+         %30 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %atomicAnd_45a819
+         %35 = OpFunctionCall %void %atomicAnd_45a819
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %31 = OpLabel
-         %33 = OpLoad %uint %local_invocation_index_1
-         %32 = OpFunctionCall %void %compute_main_inner %33
+%compute_main = OpFunction %void None %10
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.wgsl
index 2b43c8e..0bc2070 100644
--- a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicAnd_45a819() {
   var arg_1 = 1i;
   var res : i32 = atomicAnd(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicAnd_45a819();
diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl
index 5e1b35e..48f6a7a 100644
--- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl
+++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl
@@ -29,7 +29,9 @@
 fn atomicAnd_85a8d9() {
   var arg_1 = 1u;
   var res: u32 = atomicAnd(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl
index cab948c..3f3e208 100644
--- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAnd_85a8d9() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicAnd(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl
index cab948c..3f3e208 100644
--- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicAnd_85a8d9() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicAnd(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.glsl
index 03ef7202..1112ac0 100644
--- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAnd_85a8d9() {
   uint arg_1 = 1u;
   uint res = atomicAnd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicAnd_85a8d9() {
   uint arg_1 = 1u;
   uint res = atomicAnd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.msl
index f38ff43..3439e59 100644
--- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicAnd_85a8d9(device SB_RW* const tint_symbol) {
+void atomicAnd_85a8d9(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_and_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicAnd_85a8d9(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicAnd_85a8d9(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicAnd_85a8d9(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicAnd_85a8d9(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.spvasm
index 7bfd7ff..1e212dd 100644
--- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicAnd_85a8d9 "atomicAnd_85a8d9"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,36 +27,47 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-%atomicAnd_85a8d9 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicAnd_85a8d9 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %19 = OpLoad %uint %arg_1
-         %14 = OpAtomicAnd %uint %18 %uint_1 %uint_0 %19
-               OpStore %res %14
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %22 = OpLoad %uint %arg_1
+         %17 = OpAtomicAnd %uint %21 %uint_1 %uint_0 %22
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %26 = OpLoad %uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicAnd_85a8d9
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicAnd_85a8d9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicAnd_85a8d9
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicAnd_85a8d9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.wgsl
index b0eb8ca..3c7ebe0 100644
--- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicAnd_85a8d9() {
   var arg_1 = 1u;
   var res : u32 = atomicAnd(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicAnd_85a8d9();
diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl
index 324d09c..7580cfe 100644
--- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl
+++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl
@@ -31,7 +31,6 @@
   var arg_2 = 1i;
   var res = atomicCompareExchangeWeak(&sb_rw.arg_0, arg_1, arg_2);
 }
-
 @fragment
 fn fragment_main() {
   atomicCompareExchangeWeak_1bd40a();
diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl
index 9fdbc09..0f74194 100644
--- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl
+++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl
@@ -31,7 +31,6 @@
   var arg_2 = 1u;
   var res = atomicCompareExchangeWeak(&sb_rw.arg_0, arg_1, arg_2);
 }
-
 @fragment
 fn fragment_main() {
   atomicCompareExchangeWeak_63d8e6();
diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/83580d.wgsl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/83580d.wgsl
index 0f47c9b..a8032b4 100644
--- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/83580d.wgsl
+++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/83580d.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = 1u;
   var res = atomicCompareExchangeWeak(&arg_0, arg_1, arg_2);
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicCompareExchangeWeak_83580d();
diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/e88938.wgsl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/e88938.wgsl
index 1e78a29..3ca766c 100644
--- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/e88938.wgsl
+++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/e88938.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = 1i;
   var res = atomicCompareExchangeWeak(&arg_0, arg_1, arg_2);
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicCompareExchangeWeak_e88938();
diff --git a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl
index 58fce8a..853a922 100644
--- a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl
+++ b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl
@@ -26,7 +26,9 @@
 fn atomicExchange_0a5dca() {
   var arg_1 = 1u;
   var res: u32 = atomicExchange(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.dxc.hlsl
index b119a3f..2ceb018 100644
--- a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicExchange_0a5dca() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedExchange(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.fxc.hlsl
index b119a3f..2ceb018 100644
--- a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicExchange_0a5dca() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedExchange(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.glsl
index 268ea18..ad8c9db 100644
--- a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicExchange_0a5dca() {
   uint arg_1 = 1u;
   uint res = atomicExchange(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.msl
index 3b21e2f..5b8ba36 100644
--- a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicExchange_0a5dca(threadgroup atomic_uint* const tint_symbol) {
+void atomicExchange_0a5dca(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_exchange_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicExchange_0a5dca(tint_symbol_1);
+  atomicExchange_0a5dca(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.spvasm
index 3bbfe18..e7985a8 100644
--- a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicExchange_0a5dca "atomicExchange_0a5dca"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,41 +19,52 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %20 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicExchange_0a5dca = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%atomicExchange_0a5dca = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpLoad %uint %arg_1
-         %14 = OpAtomicExchange %uint %arg_0 %uint_2 %uint_0 %18
-               OpStore %res %14
+         %21 = OpLoad %uint %arg_1
+         %17 = OpAtomicExchange %uint %arg_0 %uint_2 %uint_0 %21
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %20
+%compute_main_inner = OpFunction %void None %26
 %local_invocation_index = OpFunctionParameter %uint
-         %23 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %13
+         %29 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicExchange_0a5dca
+         %34 = OpFunctionCall %void %atomicExchange_0a5dca
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %9
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.wgsl
index 0d58d70..130087c 100644
--- a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicExchange_0a5dca() {
   var arg_1 = 1u;
   var res : u32 = atomicExchange(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicExchange_0a5dca();
diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl
index 08fac93..26bc664 100644
--- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl
+++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl
@@ -29,7 +29,9 @@
 fn atomicExchange_d59712() {
   var arg_1 = 1u;
   var res: u32 = atomicExchange(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.dxc.hlsl
index d31825d..cd4519a 100644
--- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicExchange_d59712() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicExchange(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.fxc.hlsl
index d31825d..cd4519a 100644
--- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicExchange_d59712() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicExchange(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.glsl
index 0b5c70d..e3071be 100644
--- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicExchange_d59712() {
   uint arg_1 = 1u;
   uint res = atomicExchange(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicExchange_d59712() {
   uint arg_1 = 1u;
   uint res = atomicExchange(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.msl
index 425a34f..5aeead5 100644
--- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicExchange_d59712(device SB_RW* const tint_symbol) {
+void atomicExchange_d59712(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_exchange_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicExchange_d59712(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicExchange_d59712(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicExchange_d59712(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicExchange_d59712(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.spvasm
index c43ee4f..0953e6b 100644
--- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicExchange_d59712 "atomicExchange_d59712"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,36 +27,47 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-%atomicExchange_d59712 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicExchange_d59712 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %19 = OpLoad %uint %arg_1
-         %14 = OpAtomicExchange %uint %18 %uint_1 %uint_0 %19
-               OpStore %res %14
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %22 = OpLoad %uint %arg_1
+         %17 = OpAtomicExchange %uint %21 %uint_1 %uint_0 %22
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %26 = OpLoad %uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicExchange_d59712
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicExchange_d59712
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicExchange_d59712
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicExchange_d59712
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.wgsl
index 5f0d591..9740547 100644
--- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicExchange_d59712() {
   var arg_1 = 1u;
   var res : u32 = atomicExchange(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicExchange_d59712();
diff --git a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl
index b2978df..210f896 100644
--- a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl
+++ b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl
@@ -26,7 +26,9 @@
 fn atomicExchange_e114ba() {
   var arg_1 = 1i;
   var res: i32 = atomicExchange(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.dxc.hlsl
index 86842c2..e8af149 100644
--- a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicExchange_e114ba() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedExchange(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.fxc.hlsl
index 86842c2..e8af149 100644
--- a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicExchange_e114ba() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedExchange(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.glsl
index 7eb05f37b..ef81e35 100644
--- a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicExchange_e114ba() {
   int arg_1 = 1;
   int res = atomicExchange(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.msl
index a7180f6..11a4ba4 100644
--- a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicExchange_e114ba(threadgroup atomic_int* const tint_symbol) {
+void atomicExchange_e114ba(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_exchange_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicExchange_e114ba(tint_symbol_1);
+  atomicExchange_e114ba(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.spvasm
index 0e6f0a8..47eff02 100644
--- a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicExchange_e114ba "atomicExchange_e114ba"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,42 +19,53 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %14 = OpConstantNull %int
+         %17 = OpConstantNull %int
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %21 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicExchange_e114ba = OpFunction %void None %7
-         %10 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %14
-        %res = OpVariable %_ptr_Function_int Function %14
+%atomicExchange_e114ba = OpFunction %void None %10
+         %13 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %17
+        %res = OpVariable %_ptr_Function_int Function %17
                OpStore %arg_1 %int_1
-         %19 = OpLoad %int %arg_1
-         %15 = OpAtomicExchange %int %arg_0 %uint_2 %uint_0 %19
-               OpStore %res %15
+         %22 = OpLoad %int %arg_1
+         %18 = OpAtomicExchange %int %arg_0 %uint_2 %uint_0 %22
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %21
+%compute_main_inner = OpFunction %void None %27
 %local_invocation_index = OpFunctionParameter %uint
-         %24 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %14
+         %30 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %atomicExchange_e114ba
+         %35 = OpFunctionCall %void %atomicExchange_e114ba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %31 = OpLabel
-         %33 = OpLoad %uint %local_invocation_index_1
-         %32 = OpFunctionCall %void %compute_main_inner %33
+%compute_main = OpFunction %void None %10
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.wgsl
index 93146cc..5ffd5cd 100644
--- a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicExchange_e114ba() {
   var arg_1 = 1i;
   var res : i32 = atomicExchange(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicExchange_e114ba();
diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl
index c9fe752..0d1da6b 100644
--- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl
+++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl
@@ -29,7 +29,9 @@
 fn atomicExchange_f2e22f() {
   var arg_1 = 1i;
   var res: i32 = atomicExchange(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl
index d934c72..3cee2c8 100644
--- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicExchange_f2e22f() {
   int arg_1 = 1;
   int res = sb_rwatomicExchange(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl
index d934c72..3cee2c8 100644
--- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicExchange_f2e22f() {
   int arg_1 = 1;
   int res = sb_rwatomicExchange(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.glsl
index 5092d33..c39edb1 100644
--- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicExchange_f2e22f() {
   int arg_1 = 1;
   int res = atomicExchange(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicExchange_f2e22f() {
   int arg_1 = 1;
   int res = atomicExchange(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.msl
index e4e291f..28cdb51 100644
--- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicExchange_f2e22f(device SB_RW* const tint_symbol) {
+void atomicExchange_f2e22f(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_exchange_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicExchange_f2e22f(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicExchange_f2e22f(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicExchange_f2e22f(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicExchange_f2e22f(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.spvasm
index c7e014e..f77fb4e 100644
--- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicExchange_f2e22f "atomicExchange_f2e22f"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,38 +27,49 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %13 = OpConstantNull %int
+         %16 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-%atomicExchange_f2e22f = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %13
-        %res = OpVariable %_ptr_Function_int Function %13
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicExchange_f2e22f = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %16
+        %res = OpVariable %_ptr_Function_int Function %16
                OpStore %arg_1 %int_1
-         %20 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %21 = OpLoad %int %arg_1
-         %14 = OpAtomicExchange %int %20 %uint_1 %uint_0 %21
-               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %24 = OpLoad %int %arg_1
+         %17 = OpAtomicExchange %int %23 %uint_1 %uint_0 %24
+               OpStore %res %17
+         %27 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicExchange_f2e22f
+%fragment_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicExchange_f2e22f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atomicExchange_f2e22f
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atomicExchange_f2e22f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.wgsl
index 79c3679..ae3310d 100644
--- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicExchange_f2e22f() {
   var arg_1 = 1i;
   var res : i32 = atomicExchange(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicExchange_f2e22f();
diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl
index 488d664..50aa58f 100644
--- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl
+++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl
@@ -28,7 +28,9 @@
 // fn atomicLoad(ptr<storage, atomic<i32>, read_write>) -> i32
 fn atomicLoad_0806ad() {
   var res: i32 = atomicLoad(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.dxc.hlsl
index 413dcf0..f91a4a9 100644
--- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicLoad_0806ad() {
   int res = sb_rwatomicLoad(0u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.fxc.hlsl
index 413dcf0..f91a4a9 100644
--- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicLoad_0806ad() {
   int res = sb_rwatomicLoad(0u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.glsl
index f9f7949..d38ae3c 100644
--- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicLoad_0806ad() {
   int res = atomicOr(sb_rw.inner.arg_0, 0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicLoad_0806ad() {
   int res = atomicOr(sb_rw.inner.arg_0, 0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.msl
index 2335d0d..5b81064 100644
--- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicLoad_0806ad(device SB_RW* const tint_symbol) {
+void atomicLoad_0806ad(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_load_explicit(&((*(tint_symbol)).arg_0), memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicLoad_0806ad(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicLoad_0806ad(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicLoad_0806ad(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicLoad_0806ad(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.spvasm
index 0a09d9d..82695e7 100644
--- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicLoad_0806ad "atomicLoad_0806ad"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,34 +26,45 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
 %_ptr_Function_int = OpTypePointer Function %int
-         %19 = OpConstantNull %int
-%atomicLoad_0806ad = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %19
-         %16 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicLoad %int %16 %uint_1 %uint_0
-               OpStore %res %10
+         %22 = OpConstantNull %int
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicLoad_0806ad = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %22
+         %19 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicLoad %int %19 %uint_1 %uint_0
+               OpStore %res %13
+         %24 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %25 = OpLoad %int %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %atomicLoad_0806ad
+%fragment_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %atomicLoad_0806ad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicLoad_0806ad
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicLoad_0806ad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.wgsl
index 06c2703..5fe3796 100644
--- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicLoad_0806ad() {
   var res : i32 = atomicLoad(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicLoad_0806ad();
diff --git a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl
index 162c19f..29525b1 100644
--- a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl
+++ b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl
@@ -25,7 +25,9 @@
 // fn atomicLoad(ptr<workgroup, atomic<u32>, read_write>) -> u32
 fn atomicLoad_361bf1() {
   var res: u32 = atomicLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.dxc.hlsl
index f0f031f..0be9808 100644
--- a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicLoad_361bf1() {
   uint atomic_result = 0u;
   InterlockedOr(arg_0, 0, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.fxc.hlsl
index f0f031f..0be9808 100644
--- a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicLoad_361bf1() {
   uint atomic_result = 0u;
   InterlockedOr(arg_0, 0, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.glsl
index f56f5a7..6c89f0e 100644
--- a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicLoad_361bf1() {
   uint res = atomicOr(arg_0, 0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.msl
index eedf946..6942bf4 100644
--- a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicLoad_361bf1(threadgroup atomic_uint* const tint_symbol) {
+void atomicLoad_361bf1(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_load_explicit(tint_symbol, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicLoad_361bf1(tint_symbol_1);
+  atomicLoad_361bf1(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.spvasm
index 20eeca7..c9e76eb 100644
--- a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 36
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,43 +9,57 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicLoad_361bf1 "atomicLoad_361bf1"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %16 = OpConstantNull %uint
-         %17 = OpTypeFunction %void %uint
+         %19 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %23 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicLoad_361bf1 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %16
-         %10 = OpAtomicLoad %uint %arg_0 %uint_2 %uint_0
-               OpStore %res %10
+%atomicLoad_361bf1 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %19
+         %13 = OpAtomicLoad %uint %arg_0 %uint_2 %uint_0
+               OpStore %res %13
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %22 = OpLoad %uint %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %17
+%compute_main_inner = OpFunction %void None %23
 %local_invocation_index = OpFunctionParameter %uint
-         %20 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
+         %26 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %19
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %25 = OpFunctionCall %void %atomicLoad_361bf1
+         %31 = OpFunctionCall %void %atomicLoad_361bf1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %29 = OpLoad %uint %local_invocation_index_1
-         %28 = OpFunctionCall %void %compute_main_inner %29
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %35 = OpLoad %uint %local_invocation_index_1
+         %34 = OpFunctionCall %void %compute_main_inner %35
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.wgsl
index 2fb4caa..31f0757 100644
--- a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicLoad_361bf1() {
   var res : u32 = atomicLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicLoad_361bf1();
diff --git a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl
index 5b2faf2..0dbf1fc 100644
--- a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl
+++ b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl
@@ -25,7 +25,9 @@
 // fn atomicLoad(ptr<workgroup, atomic<i32>, read_write>) -> i32
 fn atomicLoad_afcc03() {
   var res: i32 = atomicLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.dxc.hlsl
index adf265f..222a7e4 100644
--- a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicLoad_afcc03() {
   int atomic_result = 0;
   InterlockedOr(arg_0, 0, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.fxc.hlsl
index adf265f..222a7e4 100644
--- a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicLoad_afcc03() {
   int atomic_result = 0;
   InterlockedOr(arg_0, 0, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.glsl
index a290c99..33d8755 100644
--- a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicLoad_afcc03() {
   int res = atomicOr(arg_0, 0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.msl
index 90d483d..43c4c68 100644
--- a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.msl
@@ -1,21 +1,22 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicLoad_afcc03(threadgroup atomic_int* const tint_symbol) {
+void atomicLoad_afcc03(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int res = atomic_load_explicit(tint_symbol, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicLoad_afcc03(tint_symbol_1);
+  atomicLoad_afcc03(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.spvasm
index b996359..88338ea 100644
--- a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,44 +9,58 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicLoad_afcc03 "atomicLoad_afcc03"
                OpName %res "res"
                OpName %compute_main_inner "compute_main_inner"
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %18 = OpTypeFunction %void %uint
+         %20 = OpConstantNull %int
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %24 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicLoad_afcc03 = OpFunction %void None %7
-         %10 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %17
-         %11 = OpAtomicLoad %int %arg_0 %uint_2 %uint_0
-               OpStore %res %11
+%atomicLoad_afcc03 = OpFunction %void None %10
+         %13 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %20
+         %14 = OpAtomicLoad %int %arg_0 %uint_2 %uint_0
+               OpStore %res %14
+         %22 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %23 = OpLoad %int %res
+               OpStore %22 %23
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %18
+%compute_main_inner = OpFunction %void None %24
 %local_invocation_index = OpFunctionParameter %uint
-         %21 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
+         %27 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %20
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpFunctionCall %void %atomicLoad_afcc03
+         %32 = OpFunctionCall %void %atomicLoad_afcc03
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %28 = OpLabel
-         %30 = OpLoad %uint %local_invocation_index_1
-         %29 = OpFunctionCall %void %compute_main_inner %30
+%compute_main = OpFunction %void None %10
+         %34 = OpLabel
+         %36 = OpLoad %uint %local_invocation_index_1
+         %35 = OpFunctionCall %void %compute_main_inner %36
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.wgsl
index 37509ca..4b97959 100644
--- a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn atomicLoad_afcc03() {
   var res : i32 = atomicLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicLoad_afcc03();
diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl
index 47b80d7..f7d4ad5 100644
--- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl
+++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl
@@ -28,7 +28,9 @@
 // fn atomicLoad(ptr<storage, atomic<u32>, read_write>) -> u32
 fn atomicLoad_fe6cc3() {
   var res: u32 = atomicLoad(&sb_rw.arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl
index d8fda75..a819268 100644
--- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicLoad_fe6cc3() {
   uint res = sb_rwatomicLoad(0u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl
index d8fda75..a819268 100644
--- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl
@@ -7,8 +7,11 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicLoad_fe6cc3() {
   uint res = sb_rwatomicLoad(0u);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.glsl
index eaede54..6f69cb8 100644
--- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.glsl
@@ -9,8 +9,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicLoad_fe6cc3() {
   uint res = atomicOr(sb_rw.inner.arg_0, 0u);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -31,8 +36,13 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicLoad_fe6cc3() {
   uint res = atomicOr(sb_rw.inner.arg_0, 0u);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.msl
index e78624d..66e39fc 100644
--- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.msl
@@ -5,17 +5,18 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicLoad_fe6cc3(device SB_RW* const tint_symbol) {
+void atomicLoad_fe6cc3(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = atomic_load_explicit(&((*(tint_symbol)).arg_0), memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicLoad_fe6cc3(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicLoad_fe6cc3(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicLoad_fe6cc3(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicLoad_fe6cc3(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.spvasm
index d1efbaa..b612cf4 100644
--- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicLoad_fe6cc3 "atomicLoad_fe6cc3"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
@@ -23,33 +26,44 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
-%atomicLoad_fe6cc3 = OpFunction %void None %6
-          %9 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %18
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %10 = OpAtomicLoad %uint %15 %uint_1 %uint_0
-               OpStore %res %10
+         %21 = OpConstantNull %uint
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicLoad_fe6cc3 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %21
+         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %13 = OpAtomicLoad %uint %18 %uint_1 %uint_0
+               OpStore %res %13
+         %23 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %24 = OpLoad %uint %res
+               OpStore %23 %24
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %atomicLoad_fe6cc3
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %atomicLoad_fe6cc3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %atomicLoad_fe6cc3
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %atomicLoad_fe6cc3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.wgsl
index 8691467..e9a1b54 100644
--- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
 
 fn atomicLoad_fe6cc3() {
   var res : u32 = atomicLoad(&(sb_rw.arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicLoad_fe6cc3();
diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl
index d6cce3d..62c94e6 100644
--- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl
+++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl
@@ -29,7 +29,9 @@
 fn atomicMax_51b9be() {
   var arg_1 = 1u;
   var res: u32 = atomicMax(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.dxc.hlsl
index 4b961bf..d477eef 100644
--- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMax_51b9be() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicMax(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.fxc.hlsl
index 4b961bf..d477eef 100644
--- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMax_51b9be() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicMax(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.glsl
index daca80c..c02fd60 100644
--- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMax_51b9be() {
   uint arg_1 = 1u;
   uint res = atomicMax(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMax_51b9be() {
   uint arg_1 = 1u;
   uint res = atomicMax(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.msl
index 71acd56..d9912a7 100644
--- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicMax_51b9be(device SB_RW* const tint_symbol) {
+void atomicMax_51b9be(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_max_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicMax_51b9be(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicMax_51b9be(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicMax_51b9be(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicMax_51b9be(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.spvasm
index 52b100e..42adc7b 100644
--- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMax_51b9be "atomicMax_51b9be"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,36 +27,47 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-%atomicMax_51b9be = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicMax_51b9be = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %19 = OpLoad %uint %arg_1
-         %14 = OpAtomicUMax %uint %18 %uint_1 %uint_0 %19
-               OpStore %res %14
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %22 = OpLoad %uint %arg_1
+         %17 = OpAtomicUMax %uint %21 %uint_1 %uint_0 %22
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %26 = OpLoad %uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicMax_51b9be
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicMax_51b9be
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicMax_51b9be
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicMax_51b9be
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.wgsl
index a786881..7ed92f0 100644
--- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicMax_51b9be() {
   var arg_1 = 1u;
   var res : u32 = atomicMax(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicMax_51b9be();
diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl
index 5b9b6a5..32497a0 100644
--- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl
+++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl
@@ -29,7 +29,9 @@
 fn atomicMax_92aa72() {
   var arg_1 = 1i;
   var res: i32 = atomicMax(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.dxc.hlsl
index 5284265..824fa34 100644
--- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMax_92aa72() {
   int arg_1 = 1;
   int res = sb_rwatomicMax(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.fxc.hlsl
index 5284265..824fa34 100644
--- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMax_92aa72() {
   int arg_1 = 1;
   int res = sb_rwatomicMax(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.glsl
index c030791..219ae2e 100644
--- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMax_92aa72() {
   int arg_1 = 1;
   int res = atomicMax(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMax_92aa72() {
   int arg_1 = 1;
   int res = atomicMax(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.msl
index 9fefd97..96d232a 100644
--- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicMax_92aa72(device SB_RW* const tint_symbol) {
+void atomicMax_92aa72(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_max_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicMax_92aa72(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicMax_92aa72(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicMax_92aa72(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicMax_92aa72(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.spvasm
index fd7d25b..a78980c 100644
--- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMax_92aa72 "atomicMax_92aa72"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,38 +27,49 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %13 = OpConstantNull %int
+         %16 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-%atomicMax_92aa72 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %13
-        %res = OpVariable %_ptr_Function_int Function %13
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicMax_92aa72 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %16
+        %res = OpVariable %_ptr_Function_int Function %16
                OpStore %arg_1 %int_1
-         %20 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %21 = OpLoad %int %arg_1
-         %14 = OpAtomicSMax %int %20 %uint_1 %uint_0 %21
-               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %24 = OpLoad %int %arg_1
+         %17 = OpAtomicSMax %int %23 %uint_1 %uint_0 %24
+               OpStore %res %17
+         %27 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicMax_92aa72
+%fragment_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicMax_92aa72
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atomicMax_92aa72
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atomicMax_92aa72
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.wgsl
index 118f770..9fa061d 100644
--- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicMax_92aa72() {
   var arg_1 = 1i;
   var res : i32 = atomicMax(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicMax_92aa72();
diff --git a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl
index 0aa5139..5192cc3 100644
--- a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl
+++ b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl
@@ -26,7 +26,9 @@
 fn atomicMax_a89cc3() {
   var arg_1 = 1i;
   var res: i32 = atomicMax(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.dxc.hlsl
index 5f4f6cb..c50719a 100644
--- a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMax_a89cc3() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedMax(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.fxc.hlsl
index 5f4f6cb..c50719a 100644
--- a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMax_a89cc3() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedMax(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.glsl
index cfc9b4f..a2581dc 100644
--- a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMax_a89cc3() {
   int arg_1 = 1;
   int res = atomicMax(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.msl
index a067fcd..8f4a8ca 100644
--- a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicMax_a89cc3(threadgroup atomic_int* const tint_symbol) {
+void atomicMax_a89cc3(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_max_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicMax_a89cc3(tint_symbol_1);
+  atomicMax_a89cc3(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.spvasm
index 2864a14..a7bb268 100644
--- a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMax_a89cc3 "atomicMax_a89cc3"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,42 +19,53 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %14 = OpConstantNull %int
+         %17 = OpConstantNull %int
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %21 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicMax_a89cc3 = OpFunction %void None %7
-         %10 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %14
-        %res = OpVariable %_ptr_Function_int Function %14
+%atomicMax_a89cc3 = OpFunction %void None %10
+         %13 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %17
+        %res = OpVariable %_ptr_Function_int Function %17
                OpStore %arg_1 %int_1
-         %19 = OpLoad %int %arg_1
-         %15 = OpAtomicSMax %int %arg_0 %uint_2 %uint_0 %19
-               OpStore %res %15
+         %22 = OpLoad %int %arg_1
+         %18 = OpAtomicSMax %int %arg_0 %uint_2 %uint_0 %22
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %21
+%compute_main_inner = OpFunction %void None %27
 %local_invocation_index = OpFunctionParameter %uint
-         %24 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %14
+         %30 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %atomicMax_a89cc3
+         %35 = OpFunctionCall %void %atomicMax_a89cc3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %31 = OpLabel
-         %33 = OpLoad %uint %local_invocation_index_1
-         %32 = OpFunctionCall %void %compute_main_inner %33
+%compute_main = OpFunction %void None %10
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.wgsl
index 0741d6b..ae180ef 100644
--- a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicMax_a89cc3() {
   var arg_1 = 1i;
   var res : i32 = atomicMax(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicMax_a89cc3();
diff --git a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl
index b80c65f..3b13c53 100644
--- a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl
+++ b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl
@@ -26,7 +26,9 @@
 fn atomicMax_beccfc() {
   var arg_1 = 1u;
   var res: u32 = atomicMax(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.dxc.hlsl
index acdda2c..39db393 100644
--- a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMax_beccfc() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedMax(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.fxc.hlsl
index acdda2c..39db393 100644
--- a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMax_beccfc() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedMax(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.glsl
index b68a3e2..8ba4abb 100644
--- a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMax_beccfc() {
   uint arg_1 = 1u;
   uint res = atomicMax(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.msl
index 96c5d28..926619d 100644
--- a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicMax_beccfc(threadgroup atomic_uint* const tint_symbol) {
+void atomicMax_beccfc(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_max_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicMax_beccfc(tint_symbol_1);
+  atomicMax_beccfc(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.spvasm
index 03577ee..f9be64d 100644
--- a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMax_beccfc "atomicMax_beccfc"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,41 +19,52 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %20 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicMax_beccfc = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%atomicMax_beccfc = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpLoad %uint %arg_1
-         %14 = OpAtomicUMax %uint %arg_0 %uint_2 %uint_0 %18
-               OpStore %res %14
+         %21 = OpLoad %uint %arg_1
+         %17 = OpAtomicUMax %uint %arg_0 %uint_2 %uint_0 %21
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %20
+%compute_main_inner = OpFunction %void None %26
 %local_invocation_index = OpFunctionParameter %uint
-         %23 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %13
+         %29 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicMax_beccfc
+         %34 = OpFunctionCall %void %atomicMax_beccfc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %9
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.wgsl
index 22cf4aa..fdb9cf2 100644
--- a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicMax_beccfc() {
   var arg_1 = 1u;
   var res : u32 = atomicMax(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicMax_beccfc();
diff --git a/test/tint/builtins/gen/var/atomicMin/278235.wgsl b/test/tint/builtins/gen/var/atomicMin/278235.wgsl
index 3b02497..3f88f44 100644
--- a/test/tint/builtins/gen/var/atomicMin/278235.wgsl
+++ b/test/tint/builtins/gen/var/atomicMin/278235.wgsl
@@ -26,7 +26,9 @@
 fn atomicMin_278235() {
   var arg_1 = 1i;
   var res: i32 = atomicMin(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.dxc.hlsl
index 06c49cd..b743c28 100644
--- a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMin_278235() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedMin(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.fxc.hlsl
index 06c49cd..b743c28 100644
--- a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMin_278235() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedMin(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.glsl
index e27c1f1..30b0bf6 100644
--- a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMin_278235() {
   int arg_1 = 1;
   int res = atomicMin(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.msl
index 8443629..0eb8de1 100644
--- a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicMin_278235(threadgroup atomic_int* const tint_symbol) {
+void atomicMin_278235(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_min_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicMin_278235(tint_symbol_1);
+  atomicMin_278235(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.spvasm
index ddfa25a..f91b2dc 100644
--- a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMin_278235 "atomicMin_278235"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,42 +19,53 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %14 = OpConstantNull %int
+         %17 = OpConstantNull %int
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %21 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicMin_278235 = OpFunction %void None %7
-         %10 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %14
-        %res = OpVariable %_ptr_Function_int Function %14
+%atomicMin_278235 = OpFunction %void None %10
+         %13 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %17
+        %res = OpVariable %_ptr_Function_int Function %17
                OpStore %arg_1 %int_1
-         %19 = OpLoad %int %arg_1
-         %15 = OpAtomicSMin %int %arg_0 %uint_2 %uint_0 %19
-               OpStore %res %15
+         %22 = OpLoad %int %arg_1
+         %18 = OpAtomicSMin %int %arg_0 %uint_2 %uint_0 %22
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %21
+%compute_main_inner = OpFunction %void None %27
 %local_invocation_index = OpFunctionParameter %uint
-         %24 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %14
+         %30 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %atomicMin_278235
+         %35 = OpFunctionCall %void %atomicMin_278235
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %31 = OpLabel
-         %33 = OpLoad %uint %local_invocation_index_1
-         %32 = OpFunctionCall %void %compute_main_inner %33
+%compute_main = OpFunction %void None %10
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.wgsl
index fa7c483..07fcc229 100644
--- a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicMin_278235() {
   var arg_1 = 1i;
   var res : i32 = atomicMin(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicMin_278235();
diff --git a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl
index 164a4c0..8598167 100644
--- a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl
+++ b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl
@@ -26,7 +26,9 @@
 fn atomicMin_69d383() {
   var arg_1 = 1u;
   var res: u32 = atomicMin(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.dxc.hlsl
index 1c16fc8..87544ab 100644
--- a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMin_69d383() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedMin(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.fxc.hlsl
index 1c16fc8..87544ab 100644
--- a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicMin_69d383() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedMin(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.glsl
index c14fbe6..fad9720 100644
--- a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMin_69d383() {
   uint arg_1 = 1u;
   uint res = atomicMin(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.msl
index c04290f..6fb843c 100644
--- a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicMin_69d383(threadgroup atomic_uint* const tint_symbol) {
+void atomicMin_69d383(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_min_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicMin_69d383(tint_symbol_1);
+  atomicMin_69d383(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.spvasm
index 784a014..64d1a94 100644
--- a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMin_69d383 "atomicMin_69d383"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,41 +19,52 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %20 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicMin_69d383 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%atomicMin_69d383 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpLoad %uint %arg_1
-         %14 = OpAtomicUMin %uint %arg_0 %uint_2 %uint_0 %18
-               OpStore %res %14
+         %21 = OpLoad %uint %arg_1
+         %17 = OpAtomicUMin %uint %arg_0 %uint_2 %uint_0 %21
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %20
+%compute_main_inner = OpFunction %void None %26
 %local_invocation_index = OpFunctionParameter %uint
-         %23 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %13
+         %29 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicMin_69d383
+         %34 = OpFunctionCall %void %atomicMin_69d383
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %9
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.wgsl
index e0fd2ad..aa2507e 100644
--- a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicMin_69d383() {
   var arg_1 = 1u;
   var res : u32 = atomicMin(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicMin_69d383();
diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl
index 1cd9226..9532e8a 100644
--- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl
+++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl
@@ -29,7 +29,9 @@
 fn atomicMin_8e38dc() {
   var arg_1 = 1i;
   var res: i32 = atomicMin(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.dxc.hlsl
index daf622d..96591ca 100644
--- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMin_8e38dc() {
   int arg_1 = 1;
   int res = sb_rwatomicMin(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.fxc.hlsl
index daf622d..96591ca 100644
--- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMin_8e38dc() {
   int arg_1 = 1;
   int res = sb_rwatomicMin(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.glsl
index 0440e77..392dcdf 100644
--- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMin_8e38dc() {
   int arg_1 = 1;
   int res = atomicMin(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicMin_8e38dc() {
   int arg_1 = 1;
   int res = atomicMin(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.msl
index d670f6f..1eb2f2b 100644
--- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicMin_8e38dc(device SB_RW* const tint_symbol) {
+void atomicMin_8e38dc(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_min_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicMin_8e38dc(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicMin_8e38dc(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicMin_8e38dc(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicMin_8e38dc(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.spvasm
index db6642c..b54e196 100644
--- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMin_8e38dc "atomicMin_8e38dc"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,38 +27,49 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %13 = OpConstantNull %int
+         %16 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-%atomicMin_8e38dc = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %13
-        %res = OpVariable %_ptr_Function_int Function %13
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicMin_8e38dc = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %16
+        %res = OpVariable %_ptr_Function_int Function %16
                OpStore %arg_1 %int_1
-         %20 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %21 = OpLoad %int %arg_1
-         %14 = OpAtomicSMin %int %20 %uint_1 %uint_0 %21
-               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %24 = OpLoad %int %arg_1
+         %17 = OpAtomicSMin %int %23 %uint_1 %uint_0 %24
+               OpStore %res %17
+         %27 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicMin_8e38dc
+%fragment_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicMin_8e38dc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atomicMin_8e38dc
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atomicMin_8e38dc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.wgsl
index 40fd5e4..fd80e6f 100644
--- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicMin_8e38dc() {
   var arg_1 = 1i;
   var res : i32 = atomicMin(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicMin_8e38dc();
diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl
index ac0e9af..92c8272 100644
--- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl
+++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl
@@ -29,7 +29,9 @@
 fn atomicMin_c67a74() {
   var arg_1 = 1u;
   var res: u32 = atomicMin(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.dxc.hlsl
index f5ba0d9..fdae95e 100644
--- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMin_c67a74() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicMin(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.fxc.hlsl
index f5ba0d9..fdae95e 100644
--- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicMin_c67a74() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicMin(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.glsl
index c065703..a25756d 100644
--- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMin_c67a74() {
   uint arg_1 = 1u;
   uint res = atomicMin(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicMin_c67a74() {
   uint arg_1 = 1u;
   uint res = atomicMin(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.msl
index 86f2cf2..b6c15f8 100644
--- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicMin_c67a74(device SB_RW* const tint_symbol) {
+void atomicMin_c67a74(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_min_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicMin_c67a74(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicMin_c67a74(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicMin_c67a74(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicMin_c67a74(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.spvasm
index 3816db2..2e970a8 100644
--- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicMin_c67a74 "atomicMin_c67a74"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,36 +27,47 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-%atomicMin_c67a74 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicMin_c67a74 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %19 = OpLoad %uint %arg_1
-         %14 = OpAtomicUMin %uint %18 %uint_1 %uint_0 %19
-               OpStore %res %14
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %22 = OpLoad %uint %arg_1
+         %17 = OpAtomicUMin %uint %21 %uint_1 %uint_0 %22
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %26 = OpLoad %uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicMin_c67a74
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicMin_c67a74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicMin_c67a74
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicMin_c67a74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.wgsl
index 880c6a6..2f6ccf9 100644
--- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicMin_c67a74() {
   var arg_1 = 1u;
   var res : u32 = atomicMin(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicMin_c67a74();
diff --git a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl
index 4017068..15da7ab 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl
@@ -26,7 +26,9 @@
 fn atomicOr_5e3d61() {
   var arg_1 = 1u;
   var res: u32 = atomicOr(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.dxc.hlsl
index 80cf20e..44a0797 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicOr_5e3d61() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedOr(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.fxc.hlsl
index 80cf20e..44a0797 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicOr_5e3d61() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedOr(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.glsl
index 23ddd2e..12ddc58 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicOr_5e3d61() {
   uint arg_1 = 1u;
   uint res = atomicOr(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.msl
index 0801fc9..fb54529 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicOr_5e3d61(threadgroup atomic_uint* const tint_symbol) {
+void atomicOr_5e3d61(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_or_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicOr_5e3d61(tint_symbol_1);
+  atomicOr_5e3d61(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.spvasm
index 9db7191..570a9b6 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicOr_5e3d61 "atomicOr_5e3d61"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,41 +19,52 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %20 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicOr_5e3d61 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%atomicOr_5e3d61 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpLoad %uint %arg_1
-         %14 = OpAtomicOr %uint %arg_0 %uint_2 %uint_0 %18
-               OpStore %res %14
+         %21 = OpLoad %uint %arg_1
+         %17 = OpAtomicOr %uint %arg_0 %uint_2 %uint_0 %21
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %20
+%compute_main_inner = OpFunction %void None %26
 %local_invocation_index = OpFunctionParameter %uint
-         %23 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %13
+         %29 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicOr_5e3d61
+         %34 = OpFunctionCall %void %atomicOr_5e3d61
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %9
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.wgsl
index c88c5a9..37f5fa0 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicOr_5e3d61() {
   var arg_1 = 1u;
   var res : u32 = atomicOr(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicOr_5e3d61();
diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl
index 6219ffe..655db31 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl
@@ -29,7 +29,9 @@
 fn atomicOr_5e95d4() {
   var arg_1 = 1u;
   var res: u32 = atomicOr(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.dxc.hlsl
index 5945dea..fe5dd36 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicOr_5e95d4() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicOr(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.fxc.hlsl
index 5945dea..fe5dd36 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicOr_5e95d4() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicOr(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.glsl
index 7d9ec02..c1adeac 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicOr_5e95d4() {
   uint arg_1 = 1u;
   uint res = atomicOr(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicOr_5e95d4() {
   uint arg_1 = 1u;
   uint res = atomicOr(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.msl
index f6a899e..c87c9a5 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicOr_5e95d4(device SB_RW* const tint_symbol) {
+void atomicOr_5e95d4(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_or_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicOr_5e95d4(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicOr_5e95d4(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicOr_5e95d4(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicOr_5e95d4(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.spvasm
index e5533fa..a62de04 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicOr_5e95d4 "atomicOr_5e95d4"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,36 +27,47 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-%atomicOr_5e95d4 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicOr_5e95d4 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %19 = OpLoad %uint %arg_1
-         %14 = OpAtomicOr %uint %18 %uint_1 %uint_0 %19
-               OpStore %res %14
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %22 = OpLoad %uint %arg_1
+         %17 = OpAtomicOr %uint %21 %uint_1 %uint_0 %22
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %26 = OpLoad %uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicOr_5e95d4
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicOr_5e95d4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicOr_5e95d4
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicOr_5e95d4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.wgsl
index c9d86b6..70ff48b 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicOr_5e95d4() {
   var arg_1 = 1u;
   var res : u32 = atomicOr(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicOr_5e95d4();
diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl
index cfbed5f..374a901 100644
--- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl
+++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl
@@ -29,7 +29,9 @@
 fn atomicOr_8d96a0() {
   var arg_1 = 1i;
   var res: i32 = atomicOr(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.dxc.hlsl
index 9e1b10c..0ebbb36 100644
--- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicOr_8d96a0() {
   int arg_1 = 1;
   int res = sb_rwatomicOr(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.fxc.hlsl
index 9e1b10c..0ebbb36 100644
--- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicOr_8d96a0() {
   int arg_1 = 1;
   int res = sb_rwatomicOr(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.glsl
index 7b14ac9..0374747 100644
--- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicOr_8d96a0() {
   int arg_1 = 1;
   int res = atomicOr(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicOr_8d96a0() {
   int arg_1 = 1;
   int res = atomicOr(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.msl
index e21e22d..2bf89a1 100644
--- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicOr_8d96a0(device SB_RW* const tint_symbol) {
+void atomicOr_8d96a0(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_or_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicOr_8d96a0(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicOr_8d96a0(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicOr_8d96a0(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicOr_8d96a0(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.spvasm
index e44b318..8f66355 100644
--- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicOr_8d96a0 "atomicOr_8d96a0"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,38 +27,49 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %13 = OpConstantNull %int
+         %16 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-%atomicOr_8d96a0 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %13
-        %res = OpVariable %_ptr_Function_int Function %13
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicOr_8d96a0 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %16
+        %res = OpVariable %_ptr_Function_int Function %16
                OpStore %arg_1 %int_1
-         %20 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %21 = OpLoad %int %arg_1
-         %14 = OpAtomicOr %int %20 %uint_1 %uint_0 %21
-               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %24 = OpLoad %int %arg_1
+         %17 = OpAtomicOr %int %23 %uint_1 %uint_0 %24
+               OpStore %res %17
+         %27 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicOr_8d96a0
+%fragment_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicOr_8d96a0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atomicOr_8d96a0
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atomicOr_8d96a0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.wgsl
index b10dc6d..2cbeded 100644
--- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicOr_8d96a0() {
   var arg_1 = 1i;
   var res : i32 = atomicOr(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicOr_8d96a0();
diff --git a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl
index 776295b..135a6a1 100644
--- a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl
+++ b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl
@@ -26,7 +26,9 @@
 fn atomicOr_d09248() {
   var arg_1 = 1i;
   var res: i32 = atomicOr(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.dxc.hlsl
index 04e7f92..61b8369 100644
--- a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicOr_d09248() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedOr(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.fxc.hlsl
index 04e7f92..61b8369 100644
--- a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicOr_d09248() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedOr(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.glsl
index d601550..671d9e7 100644
--- a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicOr_d09248() {
   int arg_1 = 1;
   int res = atomicOr(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.msl
index 7569a48..5549178 100644
--- a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicOr_d09248(threadgroup atomic_int* const tint_symbol) {
+void atomicOr_d09248(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_or_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicOr_d09248(tint_symbol_1);
+  atomicOr_d09248(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.spvasm
index 6a5541c..f7eceaf3 100644
--- a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicOr_d09248 "atomicOr_d09248"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,42 +19,53 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %14 = OpConstantNull %int
+         %17 = OpConstantNull %int
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %21 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicOr_d09248 = OpFunction %void None %7
-         %10 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %14
-        %res = OpVariable %_ptr_Function_int Function %14
+%atomicOr_d09248 = OpFunction %void None %10
+         %13 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %17
+        %res = OpVariable %_ptr_Function_int Function %17
                OpStore %arg_1 %int_1
-         %19 = OpLoad %int %arg_1
-         %15 = OpAtomicOr %int %arg_0 %uint_2 %uint_0 %19
-               OpStore %res %15
+         %22 = OpLoad %int %arg_1
+         %18 = OpAtomicOr %int %arg_0 %uint_2 %uint_0 %22
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %21
+%compute_main_inner = OpFunction %void None %27
 %local_invocation_index = OpFunctionParameter %uint
-         %24 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %14
+         %30 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %atomicOr_d09248
+         %35 = OpFunctionCall %void %atomicOr_d09248
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %31 = OpLabel
-         %33 = OpLoad %uint %local_invocation_index_1
-         %32 = OpFunctionCall %void %compute_main_inner %33
+%compute_main = OpFunction %void None %10
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.wgsl
index cba0211..f33a0b4 100644
--- a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicOr_d09248() {
   var arg_1 = 1i;
   var res : i32 = atomicOr(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicOr_d09248();
diff --git a/test/tint/builtins/gen/var/atomicStore/726882.wgsl b/test/tint/builtins/gen/var/atomicStore/726882.wgsl
index 93846e1..b95f3c2 100644
--- a/test/tint/builtins/gen/var/atomicStore/726882.wgsl
+++ b/test/tint/builtins/gen/var/atomicStore/726882.wgsl
@@ -27,7 +27,6 @@
   var arg_1 = 1u;
   atomicStore(&arg_0, arg_1);
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicStore_726882();
diff --git a/test/tint/builtins/gen/var/atomicStore/8bea94.wgsl b/test/tint/builtins/gen/var/atomicStore/8bea94.wgsl
index 3a5ed5a..c3dd9f6 100644
--- a/test/tint/builtins/gen/var/atomicStore/8bea94.wgsl
+++ b/test/tint/builtins/gen/var/atomicStore/8bea94.wgsl
@@ -27,7 +27,6 @@
   var arg_1 = 1i;
   atomicStore(&arg_0, arg_1);
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicStore_8bea94();
diff --git a/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl b/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl
index d109ef7..202ab65 100644
--- a/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl
+++ b/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl
@@ -30,7 +30,6 @@
   var arg_1 = 1u;
   atomicStore(&sb_rw.arg_0, arg_1);
 }
-
 @fragment
 fn fragment_main() {
   atomicStore_cdc29e();
diff --git a/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl b/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl
index ee28858..2bb8802 100644
--- a/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl
+++ b/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl
@@ -30,7 +30,6 @@
   var arg_1 = 1i;
   atomicStore(&sb_rw.arg_0, arg_1);
 }
-
 @fragment
 fn fragment_main() {
   atomicStore_d1e9a6();
diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl
index 0bc68cf..fa4e859 100644
--- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl
+++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl
@@ -29,7 +29,9 @@
 fn atomicSub_051100() {
   var arg_1 = 1i;
   var res: i32 = atomicSub(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.dxc.hlsl
index 3e49340..c077761 100644
--- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicSub_051100() {
   int arg_1 = 1;
   int res = sb_rwatomicSub(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.fxc.hlsl
index 3e49340..c077761 100644
--- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicSub_051100() {
   int arg_1 = 1;
   int res = sb_rwatomicSub(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.glsl
index 3b0d503..eacf33f 100644
--- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicSub_051100() {
   int arg_1 = 1;
   int res = atomicAdd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicSub_051100() {
   int arg_1 = 1;
   int res = atomicAdd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.msl
index 695c085..66f0bc3 100644
--- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicSub_051100(device SB_RW* const tint_symbol) {
+void atomicSub_051100(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_sub_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicSub_051100(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicSub_051100(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicSub_051100(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicSub_051100(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.spvasm
index 8bdad33..2527994 100644
--- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicSub_051100 "atomicSub_051100"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,38 +27,49 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %13 = OpConstantNull %int
+         %16 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-%atomicSub_051100 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %13
-        %res = OpVariable %_ptr_Function_int Function %13
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicSub_051100 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %16
+        %res = OpVariable %_ptr_Function_int Function %16
                OpStore %arg_1 %int_1
-         %20 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %21 = OpLoad %int %arg_1
-         %14 = OpAtomicISub %int %20 %uint_1 %uint_0 %21
-               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %24 = OpLoad %int %arg_1
+         %17 = OpAtomicISub %int %23 %uint_1 %uint_0 %24
+               OpStore %res %17
+         %27 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicSub_051100
+%fragment_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicSub_051100
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atomicSub_051100
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atomicSub_051100
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.wgsl
index 5a6160b..44f5481 100644
--- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicSub_051100() {
   var arg_1 = 1i;
   var res : i32 = atomicSub(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicSub_051100();
diff --git a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl
index 6113cf9..7d13550 100644
--- a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl
+++ b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl
@@ -26,7 +26,9 @@
 fn atomicSub_0d26c2() {
   var arg_1 = 1u;
   var res: u32 = atomicSub(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.dxc.hlsl
index abced13..c3cf985 100644
--- a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicSub_0d26c2() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedAdd(arg_0, -arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.fxc.hlsl
index abced13..c3cf985 100644
--- a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicSub_0d26c2() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedAdd(arg_0, -arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.glsl
index 739fc9e..c37cb6f 100644
--- a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicSub_0d26c2() {
   uint arg_1 = 1u;
   uint res = atomicAdd(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.msl
index 2f510de..db72de5 100644
--- a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicSub_0d26c2(threadgroup atomic_uint* const tint_symbol) {
+void atomicSub_0d26c2(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_sub_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicSub_0d26c2(tint_symbol_1);
+  atomicSub_0d26c2(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.spvasm
index 2c6b98e..1a81671 100644
--- a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicSub_0d26c2 "atomicSub_0d26c2"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,41 +19,52 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %20 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicSub_0d26c2 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%atomicSub_0d26c2 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpLoad %uint %arg_1
-         %14 = OpAtomicISub %uint %arg_0 %uint_2 %uint_0 %18
-               OpStore %res %14
+         %21 = OpLoad %uint %arg_1
+         %17 = OpAtomicISub %uint %arg_0 %uint_2 %uint_0 %21
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %20
+%compute_main_inner = OpFunction %void None %26
 %local_invocation_index = OpFunctionParameter %uint
-         %23 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %13
+         %29 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicSub_0d26c2
+         %34 = OpFunctionCall %void %atomicSub_0d26c2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %9
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.wgsl
index 1f5446e..1adfc9d 100644
--- a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicSub_0d26c2() {
   var arg_1 = 1u;
   var res : u32 = atomicSub(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicSub_0d26c2();
diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl
index e676cc2..734d274 100644
--- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl
+++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl
@@ -29,7 +29,9 @@
 fn atomicSub_15bfc9() {
   var arg_1 = 1u;
   var res: u32 = atomicSub(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.dxc.hlsl
index 374add5..c64d5e0 100644
--- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicSub_15bfc9() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicSub(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.fxc.hlsl
index 374add5..c64d5e0 100644
--- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicSub_15bfc9() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicSub(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.glsl
index 9613271..e76d133 100644
--- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicSub_15bfc9() {
   uint arg_1 = 1u;
   uint res = atomicAdd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicSub_15bfc9() {
   uint arg_1 = 1u;
   uint res = atomicAdd(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.msl
index c664e5a..93e0f8b 100644
--- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicSub_15bfc9(device SB_RW* const tint_symbol) {
+void atomicSub_15bfc9(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_sub_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicSub_15bfc9(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicSub_15bfc9(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicSub_15bfc9(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicSub_15bfc9(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.spvasm
index becb222..7e18eb6 100644
--- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicSub_15bfc9 "atomicSub_15bfc9"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,36 +27,47 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-%atomicSub_15bfc9 = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicSub_15bfc9 = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %19 = OpLoad %uint %arg_1
-         %14 = OpAtomicISub %uint %18 %uint_1 %uint_0 %19
-               OpStore %res %14
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %22 = OpLoad %uint %arg_1
+         %17 = OpAtomicISub %uint %21 %uint_1 %uint_0 %22
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %26 = OpLoad %uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicSub_15bfc9
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicSub_15bfc9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicSub_15bfc9
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicSub_15bfc9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.wgsl
index ea7a046..7b8f08f 100644
--- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicSub_15bfc9() {
   var arg_1 = 1u;
   var res : u32 = atomicSub(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicSub_15bfc9();
diff --git a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl
index f6bbd19..df2c0f3 100644
--- a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl
+++ b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl
@@ -26,7 +26,9 @@
 fn atomicSub_77883a() {
   var arg_1 = 1i;
   var res: i32 = atomicSub(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.dxc.hlsl
index dcc2e25..6d4ae8f 100644
--- a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicSub_77883a() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedAdd(arg_0, -arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.fxc.hlsl
index dcc2e25..6d4ae8f 100644
--- a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicSub_77883a() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedAdd(arg_0, -arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.glsl
index 02de7e6..0e4cfae 100644
--- a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicSub_77883a() {
   int arg_1 = 1;
   int res = atomicAdd(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.msl
index 2e54b64..6da9669 100644
--- a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicSub_77883a(threadgroup atomic_int* const tint_symbol) {
+void atomicSub_77883a(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_sub_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicSub_77883a(tint_symbol_1);
+  atomicSub_77883a(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.spvasm
index d96432d..94262b5 100644
--- a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicSub_77883a "atomicSub_77883a"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,42 +19,53 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %14 = OpConstantNull %int
+         %17 = OpConstantNull %int
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %21 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicSub_77883a = OpFunction %void None %7
-         %10 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %14
-        %res = OpVariable %_ptr_Function_int Function %14
+%atomicSub_77883a = OpFunction %void None %10
+         %13 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %17
+        %res = OpVariable %_ptr_Function_int Function %17
                OpStore %arg_1 %int_1
-         %19 = OpLoad %int %arg_1
-         %15 = OpAtomicISub %int %arg_0 %uint_2 %uint_0 %19
-               OpStore %res %15
+         %22 = OpLoad %int %arg_1
+         %18 = OpAtomicISub %int %arg_0 %uint_2 %uint_0 %22
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %21
+%compute_main_inner = OpFunction %void None %27
 %local_invocation_index = OpFunctionParameter %uint
-         %24 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %14
+         %30 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %atomicSub_77883a
+         %35 = OpFunctionCall %void %atomicSub_77883a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %31 = OpLabel
-         %33 = OpLoad %uint %local_invocation_index_1
-         %32 = OpFunctionCall %void %compute_main_inner %33
+%compute_main = OpFunction %void None %10
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.wgsl
index d42d866..c36b23c 100644
--- a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicSub_77883a() {
   var arg_1 = 1i;
   var res : i32 = atomicSub(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicSub_77883a();
diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl
index 7eeb0dc..6077675 100644
--- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl
+++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl
@@ -29,7 +29,9 @@
 fn atomicXor_54510e() {
   var arg_1 = 1u;
   var res: u32 = atomicXor(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.dxc.hlsl
index 6294ed3..9a07841 100644
--- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicXor_54510e() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicXor(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.fxc.hlsl
index 6294ed3..9a07841 100644
--- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicXor_54510e() {
   uint arg_1 = 1u;
   uint res = sb_rwatomicXor(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.glsl
index c32a892..e9d656c 100644
--- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicXor_54510e() {
   uint arg_1 = 1u;
   uint res = atomicXor(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicXor_54510e() {
   uint arg_1 = 1u;
   uint res = atomicXor(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.msl
index fc578f9..efaeb4e 100644
--- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_uint arg_0;
 };
 
-void atomicXor_54510e(device SB_RW* const tint_symbol) {
+void atomicXor_54510e(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_xor_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicXor_54510e(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
+  atomicXor_54510e(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicXor_54510e(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
+  atomicXor_54510e(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.spvasm
index 6c64a5d..2c46b0b 100644
--- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicXor_54510e "atomicXor_54510e"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,36 +27,47 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
       %SB_RW = OpTypeStruct %uint
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-%atomicXor_54510e = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
+%atomicXor_54510e = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
-         %19 = OpLoad %uint %arg_1
-         %14 = OpAtomicXor %uint %18 %uint_1 %uint_0 %19
-               OpStore %res %14
+         %21 = OpAccessChain %_ptr_StorageBuffer_uint %sb_rw %uint_0 %uint_0
+         %22 = OpLoad %uint %arg_1
+         %17 = OpAtomicXor %uint %21 %uint_1 %uint_0 %22
+               OpStore %res %17
+         %25 = OpAccessChain %_ptr_StorageBuffer_uint_0 %prevent_dce %uint_0
+         %26 = OpLoad %uint %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %atomicXor_54510e
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %atomicXor_54510e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %atomicXor_54510e
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %atomicXor_54510e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.wgsl
index 873a863..4a9f245 100644
--- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicXor_54510e() {
   var arg_1 = 1u;
   var res : u32 = atomicXor(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @fragment
 fn fragment_main() {
   atomicXor_54510e();
diff --git a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl
index 43ef1a3..86d1e31 100644
--- a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl
+++ b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl
@@ -26,7 +26,9 @@
 fn atomicXor_75dc95() {
   var arg_1 = 1i;
   var res: i32 = atomicXor(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.dxc.hlsl
index a93c5dc..1809e3e 100644
--- a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicXor_75dc95() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedXor(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.fxc.hlsl
index a93c5dc..1809e3e 100644
--- a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicXor_75dc95() {
   int arg_1 = 1;
   int atomic_result = 0;
   InterlockedXor(arg_0, arg_1, atomic_result);
   int res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.glsl
index 207bfd4..a42ae80 100644
--- a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicXor_75dc95() {
   int arg_1 = 1;
   int res = atomicXor(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.msl
index afad14b..4caafeb 100644
--- a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicXor_75dc95(threadgroup atomic_int* const tint_symbol) {
+void atomicXor_75dc95(threadgroup atomic_int* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_xor_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicXor_75dc95(tint_symbol_1);
+  atomicXor_75dc95(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.spvasm
index 62e0351..669b6e8 100644
--- a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicXor_75dc95 "atomicXor_75dc95"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,42 +19,53 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %7 = OpTypeFunction %void
+         %10 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %14 = OpConstantNull %int
+         %17 = OpConstantNull %int
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %21 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %27 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicXor_75dc95 = OpFunction %void None %7
-         %10 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %14
-        %res = OpVariable %_ptr_Function_int Function %14
+%atomicXor_75dc95 = OpFunction %void None %10
+         %13 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %17
+        %res = OpVariable %_ptr_Function_int Function %17
                OpStore %arg_1 %int_1
-         %19 = OpLoad %int %arg_1
-         %15 = OpAtomicXor %int %arg_0 %uint_2 %uint_0 %19
-               OpStore %res %15
+         %22 = OpLoad %int %arg_1
+         %18 = OpAtomicXor %int %arg_0 %uint_2 %uint_0 %22
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %26 = OpLoad %int %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %21
+%compute_main_inner = OpFunction %void None %27
 %local_invocation_index = OpFunctionParameter %uint
-         %24 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %14
+         %30 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %17
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %atomicXor_75dc95
+         %35 = OpFunctionCall %void %atomicXor_75dc95
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %7
-         %31 = OpLabel
-         %33 = OpLoad %uint %local_invocation_index_1
-         %32 = OpFunctionCall %void %compute_main_inner %33
+%compute_main = OpFunction %void None %10
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.wgsl
index ca4d853..60260bf 100644
--- a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicXor_75dc95() {
   var arg_1 = 1i;
   var res : i32 = atomicXor(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicXor_75dc95();
diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl
index 87a1599..f3be11b 100644
--- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl
+++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl
@@ -29,7 +29,9 @@
 fn atomicXor_c1b78c() {
   var arg_1 = 1i;
   var res: i32 = atomicXor(&sb_rw.arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.dxc.hlsl
index 168a8a0..2fc13fd 100644
--- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.dxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicXor_c1b78c() {
   int arg_1 = 1;
   int res = sb_rwatomicXor(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.fxc.hlsl
index 168a8a0..2fc13fd 100644
--- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.fxc.hlsl
@@ -7,9 +7,12 @@
 }
 
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void atomicXor_c1b78c() {
   int arg_1 = 1;
   int res = sb_rwatomicXor(0u, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.glsl
index b2a9425..fcc92ef 100644
--- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.glsl
@@ -9,9 +9,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicXor_c1b78c() {
   int arg_1 = 1;
   int res = atomicXor(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -32,9 +37,14 @@
   SB_RW inner;
 } sb_rw;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void atomicXor_c1b78c() {
   int arg_1 = 1;
   int res = atomicXor(sb_rw.inner.arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.msl
index 1dba501..6a7bf5b 100644
--- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.msl
@@ -5,18 +5,19 @@
   /* 0x0000 */ atomic_int arg_0;
 };
 
-void atomicXor_c1b78c(device SB_RW* const tint_symbol) {
+void atomicXor_c1b78c(device SB_RW* const tint_symbol, device int* const tint_symbol_1) {
   int arg_1 = 1;
   int res = atomic_fetch_xor_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) {
-  atomicXor_c1b78c(tint_symbol_1);
+fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device int* tint_symbol_3 [[buffer(1)]]) {
+  atomicXor_c1b78c(tint_symbol_2, tint_symbol_3);
   return;
 }
 
-kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) {
-  atomicXor_c1b78c(tint_symbol_2);
+kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device int* tint_symbol_5 [[buffer(1)]]) {
+  atomicXor_c1b78c(tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.spvasm
index dff9f26..f2c75b1 100644
--- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %SB_RW "SB_RW"
                OpMemberName %SB_RW 0 "arg_0"
                OpName %sb_rw "sb_rw"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicXor_c1b78c "atomicXor_c1b78c"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -24,38 +27,49 @@
                OpMemberDecorate %SB_RW 0 Offset 0
                OpDecorate %sb_rw DescriptorSet 0
                OpDecorate %sb_rw Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
         %int = OpTypeInt 32 1
       %SB_RW = OpTypeStruct %int
 %sb_rw_block = OpTypeStruct %SB_RW
 %_ptr_StorageBuffer_sb_rw_block = OpTypePointer StorageBuffer %sb_rw_block
       %sb_rw = OpVariable %_ptr_StorageBuffer_sb_rw_block StorageBuffer
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %13 = OpConstantNull %int
+         %16 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-%atomicXor_c1b78c = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %13
-        %res = OpVariable %_ptr_Function_int Function %13
+%_ptr_StorageBuffer_int_0 = OpTypePointer StorageBuffer %int
+%atomicXor_c1b78c = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %16
+        %res = OpVariable %_ptr_Function_int Function %16
                OpStore %arg_1 %int_1
-         %20 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
-         %21 = OpLoad %int %arg_1
-         %14 = OpAtomicXor %int %20 %uint_1 %uint_0 %21
-               OpStore %res %14
+         %23 = OpAccessChain %_ptr_StorageBuffer_int %sb_rw %uint_0 %uint_0
+         %24 = OpLoad %int %arg_1
+         %17 = OpAtomicXor %int %23 %uint_1 %uint_0 %24
+               OpStore %res %17
+         %27 = OpAccessChain %_ptr_StorageBuffer_int_0 %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %6
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %atomicXor_c1b78c
+%fragment_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %atomicXor_c1b78c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %atomicXor_c1b78c
+%compute_main = OpFunction %void None %9
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %atomicXor_c1b78c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.wgsl
index a8129e8..d70c9d8 100644
--- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
 fn atomicXor_c1b78c() {
   var arg_1 = 1i;
   var res : i32 = atomicXor(&(sb_rw.arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @fragment
 fn fragment_main() {
   atomicXor_c1b78c();
diff --git a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl
index 3596bc8..3bfac33 100644
--- a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl
+++ b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl
@@ -26,7 +26,9 @@
 fn atomicXor_c8e6be() {
   var arg_1 = 1u;
   var res: u32 = atomicXor(&arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.dxc.hlsl
index 18b6de7..4e4a437 100644
--- a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicXor_c8e6be() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedXor(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.fxc.hlsl
index 18b6de7..4e4a437 100644
--- a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void atomicXor_c8e6be() {
   uint arg_1 = 1u;
   uint atomic_result = 0u;
   InterlockedXor(arg_0, arg_1, atomic_result);
   uint res = atomic_result;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.glsl b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.glsl
index 36660a3..d4fc731 100644
--- a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void atomicXor_c8e6be() {
   uint arg_1 = 1u;
   uint res = atomicXor(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.msl b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.msl
index 0f81e1e..a468fad 100644
--- a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.msl
@@ -1,22 +1,23 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void atomicXor_c8e6be(threadgroup atomic_uint* const tint_symbol) {
+void atomicXor_c8e6be(threadgroup atomic_uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint arg_1 = 1u;
   uint res = atomic_fetch_xor_explicit(tint_symbol, arg_1, memory_order_relaxed);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup atomic_uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    atomic_store_explicit(tint_symbol_1, 0u, memory_order_relaxed);
+    atomic_store_explicit(tint_symbol_2, 0u, memory_order_relaxed);
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  atomicXor_c8e6be(tint_symbol_1);
+  atomicXor_c8e6be(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup atomic_uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup atomic_uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.spvasm
index ba98e8d..a7bbff9 100644
--- a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %atomicXor_c8e6be "atomicXor_c8e6be"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -16,41 +19,52 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %6 = OpTypeFunction %void
+          %9 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %13 = OpConstantNull %uint
+         %16 = OpConstantNull %uint
      %uint_2 = OpConstant %uint 2
      %uint_0 = OpConstant %uint 0
-         %20 = OpTypeFunction %void %uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %26 = OpTypeFunction %void %uint
    %uint_264 = OpConstant %uint 264
-%atomicXor_c8e6be = OpFunction %void None %6
-          %9 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %13
-        %res = OpVariable %_ptr_Function_uint Function %13
+%atomicXor_c8e6be = OpFunction %void None %9
+         %12 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %16
+        %res = OpVariable %_ptr_Function_uint Function %16
                OpStore %arg_1 %uint_1
-         %18 = OpLoad %uint %arg_1
-         %14 = OpAtomicXor %uint %arg_0 %uint_2 %uint_0 %18
-               OpStore %res %14
+         %21 = OpLoad %uint %arg_1
+         %17 = OpAtomicXor %uint %arg_0 %uint_2 %uint_0 %21
+               OpStore %res %17
+         %24 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %25 = OpLoad %uint %res
+               OpStore %24 %25
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %20
+%compute_main_inner = OpFunction %void None %26
 %local_invocation_index = OpFunctionParameter %uint
-         %23 = OpLabel
-               OpAtomicStore %arg_0 %uint_2 %uint_0 %13
+         %29 = OpLabel
+               OpAtomicStore %arg_0 %uint_2 %uint_0 %16
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicXor_c8e6be
+         %34 = OpFunctionCall %void %atomicXor_c8e6be
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %6
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %9
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.wgsl b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.wgsl
index 3cf4fef..3e5d231 100644
--- a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn atomicXor_c8e6be() {
   var arg_1 = 1u;
   var res : u32 = atomicXor(&(arg_0), arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   atomicXor_c8e6be();
diff --git a/test/tint/builtins/gen/var/ceil/09bf52.wgsl b/test/tint/builtins/gen/var/ceil/09bf52.wgsl
index cbaee7b..1976b3d 100644
--- a/test/tint/builtins/gen/var/ceil/09bf52.wgsl
+++ b/test/tint/builtins/gen/var/ceil/09bf52.wgsl
@@ -27,7 +27,9 @@
 fn ceil_09bf52() {
   var arg_0 = vec3<f16>(1.5h);
   var res: vec3<f16> = ceil(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.dxc.hlsl
index e3fd593..0d50431 100644
--- a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_09bf52() {
   vector<float16_t, 3> arg_0 = (float16_t(1.5h)).xxx;
   vector<float16_t, 3> res = ceil(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.fxc.hlsl
index 7ac9b8d..189a30c 100644
--- a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_09bf52() {
   vector<float16_t, 3> arg_0 = (float16_t(1.5h)).xxx;
   vector<float16_t, 3> res = ceil(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.glsl b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.glsl
index 6ef9722..23c4504 100644
--- a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ceil_09bf52() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ceil_09bf52() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ceil_09bf52() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.msl b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.msl
index 96a9b32..630c5e7 100644
--- a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_09bf52() {
+void ceil_09bf52(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.5h);
   half3 res = ceil(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_09bf52();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  ceil_09bf52(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_09bf52();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  ceil_09bf52(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_09bf52();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  ceil_09bf52(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.spvasm
index feea526..05bfdb5 100644
--- a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_09bf52 "ceil_09bf52"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v3half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v3half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_09bf52 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Ceil %22
-               OpStore %res %20
+%ceil_09bf52 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Ceil %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %ceil_09bf52
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %ceil_09bf52
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ceil_09bf52
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ceil_09bf52
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %ceil_09bf52
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %ceil_09bf52
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.wgsl
index 35408a5..90081dd 100644
--- a/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ceil/09bf52.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn ceil_09bf52() {
   var arg_0 = vec3<f16>(1.5h);
   var res : vec3<f16> = ceil(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_09bf52();
diff --git a/test/tint/builtins/gen/var/ceil/11b1dc.wgsl b/test/tint/builtins/gen/var/ceil/11b1dc.wgsl
index e87aa07..c248116 100644
--- a/test/tint/builtins/gen/var/ceil/11b1dc.wgsl
+++ b/test/tint/builtins/gen/var/ceil/11b1dc.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.5);
   var res = ceil(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_11b1dc();
diff --git a/test/tint/builtins/gen/var/ceil/18c240.wgsl b/test/tint/builtins/gen/var/ceil/18c240.wgsl
index 5e554cc..a460b2e 100644
--- a/test/tint/builtins/gen/var/ceil/18c240.wgsl
+++ b/test/tint/builtins/gen/var/ceil/18c240.wgsl
@@ -27,7 +27,9 @@
 fn ceil_18c240() {
   var arg_0 = vec2<f16>(1.5h);
   var res: vec2<f16> = ceil(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.dxc.hlsl
index cfbc86d..26312f7 100644
--- a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_18c240() {
   vector<float16_t, 2> arg_0 = (float16_t(1.5h)).xx;
   vector<float16_t, 2> res = ceil(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.fxc.hlsl
index 7fdf3af..3299498 100644
--- a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_18c240() {
   vector<float16_t, 2> arg_0 = (float16_t(1.5h)).xx;
   vector<float16_t, 2> res = ceil(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.glsl b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.glsl
index d76e772..47b8a69 100644
--- a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ceil_18c240() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ceil_18c240() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ceil_18c240() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.msl b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.msl
index d10193a..a685ac1 100644
--- a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_18c240() {
+void ceil_18c240(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.5h);
   half2 res = ceil(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_18c240();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  ceil_18c240(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_18c240();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  ceil_18c240(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_18c240();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  ceil_18c240(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.spvasm
index f5b89de..2aed11f 100644
--- a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_18c240 "ceil_18c240"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v2half %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v2half %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_18c240 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Ceil %22
-               OpStore %res %20
+%ceil_18c240 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Ceil %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %ceil_18c240
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %ceil_18c240
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ceil_18c240
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ceil_18c240
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %ceil_18c240
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %ceil_18c240
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.wgsl
index dc2a454..d4f8933 100644
--- a/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ceil/18c240.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn ceil_18c240() {
   var arg_0 = vec2<f16>(1.5h);
   var res : vec2<f16> = ceil(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_18c240();
diff --git a/test/tint/builtins/gen/var/ceil/32c946.wgsl b/test/tint/builtins/gen/var/ceil/32c946.wgsl
index 505d32b..5bc0d1c 100644
--- a/test/tint/builtins/gen/var/ceil/32c946.wgsl
+++ b/test/tint/builtins/gen/var/ceil/32c946.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.5);
   var res = ceil(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_32c946();
diff --git a/test/tint/builtins/gen/var/ceil/34064b.wgsl b/test/tint/builtins/gen/var/ceil/34064b.wgsl
index 5cdb7e3..8580c11 100644
--- a/test/tint/builtins/gen/var/ceil/34064b.wgsl
+++ b/test/tint/builtins/gen/var/ceil/34064b.wgsl
@@ -25,7 +25,9 @@
 fn ceil_34064b() {
   var arg_0 = vec3<f32>(1.5f);
   var res: vec3<f32> = ceil(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.dxc.hlsl
index b195a21..3713b12 100644
--- a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_34064b() {
   float3 arg_0 = (1.5f).xxx;
   float3 res = ceil(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.fxc.hlsl
index b195a21..3713b12 100644
--- a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_34064b() {
   float3 arg_0 = (1.5f).xxx;
   float3 res = ceil(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.glsl b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.glsl
index c5b7218..8d3db95 100644
--- a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ceil_34064b() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ceil_34064b() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ceil_34064b() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.msl b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.msl
index 8a2cc0b..d11968d 100644
--- a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_34064b() {
+void ceil_34064b(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.5f);
   float3 res = ceil(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_34064b();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  ceil_34064b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_34064b();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  ceil_34064b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_34064b();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  ceil_34064b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.spvasm
index 949ebc4..a12a293 100644
--- a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_34064b "ceil_34064b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %15 = OpConstantComposite %v3float %float_1_5 %float_1_5 %float_1_5
+         %18 = OpConstantComposite %v3float %float_1_5 %float_1_5 %float_1_5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_34064b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Ceil %21
-               OpStore %res %19
+%ceil_34064b = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Ceil %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %ceil_34064b
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %ceil_34064b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ceil_34064b
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ceil_34064b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %ceil_34064b
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %ceil_34064b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.wgsl
index 52f16c4..3a11425 100644
--- a/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ceil/34064b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn ceil_34064b() {
   var arg_0 = vec3<f32>(1.5f);
   var res : vec3<f32> = ceil(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_34064b();
diff --git a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl
index 5af7c60..57336ea 100644
--- a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl
+++ b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl
@@ -27,7 +27,9 @@
 fn ceil_4bca2a() {
   var arg_0 = vec4<f16>(1.5h);
   var res: vec4<f16> = ceil(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.dxc.hlsl
index 23da27f..1a485d1 100644
--- a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_4bca2a() {
   vector<float16_t, 4> arg_0 = (float16_t(1.5h)).xxxx;
   vector<float16_t, 4> res = ceil(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.fxc.hlsl
index f9c9e37..a59760b 100644
--- a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_4bca2a() {
   vector<float16_t, 4> arg_0 = (float16_t(1.5h)).xxxx;
   vector<float16_t, 4> res = ceil(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.glsl b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.glsl
index 1f11412..a18c18e 100644
--- a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ceil_4bca2a() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ceil_4bca2a() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ceil_4bca2a() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.msl b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.msl
index c19ee3e..48ec2dc 100644
--- a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_4bca2a() {
+void ceil_4bca2a(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.5h);
   half4 res = ceil(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_4bca2a();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  ceil_4bca2a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_4bca2a();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  ceil_4bca2a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_4bca2a();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  ceil_4bca2a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.spvasm
index 63f2c7d..7b743bb 100644
--- a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_4bca2a "ceil_4bca2a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v4half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v4half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_4bca2a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Ceil %22
-               OpStore %res %20
+%ceil_4bca2a = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Ceil %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %ceil_4bca2a
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %ceil_4bca2a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ceil_4bca2a
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ceil_4bca2a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %ceil_4bca2a
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %ceil_4bca2a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.wgsl
index 3cfbbfb..03ab0b6 100644
--- a/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ceil/4bca2a.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn ceil_4bca2a() {
   var arg_0 = vec4<f16>(1.5h);
   var res : vec4<f16> = ceil(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_4bca2a();
diff --git a/test/tint/builtins/gen/var/ceil/678655.wgsl b/test/tint/builtins/gen/var/ceil/678655.wgsl
index 6446299..2d43564 100644
--- a/test/tint/builtins/gen/var/ceil/678655.wgsl
+++ b/test/tint/builtins/gen/var/ceil/678655.wgsl
@@ -25,7 +25,9 @@
 fn ceil_678655() {
   var arg_0 = 1.5f;
   var res: f32 = ceil(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.dxc.hlsl
index 981082d..6fa5095 100644
--- a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_678655() {
   float arg_0 = 1.5f;
   float res = ceil(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.fxc.hlsl
index 981082d..6fa5095 100644
--- a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_678655() {
   float arg_0 = 1.5f;
   float res = ceil(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.glsl b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.glsl
index 85fc5c5..0ebe7c0 100644
--- a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ceil_678655() {
   float arg_0 = 1.5f;
   float res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ceil_678655() {
   float arg_0 = 1.5f;
   float res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ceil_678655() {
   float arg_0 = 1.5f;
   float res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.msl b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.msl
index 5637519..31ef06a 100644
--- a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_678655() {
+void ceil_678655(device float* const tint_symbol_1) {
   float arg_0 = 1.5f;
   float res = ceil(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_678655();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  ceil_678655(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_678655();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  ceil_678655(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_678655();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  ceil_678655(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.spvasm
index 5b09b5a..c4eed30 100644
--- a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_678655 "ceil_678655"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_678655 = OpFunction %void None %9
-         %12 = OpLabel
+%ceil_678655 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1_5
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Ceil %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Ceil %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %ceil_678655
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %ceil_678655
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ceil_678655
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ceil_678655
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ceil_678655
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ceil_678655
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.wgsl
index 789395f..3707537 100644
--- a/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ceil/678655.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn ceil_678655() {
   var arg_0 = 1.5f;
   var res : f32 = ceil(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_678655();
diff --git a/test/tint/builtins/gen/var/ceil/96f597.wgsl b/test/tint/builtins/gen/var/ceil/96f597.wgsl
index c149c74..5c0f738 100644
--- a/test/tint/builtins/gen/var/ceil/96f597.wgsl
+++ b/test/tint/builtins/gen/var/ceil/96f597.wgsl
@@ -25,7 +25,9 @@
 fn ceil_96f597() {
   var arg_0 = vec2<f32>(1.5f);
   var res: vec2<f32> = ceil(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.dxc.hlsl
index 98e9c51..9a42a40 100644
--- a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_96f597() {
   float2 arg_0 = (1.5f).xx;
   float2 res = ceil(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.fxc.hlsl
index 98e9c51..9a42a40 100644
--- a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_96f597() {
   float2 arg_0 = (1.5f).xx;
   float2 res = ceil(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.glsl b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.glsl
index ceba85e..9b808b0 100644
--- a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ceil_96f597() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ceil_96f597() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ceil_96f597() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.msl b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.msl
index c2e5a5f..f82cb3c 100644
--- a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_96f597() {
+void ceil_96f597(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.5f);
   float2 res = ceil(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_96f597();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  ceil_96f597(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_96f597();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  ceil_96f597(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_96f597();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  ceil_96f597(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.spvasm
index f825800..982e102 100644
--- a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_96f597 "ceil_96f597"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %15 = OpConstantComposite %v2float %float_1_5 %float_1_5
+         %18 = OpConstantComposite %v2float %float_1_5 %float_1_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_96f597 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Ceil %21
-               OpStore %res %19
+%ceil_96f597 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Ceil %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %ceil_96f597
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %ceil_96f597
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %ceil_96f597
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %ceil_96f597
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %ceil_96f597
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %ceil_96f597
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.wgsl
index a36992b..df49187 100644
--- a/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ceil/96f597.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn ceil_96f597() {
   var arg_0 = vec2<f32>(1.5f);
   var res : vec2<f32> = ceil(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_96f597();
diff --git a/test/tint/builtins/gen/var/ceil/b74c16.wgsl b/test/tint/builtins/gen/var/ceil/b74c16.wgsl
index b5ff72b..a903840 100644
--- a/test/tint/builtins/gen/var/ceil/b74c16.wgsl
+++ b/test/tint/builtins/gen/var/ceil/b74c16.wgsl
@@ -25,7 +25,9 @@
 fn ceil_b74c16() {
   var arg_0 = vec4<f32>(1.5f);
   var res: vec4<f32> = ceil(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.dxc.hlsl
index dedbf8a..2936e9d 100644
--- a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_b74c16() {
   float4 arg_0 = (1.5f).xxxx;
   float4 res = ceil(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.fxc.hlsl
index dedbf8a..2936e9d 100644
--- a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_b74c16() {
   float4 arg_0 = (1.5f).xxxx;
   float4 res = ceil(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.glsl b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.glsl
index 56993a9..6c206ad 100644
--- a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ceil_b74c16() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ceil_b74c16() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ceil_b74c16() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.msl b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.msl
index 26b12da..62502d8 100644
--- a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_b74c16() {
+void ceil_b74c16(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.5f);
   float4 res = ceil(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_b74c16();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  ceil_b74c16(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_b74c16();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  ceil_b74c16(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_b74c16();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  ceil_b74c16(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.spvasm
index 3f86045..505b4f7 100644
--- a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_b74c16 "ceil_b74c16"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %14 = OpConstantComposite %v4float %float_1_5 %float_1_5 %float_1_5 %float_1_5
+         %17 = OpConstantComposite %v4float %float_1_5 %float_1_5 %float_1_5 %float_1_5
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_b74c16 = OpFunction %void None %9
-         %12 = OpLabel
+%ceil_b74c16 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Ceil %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Ceil %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %ceil_b74c16
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %ceil_b74c16
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ceil_b74c16
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ceil_b74c16
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ceil_b74c16
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ceil_b74c16
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.wgsl
index 5ec0df2..f219e6b 100644
--- a/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ceil/b74c16.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn ceil_b74c16() {
   var arg_0 = vec4<f32>(1.5f);
   var res : vec4<f32> = ceil(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_b74c16();
diff --git a/test/tint/builtins/gen/var/ceil/bb2ca2.wgsl b/test/tint/builtins/gen/var/ceil/bb2ca2.wgsl
index c9ea5c5..cc8d927 100644
--- a/test/tint/builtins/gen/var/ceil/bb2ca2.wgsl
+++ b/test/tint/builtins/gen/var/ceil/bb2ca2.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.5);
   var res = ceil(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_bb2ca2();
diff --git a/test/tint/builtins/gen/var/ceil/e0b70a.wgsl b/test/tint/builtins/gen/var/ceil/e0b70a.wgsl
index af56279..d3adbb1 100644
--- a/test/tint/builtins/gen/var/ceil/e0b70a.wgsl
+++ b/test/tint/builtins/gen/var/ceil/e0b70a.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.5;
   var res = ceil(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_e0b70a();
diff --git a/test/tint/builtins/gen/var/ceil/f3f889.wgsl b/test/tint/builtins/gen/var/ceil/f3f889.wgsl
index b6dd4eb..30dcc05 100644
--- a/test/tint/builtins/gen/var/ceil/f3f889.wgsl
+++ b/test/tint/builtins/gen/var/ceil/f3f889.wgsl
@@ -27,7 +27,9 @@
 fn ceil_f3f889() {
   var arg_0 = 1.5h;
   var res: f16 = ceil(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.dxc.hlsl
index 483ceb6..b7f0ac4 100644
--- a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_f3f889() {
   float16_t arg_0 = float16_t(1.5h);
   float16_t res = ceil(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.fxc.hlsl
index 780bc35..e28f1a5 100644
--- a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ceil_f3f889() {
   float16_t arg_0 = float16_t(1.5h);
   float16_t res = ceil(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.glsl b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.glsl
index 5bef6ff..3464759 100644
--- a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ceil_f3f889() {
   float16_t arg_0 = 1.5hf;
   float16_t res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ceil_f3f889() {
   float16_t arg_0 = 1.5hf;
   float16_t res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ceil_f3f889() {
   float16_t arg_0 = 1.5hf;
   float16_t res = ceil(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.msl b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.msl
index 2b7e48d..49bc8ce 100644
--- a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ceil_f3f889() {
+void ceil_f3f889(device half* const tint_symbol_1) {
   half arg_0 = 1.5h;
   half res = ceil(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ceil_f3f889();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  ceil_f3f889(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ceil_f3f889();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  ceil_f3f889(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ceil_f3f889();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  ceil_f3f889(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.spvasm
index 0d412df..d1cd4a2 100644
--- a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ceil_f3f889 "ceil_f3f889"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ceil_f3f889 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%ceil_f3f889 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1_8p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Ceil %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Ceil %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %ceil_f3f889
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %ceil_f3f889
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %ceil_f3f889
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %ceil_f3f889
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %ceil_f3f889
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %ceil_f3f889
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.wgsl
index 442e78f..f4195cc 100644
--- a/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ceil/f3f889.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn ceil_f3f889() {
   var arg_0 = 1.5h;
   var res : f16 = ceil(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ceil_f3f889();
diff --git a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl
index 2c7a136..fe276ad 100644
--- a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl
+++ b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(1.f);
   var arg_2 = vec2<f32>(1.f);
   var res: vec2<f32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.dxc.hlsl
index db83687..68924db 100644
--- a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_0acf8f() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 arg_2 = (1.0f).xx;
   float2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.fxc.hlsl
index db83687..68924db 100644
--- a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_0acf8f() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 arg_2 = (1.0f).xx;
   float2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.glsl
index 440ce35..3f8fa23 100644
--- a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void clamp_0acf8f() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void clamp_0acf8f() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void clamp_0acf8f() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.msl
index a8a7875..7067ec0 100644
--- a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_0acf8f() {
+void clamp_0acf8f(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 arg_2 = float2(1.0f);
   float2 res = clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_0acf8f();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  clamp_0acf8f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_0acf8f();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  clamp_0acf8f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_0acf8f();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  clamp_0acf8f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.spvasm
index 9d32a7b..6cfa735 100644
--- a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_0acf8f "clamp_0acf8f"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,49 +39,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %27 = OpTypeFunction %v4float
-%clamp_0acf8f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %15
-         %23 = OpLoad %v2float %arg_0
-         %24 = OpLoad %v2float %arg_1
-         %25 = OpLoad %v2float %arg_2
-         %21 = OpExtInst %v2float %22 NClamp %23 %24 %25
-               OpStore %res %21
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %35 = OpTypeFunction %v4float
+%clamp_0acf8f = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %18
+         %26 = OpLoad %v2float %arg_0
+         %27 = OpLoad %v2float %arg_1
+         %28 = OpLoad %v2float %arg_2
+         %24 = OpExtInst %v2float %25 NClamp %26 %27 %28
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %34 = OpLoad %v2float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_0acf8f
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_0acf8f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %clamp_0acf8f
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %clamp_0acf8f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_0acf8f
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %clamp_0acf8f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.wgsl
index a217c18..7d25d99 100644
--- a/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/0acf8f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(1.0f);
   var arg_2 = vec2<f32>(1.0f);
   var res : vec2<f32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_0acf8f();
diff --git a/test/tint/builtins/gen/var/clamp/177548.wgsl b/test/tint/builtins/gen/var/clamp/177548.wgsl
index 3b17a48..567204e 100644
--- a/test/tint/builtins/gen/var/clamp/177548.wgsl
+++ b/test/tint/builtins/gen/var/clamp/177548.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec2(1);
   var res = clamp(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_177548();
diff --git a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl
index 03a55bd..c9130e5 100644
--- a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl
+++ b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<i32>(1i);
   var arg_2 = vec4<i32>(1i);
   var res: vec4<i32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.dxc.hlsl
index 2a7f794..5579916 100644
--- a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.dxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_1a32e3() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   int4 arg_2 = (1).xxxx;
   int4 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.fxc.hlsl
index 2a7f794..5579916 100644
--- a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.fxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_1a32e3() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   int4 arg_2 = (1).xxxx;
   int4 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.glsl
index ed2339a..25cce0c 100644
--- a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void clamp_1a32e3() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 arg_2 = ivec4(1);
   ivec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void clamp_1a32e3() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 arg_2 = ivec4(1);
   ivec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void clamp_1a32e3() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 arg_2 = ivec4(1);
   ivec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.msl
index eb57d27..847d6bd 100644
--- a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.msl
@@ -5,36 +5,37 @@
   return min(max(e, low), high);
 }
 
-void clamp_1a32e3() {
+void clamp_1a32e3(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 arg_1 = int4(1);
   int4 arg_2 = int4(1);
   int4 res = tint_clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_1a32e3();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  clamp_1a32e3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_1a32e3();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  clamp_1a32e3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_1a32e3();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  clamp_1a32e3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.spvasm
index ca8ce26..4482c75 100644
--- a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_clamp "tint_clamp"
                OpName %e "e"
                OpName %low "low"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,59 +45,68 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-          %9 = OpTypeFunction %v4int %v4int %v4int %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4int %v4int %v4int %v4int
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %25 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %28 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %28 = OpConstantNull %v4int
-         %36 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_clamp = OpFunction %v4int None %9
+ %tint_clamp = OpFunction %v4int None %14
           %e = OpFunctionParameter %v4int
         %low = OpFunctionParameter %v4int
        %high = OpFunctionParameter %v4int
-         %16 = OpLabel
-         %19 = OpExtInst %v4int %18 SMax %e %low
-         %17 = OpExtInst %v4int %18 SMin %19 %high
-               OpReturnValue %17
+         %19 = OpLabel
+         %22 = OpExtInst %v4int %21 SMax %e %low
+         %20 = OpExtInst %v4int %21 SMin %22 %high
+               OpReturnValue %20
                OpFunctionEnd
-%clamp_1a32e3 = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %28
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %28
-      %arg_2 = OpVariable %_ptr_Function_v4int Function %28
-        %res = OpVariable %_ptr_Function_v4int Function %28
-               OpStore %arg_0 %25
-               OpStore %arg_1 %25
-               OpStore %arg_2 %25
-         %32 = OpLoad %v4int %arg_0
-         %33 = OpLoad %v4int %arg_1
-         %34 = OpLoad %v4int %arg_2
-         %31 = OpFunctionCall %v4int %tint_clamp %32 %33 %34
-               OpStore %res %31
+%clamp_1a32e3 = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %31
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %31
+      %arg_2 = OpVariable %_ptr_Function_v4int Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %31
+               OpStore %arg_0 %28
+               OpStore %arg_1 %28
+               OpStore %arg_2 %28
+         %35 = OpLoad %v4int %arg_0
+         %36 = OpLoad %v4int %arg_1
+         %37 = OpLoad %v4int %arg_2
+         %34 = OpFunctionCall %v4int %tint_clamp %35 %36 %37
+               OpStore %res %34
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %43 = OpLoad %v4int %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_1a32e3
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %clamp_1a32e3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %23
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %clamp_1a32e3
+%fragment_main = OpFunction %void None %23
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %clamp_1a32e3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %clamp_1a32e3
+%compute_main = OpFunction %void None %23
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %clamp_1a32e3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.wgsl
index ef0f3bd..0bf6aab 100644
--- a/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/1a32e3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<i32>(1i);
   var arg_2 = vec4<i32>(1i);
   var res : vec4<i32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_1a32e3();
diff --git a/test/tint/builtins/gen/var/clamp/235b29.wgsl b/test/tint/builtins/gen/var/clamp/235b29.wgsl
index 27cdc7c..0c5c1a1 100644
--- a/test/tint/builtins/gen/var/clamp/235b29.wgsl
+++ b/test/tint/builtins/gen/var/clamp/235b29.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(1.h);
   var arg_2 = vec2<f16>(1.h);
   var res: vec2<f16> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.dxc.hlsl
index 7840136..feb686b 100644
--- a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_235b29() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.fxc.hlsl
index 37fbc36..2c3f9cf 100644
--- a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_235b29() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.glsl
index e721222..2b18490 100644
--- a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void clamp_235b29() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void clamp_235b29() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void clamp_235b29() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.msl
index 16a71cb..aee4297 100644
--- a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_235b29() {
+void clamp_235b29(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 arg_2 = half2(1.0h);
   half2 res = clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_235b29();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  clamp_235b29(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_235b29();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  clamp_235b29(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_235b29();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  clamp_235b29(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.spvasm
index 3d10d2f..6345a75 100644
--- a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_235b29 "clamp_235b29"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_235b29 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v2half %arg_0
-         %25 = OpLoad %v2half %arg_1
-         %26 = OpLoad %v2half %arg_2
-         %22 = OpExtInst %v2half %23 NClamp %24 %25 %26
-               OpStore %res %22
+%clamp_235b29 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v2half %arg_0
+         %28 = OpLoad %v2half %arg_1
+         %29 = OpLoad %v2half %arg_2
+         %25 = OpExtInst %v2half %26 NClamp %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %35 = OpLoad %v2half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %clamp_235b29
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %clamp_235b29
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %clamp_235b29
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %clamp_235b29
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %clamp_235b29
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %clamp_235b29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.wgsl
index b39b925..3c240ff 100644
--- a/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/235b29.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(1.0h);
   var arg_2 = vec2<f16>(1.0h);
   var res : vec2<f16> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_235b29();
diff --git a/test/tint/builtins/gen/var/clamp/23aa4f.wgsl b/test/tint/builtins/gen/var/clamp/23aa4f.wgsl
index 05f4aec..d30cfb0 100644
--- a/test/tint/builtins/gen/var/clamp/23aa4f.wgsl
+++ b/test/tint/builtins/gen/var/clamp/23aa4f.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = clamp(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_23aa4f();
diff --git a/test/tint/builtins/gen/var/clamp/2bd567.wgsl b/test/tint/builtins/gen/var/clamp/2bd567.wgsl
index a924231..faadf16 100644
--- a/test/tint/builtins/gen/var/clamp/2bd567.wgsl
+++ b/test/tint/builtins/gen/var/clamp/2bd567.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1.f;
   var arg_2 = 1.f;
   var res: f32 = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.dxc.hlsl
index 6584447..0604c93 100644
--- a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2bd567() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.fxc.hlsl
index 6584447..0604c93 100644
--- a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2bd567() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.glsl
index a152ab2..990fdac 100644
--- a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void clamp_2bd567() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void clamp_2bd567() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void clamp_2bd567() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.msl
index 033fc2a..cb092ad 100644
--- a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_2bd567() {
+void clamp_2bd567(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_2bd567();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  clamp_2bd567(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_2bd567();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  clamp_2bd567(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_2bd567();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  clamp_2bd567(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.spvasm
index 0319b1f..b6c020a 100644
--- a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_2bd567 "clamp_2bd567"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,13 +39,19 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %24 = OpTypeFunction %v4float
-%clamp_2bd567 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %32 = OpTypeFunction %v4float
+%clamp_2bd567 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
       %arg_2 = OpVariable %_ptr_Function_float Function %8
@@ -46,32 +59,35 @@
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
                OpStore %arg_2 %float_1
-         %20 = OpLoad %float %arg_0
-         %21 = OpLoad %float %arg_1
-         %22 = OpLoad %float %arg_2
-         %18 = OpExtInst %float %19 NClamp %20 %21 %22
-               OpStore %res %18
+         %23 = OpLoad %float %arg_0
+         %24 = OpLoad %float %arg_1
+         %25 = OpLoad %float %arg_2
+         %21 = OpExtInst %float %22 NClamp %23 %24 %25
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %31 = OpLoad %float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %clamp_2bd567
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %clamp_2bd567
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %clamp_2bd567
+%fragment_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %clamp_2bd567
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %clamp_2bd567
+%compute_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %clamp_2bd567
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.wgsl
index 54ea133..46295fc 100644
--- a/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/2bd567.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1.0f;
   var arg_2 = 1.0f;
   var res : f32 = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_2bd567();
diff --git a/test/tint/builtins/gen/var/clamp/2bde41.wgsl b/test/tint/builtins/gen/var/clamp/2bde41.wgsl
index bf67874..ac46a14 100644
--- a/test/tint/builtins/gen/var/clamp/2bde41.wgsl
+++ b/test/tint/builtins/gen/var/clamp/2bde41.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(1.f);
   var arg_2 = vec4<f32>(1.f);
   var res: vec4<f32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.dxc.hlsl
index 78e4d3f..c42fc2f 100644
--- a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2bde41() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 arg_2 = (1.0f).xxxx;
   float4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.fxc.hlsl
index 78e4d3f..c42fc2f 100644
--- a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2bde41() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 arg_2 = (1.0f).xxxx;
   float4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.glsl
index 6be8122..099ef62 100644
--- a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void clamp_2bde41() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void clamp_2bde41() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void clamp_2bde41() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.msl
index e8206cd..f677d5d 100644
--- a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_2bde41() {
+void clamp_2bde41(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 arg_2 = float4(1.0f);
   float4 res = clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_2bde41();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  clamp_2bde41(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_2bde41();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  clamp_2bde41(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_2bde41();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  clamp_2bde41(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.spvasm
index e481bf2..a4aa017 100644
--- a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_2bde41 "clamp_2bde41"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,47 +39,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %25 = OpTypeFunction %v4float
-%clamp_2bde41 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
+%clamp_2bde41 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
       %arg_2 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-               OpStore %arg_2 %14
-         %21 = OpLoad %v4float %arg_0
-         %22 = OpLoad %v4float %arg_1
-         %23 = OpLoad %v4float %arg_2
-         %19 = OpExtInst %v4float %20 NClamp %21 %22 %23
-               OpStore %res %19
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+               OpStore %arg_2 %17
+         %24 = OpLoad %v4float %arg_0
+         %25 = OpLoad %v4float %arg_1
+         %26 = OpLoad %v4float %arg_2
+         %22 = OpExtInst %v4float %23 NClamp %24 %25 %26
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %clamp_2bde41
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %clamp_2bde41
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %clamp_2bde41
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %clamp_2bde41
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %clamp_2bde41
+%compute_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %clamp_2bde41
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.wgsl
index 0b42465..70bef80 100644
--- a/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/2bde41.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(1.0f);
   var arg_2 = vec4<f32>(1.0f);
   var res : vec4<f32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_2bde41();
diff --git a/test/tint/builtins/gen/var/clamp/2c251b.wgsl b/test/tint/builtins/gen/var/clamp/2c251b.wgsl
index b4b458a7..d0af6b9 100644
--- a/test/tint/builtins/gen/var/clamp/2c251b.wgsl
+++ b/test/tint/builtins/gen/var/clamp/2c251b.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(1.h);
   var arg_2 = vec4<f16>(1.h);
   var res: vec4<f16> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.dxc.hlsl
index 6323b4b..75ddc3e 100644
--- a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2c251b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.fxc.hlsl
index e2815ba..1ebf0b0 100644
--- a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_2c251b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.glsl
index 680ad9e..7c95fdd 100644
--- a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void clamp_2c251b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void clamp_2c251b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void clamp_2c251b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.msl
index 8bbe301..286f045 100644
--- a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_2c251b() {
+void clamp_2c251b(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 arg_2 = half4(1.0h);
   half4 res = clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_2c251b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  clamp_2c251b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_2c251b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  clamp_2c251b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_2c251b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  clamp_2c251b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.spvasm
index e7f9e12..9d6f0e2 100644
--- a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_2c251b "clamp_2c251b"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_2c251b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v4half %arg_0
-         %25 = OpLoad %v4half %arg_1
-         %26 = OpLoad %v4half %arg_2
-         %22 = OpExtInst %v4half %23 NClamp %24 %25 %26
-               OpStore %res %22
+%clamp_2c251b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v4half %arg_0
+         %28 = OpLoad %v4half %arg_1
+         %29 = OpLoad %v4half %arg_2
+         %25 = OpExtInst %v4half %26 NClamp %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %35 = OpLoad %v4half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %clamp_2c251b
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %clamp_2c251b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %clamp_2c251b
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %clamp_2c251b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %clamp_2c251b
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %clamp_2c251b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.wgsl
index e4b9b24..a646536 100644
--- a/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/2c251b.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(1.0h);
   var arg_2 = vec4<f16>(1.0h);
   var res : vec4<f16> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_2c251b();
diff --git a/test/tint/builtins/gen/var/clamp/548fc7.wgsl b/test/tint/builtins/gen/var/clamp/548fc7.wgsl
index 4f7728b..162407b 100644
--- a/test/tint/builtins/gen/var/clamp/548fc7.wgsl
+++ b/test/tint/builtins/gen/var/clamp/548fc7.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = vec3<u32>(1u);
   var res: vec3<u32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.dxc.hlsl
index 8b32676..3dc7f85 100644
--- a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.dxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_548fc7() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint3 arg_2 = (1u).xxx;
   uint3 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.fxc.hlsl
index 8b32676..3dc7f85 100644
--- a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.fxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_548fc7() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint3 arg_2 = (1u).xxx;
   uint3 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.glsl
index 4951041..cdda825 100644
--- a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void clamp_548fc7() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 arg_2 = uvec3(1u);
   uvec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void clamp_548fc7() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 arg_2 = uvec3(1u);
   uvec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void clamp_548fc7() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 arg_2 = uvec3(1u);
   uvec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.msl
index 4a691dc..b678759 100644
--- a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.msl
@@ -5,36 +5,37 @@
   return min(max(e, low), high);
 }
 
-void clamp_548fc7() {
+void clamp_548fc7(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 arg_1 = uint3(1u);
   uint3 arg_2 = uint3(1u);
   uint3 res = tint_clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_548fc7();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  clamp_548fc7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_548fc7();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  clamp_548fc7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_548fc7();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  clamp_548fc7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.spvasm
index 5c3020c..3b18e70 100644
--- a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_clamp "tint_clamp"
                OpName %e "e"
                OpName %low "low"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,59 +45,67 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-          %9 = OpTypeFunction %v3uint %v3uint %v3uint %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3uint %v3uint %v3uint %v3uint
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %25 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %28 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %28 = OpConstantNull %v3uint
-         %36 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_clamp = OpFunction %v3uint None %9
+ %tint_clamp = OpFunction %v3uint None %14
           %e = OpFunctionParameter %v3uint
         %low = OpFunctionParameter %v3uint
        %high = OpFunctionParameter %v3uint
-         %16 = OpLabel
-         %19 = OpExtInst %v3uint %18 UMax %e %low
-         %17 = OpExtInst %v3uint %18 UMin %19 %high
-               OpReturnValue %17
+         %19 = OpLabel
+         %22 = OpExtInst %v3uint %21 UMax %e %low
+         %20 = OpExtInst %v3uint %21 UMin %22 %high
+               OpReturnValue %20
                OpFunctionEnd
-%clamp_548fc7 = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %28
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %28
-      %arg_2 = OpVariable %_ptr_Function_v3uint Function %28
-        %res = OpVariable %_ptr_Function_v3uint Function %28
-               OpStore %arg_0 %25
-               OpStore %arg_1 %25
-               OpStore %arg_2 %25
-         %32 = OpLoad %v3uint %arg_0
-         %33 = OpLoad %v3uint %arg_1
-         %34 = OpLoad %v3uint %arg_2
-         %31 = OpFunctionCall %v3uint %tint_clamp %32 %33 %34
-               OpStore %res %31
+%clamp_548fc7 = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %31
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %31
+      %arg_2 = OpVariable %_ptr_Function_v3uint Function %31
+        %res = OpVariable %_ptr_Function_v3uint Function %31
+               OpStore %arg_0 %28
+               OpStore %arg_1 %28
+               OpStore %arg_2 %28
+         %35 = OpLoad %v3uint %arg_0
+         %36 = OpLoad %v3uint %arg_1
+         %37 = OpLoad %v3uint %arg_2
+         %34 = OpFunctionCall %v3uint %tint_clamp %35 %36 %37
+               OpStore %res %34
+         %41 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %42 = OpLoad %v3uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_548fc7
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %clamp_548fc7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %23
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %clamp_548fc7
+%fragment_main = OpFunction %void None %23
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %clamp_548fc7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %clamp_548fc7
+%compute_main = OpFunction %void None %23
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %clamp_548fc7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.wgsl
index c2ff699..e29ca7d 100644
--- a/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/548fc7.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = vec3<u32>(1u);
   var res : vec3<u32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_548fc7();
diff --git a/test/tint/builtins/gen/var/clamp/553ffb.wgsl b/test/tint/builtins/gen/var/clamp/553ffb.wgsl
index cf84196..b2b078a 100644
--- a/test/tint/builtins/gen/var/clamp/553ffb.wgsl
+++ b/test/tint/builtins/gen/var/clamp/553ffb.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = 1.h;
   var arg_2 = 1.h;
   var res: f16 = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.dxc.hlsl
index 9b52ff1..6c997e4 100644
--- a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_553ffb() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t arg_2 = float16_t(1.0h);
   float16_t res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.fxc.hlsl
index 13c67fe..ac4f6eb 100644
--- a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_553ffb() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t arg_2 = float16_t(1.0h);
   float16_t res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.glsl
index 7381ed8..7442317 100644
--- a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void clamp_553ffb() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void clamp_553ffb() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void clamp_553ffb() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.msl
index 4b78c06..fa9e239 100644
--- a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_553ffb() {
+void clamp_553ffb(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half arg_2 = 1.0h;
   half res = clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_553ffb();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  clamp_553ffb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_553ffb();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  clamp_553ffb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_553ffb();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  clamp_553ffb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.spvasm
index a5291a7..bf754a0 100644
--- a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_553ffb "clamp_553ffb"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,49 +43,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %26 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_553ffb = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-      %arg_2 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%clamp_553ffb = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+      %arg_2 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
                OpStore %arg_2 %half_0x1p_0
-         %22 = OpLoad %half %arg_0
-         %23 = OpLoad %half %arg_1
-         %24 = OpLoad %half %arg_2
-         %20 = OpExtInst %half %21 NClamp %22 %23 %24
-               OpStore %res %20
+         %25 = OpLoad %half %arg_0
+         %26 = OpLoad %half %arg_1
+         %27 = OpLoad %half %arg_2
+         %23 = OpExtInst %half %24 NClamp %25 %26 %27
+               OpStore %res %23
+         %32 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %33 = OpLoad %half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %clamp_553ffb
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %clamp_553ffb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %clamp_553ffb
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %clamp_553ffb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_553ffb
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %clamp_553ffb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.wgsl
index 7a447e3..20873fd 100644
--- a/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/553ffb.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = 1.0h;
   var arg_2 = 1.0h;
   var res : f16 = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_553ffb();
diff --git a/test/tint/builtins/gen/var/clamp/5cf700.wgsl b/test/tint/builtins/gen/var/clamp/5cf700.wgsl
index d3bca4f..e208ef5 100644
--- a/test/tint/builtins/gen/var/clamp/5cf700.wgsl
+++ b/test/tint/builtins/gen/var/clamp/5cf700.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec3(1.);
   var res = clamp(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_5cf700();
diff --git a/test/tint/builtins/gen/var/clamp/5f0819.wgsl b/test/tint/builtins/gen/var/clamp/5f0819.wgsl
index c4804b5..27513d3 100644
--- a/test/tint/builtins/gen/var/clamp/5f0819.wgsl
+++ b/test/tint/builtins/gen/var/clamp/5f0819.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = vec3<i32>(1i);
   var res: vec3<i32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.dxc.hlsl
index 8f444fc..1004b4d 100644
--- a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.dxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_5f0819() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   int3 arg_2 = (1).xxx;
   int3 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.fxc.hlsl
index 8f444fc..1004b4d 100644
--- a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.fxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_5f0819() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   int3 arg_2 = (1).xxx;
   int3 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.glsl
index d56a210..a715a0b 100644
--- a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void clamp_5f0819() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 arg_2 = ivec3(1);
   ivec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void clamp_5f0819() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 arg_2 = ivec3(1);
   ivec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void clamp_5f0819() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 arg_2 = ivec3(1);
   ivec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.msl
index a0a1dca..bceefec 100644
--- a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.msl
@@ -5,36 +5,37 @@
   return min(max(e, low), high);
 }
 
-void clamp_5f0819() {
+void clamp_5f0819(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 arg_1 = int3(1);
   int3 arg_2 = int3(1);
   int3 res = tint_clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_5f0819();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  clamp_5f0819(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_5f0819();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  clamp_5f0819(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_5f0819();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  clamp_5f0819(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.spvasm
index 0bc5ea2..9435516 100644
--- a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_clamp "tint_clamp"
                OpName %e "e"
                OpName %low "low"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,59 +45,68 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-          %9 = OpTypeFunction %v3int %v3int %v3int %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3int %v3int %v3int %v3int
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %25 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %28 = OpConstantNull %v3int
-         %36 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_clamp = OpFunction %v3int None %9
+ %tint_clamp = OpFunction %v3int None %14
           %e = OpFunctionParameter %v3int
         %low = OpFunctionParameter %v3int
        %high = OpFunctionParameter %v3int
-         %16 = OpLabel
-         %19 = OpExtInst %v3int %18 SMax %e %low
-         %17 = OpExtInst %v3int %18 SMin %19 %high
-               OpReturnValue %17
+         %19 = OpLabel
+         %22 = OpExtInst %v3int %21 SMax %e %low
+         %20 = OpExtInst %v3int %21 SMin %22 %high
+               OpReturnValue %20
                OpFunctionEnd
-%clamp_5f0819 = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %28
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %28
-      %arg_2 = OpVariable %_ptr_Function_v3int Function %28
-        %res = OpVariable %_ptr_Function_v3int Function %28
-               OpStore %arg_0 %25
-               OpStore %arg_1 %25
-               OpStore %arg_2 %25
-         %32 = OpLoad %v3int %arg_0
-         %33 = OpLoad %v3int %arg_1
-         %34 = OpLoad %v3int %arg_2
-         %31 = OpFunctionCall %v3int %tint_clamp %32 %33 %34
-               OpStore %res %31
+%clamp_5f0819 = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %31
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %31
+      %arg_2 = OpVariable %_ptr_Function_v3int Function %31
+        %res = OpVariable %_ptr_Function_v3int Function %31
+               OpStore %arg_0 %28
+               OpStore %arg_1 %28
+               OpStore %arg_2 %28
+         %35 = OpLoad %v3int %arg_0
+         %36 = OpLoad %v3int %arg_1
+         %37 = OpLoad %v3int %arg_2
+         %34 = OpFunctionCall %v3int %tint_clamp %35 %36 %37
+               OpStore %res %34
+         %42 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %43 = OpLoad %v3int %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_5f0819
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %clamp_5f0819
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %23
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %clamp_5f0819
+%fragment_main = OpFunction %void None %23
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %clamp_5f0819
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %clamp_5f0819
+%compute_main = OpFunction %void None %23
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %clamp_5f0819
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.wgsl
index 39cd427..d57ccc0 100644
--- a/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/5f0819.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = vec3<i32>(1i);
   var res : vec3<i32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_5f0819();
diff --git a/test/tint/builtins/gen/var/clamp/6c1749.wgsl b/test/tint/builtins/gen/var/clamp/6c1749.wgsl
index 32b6072..3bb9a2d6 100644
--- a/test/tint/builtins/gen/var/clamp/6c1749.wgsl
+++ b/test/tint/builtins/gen/var/clamp/6c1749.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = vec2<i32>(1i);
   var res: vec2<i32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.dxc.hlsl
index 13e317b..d9f070a 100644
--- a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.dxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_6c1749() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   int2 arg_2 = (1).xx;
   int2 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.fxc.hlsl
index 13e317b..d9f070a 100644
--- a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.fxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_6c1749() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   int2 arg_2 = (1).xx;
   int2 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.glsl
index 40d616f..1aa814f 100644
--- a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void clamp_6c1749() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 arg_2 = ivec2(1);
   ivec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void clamp_6c1749() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 arg_2 = ivec2(1);
   ivec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void clamp_6c1749() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 arg_2 = ivec2(1);
   ivec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.msl
index 2b6d214..5b50d6e 100644
--- a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.msl
@@ -5,36 +5,37 @@
   return min(max(e, low), high);
 }
 
-void clamp_6c1749() {
+void clamp_6c1749(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 arg_1 = int2(1);
   int2 arg_2 = int2(1);
   int2 res = tint_clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_6c1749();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  clamp_6c1749(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_6c1749();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  clamp_6c1749(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_6c1749();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  clamp_6c1749(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.spvasm
index 41d2edb..b64b450 100644
--- a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_clamp "tint_clamp"
                OpName %e "e"
                OpName %low "low"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,59 +45,68 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-          %9 = OpTypeFunction %v2int %v2int %v2int %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2int %v2int %v2int %v2int
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %25 = OpConstantComposite %v2int %int_1 %int_1
+         %28 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %28 = OpConstantNull %v2int
-         %36 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_clamp = OpFunction %v2int None %9
+ %tint_clamp = OpFunction %v2int None %14
           %e = OpFunctionParameter %v2int
         %low = OpFunctionParameter %v2int
        %high = OpFunctionParameter %v2int
-         %16 = OpLabel
-         %19 = OpExtInst %v2int %18 SMax %e %low
-         %17 = OpExtInst %v2int %18 SMin %19 %high
-               OpReturnValue %17
+         %19 = OpLabel
+         %22 = OpExtInst %v2int %21 SMax %e %low
+         %20 = OpExtInst %v2int %21 SMin %22 %high
+               OpReturnValue %20
                OpFunctionEnd
-%clamp_6c1749 = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %28
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %28
-      %arg_2 = OpVariable %_ptr_Function_v2int Function %28
-        %res = OpVariable %_ptr_Function_v2int Function %28
-               OpStore %arg_0 %25
-               OpStore %arg_1 %25
-               OpStore %arg_2 %25
-         %32 = OpLoad %v2int %arg_0
-         %33 = OpLoad %v2int %arg_1
-         %34 = OpLoad %v2int %arg_2
-         %31 = OpFunctionCall %v2int %tint_clamp %32 %33 %34
-               OpStore %res %31
+%clamp_6c1749 = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %31
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %31
+      %arg_2 = OpVariable %_ptr_Function_v2int Function %31
+        %res = OpVariable %_ptr_Function_v2int Function %31
+               OpStore %arg_0 %28
+               OpStore %arg_1 %28
+               OpStore %arg_2 %28
+         %35 = OpLoad %v2int %arg_0
+         %36 = OpLoad %v2int %arg_1
+         %37 = OpLoad %v2int %arg_2
+         %34 = OpFunctionCall %v2int %tint_clamp %35 %36 %37
+               OpStore %res %34
+         %42 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %43 = OpLoad %v2int %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_6c1749
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %clamp_6c1749
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %23
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %clamp_6c1749
+%fragment_main = OpFunction %void None %23
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %clamp_6c1749
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %clamp_6c1749
+%compute_main = OpFunction %void None %23
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %clamp_6c1749
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.wgsl
index e8a8533..389c159 100644
--- a/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/6c1749.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = vec2<i32>(1i);
   var res : vec2<i32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_6c1749();
diff --git a/test/tint/builtins/gen/var/clamp/7706d7.wgsl b/test/tint/builtins/gen/var/clamp/7706d7.wgsl
index d8f14ec..1dd5fe3 100644
--- a/test/tint/builtins/gen/var/clamp/7706d7.wgsl
+++ b/test/tint/builtins/gen/var/clamp/7706d7.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = vec2<u32>(1u);
   var res: vec2<u32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.dxc.hlsl
index 09d5095..baf0f4b 100644
--- a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.dxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_7706d7() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint2 arg_2 = (1u).xx;
   uint2 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.fxc.hlsl
index 09d5095..baf0f4b 100644
--- a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.fxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_7706d7() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint2 arg_2 = (1u).xx;
   uint2 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.glsl
index 993b295..0760a8e 100644
--- a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void clamp_7706d7() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 arg_2 = uvec2(1u);
   uvec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void clamp_7706d7() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 arg_2 = uvec2(1u);
   uvec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void clamp_7706d7() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 arg_2 = uvec2(1u);
   uvec2 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.msl
index 086ac40..6379708 100644
--- a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.msl
@@ -5,36 +5,37 @@
   return min(max(e, low), high);
 }
 
-void clamp_7706d7() {
+void clamp_7706d7(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 arg_1 = uint2(1u);
   uint2 arg_2 = uint2(1u);
   uint2 res = tint_clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_7706d7();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  clamp_7706d7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_7706d7();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  clamp_7706d7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_7706d7();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  clamp_7706d7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.spvasm
index 643fa83..93f3de7 100644
--- a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_clamp "tint_clamp"
                OpName %e "e"
                OpName %low "low"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,59 +45,67 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-          %9 = OpTypeFunction %v2uint %v2uint %v2uint %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2uint %v2uint %v2uint %v2uint
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %25 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %28 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %36 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_clamp = OpFunction %v2uint None %9
+ %tint_clamp = OpFunction %v2uint None %14
           %e = OpFunctionParameter %v2uint
         %low = OpFunctionParameter %v2uint
        %high = OpFunctionParameter %v2uint
-         %16 = OpLabel
-         %19 = OpExtInst %v2uint %18 UMax %e %low
-         %17 = OpExtInst %v2uint %18 UMin %19 %high
-               OpReturnValue %17
+         %19 = OpLabel
+         %22 = OpExtInst %v2uint %21 UMax %e %low
+         %20 = OpExtInst %v2uint %21 UMin %22 %high
+               OpReturnValue %20
                OpFunctionEnd
-%clamp_7706d7 = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %28
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %28
-      %arg_2 = OpVariable %_ptr_Function_v2uint Function %28
-        %res = OpVariable %_ptr_Function_v2uint Function %28
-               OpStore %arg_0 %25
-               OpStore %arg_1 %25
-               OpStore %arg_2 %25
-         %32 = OpLoad %v2uint %arg_0
-         %33 = OpLoad %v2uint %arg_1
-         %34 = OpLoad %v2uint %arg_2
-         %31 = OpFunctionCall %v2uint %tint_clamp %32 %33 %34
-               OpStore %res %31
+%clamp_7706d7 = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %31
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %31
+      %arg_2 = OpVariable %_ptr_Function_v2uint Function %31
+        %res = OpVariable %_ptr_Function_v2uint Function %31
+               OpStore %arg_0 %28
+               OpStore %arg_1 %28
+               OpStore %arg_2 %28
+         %35 = OpLoad %v2uint %arg_0
+         %36 = OpLoad %v2uint %arg_1
+         %37 = OpLoad %v2uint %arg_2
+         %34 = OpFunctionCall %v2uint %tint_clamp %35 %36 %37
+               OpStore %res %34
+         %41 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %42 = OpLoad %v2uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_7706d7
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %clamp_7706d7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %23
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %clamp_7706d7
+%fragment_main = OpFunction %void None %23
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %clamp_7706d7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %clamp_7706d7
+%compute_main = OpFunction %void None %23
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %clamp_7706d7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.wgsl
index ca14f76..a5d8d86 100644
--- a/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/7706d7.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = vec2<u32>(1u);
   var res : vec2<u32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_7706d7();
diff --git a/test/tint/builtins/gen/var/clamp/867397.wgsl b/test/tint/builtins/gen/var/clamp/867397.wgsl
index 31706de..756cc84 100644
--- a/test/tint/builtins/gen/var/clamp/867397.wgsl
+++ b/test/tint/builtins/gen/var/clamp/867397.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(1.f);
   var arg_2 = vec3<f32>(1.f);
   var res: vec3<f32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.dxc.hlsl
index 08aaf74..755a5c6 100644
--- a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_867397() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 arg_2 = (1.0f).xxx;
   float3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.fxc.hlsl
index 08aaf74..755a5c6 100644
--- a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_867397() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 arg_2 = (1.0f).xxx;
   float3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.glsl
index 3fd741c..f6f9b96 100644
--- a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void clamp_867397() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void clamp_867397() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void clamp_867397() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.msl
index 0e88a81..ef7e8cd 100644
--- a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_867397() {
+void clamp_867397(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 arg_2 = float3(1.0f);
   float3 res = clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_867397();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  clamp_867397(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_867397();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  clamp_867397(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_867397();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  clamp_867397(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.spvasm
index 6283a26..e904887 100644
--- a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_867397 "clamp_867397"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,49 +39,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %27 = OpTypeFunction %v4float
-%clamp_867397 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %15
-         %23 = OpLoad %v3float %arg_0
-         %24 = OpLoad %v3float %arg_1
-         %25 = OpLoad %v3float %arg_2
-         %21 = OpExtInst %v3float %22 NClamp %23 %24 %25
-               OpStore %res %21
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %35 = OpTypeFunction %v4float
+%clamp_867397 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %18
+         %26 = OpLoad %v3float %arg_0
+         %27 = OpLoad %v3float %arg_1
+         %28 = OpLoad %v3float %arg_2
+         %24 = OpExtInst %v3float %25 NClamp %26 %27 %28
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %34 = OpLoad %v3float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %clamp_867397
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %clamp_867397
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %clamp_867397
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %clamp_867397
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_867397
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %clamp_867397
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.wgsl
index 9f64a6e..1b08c4f 100644
--- a/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/867397.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(1.0f);
   var arg_2 = vec3<f32>(1.0f);
   var res : vec3<f32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_867397();
diff --git a/test/tint/builtins/gen/var/clamp/87df46.wgsl b/test/tint/builtins/gen/var/clamp/87df46.wgsl
index ea8e101..2d4f345 100644
--- a/test/tint/builtins/gen/var/clamp/87df46.wgsl
+++ b/test/tint/builtins/gen/var/clamp/87df46.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec4(1.);
   var res = clamp(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_87df46();
diff --git a/test/tint/builtins/gen/var/clamp/8b1eaa.wgsl b/test/tint/builtins/gen/var/clamp/8b1eaa.wgsl
index 307f986..eb4a184 100644
--- a/test/tint/builtins/gen/var/clamp/8b1eaa.wgsl
+++ b/test/tint/builtins/gen/var/clamp/8b1eaa.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec3(1);
   var res = clamp(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_8b1eaa();
diff --git a/test/tint/builtins/gen/var/clamp/96e56a.wgsl b/test/tint/builtins/gen/var/clamp/96e56a.wgsl
index 67ff631..840d273 100644
--- a/test/tint/builtins/gen/var/clamp/96e56a.wgsl
+++ b/test/tint/builtins/gen/var/clamp/96e56a.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1;
   var res = clamp(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_96e56a();
diff --git a/test/tint/builtins/gen/var/clamp/9d731c.wgsl b/test/tint/builtins/gen/var/clamp/9d731c.wgsl
index e83bb0f..d327cda 100644
--- a/test/tint/builtins/gen/var/clamp/9d731c.wgsl
+++ b/test/tint/builtins/gen/var/clamp/9d731c.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec2(1.);
   var res = clamp(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_9d731c();
diff --git a/test/tint/builtins/gen/var/clamp/a2de25.wgsl b/test/tint/builtins/gen/var/clamp/a2de25.wgsl
index 40dae61..ee8781d 100644
--- a/test/tint/builtins/gen/var/clamp/a2de25.wgsl
+++ b/test/tint/builtins/gen/var/clamp/a2de25.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: u32 = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.dxc.hlsl
index fbba325..d089970 100644
--- a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.dxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_a2de25() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.fxc.hlsl
index fbba325..d089970 100644
--- a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.fxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_a2de25() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.glsl
index 93c876b..c4fb2c8 100644
--- a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void clamp_a2de25() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void clamp_a2de25() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void clamp_a2de25() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.msl
index f995afc..8f54bc7 100644
--- a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.msl
@@ -5,36 +5,37 @@
   return min(max(e, low), high);
 }
 
-void clamp_a2de25() {
+void clamp_a2de25(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_a2de25();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  clamp_a2de25(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_a2de25();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  clamp_a2de25(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_a2de25();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  clamp_a2de25(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.spvasm
index a4a2990..407aa5b 100644
--- a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_clamp "tint_clamp"
                OpName %e "e"
                OpName %low "low"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,58 +44,66 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %uint %uint %uint %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %uint %uint %uint %uint
        %void = OpTypeVoid
-         %19 = OpTypeFunction %void
+         %22 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %26 = OpConstantNull %uint
-         %34 = OpTypeFunction %v4float
+         %29 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_clamp = OpFunction %uint None %9
+ %tint_clamp = OpFunction %uint None %13
           %e = OpFunctionParameter %uint
         %low = OpFunctionParameter %uint
        %high = OpFunctionParameter %uint
-         %15 = OpLabel
-         %18 = OpExtInst %uint %17 UMax %e %low
-         %16 = OpExtInst %uint %17 UMin %18 %high
-               OpReturnValue %16
+         %18 = OpLabel
+         %21 = OpExtInst %uint %20 UMax %e %low
+         %19 = OpExtInst %uint %20 UMin %21 %high
+               OpReturnValue %19
                OpFunctionEnd
-%clamp_a2de25 = OpFunction %void None %19
-         %22 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %26
-      %arg_1 = OpVariable %_ptr_Function_uint Function %26
-      %arg_2 = OpVariable %_ptr_Function_uint Function %26
-        %res = OpVariable %_ptr_Function_uint Function %26
+%clamp_a2de25 = OpFunction %void None %22
+         %25 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %29
+      %arg_1 = OpVariable %_ptr_Function_uint Function %29
+      %arg_2 = OpVariable %_ptr_Function_uint Function %29
+        %res = OpVariable %_ptr_Function_uint Function %29
                OpStore %arg_0 %uint_1
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %uint %arg_0
-         %31 = OpLoad %uint %arg_1
-         %32 = OpLoad %uint %arg_2
-         %29 = OpFunctionCall %uint %tint_clamp %30 %31 %32
-               OpStore %res %29
+         %33 = OpLoad %uint %arg_0
+         %34 = OpLoad %uint %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpFunctionCall %uint %tint_clamp %33 %34 %35
+               OpStore %res %32
+         %39 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %40 = OpLoad %uint %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %clamp_a2de25
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %clamp_a2de25
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %19
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %22
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %19
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %clamp_a2de25
+%fragment_main = OpFunction %void None %22
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %clamp_a2de25
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %19
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %clamp_a2de25
+%compute_main = OpFunction %void None %22
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %clamp_a2de25
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.wgsl
index a2e55fe..125cd93 100644
--- a/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/a2de25.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : u32 = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_a2de25();
diff --git a/test/tint/builtins/gen/var/clamp/b07c65.wgsl b/test/tint/builtins/gen/var/clamp/b07c65.wgsl
index 6f504fe..5c004dc 100644
--- a/test/tint/builtins/gen/var/clamp/b07c65.wgsl
+++ b/test/tint/builtins/gen/var/clamp/b07c65.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1i;
   var arg_2 = 1i;
   var res: i32 = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.dxc.hlsl
index 88d36c6..1dd1d03 100644
--- a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.dxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_b07c65() {
   int arg_0 = 1;
   int arg_1 = 1;
   int arg_2 = 1;
   int res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.fxc.hlsl
index 88d36c6..1dd1d03 100644
--- a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.fxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_b07c65() {
   int arg_0 = 1;
   int arg_1 = 1;
   int arg_2 = 1;
   int res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.glsl
index 4e79afe..9128fc8 100644
--- a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void clamp_b07c65() {
   int arg_0 = 1;
   int arg_1 = 1;
   int arg_2 = 1;
   int res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void clamp_b07c65() {
   int arg_0 = 1;
   int arg_1 = 1;
   int arg_2 = 1;
   int res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void clamp_b07c65() {
   int arg_0 = 1;
   int arg_1 = 1;
   int arg_2 = 1;
   int res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.msl
index ee00853..d70ed60 100644
--- a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.msl
@@ -5,36 +5,37 @@
   return min(max(e, low), high);
 }
 
-void clamp_b07c65() {
+void clamp_b07c65(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int arg_1 = 1;
   int arg_2 = 1;
   int res = tint_clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_b07c65();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  clamp_b07c65(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_b07c65();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  clamp_b07c65(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_b07c65();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  clamp_b07c65(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.spvasm
index 007433e..09e2cbe 100644
--- a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_clamp "tint_clamp"
                OpName %e "e"
                OpName %low "low"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,58 +44,67 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
-          %9 = OpTypeFunction %int %int %int %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %int %int %int %int
        %void = OpTypeVoid
-         %19 = OpTypeFunction %void
+         %22 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %26 = OpConstantNull %int
-         %34 = OpTypeFunction %v4float
+         %29 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_clamp = OpFunction %int None %9
+ %tint_clamp = OpFunction %int None %13
           %e = OpFunctionParameter %int
         %low = OpFunctionParameter %int
        %high = OpFunctionParameter %int
-         %15 = OpLabel
-         %18 = OpExtInst %int %17 SMax %e %low
-         %16 = OpExtInst %int %17 SMin %18 %high
-               OpReturnValue %16
+         %18 = OpLabel
+         %21 = OpExtInst %int %20 SMax %e %low
+         %19 = OpExtInst %int %20 SMin %21 %high
+               OpReturnValue %19
                OpFunctionEnd
-%clamp_b07c65 = OpFunction %void None %19
-         %22 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %26
-      %arg_1 = OpVariable %_ptr_Function_int Function %26
-      %arg_2 = OpVariable %_ptr_Function_int Function %26
-        %res = OpVariable %_ptr_Function_int Function %26
+%clamp_b07c65 = OpFunction %void None %22
+         %25 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %29
+      %arg_1 = OpVariable %_ptr_Function_int Function %29
+      %arg_2 = OpVariable %_ptr_Function_int Function %29
+        %res = OpVariable %_ptr_Function_int Function %29
                OpStore %arg_0 %int_1
                OpStore %arg_1 %int_1
                OpStore %arg_2 %int_1
-         %30 = OpLoad %int %arg_0
-         %31 = OpLoad %int %arg_1
-         %32 = OpLoad %int %arg_2
-         %29 = OpFunctionCall %int %tint_clamp %30 %31 %32
-               OpStore %res %29
+         %33 = OpLoad %int %arg_0
+         %34 = OpLoad %int %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpFunctionCall %int %tint_clamp %33 %34 %35
+               OpStore %res %32
+         %40 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %41 = OpLoad %int %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %clamp_b07c65
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %clamp_b07c65
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %19
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %22
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %19
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %clamp_b07c65
+%fragment_main = OpFunction %void None %22
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %clamp_b07c65
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %19
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %clamp_b07c65
+%compute_main = OpFunction %void None %22
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %clamp_b07c65
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.wgsl
index f254a73..a7985e9 100644
--- a/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/b07c65.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1i;
   var arg_2 = 1i;
   var res : i32 = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_b07c65();
diff --git a/test/tint/builtins/gen/var/clamp/b195eb.wgsl b/test/tint/builtins/gen/var/clamp/b195eb.wgsl
index f4f03ff..bbbb92c 100644
--- a/test/tint/builtins/gen/var/clamp/b195eb.wgsl
+++ b/test/tint/builtins/gen/var/clamp/b195eb.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(1.h);
   var arg_2 = vec3<f16>(1.h);
   var res: vec3<f16> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.dxc.hlsl
index dffd29f..97de5a9 100644
--- a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_b195eb() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.fxc.hlsl
index 6e1ea87..5589458 100644
--- a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_b195eb() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.glsl
index 222c3d0..8f84f74 100644
--- a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void clamp_b195eb() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void clamp_b195eb() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void clamp_b195eb() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.msl
index 6f9f9de..256076a 100644
--- a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void clamp_b195eb() {
+void clamp_b195eb(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 arg_2 = half3(1.0h);
   half3 res = clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_b195eb();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  clamp_b195eb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_b195eb();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  clamp_b195eb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_b195eb();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  clamp_b195eb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.spvasm
index 9b6bd0c..79cd984 100644
--- a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %clamp_b195eb "clamp_b195eb"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%clamp_b195eb = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v3half %arg_0
-         %25 = OpLoad %v3half %arg_1
-         %26 = OpLoad %v3half %arg_2
-         %22 = OpExtInst %v3half %23 NClamp %24 %25 %26
-               OpStore %res %22
+%clamp_b195eb = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v3half %arg_0
+         %28 = OpLoad %v3half %arg_1
+         %29 = OpLoad %v3half %arg_2
+         %25 = OpExtInst %v3half %26 NClamp %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %35 = OpLoad %v3half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %clamp_b195eb
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %clamp_b195eb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %clamp_b195eb
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %clamp_b195eb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %clamp_b195eb
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %clamp_b195eb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.wgsl
index 82ce2ad..bb7144a 100644
--- a/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/b195eb.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(1.0h);
   var arg_2 = vec3<f16>(1.0h);
   var res : vec3<f16> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_b195eb();
diff --git a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl
index 9351489..a200837 100644
--- a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl
+++ b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<u32>(1u);
   var arg_2 = vec4<u32>(1u);
   var res: vec4<u32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.dxc.hlsl
index 6a37b5e..446993e 100644
--- a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.dxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_bd43ce() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint4 arg_2 = (1u).xxxx;
   uint4 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.fxc.hlsl
index 6a37b5e..446993e 100644
--- a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.fxc.hlsl
@@ -2,11 +2,14 @@
   return min(max(e, low), high);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void clamp_bd43ce() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint4 arg_2 = (1u).xxxx;
   uint4 res = tint_clamp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.glsl
index be421b3..4f7dabb 100644
--- a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void clamp_bd43ce() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 arg_2 = uvec4(1u);
   uvec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void clamp_bd43ce() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 arg_2 = uvec4(1u);
   uvec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void clamp_bd43ce() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 arg_2 = uvec4(1u);
   uvec4 res = clamp(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.msl b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.msl
index b4e465d..6589332 100644
--- a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.msl
@@ -5,36 +5,37 @@
   return min(max(e, low), high);
 }
 
-void clamp_bd43ce() {
+void clamp_bd43ce(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 arg_1 = uint4(1u);
   uint4 arg_2 = uint4(1u);
   uint4 res = tint_clamp(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  clamp_bd43ce();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  clamp_bd43ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  clamp_bd43ce();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  clamp_bd43ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  clamp_bd43ce();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  clamp_bd43ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.spvasm
index 6751acc..fc31706 100644
--- a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_clamp "tint_clamp"
                OpName %e "e"
                OpName %low "low"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,59 +45,67 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-          %9 = OpTypeFunction %v4uint %v4uint %v4uint %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4uint %v4uint %v4uint %v4uint
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %25 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %28 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %28 = OpConstantNull %v4uint
-         %36 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tint_clamp = OpFunction %v4uint None %9
+ %tint_clamp = OpFunction %v4uint None %14
           %e = OpFunctionParameter %v4uint
         %low = OpFunctionParameter %v4uint
        %high = OpFunctionParameter %v4uint
-         %16 = OpLabel
-         %19 = OpExtInst %v4uint %18 UMax %e %low
-         %17 = OpExtInst %v4uint %18 UMin %19 %high
-               OpReturnValue %17
+         %19 = OpLabel
+         %22 = OpExtInst %v4uint %21 UMax %e %low
+         %20 = OpExtInst %v4uint %21 UMin %22 %high
+               OpReturnValue %20
                OpFunctionEnd
-%clamp_bd43ce = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %28
-      %arg_1 = OpVariable %_ptr_Function_v4uint Function %28
-      %arg_2 = OpVariable %_ptr_Function_v4uint Function %28
-        %res = OpVariable %_ptr_Function_v4uint Function %28
-               OpStore %arg_0 %25
-               OpStore %arg_1 %25
-               OpStore %arg_2 %25
-         %32 = OpLoad %v4uint %arg_0
-         %33 = OpLoad %v4uint %arg_1
-         %34 = OpLoad %v4uint %arg_2
-         %31 = OpFunctionCall %v4uint %tint_clamp %32 %33 %34
-               OpStore %res %31
+%clamp_bd43ce = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %31
+      %arg_1 = OpVariable %_ptr_Function_v4uint Function %31
+      %arg_2 = OpVariable %_ptr_Function_v4uint Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %31
+               OpStore %arg_0 %28
+               OpStore %arg_1 %28
+               OpStore %arg_2 %28
+         %35 = OpLoad %v4uint %arg_0
+         %36 = OpLoad %v4uint %arg_1
+         %37 = OpLoad %v4uint %arg_2
+         %34 = OpFunctionCall %v4uint %tint_clamp %35 %36 %37
+               OpStore %res %34
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %clamp_bd43ce
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %clamp_bd43ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %23
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %clamp_bd43ce
+%fragment_main = OpFunction %void None %23
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %clamp_bd43ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %clamp_bd43ce
+%compute_main = OpFunction %void None %23
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %clamp_bd43ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.wgsl
index ef14a31..bd78d34 100644
--- a/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/clamp/bd43ce.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<u32>(1u);
   var arg_2 = vec4<u32>(1u);
   var res : vec4<u32> = clamp(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_bd43ce();
diff --git a/test/tint/builtins/gen/var/clamp/d396af.wgsl b/test/tint/builtins/gen/var/clamp/d396af.wgsl
index bb8b586..c2b6c20 100644
--- a/test/tint/builtins/gen/var/clamp/d396af.wgsl
+++ b/test/tint/builtins/gen/var/clamp/d396af.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec4(1);
   var res = clamp(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   clamp_d396af();
diff --git a/test/tint/builtins/gen/var/cos/0835a8.wgsl b/test/tint/builtins/gen/var/cos/0835a8.wgsl
index 3dde882..b60b5c4 100644
--- a/test/tint/builtins/gen/var/cos/0835a8.wgsl
+++ b/test/tint/builtins/gen/var/cos/0835a8.wgsl
@@ -27,7 +27,9 @@
 fn cos_0835a8() {
   var arg_0 = vec3<f16>(0.h);
   var res: vec3<f16> = cos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.dxc.hlsl
index cced281..48d63d1 100644
--- a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_0835a8() {
   vector<float16_t, 3> arg_0 = (float16_t(0.0h)).xxx;
   vector<float16_t, 3> res = cos(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.fxc.hlsl
index 06f97cd..17ef763 100644
--- a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_0835a8() {
   vector<float16_t, 3> arg_0 = (float16_t(0.0h)).xxx;
   vector<float16_t, 3> res = cos(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.glsl b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.glsl
index bafe1a5..8c245cf 100644
--- a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cos_0835a8() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   f16vec3 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cos_0835a8() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   f16vec3 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cos_0835a8() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   f16vec3 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.msl b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.msl
index 9420e0b..1f6812a 100644
--- a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_0835a8() {
+void cos_0835a8(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(0.0h);
   half3 res = cos(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_0835a8();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  cos_0835a8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_0835a8();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  cos_0835a8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_0835a8();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  cos_0835a8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.spvasm
index 9ae25ea..9347d8c 100644
--- a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_0835a8 "cos_0835a8"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-         %15 = OpConstantNull %v3half
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3half
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_0835a8 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %15
-        %res = OpVariable %_ptr_Function_v3half Function %15
-               OpStore %arg_0 %15
-         %20 = OpLoad %v3half %arg_0
-         %18 = OpExtInst %v3half %19 Cos %20
-               OpStore %res %18
+ %cos_0835a8 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %18
+        %res = OpVariable %_ptr_Function_v3half Function %18
+               OpStore %arg_0 %18
+         %23 = OpLoad %v3half %arg_0
+         %21 = OpExtInst %v3half %22 Cos %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %29 = OpLoad %v3half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %cos_0835a8
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %cos_0835a8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cos_0835a8
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cos_0835a8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %cos_0835a8
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %cos_0835a8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.wgsl
index e57f0de..2b28ccc 100644
--- a/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cos/0835a8.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn cos_0835a8() {
   var arg_0 = vec3<f16>(0.0h);
   var res : vec3<f16> = cos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_0835a8();
diff --git a/test/tint/builtins/gen/var/cos/0a89f7.wgsl b/test/tint/builtins/gen/var/cos/0a89f7.wgsl
index c6faae8..770f85d 100644
--- a/test/tint/builtins/gen/var/cos/0a89f7.wgsl
+++ b/test/tint/builtins/gen/var/cos/0a89f7.wgsl
@@ -27,7 +27,9 @@
 fn cos_0a89f7() {
   var arg_0 = vec4<f16>(0.h);
   var res: vec4<f16> = cos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.dxc.hlsl
index 3d47a4a..65902fb 100644
--- a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_0a89f7() {
   vector<float16_t, 4> arg_0 = (float16_t(0.0h)).xxxx;
   vector<float16_t, 4> res = cos(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.fxc.hlsl
index 92c2a80..17f76de 100644
--- a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_0a89f7() {
   vector<float16_t, 4> arg_0 = (float16_t(0.0h)).xxxx;
   vector<float16_t, 4> res = cos(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.glsl b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.glsl
index ba601e2..5c0c063 100644
--- a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cos_0a89f7() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   f16vec4 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cos_0a89f7() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   f16vec4 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cos_0a89f7() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   f16vec4 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.msl b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.msl
index 82d913d..3f4a1b7 100644
--- a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_0a89f7() {
+void cos_0a89f7(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(0.0h);
   half4 res = cos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_0a89f7();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  cos_0a89f7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_0a89f7();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  cos_0a89f7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_0a89f7();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  cos_0a89f7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.spvasm
index c2987df..ed8b606 100644
--- a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_0a89f7 "cos_0a89f7"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-         %15 = OpConstantNull %v4half
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4half
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_0a89f7 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %15
-        %res = OpVariable %_ptr_Function_v4half Function %15
-               OpStore %arg_0 %15
-         %20 = OpLoad %v4half %arg_0
-         %18 = OpExtInst %v4half %19 Cos %20
-               OpStore %res %18
+ %cos_0a89f7 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %18
+        %res = OpVariable %_ptr_Function_v4half Function %18
+               OpStore %arg_0 %18
+         %23 = OpLoad %v4half %arg_0
+         %21 = OpExtInst %v4half %22 Cos %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %29 = OpLoad %v4half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %cos_0a89f7
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %cos_0a89f7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cos_0a89f7
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cos_0a89f7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %cos_0a89f7
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %cos_0a89f7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.wgsl
index 9038fc2..852703f 100644
--- a/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cos/0a89f7.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn cos_0a89f7() {
   var arg_0 = vec4<f16>(0.0h);
   var res : vec4<f16> = cos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_0a89f7();
diff --git a/test/tint/builtins/gen/var/cos/16dc15.wgsl b/test/tint/builtins/gen/var/cos/16dc15.wgsl
index 9ff5f3f..322cdda 100644
--- a/test/tint/builtins/gen/var/cos/16dc15.wgsl
+++ b/test/tint/builtins/gen/var/cos/16dc15.wgsl
@@ -25,7 +25,9 @@
 fn cos_16dc15() {
   var arg_0 = vec3<f32>(0.f);
   var res: vec3<f32> = cos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.dxc.hlsl
index 73f5a2f..42acd55 100644
--- a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_16dc15() {
   float3 arg_0 = (0.0f).xxx;
   float3 res = cos(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.fxc.hlsl
index 73f5a2f..42acd55 100644
--- a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_16dc15() {
   float3 arg_0 = (0.0f).xxx;
   float3 res = cos(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.glsl b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.glsl
index 21b1448..0e6b3a7 100644
--- a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cos_16dc15() {
   vec3 arg_0 = vec3(0.0f);
   vec3 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cos_16dc15() {
   vec3 arg_0 = vec3(0.0f);
   vec3 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cos_16dc15() {
   vec3 arg_0 = vec3(0.0f);
   vec3 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.msl b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.msl
index a93875e..0cdd09b 100644
--- a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_16dc15() {
+void cos_16dc15(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(0.0f);
   float3 res = cos(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_16dc15();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  cos_16dc15(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_16dc15();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  cos_16dc15(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_16dc15();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  cos_16dc15(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.spvasm
index d230830..fde472e 100644
--- a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_16dc15 "cos_16dc15"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
-         %14 = OpConstantNull %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v3float
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_16dc15 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
-        %res = OpVariable %_ptr_Function_v3float Function %14
-               OpStore %arg_0 %14
-         %19 = OpLoad %v3float %arg_0
-         %17 = OpExtInst %v3float %18 Cos %19
-               OpStore %res %17
+ %cos_16dc15 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %17
+        %res = OpVariable %_ptr_Function_v3float Function %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v3float %arg_0
+         %20 = OpExtInst %v3float %21 Cos %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %28 = OpLoad %v3float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %cos_16dc15
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %cos_16dc15
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cos_16dc15
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cos_16dc15
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %cos_16dc15
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %cos_16dc15
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.wgsl
index a4cb55f..3081fa1 100644
--- a/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cos/16dc15.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn cos_16dc15() {
   var arg_0 = vec3<f32>(0.0f);
   var res : vec3<f32> = cos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_16dc15();
diff --git a/test/tint/builtins/gen/var/cos/29d66d.wgsl b/test/tint/builtins/gen/var/cos/29d66d.wgsl
index 5a3ba13..939d8c9 100644
--- a/test/tint/builtins/gen/var/cos/29d66d.wgsl
+++ b/test/tint/builtins/gen/var/cos/29d66d.wgsl
@@ -25,7 +25,9 @@
 fn cos_29d66d() {
   var arg_0 = vec4<f32>(0.f);
   var res: vec4<f32> = cos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.dxc.hlsl
index 9a9e05e..59157bf 100644
--- a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_29d66d() {
   float4 arg_0 = (0.0f).xxxx;
   float4 res = cos(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.fxc.hlsl
index 9a9e05e..59157bf 100644
--- a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_29d66d() {
   float4 arg_0 = (0.0f).xxxx;
   float4 res = cos(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.glsl b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.glsl
index 65c8035..4a10c86 100644
--- a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cos_29d66d() {
   vec4 arg_0 = vec4(0.0f);
   vec4 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cos_29d66d() {
   vec4 arg_0 = vec4(0.0f);
   vec4 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cos_29d66d() {
   vec4 arg_0 = vec4(0.0f);
   vec4 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.msl b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.msl
index 6f3ca2b..06a1f1a 100644
--- a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_29d66d() {
+void cos_29d66d(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(0.0f);
   float4 res = cos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_29d66d();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  cos_29d66d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_29d66d();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  cos_29d66d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_29d66d();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  cos_29d66d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.spvasm
index 8c921e7..13e7bd3 100644
--- a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_29d66d "cos_29d66d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %19 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_29d66d = OpFunction %void None %9
-         %12 = OpLabel
+ %cos_29d66d = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %arg_0 %5
-         %17 = OpLoad %v4float %arg_0
-         %15 = OpExtInst %v4float %16 Cos %17
-               OpStore %res %15
+         %20 = OpLoad %v4float %arg_0
+         %18 = OpExtInst %v4float %19 Cos %20
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %26 = OpLoad %v4float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %cos_29d66d
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %cos_29d66d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %cos_29d66d
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %cos_29d66d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cos_29d66d
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cos_29d66d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.wgsl
index c77a5ec..e8b46d0 100644
--- a/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cos/29d66d.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn cos_29d66d() {
   var arg_0 = vec4<f32>(0.0f);
   var res : vec4<f32> = cos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_29d66d();
diff --git a/test/tint/builtins/gen/var/cos/47d768.wgsl b/test/tint/builtins/gen/var/cos/47d768.wgsl
index cfffa60..eaa679f 100644
--- a/test/tint/builtins/gen/var/cos/47d768.wgsl
+++ b/test/tint/builtins/gen/var/cos/47d768.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(0.);
   var res = cos(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_47d768();
diff --git a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl
index 7f050fd..f1c7967 100644
--- a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl
+++ b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl
@@ -27,7 +27,9 @@
 fn cos_5bc2c6() {
   var arg_0 = vec2<f16>(0.h);
   var res: vec2<f16> = cos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.dxc.hlsl
index 09dad0a..2e266a1 100644
--- a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_5bc2c6() {
   vector<float16_t, 2> arg_0 = (float16_t(0.0h)).xx;
   vector<float16_t, 2> res = cos(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.fxc.hlsl
index c1e3823..ac593aa 100644
--- a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_5bc2c6() {
   vector<float16_t, 2> arg_0 = (float16_t(0.0h)).xx;
   vector<float16_t, 2> res = cos(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.glsl b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.glsl
index 511a507..0742349 100644
--- a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cos_5bc2c6() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   f16vec2 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cos_5bc2c6() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   f16vec2 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cos_5bc2c6() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   f16vec2 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.msl b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.msl
index 0eb3596..abc4902 100644
--- a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_5bc2c6() {
+void cos_5bc2c6(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(0.0h);
   half2 res = cos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_5bc2c6();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  cos_5bc2c6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_5bc2c6();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  cos_5bc2c6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_5bc2c6();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  cos_5bc2c6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.spvasm
index e3000bb..a72fe0d 100644
--- a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_5bc2c6 "cos_5bc2c6"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-         %15 = OpConstantNull %v2half
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2half
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_5bc2c6 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %15
-        %res = OpVariable %_ptr_Function_v2half Function %15
-               OpStore %arg_0 %15
-         %20 = OpLoad %v2half %arg_0
-         %18 = OpExtInst %v2half %19 Cos %20
-               OpStore %res %18
+ %cos_5bc2c6 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %18
+        %res = OpVariable %_ptr_Function_v2half Function %18
+               OpStore %arg_0 %18
+         %23 = OpLoad %v2half %arg_0
+         %21 = OpExtInst %v2half %22 Cos %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %29 = OpLoad %v2half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %cos_5bc2c6
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %cos_5bc2c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cos_5bc2c6
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cos_5bc2c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %cos_5bc2c6
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %cos_5bc2c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.wgsl
index 8d64d6d..080da0d 100644
--- a/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cos/5bc2c6.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn cos_5bc2c6() {
   var arg_0 = vec2<f16>(0.0h);
   var res : vec2<f16> = cos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_5bc2c6();
diff --git a/test/tint/builtins/gen/var/cos/6b1fdf.wgsl b/test/tint/builtins/gen/var/cos/6b1fdf.wgsl
index 35ec248..398ac28 100644
--- a/test/tint/builtins/gen/var/cos/6b1fdf.wgsl
+++ b/test/tint/builtins/gen/var/cos/6b1fdf.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(0.);
   var res = cos(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_6b1fdf();
diff --git a/test/tint/builtins/gen/var/cos/a297d4.wgsl b/test/tint/builtins/gen/var/cos/a297d4.wgsl
index d7d13ff..7527a30 100644
--- a/test/tint/builtins/gen/var/cos/a297d4.wgsl
+++ b/test/tint/builtins/gen/var/cos/a297d4.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 0.;
   var res = cos(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_a297d4();
diff --git a/test/tint/builtins/gen/var/cos/af7447.wgsl b/test/tint/builtins/gen/var/cos/af7447.wgsl
index 57e6a22..1b199d5 100644
--- a/test/tint/builtins/gen/var/cos/af7447.wgsl
+++ b/test/tint/builtins/gen/var/cos/af7447.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(0.);
   var res = cos(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_af7447();
diff --git a/test/tint/builtins/gen/var/cos/c3b486.wgsl b/test/tint/builtins/gen/var/cos/c3b486.wgsl
index 4b1b135..cd9f4a9 100644
--- a/test/tint/builtins/gen/var/cos/c3b486.wgsl
+++ b/test/tint/builtins/gen/var/cos/c3b486.wgsl
@@ -25,7 +25,9 @@
 fn cos_c3b486() {
   var arg_0 = vec2<f32>(0.f);
   var res: vec2<f32> = cos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.dxc.hlsl
index cd82afc..d7be3bf 100644
--- a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_c3b486() {
   float2 arg_0 = (0.0f).xx;
   float2 res = cos(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.fxc.hlsl
index cd82afc..d7be3bf 100644
--- a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_c3b486() {
   float2 arg_0 = (0.0f).xx;
   float2 res = cos(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.glsl b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.glsl
index 03fb395..09bc185 100644
--- a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cos_c3b486() {
   vec2 arg_0 = vec2(0.0f);
   vec2 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cos_c3b486() {
   vec2 arg_0 = vec2(0.0f);
   vec2 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cos_c3b486() {
   vec2 arg_0 = vec2(0.0f);
   vec2 res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.msl b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.msl
index 4e0e3b4..3dc7829 100644
--- a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_c3b486() {
+void cos_c3b486(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(0.0f);
   float2 res = cos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_c3b486();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  cos_c3b486(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_c3b486();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  cos_c3b486(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_c3b486();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  cos_c3b486(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.spvasm
index a4bb57f..36bb66b 100644
--- a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_c3b486 "cos_c3b486"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
-         %14 = OpConstantNull %v2float
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v2float
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_c3b486 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
-        %res = OpVariable %_ptr_Function_v2float Function %14
-               OpStore %arg_0 %14
-         %19 = OpLoad %v2float %arg_0
-         %17 = OpExtInst %v2float %18 Cos %19
-               OpStore %res %17
+ %cos_c3b486 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %17
+        %res = OpVariable %_ptr_Function_v2float Function %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v2float %arg_0
+         %20 = OpExtInst %v2float %21 Cos %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %28 = OpLoad %v2float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %cos_c3b486
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %cos_c3b486
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cos_c3b486
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cos_c3b486
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %cos_c3b486
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %cos_c3b486
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.wgsl
index 76e6fc3..337a6ec 100644
--- a/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cos/c3b486.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn cos_c3b486() {
   var arg_0 = vec2<f32>(0.0f);
   var res : vec2<f32> = cos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_c3b486();
diff --git a/test/tint/builtins/gen/var/cos/c5c28e.wgsl b/test/tint/builtins/gen/var/cos/c5c28e.wgsl
index f75c75e..44dd52a 100644
--- a/test/tint/builtins/gen/var/cos/c5c28e.wgsl
+++ b/test/tint/builtins/gen/var/cos/c5c28e.wgsl
@@ -25,7 +25,9 @@
 fn cos_c5c28e() {
   var arg_0 = 0.f;
   var res: f32 = cos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.dxc.hlsl
index 5455774..0fc602a 100644
--- a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_c5c28e() {
   float arg_0 = 0.0f;
   float res = cos(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.fxc.hlsl
index 5455774..0fc602a 100644
--- a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_c5c28e() {
   float arg_0 = 0.0f;
   float res = cos(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.glsl b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.glsl
index 2509839..40be5dc 100644
--- a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cos_c5c28e() {
   float arg_0 = 0.0f;
   float res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cos_c5c28e() {
   float arg_0 = 0.0f;
   float res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cos_c5c28e() {
   float arg_0 = 0.0f;
   float res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.msl b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.msl
index 1dc8052..4bf4dd0 100644
--- a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_c5c28e() {
+void cos_c5c28e(device float* const tint_symbol_1) {
   float arg_0 = 0.0f;
   float res = cos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_c5c28e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  cos_c5c28e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_c5c28e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  cos_c5c28e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_c5c28e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  cos_c5c28e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.spvasm
index 68ff80d..6b640e1 100644
--- a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_c5c28e "cos_c5c28e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %19 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_c5c28e = OpFunction %void None %9
-         %12 = OpLabel
+ %cos_c5c28e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %8
-         %17 = OpLoad %float %arg_0
-         %15 = OpExtInst %float %16 Cos %17
-               OpStore %res %15
+         %20 = OpLoad %float %arg_0
+         %18 = OpExtInst %float %19 Cos %20
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %26 = OpLoad %float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %cos_c5c28e
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %cos_c5c28e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %cos_c5c28e
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %cos_c5c28e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cos_c5c28e
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cos_c5c28e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.wgsl
index 0f3a9f2..989f2d2 100644
--- a/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cos/c5c28e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn cos_c5c28e() {
   var arg_0 = 0.0f;
   var res : f32 = cos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_c5c28e();
diff --git a/test/tint/builtins/gen/var/cos/fc047d.wgsl b/test/tint/builtins/gen/var/cos/fc047d.wgsl
index 9c01a14..014c5b8 100644
--- a/test/tint/builtins/gen/var/cos/fc047d.wgsl
+++ b/test/tint/builtins/gen/var/cos/fc047d.wgsl
@@ -27,7 +27,9 @@
 fn cos_fc047d() {
   var arg_0 = 0.h;
   var res: f16 = cos(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.dxc.hlsl
index 54b9f70..655045f 100644
--- a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_fc047d() {
   float16_t arg_0 = float16_t(0.0h);
   float16_t res = cos(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.fxc.hlsl
index 9381bca..65bef84 100644
--- a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cos_fc047d() {
   float16_t arg_0 = float16_t(0.0h);
   float16_t res = cos(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.glsl b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.glsl
index 093b9d2..ba34122 100644
--- a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cos_fc047d() {
   float16_t arg_0 = 0.0hf;
   float16_t res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cos_fc047d() {
   float16_t arg_0 = 0.0hf;
   float16_t res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cos_fc047d() {
   float16_t arg_0 = 0.0hf;
   float16_t res = cos(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.msl b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.msl
index 2c230eb..23a1cb5 100644
--- a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cos_fc047d() {
+void cos_fc047d(device half* const tint_symbol_1) {
   half arg_0 = 0.0h;
   half res = cos(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cos_fc047d();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  cos_fc047d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cos_fc047d();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  cos_fc047d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cos_fc047d();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  cos_fc047d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.spvasm
index 4adfb5e..e7f94b9 100644
--- a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cos_fc047d "cos_fc047d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %cos_fc047d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %14
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %arg_0 %14
-         %19 = OpLoad %half %arg_0
-         %17 = OpExtInst %half %18 Cos %19
-               OpStore %res %17
+ %cos_fc047d = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %17
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %half %arg_0
+         %20 = OpExtInst %half %21 Cos %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %28 = OpLoad %half %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %cos_fc047d
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %cos_fc047d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cos_fc047d
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cos_fc047d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %cos_fc047d
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %cos_fc047d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.wgsl
index 5121615..41710c4 100644
--- a/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cos/fc047d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn cos_fc047d() {
   var arg_0 = 0.0h;
   var res : f16 = cos(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cos_fc047d();
diff --git a/test/tint/builtins/gen/var/cosh/2ed778.wgsl b/test/tint/builtins/gen/var/cosh/2ed778.wgsl
index 8a0353d..065bc77 100644
--- a/test/tint/builtins/gen/var/cosh/2ed778.wgsl
+++ b/test/tint/builtins/gen/var/cosh/2ed778.wgsl
@@ -27,7 +27,9 @@
 fn cosh_2ed778() {
   var arg_0 = 0.h;
   var res: f16 = cosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.dxc.hlsl
index 6689a7f..5afc50c 100644
--- a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_2ed778() {
   float16_t arg_0 = float16_t(0.0h);
   float16_t res = cosh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.fxc.hlsl
index 02541f9..19dc5bd 100644
--- a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_2ed778() {
   float16_t arg_0 = float16_t(0.0h);
   float16_t res = cosh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.glsl b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.glsl
index 52057b9..b307d29 100644
--- a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cosh_2ed778() {
   float16_t arg_0 = 0.0hf;
   float16_t res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cosh_2ed778() {
   float16_t arg_0 = 0.0hf;
   float16_t res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void cosh_2ed778() {
   float16_t arg_0 = 0.0hf;
   float16_t res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.msl b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.msl
index 6f72358..f43a67a 100644
--- a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_2ed778() {
+void cosh_2ed778(device half* const tint_symbol_1) {
   half arg_0 = 0.0h;
   half res = cosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_2ed778();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  cosh_2ed778(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_2ed778();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  cosh_2ed778(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_2ed778();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  cosh_2ed778(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.spvasm
index 2079d7e..d3d1d61 100644
--- a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_2ed778 "cosh_2ed778"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_2ed778 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %14
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %arg_0 %14
-         %19 = OpLoad %half %arg_0
-         %17 = OpExtInst %half %18 Cosh %19
-               OpStore %res %17
+%cosh_2ed778 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %17
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %half %arg_0
+         %20 = OpExtInst %half %21 Cosh %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %28 = OpLoad %half %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %cosh_2ed778
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %cosh_2ed778
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cosh_2ed778
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cosh_2ed778
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %cosh_2ed778
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %cosh_2ed778
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.wgsl
index 5eec435..ae50025 100644
--- a/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cosh/2ed778.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn cosh_2ed778() {
   var arg_0 = 0.0h;
   var res : f16 = cosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_2ed778();
diff --git a/test/tint/builtins/gen/var/cosh/377652.wgsl b/test/tint/builtins/gen/var/cosh/377652.wgsl
index 2dccc37..888338b 100644
--- a/test/tint/builtins/gen/var/cosh/377652.wgsl
+++ b/test/tint/builtins/gen/var/cosh/377652.wgsl
@@ -25,7 +25,9 @@
 fn cosh_377652() {
   var arg_0 = vec3<f32>(0.f);
   var res: vec3<f32> = cosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.dxc.hlsl
index 4b6ec3e..3c6705c 100644
--- a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_377652() {
   float3 arg_0 = (0.0f).xxx;
   float3 res = cosh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.fxc.hlsl
index 4b6ec3e..3c6705c 100644
--- a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_377652() {
   float3 arg_0 = (0.0f).xxx;
   float3 res = cosh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.glsl b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.glsl
index bd306d8..4c86068 100644
--- a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cosh_377652() {
   vec3 arg_0 = vec3(0.0f);
   vec3 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cosh_377652() {
   vec3 arg_0 = vec3(0.0f);
   vec3 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cosh_377652() {
   vec3 arg_0 = vec3(0.0f);
   vec3 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.msl b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.msl
index e177d54..240085f 100644
--- a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_377652() {
+void cosh_377652(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(0.0f);
   float3 res = cosh(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_377652();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  cosh_377652(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_377652();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  cosh_377652(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_377652();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  cosh_377652(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.spvasm
index 4007fb3..ec824a7 100644
--- a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_377652 "cosh_377652"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
-         %14 = OpConstantNull %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v3float
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_377652 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
-        %res = OpVariable %_ptr_Function_v3float Function %14
-               OpStore %arg_0 %14
-         %19 = OpLoad %v3float %arg_0
-         %17 = OpExtInst %v3float %18 Cosh %19
-               OpStore %res %17
+%cosh_377652 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %17
+        %res = OpVariable %_ptr_Function_v3float Function %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v3float %arg_0
+         %20 = OpExtInst %v3float %21 Cosh %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %28 = OpLoad %v3float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %cosh_377652
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %cosh_377652
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cosh_377652
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cosh_377652
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %cosh_377652
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %cosh_377652
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.wgsl
index b208ffc..dce99e8 100644
--- a/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cosh/377652.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn cosh_377652() {
   var arg_0 = vec3<f32>(0.0f);
   var res : vec3<f32> = cosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_377652();
diff --git a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl
index b4fddcf..4bca526 100644
--- a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl
+++ b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl
@@ -27,7 +27,9 @@
 fn cosh_3b7bbf() {
   var arg_0 = vec4<f16>(0.h);
   var res: vec4<f16> = cosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.dxc.hlsl
index 5a96478..ace295a 100644
--- a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_3b7bbf() {
   vector<float16_t, 4> arg_0 = (float16_t(0.0h)).xxxx;
   vector<float16_t, 4> res = cosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.fxc.hlsl
index ed7b63b..26510e6 100644
--- a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_3b7bbf() {
   vector<float16_t, 4> arg_0 = (float16_t(0.0h)).xxxx;
   vector<float16_t, 4> res = cosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.glsl b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.glsl
index 8ea08d9..566b68a 100644
--- a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cosh_3b7bbf() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   f16vec4 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cosh_3b7bbf() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   f16vec4 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void cosh_3b7bbf() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   f16vec4 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.msl b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.msl
index 12acf5f..cd1b415 100644
--- a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_3b7bbf() {
+void cosh_3b7bbf(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(0.0h);
   half4 res = cosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_3b7bbf();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  cosh_3b7bbf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_3b7bbf();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  cosh_3b7bbf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_3b7bbf();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  cosh_3b7bbf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.spvasm
index 3b9f8d4..ecf444c 100644
--- a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_3b7bbf "cosh_3b7bbf"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-         %15 = OpConstantNull %v4half
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v4half
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_3b7bbf = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %15
-        %res = OpVariable %_ptr_Function_v4half Function %15
-               OpStore %arg_0 %15
-         %20 = OpLoad %v4half %arg_0
-         %18 = OpExtInst %v4half %19 Cosh %20
-               OpStore %res %18
+%cosh_3b7bbf = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %18
+        %res = OpVariable %_ptr_Function_v4half Function %18
+               OpStore %arg_0 %18
+         %23 = OpLoad %v4half %arg_0
+         %21 = OpExtInst %v4half %22 Cosh %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %29 = OpLoad %v4half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %cosh_3b7bbf
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %cosh_3b7bbf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cosh_3b7bbf
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cosh_3b7bbf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %cosh_3b7bbf
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %cosh_3b7bbf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.wgsl
index 2f43c2a..a03b874 100644
--- a/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cosh/3b7bbf.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn cosh_3b7bbf() {
   var arg_0 = vec4<f16>(0.0h);
   var res : vec4<f16> = cosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_3b7bbf();
diff --git a/test/tint/builtins/gen/var/cosh/432645.wgsl b/test/tint/builtins/gen/var/cosh/432645.wgsl
index 53be992..2827416 100644
--- a/test/tint/builtins/gen/var/cosh/432645.wgsl
+++ b/test/tint/builtins/gen/var/cosh/432645.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(0.);
   var res = cosh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_432645();
diff --git a/test/tint/builtins/gen/var/cosh/43b672.wgsl b/test/tint/builtins/gen/var/cosh/43b672.wgsl
index 854d6a9..58189a6 100644
--- a/test/tint/builtins/gen/var/cosh/43b672.wgsl
+++ b/test/tint/builtins/gen/var/cosh/43b672.wgsl
@@ -27,7 +27,9 @@
 fn cosh_43b672() {
   var arg_0 = vec2<f16>(0.h);
   var res: vec2<f16> = cosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.dxc.hlsl
index db19b27..079dd4e 100644
--- a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_43b672() {
   vector<float16_t, 2> arg_0 = (float16_t(0.0h)).xx;
   vector<float16_t, 2> res = cosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.fxc.hlsl
index 4237902..1cffff7 100644
--- a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_43b672() {
   vector<float16_t, 2> arg_0 = (float16_t(0.0h)).xx;
   vector<float16_t, 2> res = cosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.glsl b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.glsl
index 8c60a2c..c2f80bb 100644
--- a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cosh_43b672() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   f16vec2 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cosh_43b672() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   f16vec2 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void cosh_43b672() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   f16vec2 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.msl b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.msl
index 1a50e7e..c739dae 100644
--- a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_43b672() {
+void cosh_43b672(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(0.0h);
   half2 res = cosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_43b672();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  cosh_43b672(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_43b672();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  cosh_43b672(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_43b672();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  cosh_43b672(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.spvasm
index 5658285..c589617 100644
--- a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_43b672 "cosh_43b672"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-         %15 = OpConstantNull %v2half
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v2half
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_43b672 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %15
-        %res = OpVariable %_ptr_Function_v2half Function %15
-               OpStore %arg_0 %15
-         %20 = OpLoad %v2half %arg_0
-         %18 = OpExtInst %v2half %19 Cosh %20
-               OpStore %res %18
+%cosh_43b672 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %18
+        %res = OpVariable %_ptr_Function_v2half Function %18
+               OpStore %arg_0 %18
+         %23 = OpLoad %v2half %arg_0
+         %21 = OpExtInst %v2half %22 Cosh %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %29 = OpLoad %v2half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %cosh_43b672
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %cosh_43b672
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cosh_43b672
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cosh_43b672
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %cosh_43b672
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %cosh_43b672
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.wgsl
index 3a225b1..2dd3d86 100644
--- a/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cosh/43b672.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn cosh_43b672() {
   var arg_0 = vec2<f16>(0.0h);
   var res : vec2<f16> = cosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_43b672();
diff --git a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl
index 02b20f2..5a4781f 100644
--- a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl
+++ b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl
@@ -27,7 +27,9 @@
 fn cosh_b1b8a0() {
   var arg_0 = vec3<f16>(0.h);
   var res: vec3<f16> = cosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.dxc.hlsl
index a058cd2..77d878e 100644
--- a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_b1b8a0() {
   vector<float16_t, 3> arg_0 = (float16_t(0.0h)).xxx;
   vector<float16_t, 3> res = cosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.fxc.hlsl
index 0a013b6..03bc142 100644
--- a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_b1b8a0() {
   vector<float16_t, 3> arg_0 = (float16_t(0.0h)).xxx;
   vector<float16_t, 3> res = cosh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.glsl b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.glsl
index 6566e92..e133436 100644
--- a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cosh_b1b8a0() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   f16vec3 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cosh_b1b8a0() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   f16vec3 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cosh_b1b8a0() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   f16vec3 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.msl b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.msl
index 2cf0802..eae3170 100644
--- a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_b1b8a0() {
+void cosh_b1b8a0(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(0.0h);
   half3 res = cosh(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_b1b8a0();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  cosh_b1b8a0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_b1b8a0();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  cosh_b1b8a0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_b1b8a0();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  cosh_b1b8a0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.spvasm
index 29505ec..8873840 100644
--- a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_b1b8a0 "cosh_b1b8a0"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-         %15 = OpConstantNull %v3half
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+         %18 = OpConstantNull %v3half
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_b1b8a0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %15
-        %res = OpVariable %_ptr_Function_v3half Function %15
-               OpStore %arg_0 %15
-         %20 = OpLoad %v3half %arg_0
-         %18 = OpExtInst %v3half %19 Cosh %20
-               OpStore %res %18
+%cosh_b1b8a0 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %18
+        %res = OpVariable %_ptr_Function_v3half Function %18
+               OpStore %arg_0 %18
+         %23 = OpLoad %v3half %arg_0
+         %21 = OpExtInst %v3half %22 Cosh %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %29 = OpLoad %v3half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %cosh_b1b8a0
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %cosh_b1b8a0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cosh_b1b8a0
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cosh_b1b8a0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %cosh_b1b8a0
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %cosh_b1b8a0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.wgsl
index 38d7ea9..eb4f986 100644
--- a/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cosh/b1b8a0.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn cosh_b1b8a0() {
   var arg_0 = vec3<f16>(0.0h);
   var res : vec3<f16> = cosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_b1b8a0();
diff --git a/test/tint/builtins/gen/var/cosh/c13756.wgsl b/test/tint/builtins/gen/var/cosh/c13756.wgsl
index 00e626a..f4cec00 100644
--- a/test/tint/builtins/gen/var/cosh/c13756.wgsl
+++ b/test/tint/builtins/gen/var/cosh/c13756.wgsl
@@ -25,7 +25,9 @@
 fn cosh_c13756() {
   var arg_0 = vec2<f32>(0.f);
   var res: vec2<f32> = cosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.dxc.hlsl
index 1c53a74..8cc330a 100644
--- a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_c13756() {
   float2 arg_0 = (0.0f).xx;
   float2 res = cosh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.fxc.hlsl
index 1c53a74..8cc330a 100644
--- a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_c13756() {
   float2 arg_0 = (0.0f).xx;
   float2 res = cosh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.glsl b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.glsl
index 4d9ef69..c7a48f9 100644
--- a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cosh_c13756() {
   vec2 arg_0 = vec2(0.0f);
   vec2 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cosh_c13756() {
   vec2 arg_0 = vec2(0.0f);
   vec2 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void cosh_c13756() {
   vec2 arg_0 = vec2(0.0f);
   vec2 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.msl b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.msl
index 4ce9fd6..e3713ea 100644
--- a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_c13756() {
+void cosh_c13756(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(0.0f);
   float2 res = cosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_c13756();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  cosh_c13756(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_c13756();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  cosh_c13756(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_c13756();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  cosh_c13756(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.spvasm
index faad534..77802ac 100644
--- a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_c13756 "cosh_c13756"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
-         %14 = OpConstantNull %v2float
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %v2float
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_c13756 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
-        %res = OpVariable %_ptr_Function_v2float Function %14
-               OpStore %arg_0 %14
-         %19 = OpLoad %v2float %arg_0
-         %17 = OpExtInst %v2float %18 Cosh %19
-               OpStore %res %17
+%cosh_c13756 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %17
+        %res = OpVariable %_ptr_Function_v2float Function %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v2float %arg_0
+         %20 = OpExtInst %v2float %21 Cosh %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %28 = OpLoad %v2float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %cosh_c13756
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %cosh_c13756
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %cosh_c13756
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %cosh_c13756
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %cosh_c13756
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %cosh_c13756
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.wgsl
index 5c023f5..0c468e1 100644
--- a/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cosh/c13756.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn cosh_c13756() {
   var arg_0 = vec2<f32>(0.0f);
   var res : vec2<f32> = cosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_c13756();
diff --git a/test/tint/builtins/gen/var/cosh/c892bb.wgsl b/test/tint/builtins/gen/var/cosh/c892bb.wgsl
index 0de1367..50dfb3d 100644
--- a/test/tint/builtins/gen/var/cosh/c892bb.wgsl
+++ b/test/tint/builtins/gen/var/cosh/c892bb.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 0.;
   var res = cosh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_c892bb();
diff --git a/test/tint/builtins/gen/var/cosh/d8dee7.wgsl b/test/tint/builtins/gen/var/cosh/d8dee7.wgsl
index 5bc4653..a368b99 100644
--- a/test/tint/builtins/gen/var/cosh/d8dee7.wgsl
+++ b/test/tint/builtins/gen/var/cosh/d8dee7.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(0.);
   var res = cosh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_d8dee7();
diff --git a/test/tint/builtins/gen/var/cosh/da92dd.wgsl b/test/tint/builtins/gen/var/cosh/da92dd.wgsl
index 2611357..2bf1b17 100644
--- a/test/tint/builtins/gen/var/cosh/da92dd.wgsl
+++ b/test/tint/builtins/gen/var/cosh/da92dd.wgsl
@@ -25,7 +25,9 @@
 fn cosh_da92dd() {
   var arg_0 = 0.f;
   var res: f32 = cosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.dxc.hlsl
index c1bf67e..19b968f 100644
--- a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_da92dd() {
   float arg_0 = 0.0f;
   float res = cosh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.fxc.hlsl
index c1bf67e..19b968f 100644
--- a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_da92dd() {
   float arg_0 = 0.0f;
   float res = cosh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.glsl b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.glsl
index 9927b0a..da1bad6 100644
--- a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cosh_da92dd() {
   float arg_0 = 0.0f;
   float res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cosh_da92dd() {
   float arg_0 = 0.0f;
   float res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void cosh_da92dd() {
   float arg_0 = 0.0f;
   float res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.msl b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.msl
index ca678be..dc62abb 100644
--- a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_da92dd() {
+void cosh_da92dd(device float* const tint_symbol_1) {
   float arg_0 = 0.0f;
   float res = cosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_da92dd();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  cosh_da92dd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_da92dd();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  cosh_da92dd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_da92dd();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  cosh_da92dd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.spvasm
index 36cb08f..558ab38 100644
--- a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_da92dd "cosh_da92dd"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %19 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_da92dd = OpFunction %void None %9
-         %12 = OpLabel
+%cosh_da92dd = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %8
-         %17 = OpLoad %float %arg_0
-         %15 = OpExtInst %float %16 Cosh %17
-               OpStore %res %15
+         %20 = OpLoad %float %arg_0
+         %18 = OpExtInst %float %19 Cosh %20
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %26 = OpLoad %float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %cosh_da92dd
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %cosh_da92dd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %cosh_da92dd
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %cosh_da92dd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cosh_da92dd
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cosh_da92dd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.wgsl
index fd7d07e..05e9db0 100644
--- a/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cosh/da92dd.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn cosh_da92dd() {
   var arg_0 = 0.0f;
   var res : f32 = cosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_da92dd();
diff --git a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl
index 181fdd4..4bb08c2 100644
--- a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl
+++ b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl
@@ -25,7 +25,9 @@
 fn cosh_e0c1de() {
   var arg_0 = vec4<f32>(0.f);
   var res: vec4<f32> = cosh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.dxc.hlsl
index 57edfcd..23e1b74 100644
--- a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_e0c1de() {
   float4 arg_0 = (0.0f).xxxx;
   float4 res = cosh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.fxc.hlsl
index 57edfcd..23e1b74 100644
--- a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cosh_e0c1de() {
   float4 arg_0 = (0.0f).xxxx;
   float4 res = cosh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.glsl b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.glsl
index 713d23d..b28fd31 100644
--- a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cosh_e0c1de() {
   vec4 arg_0 = vec4(0.0f);
   vec4 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cosh_e0c1de() {
   vec4 arg_0 = vec4(0.0f);
   vec4 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void cosh_e0c1de() {
   vec4 arg_0 = vec4(0.0f);
   vec4 res = cosh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.msl b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.msl
index dba84b5..cc7e4d2 100644
--- a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cosh_e0c1de() {
+void cosh_e0c1de(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(0.0f);
   float4 res = cosh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cosh_e0c1de();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  cosh_e0c1de(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cosh_e0c1de();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  cosh_e0c1de(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cosh_e0c1de();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  cosh_e0c1de(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.spvasm
index b788bac..e1b4459 100644
--- a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cosh_e0c1de "cosh_e0c1de"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %19 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cosh_e0c1de = OpFunction %void None %9
-         %12 = OpLabel
+%cosh_e0c1de = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %arg_0 %5
-         %17 = OpLoad %v4float %arg_0
-         %15 = OpExtInst %v4float %16 Cosh %17
-               OpStore %res %15
+         %20 = OpLoad %v4float %arg_0
+         %18 = OpExtInst %v4float %19 Cosh %20
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %26 = OpLoad %v4float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %cosh_e0c1de
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %cosh_e0c1de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %cosh_e0c1de
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %cosh_e0c1de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %cosh_e0c1de
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %cosh_e0c1de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.wgsl
index b48ff3c..7563e52 100644
--- a/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cosh/e0c1de.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn cosh_e0c1de() {
   var arg_0 = vec4<f32>(0.0f);
   var res : vec4<f32> = cosh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_e0c1de();
diff --git a/test/tint/builtins/gen/var/cosh/f67ff1.wgsl b/test/tint/builtins/gen/var/cosh/f67ff1.wgsl
index db22528..6b4364d 100644
--- a/test/tint/builtins/gen/var/cosh/f67ff1.wgsl
+++ b/test/tint/builtins/gen/var/cosh/f67ff1.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(0.);
   var res = cosh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cosh_f67ff1();
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl
index 55921e4..1264109 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl
@@ -25,7 +25,9 @@
 fn countLeadingZeros_208d46() {
   var arg_0 = 1u;
   var res: u32 = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.dxc.hlsl
index 65bbec9..de46b27 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_208d46() {
   uint arg_0 = 1u;
   uint res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.fxc.hlsl
index 65bbec9..de46b27 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_208d46() {
   uint arg_0 = 1u;
   uint res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.glsl b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.glsl
index d416594..353e7f6 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countLeadingZeros_208d46() {
   uint arg_0 = 1u;
   uint res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countLeadingZeros_208d46() {
   uint arg_0 = 1u;
   uint res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countLeadingZeros_208d46() {
   uint arg_0 = 1u;
   uint res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.msl b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.msl
index 545a925..089424f 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_208d46() {
+void countLeadingZeros_208d46(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint res = clz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_208d46();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  countLeadingZeros_208d46(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_208d46();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_208d46(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_208d46();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_208d46(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.spvasm
index 8fb26d7..6fefdb8 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 83
+; Bound: 90
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_leading_zeros "tint_count_leading_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,9 +40,12 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %uint %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %uint %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
+         %20 = OpConstantNull %uint
  %uint_65535 = OpConstant %uint 65535
        %bool = OpTypeBool
     %uint_16 = OpConstant %uint 16
@@ -48,80 +58,85 @@
 %uint_2147483647 = OpConstant %uint 2147483647
      %uint_1 = OpConstant %uint 1
        %void = OpTypeVoid
-         %61 = OpTypeFunction %void
-         %69 = OpTypeFunction %v4float
+         %64 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %76 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_leading_zeros = OpFunction %uint None %9
+%tint_count_leading_zeros = OpFunction %uint None %13
           %v = OpFunctionParameter %uint
-         %13 = OpLabel
-          %x = OpVariable %_ptr_Function_uint Function %17
+         %16 = OpLabel
+          %x = OpVariable %_ptr_Function_uint Function %20
                OpStore %x %v
-         %19 = OpLoad %uint %x
-         %21 = OpULessThanEqual %bool %19 %uint_65535
-         %18 = OpSelect %uint %21 %uint_16 %17
-         %24 = OpLoad %uint %x
-         %25 = OpShiftLeftLogical %uint %24 %18
-               OpStore %x %25
+         %22 = OpLoad %uint %x
+         %24 = OpULessThanEqual %bool %22 %uint_65535
+         %21 = OpSelect %uint %24 %uint_16 %20
          %27 = OpLoad %uint %x
-         %29 = OpULessThanEqual %bool %27 %uint_16777215
-         %26 = OpSelect %uint %29 %uint_8 %17
-         %31 = OpLoad %uint %x
-         %32 = OpShiftLeftLogical %uint %31 %26
-               OpStore %x %32
+         %28 = OpShiftLeftLogical %uint %27 %21
+               OpStore %x %28
+         %30 = OpLoad %uint %x
+         %32 = OpULessThanEqual %bool %30 %uint_16777215
+         %29 = OpSelect %uint %32 %uint_8 %20
          %34 = OpLoad %uint %x
-         %36 = OpULessThanEqual %bool %34 %uint_268435455
-         %33 = OpSelect %uint %36 %uint_4 %17
-         %38 = OpLoad %uint %x
-         %39 = OpShiftLeftLogical %uint %38 %33
-               OpStore %x %39
+         %35 = OpShiftLeftLogical %uint %34 %29
+               OpStore %x %35
+         %37 = OpLoad %uint %x
+         %39 = OpULessThanEqual %bool %37 %uint_268435455
+         %36 = OpSelect %uint %39 %uint_4 %20
          %41 = OpLoad %uint %x
-         %43 = OpULessThanEqual %bool %41 %uint_1073741823
-         %40 = OpSelect %uint %43 %uint_2 %17
-         %45 = OpLoad %uint %x
-         %46 = OpShiftLeftLogical %uint %45 %40
-               OpStore %x %46
+         %42 = OpShiftLeftLogical %uint %41 %36
+               OpStore %x %42
+         %44 = OpLoad %uint %x
+         %46 = OpULessThanEqual %bool %44 %uint_1073741823
+         %43 = OpSelect %uint %46 %uint_2 %20
          %48 = OpLoad %uint %x
-         %50 = OpULessThanEqual %bool %48 %uint_2147483647
-         %47 = OpSelect %uint %50 %uint_1 %17
-         %53 = OpLoad %uint %x
-         %54 = OpIEqual %bool %53 %17
-         %52 = OpSelect %uint %54 %uint_1 %17
-         %56 = OpBitwiseOr %uint %18 %26
-         %57 = OpBitwiseOr %uint %56 %33
-         %58 = OpBitwiseOr %uint %57 %40
-         %59 = OpBitwiseOr %uint %58 %47
-         %60 = OpIAdd %uint %59 %52
-               OpReturnValue %60
+         %49 = OpShiftLeftLogical %uint %48 %43
+               OpStore %x %49
+         %51 = OpLoad %uint %x
+         %53 = OpULessThanEqual %bool %51 %uint_2147483647
+         %50 = OpSelect %uint %53 %uint_1 %20
+         %56 = OpLoad %uint %x
+         %57 = OpIEqual %bool %56 %20
+         %55 = OpSelect %uint %57 %uint_1 %20
+         %59 = OpBitwiseOr %uint %21 %29
+         %60 = OpBitwiseOr %uint %59 %36
+         %61 = OpBitwiseOr %uint %60 %43
+         %62 = OpBitwiseOr %uint %61 %50
+         %63 = OpIAdd %uint %62 %55
+               OpReturnValue %63
                OpFunctionEnd
-%countLeadingZeros_208d46 = OpFunction %void None %61
-         %64 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+%countLeadingZeros_208d46 = OpFunction %void None %64
+         %67 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
-         %67 = OpLoad %uint %arg_0
-         %66 = OpFunctionCall %uint %tint_count_leading_zeros %67
-               OpStore %res %66
+         %70 = OpLoad %uint %arg_0
+         %69 = OpFunctionCall %uint %tint_count_leading_zeros %70
+               OpStore %res %69
+         %74 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %75 = OpLoad %uint %res
+               OpStore %74 %75
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %69
-         %71 = OpLabel
-         %72 = OpFunctionCall %void %countLeadingZeros_208d46
+%vertex_main_inner = OpFunction %v4float None %76
+         %78 = OpLabel
+         %79 = OpFunctionCall %void %countLeadingZeros_208d46
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %61
-         %74 = OpLabel
-         %75 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %75
+%vertex_main = OpFunction %void None %64
+         %81 = OpLabel
+         %82 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %82
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %61
-         %78 = OpLabel
-         %79 = OpFunctionCall %void %countLeadingZeros_208d46
+%fragment_main = OpFunction %void None %64
+         %85 = OpLabel
+         %86 = OpFunctionCall %void %countLeadingZeros_208d46
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %61
-         %81 = OpLabel
-         %82 = OpFunctionCall %void %countLeadingZeros_208d46
+%compute_main = OpFunction %void None %64
+         %88 = OpLabel
+         %89 = OpFunctionCall %void %countLeadingZeros_208d46
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.wgsl
index fe43b71e..1412f27 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/208d46.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countLeadingZeros_208d46() {
   var arg_0 = 1u;
   var res : u32 = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_208d46();
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl
index 865a629..476b1cd 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl
@@ -25,7 +25,9 @@
 fn countLeadingZeros_6d4656() {
   var arg_0 = 1i;
   var res: i32 = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.dxc.hlsl
index ddf54fb..5a54b56 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_6d4656() {
   int arg_0 = 1;
   int res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.fxc.hlsl
index ddf54fb..5a54b56 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_6d4656() {
   int arg_0 = 1;
   int res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.glsl b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.glsl
index 4e140af..8e82333 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countLeadingZeros_6d4656() {
   int arg_0 = 1;
   int res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countLeadingZeros_6d4656() {
   int arg_0 = 1;
   int res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countLeadingZeros_6d4656() {
   int arg_0 = 1;
   int res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.msl b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.msl
index 260714f..9d1b5da 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_6d4656() {
+void countLeadingZeros_6d4656(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int res = clz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_6d4656();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  countLeadingZeros_6d4656(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_6d4656();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_6d4656(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_6d4656();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_6d4656(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.spvasm
index 558ca73..75f63f0 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 87
+; Bound: 94
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_leading_zeros "tint_count_leading_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,10 +40,13 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
-          %9 = OpTypeFunction %int %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %int %int
        %uint = OpTypeInt 32 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
+         %21 = OpConstantNull %uint
  %uint_65535 = OpConstant %uint 65535
        %bool = OpTypeBool
     %uint_16 = OpConstant %uint 16
@@ -49,85 +59,90 @@
 %uint_2147483647 = OpConstant %uint 2147483647
      %uint_1 = OpConstant %uint 1
        %void = OpTypeVoid
-         %62 = OpTypeFunction %void
+         %65 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %69 = OpConstantNull %int
-         %73 = OpTypeFunction %v4float
+         %72 = OpConstantNull %int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %80 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_leading_zeros = OpFunction %int None %9
+%tint_count_leading_zeros = OpFunction %int None %13
           %v = OpFunctionParameter %int
-         %13 = OpLabel
-          %x = OpVariable %_ptr_Function_uint Function %18
-         %14 = OpBitcast %uint %v
-               OpStore %x %14
-         %20 = OpLoad %uint %x
-         %22 = OpULessThanEqual %bool %20 %uint_65535
-         %19 = OpSelect %uint %22 %uint_16 %18
-         %25 = OpLoad %uint %x
-         %26 = OpShiftLeftLogical %uint %25 %19
-               OpStore %x %26
+         %16 = OpLabel
+          %x = OpVariable %_ptr_Function_uint Function %21
+         %17 = OpBitcast %uint %v
+               OpStore %x %17
+         %23 = OpLoad %uint %x
+         %25 = OpULessThanEqual %bool %23 %uint_65535
+         %22 = OpSelect %uint %25 %uint_16 %21
          %28 = OpLoad %uint %x
-         %30 = OpULessThanEqual %bool %28 %uint_16777215
-         %27 = OpSelect %uint %30 %uint_8 %18
-         %32 = OpLoad %uint %x
-         %33 = OpShiftLeftLogical %uint %32 %27
-               OpStore %x %33
+         %29 = OpShiftLeftLogical %uint %28 %22
+               OpStore %x %29
+         %31 = OpLoad %uint %x
+         %33 = OpULessThanEqual %bool %31 %uint_16777215
+         %30 = OpSelect %uint %33 %uint_8 %21
          %35 = OpLoad %uint %x
-         %37 = OpULessThanEqual %bool %35 %uint_268435455
-         %34 = OpSelect %uint %37 %uint_4 %18
-         %39 = OpLoad %uint %x
-         %40 = OpShiftLeftLogical %uint %39 %34
-               OpStore %x %40
+         %36 = OpShiftLeftLogical %uint %35 %30
+               OpStore %x %36
+         %38 = OpLoad %uint %x
+         %40 = OpULessThanEqual %bool %38 %uint_268435455
+         %37 = OpSelect %uint %40 %uint_4 %21
          %42 = OpLoad %uint %x
-         %44 = OpULessThanEqual %bool %42 %uint_1073741823
-         %41 = OpSelect %uint %44 %uint_2 %18
-         %46 = OpLoad %uint %x
-         %47 = OpShiftLeftLogical %uint %46 %41
-               OpStore %x %47
+         %43 = OpShiftLeftLogical %uint %42 %37
+               OpStore %x %43
+         %45 = OpLoad %uint %x
+         %47 = OpULessThanEqual %bool %45 %uint_1073741823
+         %44 = OpSelect %uint %47 %uint_2 %21
          %49 = OpLoad %uint %x
-         %51 = OpULessThanEqual %bool %49 %uint_2147483647
-         %48 = OpSelect %uint %51 %uint_1 %18
-         %54 = OpLoad %uint %x
-         %55 = OpIEqual %bool %54 %18
-         %53 = OpSelect %uint %55 %uint_1 %18
-         %57 = OpBitwiseOr %uint %19 %27
-         %58 = OpBitwiseOr %uint %57 %34
-         %59 = OpBitwiseOr %uint %58 %41
-         %60 = OpBitwiseOr %uint %59 %48
-         %61 = OpIAdd %uint %60 %53
-         %56 = OpBitcast %int %61
-               OpReturnValue %56
+         %50 = OpShiftLeftLogical %uint %49 %44
+               OpStore %x %50
+         %52 = OpLoad %uint %x
+         %54 = OpULessThanEqual %bool %52 %uint_2147483647
+         %51 = OpSelect %uint %54 %uint_1 %21
+         %57 = OpLoad %uint %x
+         %58 = OpIEqual %bool %57 %21
+         %56 = OpSelect %uint %58 %uint_1 %21
+         %60 = OpBitwiseOr %uint %22 %30
+         %61 = OpBitwiseOr %uint %60 %37
+         %62 = OpBitwiseOr %uint %61 %44
+         %63 = OpBitwiseOr %uint %62 %51
+         %64 = OpIAdd %uint %63 %56
+         %59 = OpBitcast %int %64
+               OpReturnValue %59
                OpFunctionEnd
-%countLeadingZeros_6d4656 = OpFunction %void None %62
-         %65 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %69
-        %res = OpVariable %_ptr_Function_int Function %69
+%countLeadingZeros_6d4656 = OpFunction %void None %65
+         %68 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %72
+        %res = OpVariable %_ptr_Function_int Function %72
                OpStore %arg_0 %int_1
-         %71 = OpLoad %int %arg_0
-         %70 = OpFunctionCall %int %tint_count_leading_zeros %71
-               OpStore %res %70
+         %74 = OpLoad %int %arg_0
+         %73 = OpFunctionCall %int %tint_count_leading_zeros %74
+               OpStore %res %73
+         %78 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %79 = OpLoad %int %res
+               OpStore %78 %79
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %73
-         %75 = OpLabel
-         %76 = OpFunctionCall %void %countLeadingZeros_6d4656
+%vertex_main_inner = OpFunction %v4float None %80
+         %82 = OpLabel
+         %83 = OpFunctionCall %void %countLeadingZeros_6d4656
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %62
-         %78 = OpLabel
-         %79 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %79
+%vertex_main = OpFunction %void None %65
+         %85 = OpLabel
+         %86 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %86
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %62
-         %82 = OpLabel
-         %83 = OpFunctionCall %void %countLeadingZeros_6d4656
+%fragment_main = OpFunction %void None %65
+         %89 = OpLabel
+         %90 = OpFunctionCall %void %countLeadingZeros_6d4656
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %62
-         %85 = OpLabel
-         %86 = OpFunctionCall %void %countLeadingZeros_6d4656
+%compute_main = OpFunction %void None %65
+         %92 = OpLabel
+         %93 = OpFunctionCall %void %countLeadingZeros_6d4656
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.wgsl
index acc83c8..1dc19e8 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/6d4656.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countLeadingZeros_6d4656() {
   var arg_0 = 1i;
   var res : i32 = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_6d4656();
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl
index 3758296..f086d19 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl
@@ -25,7 +25,9 @@
 fn countLeadingZeros_70783f() {
   var arg_0 = vec2<u32>(1u);
   var res: vec2<u32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.dxc.hlsl
index d1fb0c6..b31cd4c 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_70783f() {
   uint2 arg_0 = (1u).xx;
   uint2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.fxc.hlsl
index d1fb0c6..b31cd4c 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_70783f() {
   uint2 arg_0 = (1u).xx;
   uint2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.glsl b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.glsl
index 22a8c45..bdf6581 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_70783f() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_70783f() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_70783f() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.msl b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.msl
index e79069a..9ed0cb5 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_70783f() {
+void countLeadingZeros_70783f(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 res = clz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_70783f();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  countLeadingZeros_70783f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_70783f();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_70783f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_70783f();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_70783f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.spvasm
index 869590d..6d03b3a 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 95
+; Bound: 102
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_leading_zeros "tint_count_leading_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,106 +41,114 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-          %9 = OpTypeFunction %v2uint %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2uint %v2uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %18 = OpConstantNull %v2uint
+         %21 = OpConstantNull %v2uint
  %uint_65535 = OpConstant %uint 65535
-         %22 = OpConstantComposite %v2uint %uint_65535 %uint_65535
+         %25 = OpConstantComposite %v2uint %uint_65535 %uint_65535
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
     %uint_16 = OpConstant %uint 16
-         %27 = OpConstantComposite %v2uint %uint_16 %uint_16
+         %30 = OpConstantComposite %v2uint %uint_16 %uint_16
 %uint_16777215 = OpConstant %uint 16777215
-         %33 = OpConstantComposite %v2uint %uint_16777215 %uint_16777215
+         %36 = OpConstantComposite %v2uint %uint_16777215 %uint_16777215
      %uint_8 = OpConstant %uint 8
-         %36 = OpConstantComposite %v2uint %uint_8 %uint_8
+         %39 = OpConstantComposite %v2uint %uint_8 %uint_8
 %uint_268435455 = OpConstant %uint 268435455
-         %42 = OpConstantComposite %v2uint %uint_268435455 %uint_268435455
+         %45 = OpConstantComposite %v2uint %uint_268435455 %uint_268435455
      %uint_4 = OpConstant %uint 4
-         %45 = OpConstantComposite %v2uint %uint_4 %uint_4
+         %48 = OpConstantComposite %v2uint %uint_4 %uint_4
 %uint_1073741823 = OpConstant %uint 1073741823
-         %51 = OpConstantComposite %v2uint %uint_1073741823 %uint_1073741823
+         %54 = OpConstantComposite %v2uint %uint_1073741823 %uint_1073741823
      %uint_2 = OpConstant %uint 2
-         %54 = OpConstantComposite %v2uint %uint_2 %uint_2
+         %57 = OpConstantComposite %v2uint %uint_2 %uint_2
 %uint_2147483647 = OpConstant %uint 2147483647
-         %60 = OpConstantComposite %v2uint %uint_2147483647 %uint_2147483647
+         %63 = OpConstantComposite %v2uint %uint_2147483647 %uint_2147483647
      %uint_1 = OpConstant %uint 1
-         %63 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %66 = OpConstantComposite %v2uint %uint_1 %uint_1
        %void = OpTypeVoid
-         %73 = OpTypeFunction %void
-         %81 = OpTypeFunction %v4float
+         %76 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %88 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_leading_zeros = OpFunction %v2uint None %9
+%tint_count_leading_zeros = OpFunction %v2uint None %14
           %v = OpFunctionParameter %v2uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v2uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v2uint Function %21
                OpStore %x %v
-         %20 = OpLoad %v2uint %x
-         %23 = OpULessThanEqual %v2bool %20 %22
-         %19 = OpSelect %v2uint %23 %27 %18
-         %28 = OpLoad %v2uint %x
-         %29 = OpShiftLeftLogical %v2uint %28 %19
-               OpStore %x %29
+         %23 = OpLoad %v2uint %x
+         %26 = OpULessThanEqual %v2bool %23 %25
+         %22 = OpSelect %v2uint %26 %30 %21
          %31 = OpLoad %v2uint %x
-         %34 = OpULessThanEqual %v2bool %31 %33
-         %30 = OpSelect %v2uint %34 %36 %18
-         %37 = OpLoad %v2uint %x
-         %38 = OpShiftLeftLogical %v2uint %37 %30
-               OpStore %x %38
+         %32 = OpShiftLeftLogical %v2uint %31 %22
+               OpStore %x %32
+         %34 = OpLoad %v2uint %x
+         %37 = OpULessThanEqual %v2bool %34 %36
+         %33 = OpSelect %v2uint %37 %39 %21
          %40 = OpLoad %v2uint %x
-         %43 = OpULessThanEqual %v2bool %40 %42
-         %39 = OpSelect %v2uint %43 %45 %18
-         %46 = OpLoad %v2uint %x
-         %47 = OpShiftLeftLogical %v2uint %46 %39
-               OpStore %x %47
+         %41 = OpShiftLeftLogical %v2uint %40 %33
+               OpStore %x %41
+         %43 = OpLoad %v2uint %x
+         %46 = OpULessThanEqual %v2bool %43 %45
+         %42 = OpSelect %v2uint %46 %48 %21
          %49 = OpLoad %v2uint %x
-         %52 = OpULessThanEqual %v2bool %49 %51
-         %48 = OpSelect %v2uint %52 %54 %18
-         %55 = OpLoad %v2uint %x
-         %56 = OpShiftLeftLogical %v2uint %55 %48
-               OpStore %x %56
+         %50 = OpShiftLeftLogical %v2uint %49 %42
+               OpStore %x %50
+         %52 = OpLoad %v2uint %x
+         %55 = OpULessThanEqual %v2bool %52 %54
+         %51 = OpSelect %v2uint %55 %57 %21
          %58 = OpLoad %v2uint %x
-         %61 = OpULessThanEqual %v2bool %58 %60
-         %57 = OpSelect %v2uint %61 %63 %18
-         %65 = OpLoad %v2uint %x
-         %66 = OpIEqual %v2bool %65 %18
-         %64 = OpSelect %v2uint %66 %63 %18
-         %68 = OpBitwiseOr %v2uint %19 %30
-         %69 = OpBitwiseOr %v2uint %68 %39
-         %70 = OpBitwiseOr %v2uint %69 %48
-         %71 = OpBitwiseOr %v2uint %70 %57
-         %72 = OpIAdd %v2uint %71 %64
-               OpReturnValue %72
+         %59 = OpShiftLeftLogical %v2uint %58 %51
+               OpStore %x %59
+         %61 = OpLoad %v2uint %x
+         %64 = OpULessThanEqual %v2bool %61 %63
+         %60 = OpSelect %v2uint %64 %66 %21
+         %68 = OpLoad %v2uint %x
+         %69 = OpIEqual %v2bool %68 %21
+         %67 = OpSelect %v2uint %69 %66 %21
+         %71 = OpBitwiseOr %v2uint %22 %33
+         %72 = OpBitwiseOr %v2uint %71 %42
+         %73 = OpBitwiseOr %v2uint %72 %51
+         %74 = OpBitwiseOr %v2uint %73 %60
+         %75 = OpIAdd %v2uint %74 %67
+               OpReturnValue %75
                OpFunctionEnd
-%countLeadingZeros_70783f = OpFunction %void None %73
-         %76 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %18
-        %res = OpVariable %_ptr_Function_v2uint Function %18
-               OpStore %arg_0 %63
-         %79 = OpLoad %v2uint %arg_0
-         %78 = OpFunctionCall %v2uint %tint_count_leading_zeros %79
-               OpStore %res %78
+%countLeadingZeros_70783f = OpFunction %void None %76
+         %79 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %21
+        %res = OpVariable %_ptr_Function_v2uint Function %21
+               OpStore %arg_0 %66
+         %82 = OpLoad %v2uint %arg_0
+         %81 = OpFunctionCall %v2uint %tint_count_leading_zeros %82
+               OpStore %res %81
+         %86 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %87 = OpLoad %v2uint %res
+               OpStore %86 %87
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %81
-         %83 = OpLabel
-         %84 = OpFunctionCall %void %countLeadingZeros_70783f
+%vertex_main_inner = OpFunction %v4float None %88
+         %90 = OpLabel
+         %91 = OpFunctionCall %void %countLeadingZeros_70783f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %73
-         %86 = OpLabel
-         %87 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %87
+%vertex_main = OpFunction %void None %76
+         %93 = OpLabel
+         %94 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %94
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %73
-         %90 = OpLabel
-         %91 = OpFunctionCall %void %countLeadingZeros_70783f
+%fragment_main = OpFunction %void None %76
+         %97 = OpLabel
+         %98 = OpFunctionCall %void %countLeadingZeros_70783f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %73
-         %93 = OpLabel
-         %94 = OpFunctionCall %void %countLeadingZeros_70783f
+%compute_main = OpFunction %void None %76
+        %100 = OpLabel
+        %101 = OpFunctionCall %void %countLeadingZeros_70783f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.wgsl
index 27e31b6..c999091 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/70783f.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countLeadingZeros_70783f() {
   var arg_0 = vec2<u32>(1u);
   var res : vec2<u32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_70783f();
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl
index 3368c4c..f5b2d00 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl
@@ -25,7 +25,9 @@
 fn countLeadingZeros_7c38a6() {
   var arg_0 = vec3<i32>(1i);
   var res: vec3<i32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.dxc.hlsl
index 07c2c53..1ca4694 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_7c38a6() {
   int3 arg_0 = (1).xxx;
   int3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.fxc.hlsl
index 07c2c53..1ca4694 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_7c38a6() {
   int3 arg_0 = (1).xxx;
   int3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.glsl b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.glsl
index bfef89e..a54c6d2 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_7c38a6() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_7c38a6() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_7c38a6() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.msl b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.msl
index 05f2c9c..9f8b5e8 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_7c38a6() {
+void countLeadingZeros_7c38a6(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 res = clz(arg_0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_7c38a6();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  countLeadingZeros_7c38a6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_7c38a6();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_7c38a6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_7c38a6();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_7c38a6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.spvasm
index fa15928..a16e6c9 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 101
+; Bound: 108
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_leading_zeros "tint_count_leading_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,114 +41,122 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-          %9 = OpTypeFunction %v3int %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3int %v3int
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %20 = OpConstantNull %v3uint
+         %23 = OpConstantNull %v3uint
  %uint_65535 = OpConstant %uint 65535
-         %24 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
+         %27 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
     %uint_16 = OpConstant %uint 16
-         %29 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
+         %32 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
 %uint_16777215 = OpConstant %uint 16777215
-         %35 = OpConstantComposite %v3uint %uint_16777215 %uint_16777215 %uint_16777215
+         %38 = OpConstantComposite %v3uint %uint_16777215 %uint_16777215 %uint_16777215
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
+         %41 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
 %uint_268435455 = OpConstant %uint 268435455
-         %44 = OpConstantComposite %v3uint %uint_268435455 %uint_268435455 %uint_268435455
+         %47 = OpConstantComposite %v3uint %uint_268435455 %uint_268435455 %uint_268435455
      %uint_4 = OpConstant %uint 4
-         %47 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
+         %50 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
 %uint_1073741823 = OpConstant %uint 1073741823
-         %53 = OpConstantComposite %v3uint %uint_1073741823 %uint_1073741823 %uint_1073741823
+         %56 = OpConstantComposite %v3uint %uint_1073741823 %uint_1073741823 %uint_1073741823
      %uint_2 = OpConstant %uint 2
-         %56 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
+         %59 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
 %uint_2147483647 = OpConstant %uint 2147483647
-         %62 = OpConstantComposite %v3uint %uint_2147483647 %uint_2147483647 %uint_2147483647
+         %65 = OpConstantComposite %v3uint %uint_2147483647 %uint_2147483647 %uint_2147483647
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %68 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
        %void = OpTypeVoid
-         %75 = OpTypeFunction %void
+         %78 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %80 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %83 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %83 = OpConstantNull %v3int
-         %87 = OpTypeFunction %v4float
+         %86 = OpConstantNull %v3int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %94 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_leading_zeros = OpFunction %v3int None %9
+%tint_count_leading_zeros = OpFunction %v3int None %14
           %v = OpFunctionParameter %v3int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v3uint Function %20
-         %15 = OpBitcast %v3uint %v
-               OpStore %x %15
-         %22 = OpLoad %v3uint %x
-         %25 = OpULessThanEqual %v3bool %22 %24
-         %21 = OpSelect %v3uint %25 %29 %20
-         %30 = OpLoad %v3uint %x
-         %31 = OpShiftLeftLogical %v3uint %30 %21
-               OpStore %x %31
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v3uint Function %23
+         %18 = OpBitcast %v3uint %v
+               OpStore %x %18
+         %25 = OpLoad %v3uint %x
+         %28 = OpULessThanEqual %v3bool %25 %27
+         %24 = OpSelect %v3uint %28 %32 %23
          %33 = OpLoad %v3uint %x
-         %36 = OpULessThanEqual %v3bool %33 %35
-         %32 = OpSelect %v3uint %36 %38 %20
-         %39 = OpLoad %v3uint %x
-         %40 = OpShiftLeftLogical %v3uint %39 %32
-               OpStore %x %40
+         %34 = OpShiftLeftLogical %v3uint %33 %24
+               OpStore %x %34
+         %36 = OpLoad %v3uint %x
+         %39 = OpULessThanEqual %v3bool %36 %38
+         %35 = OpSelect %v3uint %39 %41 %23
          %42 = OpLoad %v3uint %x
-         %45 = OpULessThanEqual %v3bool %42 %44
-         %41 = OpSelect %v3uint %45 %47 %20
-         %48 = OpLoad %v3uint %x
-         %49 = OpShiftLeftLogical %v3uint %48 %41
-               OpStore %x %49
+         %43 = OpShiftLeftLogical %v3uint %42 %35
+               OpStore %x %43
+         %45 = OpLoad %v3uint %x
+         %48 = OpULessThanEqual %v3bool %45 %47
+         %44 = OpSelect %v3uint %48 %50 %23
          %51 = OpLoad %v3uint %x
-         %54 = OpULessThanEqual %v3bool %51 %53
-         %50 = OpSelect %v3uint %54 %56 %20
-         %57 = OpLoad %v3uint %x
-         %58 = OpShiftLeftLogical %v3uint %57 %50
-               OpStore %x %58
+         %52 = OpShiftLeftLogical %v3uint %51 %44
+               OpStore %x %52
+         %54 = OpLoad %v3uint %x
+         %57 = OpULessThanEqual %v3bool %54 %56
+         %53 = OpSelect %v3uint %57 %59 %23
          %60 = OpLoad %v3uint %x
-         %63 = OpULessThanEqual %v3bool %60 %62
-         %59 = OpSelect %v3uint %63 %65 %20
-         %67 = OpLoad %v3uint %x
-         %68 = OpIEqual %v3bool %67 %20
-         %66 = OpSelect %v3uint %68 %65 %20
-         %70 = OpBitwiseOr %v3uint %21 %32
-         %71 = OpBitwiseOr %v3uint %70 %41
-         %72 = OpBitwiseOr %v3uint %71 %50
-         %73 = OpBitwiseOr %v3uint %72 %59
-         %74 = OpIAdd %v3uint %73 %66
-         %69 = OpBitcast %v3int %74
-               OpReturnValue %69
+         %61 = OpShiftLeftLogical %v3uint %60 %53
+               OpStore %x %61
+         %63 = OpLoad %v3uint %x
+         %66 = OpULessThanEqual %v3bool %63 %65
+         %62 = OpSelect %v3uint %66 %68 %23
+         %70 = OpLoad %v3uint %x
+         %71 = OpIEqual %v3bool %70 %23
+         %69 = OpSelect %v3uint %71 %68 %23
+         %73 = OpBitwiseOr %v3uint %24 %35
+         %74 = OpBitwiseOr %v3uint %73 %44
+         %75 = OpBitwiseOr %v3uint %74 %53
+         %76 = OpBitwiseOr %v3uint %75 %62
+         %77 = OpIAdd %v3uint %76 %69
+         %72 = OpBitcast %v3int %77
+               OpReturnValue %72
                OpFunctionEnd
-%countLeadingZeros_7c38a6 = OpFunction %void None %75
-         %78 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %83
-        %res = OpVariable %_ptr_Function_v3int Function %83
-               OpStore %arg_0 %80
-         %85 = OpLoad %v3int %arg_0
-         %84 = OpFunctionCall %v3int %tint_count_leading_zeros %85
-               OpStore %res %84
+%countLeadingZeros_7c38a6 = OpFunction %void None %78
+         %81 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %86
+        %res = OpVariable %_ptr_Function_v3int Function %86
+               OpStore %arg_0 %83
+         %88 = OpLoad %v3int %arg_0
+         %87 = OpFunctionCall %v3int %tint_count_leading_zeros %88
+               OpStore %res %87
+         %92 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %93 = OpLoad %v3int %res
+               OpStore %92 %93
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %87
-         %89 = OpLabel
-         %90 = OpFunctionCall %void %countLeadingZeros_7c38a6
+%vertex_main_inner = OpFunction %v4float None %94
+         %96 = OpLabel
+         %97 = OpFunctionCall %void %countLeadingZeros_7c38a6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %75
-         %92 = OpLabel
-         %93 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %93
+%vertex_main = OpFunction %void None %78
+         %99 = OpLabel
+        %100 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %100
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %75
-         %96 = OpLabel
-         %97 = OpFunctionCall %void %countLeadingZeros_7c38a6
+%fragment_main = OpFunction %void None %78
+        %103 = OpLabel
+        %104 = OpFunctionCall %void %countLeadingZeros_7c38a6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %75
-         %99 = OpLabel
-        %100 = OpFunctionCall %void %countLeadingZeros_7c38a6
+%compute_main = OpFunction %void None %78
+        %106 = OpLabel
+        %107 = OpFunctionCall %void %countLeadingZeros_7c38a6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.wgsl
index 7e394c2..583dcc8 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/7c38a6.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countLeadingZeros_7c38a6() {
   var arg_0 = vec3<i32>(1i);
   var res : vec3<i32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_7c38a6();
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl
index d55a634..2efd42f 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl
@@ -25,7 +25,9 @@
 fn countLeadingZeros_858d40() {
   var arg_0 = vec2<i32>(1i);
   var res: vec2<i32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.dxc.hlsl
index d7b466f..54d9234 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_858d40() {
   int2 arg_0 = (1).xx;
   int2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.fxc.hlsl
index d7b466f..54d9234 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_858d40() {
   int2 arg_0 = (1).xx;
   int2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.glsl b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.glsl
index 5608edd..3d418d3 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_858d40() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_858d40() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countLeadingZeros_858d40() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.msl b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.msl
index cb4b096..577b9aa 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_858d40() {
+void countLeadingZeros_858d40(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 res = clz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_858d40();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  countLeadingZeros_858d40(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_858d40();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_858d40(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_858d40();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_858d40(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.spvasm
index f09f222..a0b0000 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 101
+; Bound: 108
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_leading_zeros "tint_count_leading_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,114 +41,122 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-          %9 = OpTypeFunction %v2int %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2int %v2int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %20 = OpConstantNull %v2uint
+         %23 = OpConstantNull %v2uint
  %uint_65535 = OpConstant %uint 65535
-         %24 = OpConstantComposite %v2uint %uint_65535 %uint_65535
+         %27 = OpConstantComposite %v2uint %uint_65535 %uint_65535
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
     %uint_16 = OpConstant %uint 16
-         %29 = OpConstantComposite %v2uint %uint_16 %uint_16
+         %32 = OpConstantComposite %v2uint %uint_16 %uint_16
 %uint_16777215 = OpConstant %uint 16777215
-         %35 = OpConstantComposite %v2uint %uint_16777215 %uint_16777215
+         %38 = OpConstantComposite %v2uint %uint_16777215 %uint_16777215
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v2uint %uint_8 %uint_8
+         %41 = OpConstantComposite %v2uint %uint_8 %uint_8
 %uint_268435455 = OpConstant %uint 268435455
-         %44 = OpConstantComposite %v2uint %uint_268435455 %uint_268435455
+         %47 = OpConstantComposite %v2uint %uint_268435455 %uint_268435455
      %uint_4 = OpConstant %uint 4
-         %47 = OpConstantComposite %v2uint %uint_4 %uint_4
+         %50 = OpConstantComposite %v2uint %uint_4 %uint_4
 %uint_1073741823 = OpConstant %uint 1073741823
-         %53 = OpConstantComposite %v2uint %uint_1073741823 %uint_1073741823
+         %56 = OpConstantComposite %v2uint %uint_1073741823 %uint_1073741823
      %uint_2 = OpConstant %uint 2
-         %56 = OpConstantComposite %v2uint %uint_2 %uint_2
+         %59 = OpConstantComposite %v2uint %uint_2 %uint_2
 %uint_2147483647 = OpConstant %uint 2147483647
-         %62 = OpConstantComposite %v2uint %uint_2147483647 %uint_2147483647
+         %65 = OpConstantComposite %v2uint %uint_2147483647 %uint_2147483647
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %68 = OpConstantComposite %v2uint %uint_1 %uint_1
        %void = OpTypeVoid
-         %75 = OpTypeFunction %void
+         %78 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %80 = OpConstantComposite %v2int %int_1 %int_1
+         %83 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %83 = OpConstantNull %v2int
-         %87 = OpTypeFunction %v4float
+         %86 = OpConstantNull %v2int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %94 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_leading_zeros = OpFunction %v2int None %9
+%tint_count_leading_zeros = OpFunction %v2int None %14
           %v = OpFunctionParameter %v2int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v2uint Function %20
-         %15 = OpBitcast %v2uint %v
-               OpStore %x %15
-         %22 = OpLoad %v2uint %x
-         %25 = OpULessThanEqual %v2bool %22 %24
-         %21 = OpSelect %v2uint %25 %29 %20
-         %30 = OpLoad %v2uint %x
-         %31 = OpShiftLeftLogical %v2uint %30 %21
-               OpStore %x %31
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v2uint Function %23
+         %18 = OpBitcast %v2uint %v
+               OpStore %x %18
+         %25 = OpLoad %v2uint %x
+         %28 = OpULessThanEqual %v2bool %25 %27
+         %24 = OpSelect %v2uint %28 %32 %23
          %33 = OpLoad %v2uint %x
-         %36 = OpULessThanEqual %v2bool %33 %35
-         %32 = OpSelect %v2uint %36 %38 %20
-         %39 = OpLoad %v2uint %x
-         %40 = OpShiftLeftLogical %v2uint %39 %32
-               OpStore %x %40
+         %34 = OpShiftLeftLogical %v2uint %33 %24
+               OpStore %x %34
+         %36 = OpLoad %v2uint %x
+         %39 = OpULessThanEqual %v2bool %36 %38
+         %35 = OpSelect %v2uint %39 %41 %23
          %42 = OpLoad %v2uint %x
-         %45 = OpULessThanEqual %v2bool %42 %44
-         %41 = OpSelect %v2uint %45 %47 %20
-         %48 = OpLoad %v2uint %x
-         %49 = OpShiftLeftLogical %v2uint %48 %41
-               OpStore %x %49
+         %43 = OpShiftLeftLogical %v2uint %42 %35
+               OpStore %x %43
+         %45 = OpLoad %v2uint %x
+         %48 = OpULessThanEqual %v2bool %45 %47
+         %44 = OpSelect %v2uint %48 %50 %23
          %51 = OpLoad %v2uint %x
-         %54 = OpULessThanEqual %v2bool %51 %53
-         %50 = OpSelect %v2uint %54 %56 %20
-         %57 = OpLoad %v2uint %x
-         %58 = OpShiftLeftLogical %v2uint %57 %50
-               OpStore %x %58
+         %52 = OpShiftLeftLogical %v2uint %51 %44
+               OpStore %x %52
+         %54 = OpLoad %v2uint %x
+         %57 = OpULessThanEqual %v2bool %54 %56
+         %53 = OpSelect %v2uint %57 %59 %23
          %60 = OpLoad %v2uint %x
-         %63 = OpULessThanEqual %v2bool %60 %62
-         %59 = OpSelect %v2uint %63 %65 %20
-         %67 = OpLoad %v2uint %x
-         %68 = OpIEqual %v2bool %67 %20
-         %66 = OpSelect %v2uint %68 %65 %20
-         %70 = OpBitwiseOr %v2uint %21 %32
-         %71 = OpBitwiseOr %v2uint %70 %41
-         %72 = OpBitwiseOr %v2uint %71 %50
-         %73 = OpBitwiseOr %v2uint %72 %59
-         %74 = OpIAdd %v2uint %73 %66
-         %69 = OpBitcast %v2int %74
-               OpReturnValue %69
+         %61 = OpShiftLeftLogical %v2uint %60 %53
+               OpStore %x %61
+         %63 = OpLoad %v2uint %x
+         %66 = OpULessThanEqual %v2bool %63 %65
+         %62 = OpSelect %v2uint %66 %68 %23
+         %70 = OpLoad %v2uint %x
+         %71 = OpIEqual %v2bool %70 %23
+         %69 = OpSelect %v2uint %71 %68 %23
+         %73 = OpBitwiseOr %v2uint %24 %35
+         %74 = OpBitwiseOr %v2uint %73 %44
+         %75 = OpBitwiseOr %v2uint %74 %53
+         %76 = OpBitwiseOr %v2uint %75 %62
+         %77 = OpIAdd %v2uint %76 %69
+         %72 = OpBitcast %v2int %77
+               OpReturnValue %72
                OpFunctionEnd
-%countLeadingZeros_858d40 = OpFunction %void None %75
-         %78 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %83
-        %res = OpVariable %_ptr_Function_v2int Function %83
-               OpStore %arg_0 %80
-         %85 = OpLoad %v2int %arg_0
-         %84 = OpFunctionCall %v2int %tint_count_leading_zeros %85
-               OpStore %res %84
+%countLeadingZeros_858d40 = OpFunction %void None %78
+         %81 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %86
+        %res = OpVariable %_ptr_Function_v2int Function %86
+               OpStore %arg_0 %83
+         %88 = OpLoad %v2int %arg_0
+         %87 = OpFunctionCall %v2int %tint_count_leading_zeros %88
+               OpStore %res %87
+         %92 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %93 = OpLoad %v2int %res
+               OpStore %92 %93
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %87
-         %89 = OpLabel
-         %90 = OpFunctionCall %void %countLeadingZeros_858d40
+%vertex_main_inner = OpFunction %v4float None %94
+         %96 = OpLabel
+         %97 = OpFunctionCall %void %countLeadingZeros_858d40
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %75
-         %92 = OpLabel
-         %93 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %93
+%vertex_main = OpFunction %void None %78
+         %99 = OpLabel
+        %100 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %100
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %75
-         %96 = OpLabel
-         %97 = OpFunctionCall %void %countLeadingZeros_858d40
+%fragment_main = OpFunction %void None %78
+        %103 = OpLabel
+        %104 = OpFunctionCall %void %countLeadingZeros_858d40
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %75
-         %99 = OpLabel
-        %100 = OpFunctionCall %void %countLeadingZeros_858d40
+%compute_main = OpFunction %void None %78
+        %106 = OpLabel
+        %107 = OpFunctionCall %void %countLeadingZeros_858d40
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.wgsl
index a4f4103..bb54a80 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/858d40.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countLeadingZeros_858d40() {
   var arg_0 = vec2<i32>(1i);
   var res : vec2<i32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_858d40();
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl
index 1a5300a..e11b9ec 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl
@@ -25,7 +25,9 @@
 fn countLeadingZeros_ab6345() {
   var arg_0 = vec3<u32>(1u);
   var res: vec3<u32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.dxc.hlsl
index 2ca1c78..e4ded49 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_ab6345() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.fxc.hlsl
index 2ca1c78..e4ded49 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_ab6345() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.glsl b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.glsl
index 5da2eb6..9bb06c3 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_ab6345() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_ab6345() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countLeadingZeros_ab6345() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.msl b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.msl
index 080bc73..eced417 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_ab6345() {
+void countLeadingZeros_ab6345(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 res = clz(arg_0);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_ab6345();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  countLeadingZeros_ab6345(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_ab6345();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_ab6345(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_ab6345();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_ab6345(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.spvasm
index e152518..dd6b350 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 95
+; Bound: 102
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_leading_zeros "tint_count_leading_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,106 +41,114 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-          %9 = OpTypeFunction %v3uint %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3uint %v3uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %18 = OpConstantNull %v3uint
+         %21 = OpConstantNull %v3uint
  %uint_65535 = OpConstant %uint 65535
-         %22 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
+         %25 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
     %uint_16 = OpConstant %uint 16
-         %27 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
+         %30 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
 %uint_16777215 = OpConstant %uint 16777215
-         %33 = OpConstantComposite %v3uint %uint_16777215 %uint_16777215 %uint_16777215
+         %36 = OpConstantComposite %v3uint %uint_16777215 %uint_16777215 %uint_16777215
      %uint_8 = OpConstant %uint 8
-         %36 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
+         %39 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
 %uint_268435455 = OpConstant %uint 268435455
-         %42 = OpConstantComposite %v3uint %uint_268435455 %uint_268435455 %uint_268435455
+         %45 = OpConstantComposite %v3uint %uint_268435455 %uint_268435455 %uint_268435455
      %uint_4 = OpConstant %uint 4
-         %45 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
+         %48 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
 %uint_1073741823 = OpConstant %uint 1073741823
-         %51 = OpConstantComposite %v3uint %uint_1073741823 %uint_1073741823 %uint_1073741823
+         %54 = OpConstantComposite %v3uint %uint_1073741823 %uint_1073741823 %uint_1073741823
      %uint_2 = OpConstant %uint 2
-         %54 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
+         %57 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
 %uint_2147483647 = OpConstant %uint 2147483647
-         %60 = OpConstantComposite %v3uint %uint_2147483647 %uint_2147483647 %uint_2147483647
+         %63 = OpConstantComposite %v3uint %uint_2147483647 %uint_2147483647 %uint_2147483647
      %uint_1 = OpConstant %uint 1
-         %63 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %66 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
        %void = OpTypeVoid
-         %73 = OpTypeFunction %void
-         %81 = OpTypeFunction %v4float
+         %76 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %88 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_leading_zeros = OpFunction %v3uint None %9
+%tint_count_leading_zeros = OpFunction %v3uint None %14
           %v = OpFunctionParameter %v3uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v3uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v3uint Function %21
                OpStore %x %v
-         %20 = OpLoad %v3uint %x
-         %23 = OpULessThanEqual %v3bool %20 %22
-         %19 = OpSelect %v3uint %23 %27 %18
-         %28 = OpLoad %v3uint %x
-         %29 = OpShiftLeftLogical %v3uint %28 %19
-               OpStore %x %29
+         %23 = OpLoad %v3uint %x
+         %26 = OpULessThanEqual %v3bool %23 %25
+         %22 = OpSelect %v3uint %26 %30 %21
          %31 = OpLoad %v3uint %x
-         %34 = OpULessThanEqual %v3bool %31 %33
-         %30 = OpSelect %v3uint %34 %36 %18
-         %37 = OpLoad %v3uint %x
-         %38 = OpShiftLeftLogical %v3uint %37 %30
-               OpStore %x %38
+         %32 = OpShiftLeftLogical %v3uint %31 %22
+               OpStore %x %32
+         %34 = OpLoad %v3uint %x
+         %37 = OpULessThanEqual %v3bool %34 %36
+         %33 = OpSelect %v3uint %37 %39 %21
          %40 = OpLoad %v3uint %x
-         %43 = OpULessThanEqual %v3bool %40 %42
-         %39 = OpSelect %v3uint %43 %45 %18
-         %46 = OpLoad %v3uint %x
-         %47 = OpShiftLeftLogical %v3uint %46 %39
-               OpStore %x %47
+         %41 = OpShiftLeftLogical %v3uint %40 %33
+               OpStore %x %41
+         %43 = OpLoad %v3uint %x
+         %46 = OpULessThanEqual %v3bool %43 %45
+         %42 = OpSelect %v3uint %46 %48 %21
          %49 = OpLoad %v3uint %x
-         %52 = OpULessThanEqual %v3bool %49 %51
-         %48 = OpSelect %v3uint %52 %54 %18
-         %55 = OpLoad %v3uint %x
-         %56 = OpShiftLeftLogical %v3uint %55 %48
-               OpStore %x %56
+         %50 = OpShiftLeftLogical %v3uint %49 %42
+               OpStore %x %50
+         %52 = OpLoad %v3uint %x
+         %55 = OpULessThanEqual %v3bool %52 %54
+         %51 = OpSelect %v3uint %55 %57 %21
          %58 = OpLoad %v3uint %x
-         %61 = OpULessThanEqual %v3bool %58 %60
-         %57 = OpSelect %v3uint %61 %63 %18
-         %65 = OpLoad %v3uint %x
-         %66 = OpIEqual %v3bool %65 %18
-         %64 = OpSelect %v3uint %66 %63 %18
-         %68 = OpBitwiseOr %v3uint %19 %30
-         %69 = OpBitwiseOr %v3uint %68 %39
-         %70 = OpBitwiseOr %v3uint %69 %48
-         %71 = OpBitwiseOr %v3uint %70 %57
-         %72 = OpIAdd %v3uint %71 %64
-               OpReturnValue %72
+         %59 = OpShiftLeftLogical %v3uint %58 %51
+               OpStore %x %59
+         %61 = OpLoad %v3uint %x
+         %64 = OpULessThanEqual %v3bool %61 %63
+         %60 = OpSelect %v3uint %64 %66 %21
+         %68 = OpLoad %v3uint %x
+         %69 = OpIEqual %v3bool %68 %21
+         %67 = OpSelect %v3uint %69 %66 %21
+         %71 = OpBitwiseOr %v3uint %22 %33
+         %72 = OpBitwiseOr %v3uint %71 %42
+         %73 = OpBitwiseOr %v3uint %72 %51
+         %74 = OpBitwiseOr %v3uint %73 %60
+         %75 = OpIAdd %v3uint %74 %67
+               OpReturnValue %75
                OpFunctionEnd
-%countLeadingZeros_ab6345 = OpFunction %void None %73
-         %76 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %18
-        %res = OpVariable %_ptr_Function_v3uint Function %18
-               OpStore %arg_0 %63
-         %79 = OpLoad %v3uint %arg_0
-         %78 = OpFunctionCall %v3uint %tint_count_leading_zeros %79
-               OpStore %res %78
+%countLeadingZeros_ab6345 = OpFunction %void None %76
+         %79 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %21
+        %res = OpVariable %_ptr_Function_v3uint Function %21
+               OpStore %arg_0 %66
+         %82 = OpLoad %v3uint %arg_0
+         %81 = OpFunctionCall %v3uint %tint_count_leading_zeros %82
+               OpStore %res %81
+         %86 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %87 = OpLoad %v3uint %res
+               OpStore %86 %87
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %81
-         %83 = OpLabel
-         %84 = OpFunctionCall %void %countLeadingZeros_ab6345
+%vertex_main_inner = OpFunction %v4float None %88
+         %90 = OpLabel
+         %91 = OpFunctionCall %void %countLeadingZeros_ab6345
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %73
-         %86 = OpLabel
-         %87 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %87
+%vertex_main = OpFunction %void None %76
+         %93 = OpLabel
+         %94 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %94
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %73
-         %90 = OpLabel
-         %91 = OpFunctionCall %void %countLeadingZeros_ab6345
+%fragment_main = OpFunction %void None %76
+         %97 = OpLabel
+         %98 = OpFunctionCall %void %countLeadingZeros_ab6345
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %73
-         %93 = OpLabel
-         %94 = OpFunctionCall %void %countLeadingZeros_ab6345
+%compute_main = OpFunction %void None %76
+        %100 = OpLabel
+        %101 = OpFunctionCall %void %countLeadingZeros_ab6345
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.wgsl
index abf1355..4a9a1c9 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/ab6345.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countLeadingZeros_ab6345() {
   var arg_0 = vec3<u32>(1u);
   var res : vec3<u32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_ab6345();
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl
index a8b360c..985bc36 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl
@@ -25,7 +25,9 @@
 fn countLeadingZeros_eab32b() {
   var arg_0 = vec4<i32>(1i);
   var res: vec4<i32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.dxc.hlsl
index 945fbe2..9db4414 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_eab32b() {
   int4 arg_0 = (1).xxxx;
   int4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.fxc.hlsl
index 945fbe2..9db4414 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_eab32b() {
   int4 arg_0 = (1).xxxx;
   int4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.glsl b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.glsl
index 32c3d54..346e9bb 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_eab32b() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_eab32b() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_eab32b() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.msl b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.msl
index dc41bfe..d8f08b0 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_eab32b() {
+void countLeadingZeros_eab32b(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 res = clz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_eab32b();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  countLeadingZeros_eab32b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_eab32b();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_eab32b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_eab32b();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_eab32b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.spvasm
index da49ea1..c1bd613 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 101
+; Bound: 108
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_leading_zeros "tint_count_leading_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,114 +41,122 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-          %9 = OpTypeFunction %v4int %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4int %v4int
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %20 = OpConstantNull %v4uint
+         %23 = OpConstantNull %v4uint
  %uint_65535 = OpConstant %uint 65535
-         %24 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
+         %27 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
     %uint_16 = OpConstant %uint 16
-         %29 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
+         %32 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
 %uint_16777215 = OpConstant %uint 16777215
-         %35 = OpConstantComposite %v4uint %uint_16777215 %uint_16777215 %uint_16777215 %uint_16777215
+         %38 = OpConstantComposite %v4uint %uint_16777215 %uint_16777215 %uint_16777215 %uint_16777215
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
+         %41 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
 %uint_268435455 = OpConstant %uint 268435455
-         %44 = OpConstantComposite %v4uint %uint_268435455 %uint_268435455 %uint_268435455 %uint_268435455
+         %47 = OpConstantComposite %v4uint %uint_268435455 %uint_268435455 %uint_268435455 %uint_268435455
      %uint_4 = OpConstant %uint 4
-         %47 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
+         %50 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
 %uint_1073741823 = OpConstant %uint 1073741823
-         %53 = OpConstantComposite %v4uint %uint_1073741823 %uint_1073741823 %uint_1073741823 %uint_1073741823
+         %56 = OpConstantComposite %v4uint %uint_1073741823 %uint_1073741823 %uint_1073741823 %uint_1073741823
      %uint_2 = OpConstant %uint 2
-         %56 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
+         %59 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
 %uint_2147483647 = OpConstant %uint 2147483647
-         %62 = OpConstantComposite %v4uint %uint_2147483647 %uint_2147483647 %uint_2147483647 %uint_2147483647
+         %65 = OpConstantComposite %v4uint %uint_2147483647 %uint_2147483647 %uint_2147483647 %uint_2147483647
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %68 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
        %void = OpTypeVoid
-         %75 = OpTypeFunction %void
+         %78 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %80 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %83 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %83 = OpConstantNull %v4int
-         %87 = OpTypeFunction %v4float
+         %86 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %94 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_leading_zeros = OpFunction %v4int None %9
+%tint_count_leading_zeros = OpFunction %v4int None %14
           %v = OpFunctionParameter %v4int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v4uint Function %20
-         %15 = OpBitcast %v4uint %v
-               OpStore %x %15
-         %22 = OpLoad %v4uint %x
-         %25 = OpULessThanEqual %v4bool %22 %24
-         %21 = OpSelect %v4uint %25 %29 %20
-         %30 = OpLoad %v4uint %x
-         %31 = OpShiftLeftLogical %v4uint %30 %21
-               OpStore %x %31
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v4uint Function %23
+         %18 = OpBitcast %v4uint %v
+               OpStore %x %18
+         %25 = OpLoad %v4uint %x
+         %28 = OpULessThanEqual %v4bool %25 %27
+         %24 = OpSelect %v4uint %28 %32 %23
          %33 = OpLoad %v4uint %x
-         %36 = OpULessThanEqual %v4bool %33 %35
-         %32 = OpSelect %v4uint %36 %38 %20
-         %39 = OpLoad %v4uint %x
-         %40 = OpShiftLeftLogical %v4uint %39 %32
-               OpStore %x %40
+         %34 = OpShiftLeftLogical %v4uint %33 %24
+               OpStore %x %34
+         %36 = OpLoad %v4uint %x
+         %39 = OpULessThanEqual %v4bool %36 %38
+         %35 = OpSelect %v4uint %39 %41 %23
          %42 = OpLoad %v4uint %x
-         %45 = OpULessThanEqual %v4bool %42 %44
-         %41 = OpSelect %v4uint %45 %47 %20
-         %48 = OpLoad %v4uint %x
-         %49 = OpShiftLeftLogical %v4uint %48 %41
-               OpStore %x %49
+         %43 = OpShiftLeftLogical %v4uint %42 %35
+               OpStore %x %43
+         %45 = OpLoad %v4uint %x
+         %48 = OpULessThanEqual %v4bool %45 %47
+         %44 = OpSelect %v4uint %48 %50 %23
          %51 = OpLoad %v4uint %x
-         %54 = OpULessThanEqual %v4bool %51 %53
-         %50 = OpSelect %v4uint %54 %56 %20
-         %57 = OpLoad %v4uint %x
-         %58 = OpShiftLeftLogical %v4uint %57 %50
-               OpStore %x %58
+         %52 = OpShiftLeftLogical %v4uint %51 %44
+               OpStore %x %52
+         %54 = OpLoad %v4uint %x
+         %57 = OpULessThanEqual %v4bool %54 %56
+         %53 = OpSelect %v4uint %57 %59 %23
          %60 = OpLoad %v4uint %x
-         %63 = OpULessThanEqual %v4bool %60 %62
-         %59 = OpSelect %v4uint %63 %65 %20
-         %67 = OpLoad %v4uint %x
-         %68 = OpIEqual %v4bool %67 %20
-         %66 = OpSelect %v4uint %68 %65 %20
-         %70 = OpBitwiseOr %v4uint %21 %32
-         %71 = OpBitwiseOr %v4uint %70 %41
-         %72 = OpBitwiseOr %v4uint %71 %50
-         %73 = OpBitwiseOr %v4uint %72 %59
-         %74 = OpIAdd %v4uint %73 %66
-         %69 = OpBitcast %v4int %74
-               OpReturnValue %69
+         %61 = OpShiftLeftLogical %v4uint %60 %53
+               OpStore %x %61
+         %63 = OpLoad %v4uint %x
+         %66 = OpULessThanEqual %v4bool %63 %65
+         %62 = OpSelect %v4uint %66 %68 %23
+         %70 = OpLoad %v4uint %x
+         %71 = OpIEqual %v4bool %70 %23
+         %69 = OpSelect %v4uint %71 %68 %23
+         %73 = OpBitwiseOr %v4uint %24 %35
+         %74 = OpBitwiseOr %v4uint %73 %44
+         %75 = OpBitwiseOr %v4uint %74 %53
+         %76 = OpBitwiseOr %v4uint %75 %62
+         %77 = OpIAdd %v4uint %76 %69
+         %72 = OpBitcast %v4int %77
+               OpReturnValue %72
                OpFunctionEnd
-%countLeadingZeros_eab32b = OpFunction %void None %75
-         %78 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %83
-        %res = OpVariable %_ptr_Function_v4int Function %83
-               OpStore %arg_0 %80
-         %85 = OpLoad %v4int %arg_0
-         %84 = OpFunctionCall %v4int %tint_count_leading_zeros %85
-               OpStore %res %84
+%countLeadingZeros_eab32b = OpFunction %void None %78
+         %81 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %86
+        %res = OpVariable %_ptr_Function_v4int Function %86
+               OpStore %arg_0 %83
+         %88 = OpLoad %v4int %arg_0
+         %87 = OpFunctionCall %v4int %tint_count_leading_zeros %88
+               OpStore %res %87
+         %92 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %93 = OpLoad %v4int %res
+               OpStore %92 %93
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %87
-         %89 = OpLabel
-         %90 = OpFunctionCall %void %countLeadingZeros_eab32b
+%vertex_main_inner = OpFunction %v4float None %94
+         %96 = OpLabel
+         %97 = OpFunctionCall %void %countLeadingZeros_eab32b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %75
-         %92 = OpLabel
-         %93 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %93
+%vertex_main = OpFunction %void None %78
+         %99 = OpLabel
+        %100 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %100
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %75
-         %96 = OpLabel
-         %97 = OpFunctionCall %void %countLeadingZeros_eab32b
+%fragment_main = OpFunction %void None %78
+        %103 = OpLabel
+        %104 = OpFunctionCall %void %countLeadingZeros_eab32b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %75
-         %99 = OpLabel
-        %100 = OpFunctionCall %void %countLeadingZeros_eab32b
+%compute_main = OpFunction %void None %78
+        %106 = OpLabel
+        %107 = OpFunctionCall %void %countLeadingZeros_eab32b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.wgsl
index 9f507c7..c42e040 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/eab32b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countLeadingZeros_eab32b() {
   var arg_0 = vec4<i32>(1i);
   var res : vec4<i32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_eab32b();
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl
index adbc4fb..e413b77 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl
@@ -25,7 +25,9 @@
 fn countLeadingZeros_f70103() {
   var arg_0 = vec4<u32>(1u);
   var res: vec4<u32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.dxc.hlsl
index d5f3876..d79eb65 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_f70103() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.fxc.hlsl
index d5f3876..d79eb65 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countLeadingZeros_f70103() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.glsl b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.glsl
index 472ba32..2ba9bb6 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_f70103() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_f70103() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countLeadingZeros_f70103() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_count_leading_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.msl b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.msl
index 2f462c8..5331ba3 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countLeadingZeros_f70103() {
+void countLeadingZeros_f70103(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 res = clz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countLeadingZeros_f70103();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  countLeadingZeros_f70103(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countLeadingZeros_f70103();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  countLeadingZeros_f70103(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countLeadingZeros_f70103();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  countLeadingZeros_f70103(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.spvasm
index 03ed1f9..c451023 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 95
+; Bound: 102
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_leading_zeros "tint_count_leading_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,106 +41,114 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-          %9 = OpTypeFunction %v4uint %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4uint %v4uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %18 = OpConstantNull %v4uint
+         %21 = OpConstantNull %v4uint
  %uint_65535 = OpConstant %uint 65535
-         %22 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
+         %25 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
     %uint_16 = OpConstant %uint 16
-         %27 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
+         %30 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
 %uint_16777215 = OpConstant %uint 16777215
-         %33 = OpConstantComposite %v4uint %uint_16777215 %uint_16777215 %uint_16777215 %uint_16777215
+         %36 = OpConstantComposite %v4uint %uint_16777215 %uint_16777215 %uint_16777215 %uint_16777215
      %uint_8 = OpConstant %uint 8
-         %36 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
+         %39 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
 %uint_268435455 = OpConstant %uint 268435455
-         %42 = OpConstantComposite %v4uint %uint_268435455 %uint_268435455 %uint_268435455 %uint_268435455
+         %45 = OpConstantComposite %v4uint %uint_268435455 %uint_268435455 %uint_268435455 %uint_268435455
      %uint_4 = OpConstant %uint 4
-         %45 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
+         %48 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
 %uint_1073741823 = OpConstant %uint 1073741823
-         %51 = OpConstantComposite %v4uint %uint_1073741823 %uint_1073741823 %uint_1073741823 %uint_1073741823
+         %54 = OpConstantComposite %v4uint %uint_1073741823 %uint_1073741823 %uint_1073741823 %uint_1073741823
      %uint_2 = OpConstant %uint 2
-         %54 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
+         %57 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
 %uint_2147483647 = OpConstant %uint 2147483647
-         %60 = OpConstantComposite %v4uint %uint_2147483647 %uint_2147483647 %uint_2147483647 %uint_2147483647
+         %63 = OpConstantComposite %v4uint %uint_2147483647 %uint_2147483647 %uint_2147483647 %uint_2147483647
      %uint_1 = OpConstant %uint 1
-         %63 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %66 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
        %void = OpTypeVoid
-         %73 = OpTypeFunction %void
-         %81 = OpTypeFunction %v4float
+         %76 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %88 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_leading_zeros = OpFunction %v4uint None %9
+%tint_count_leading_zeros = OpFunction %v4uint None %14
           %v = OpFunctionParameter %v4uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v4uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v4uint Function %21
                OpStore %x %v
-         %20 = OpLoad %v4uint %x
-         %23 = OpULessThanEqual %v4bool %20 %22
-         %19 = OpSelect %v4uint %23 %27 %18
-         %28 = OpLoad %v4uint %x
-         %29 = OpShiftLeftLogical %v4uint %28 %19
-               OpStore %x %29
+         %23 = OpLoad %v4uint %x
+         %26 = OpULessThanEqual %v4bool %23 %25
+         %22 = OpSelect %v4uint %26 %30 %21
          %31 = OpLoad %v4uint %x
-         %34 = OpULessThanEqual %v4bool %31 %33
-         %30 = OpSelect %v4uint %34 %36 %18
-         %37 = OpLoad %v4uint %x
-         %38 = OpShiftLeftLogical %v4uint %37 %30
-               OpStore %x %38
+         %32 = OpShiftLeftLogical %v4uint %31 %22
+               OpStore %x %32
+         %34 = OpLoad %v4uint %x
+         %37 = OpULessThanEqual %v4bool %34 %36
+         %33 = OpSelect %v4uint %37 %39 %21
          %40 = OpLoad %v4uint %x
-         %43 = OpULessThanEqual %v4bool %40 %42
-         %39 = OpSelect %v4uint %43 %45 %18
-         %46 = OpLoad %v4uint %x
-         %47 = OpShiftLeftLogical %v4uint %46 %39
-               OpStore %x %47
+         %41 = OpShiftLeftLogical %v4uint %40 %33
+               OpStore %x %41
+         %43 = OpLoad %v4uint %x
+         %46 = OpULessThanEqual %v4bool %43 %45
+         %42 = OpSelect %v4uint %46 %48 %21
          %49 = OpLoad %v4uint %x
-         %52 = OpULessThanEqual %v4bool %49 %51
-         %48 = OpSelect %v4uint %52 %54 %18
-         %55 = OpLoad %v4uint %x
-         %56 = OpShiftLeftLogical %v4uint %55 %48
-               OpStore %x %56
+         %50 = OpShiftLeftLogical %v4uint %49 %42
+               OpStore %x %50
+         %52 = OpLoad %v4uint %x
+         %55 = OpULessThanEqual %v4bool %52 %54
+         %51 = OpSelect %v4uint %55 %57 %21
          %58 = OpLoad %v4uint %x
-         %61 = OpULessThanEqual %v4bool %58 %60
-         %57 = OpSelect %v4uint %61 %63 %18
-         %65 = OpLoad %v4uint %x
-         %66 = OpIEqual %v4bool %65 %18
-         %64 = OpSelect %v4uint %66 %63 %18
-         %68 = OpBitwiseOr %v4uint %19 %30
-         %69 = OpBitwiseOr %v4uint %68 %39
-         %70 = OpBitwiseOr %v4uint %69 %48
-         %71 = OpBitwiseOr %v4uint %70 %57
-         %72 = OpIAdd %v4uint %71 %64
-               OpReturnValue %72
+         %59 = OpShiftLeftLogical %v4uint %58 %51
+               OpStore %x %59
+         %61 = OpLoad %v4uint %x
+         %64 = OpULessThanEqual %v4bool %61 %63
+         %60 = OpSelect %v4uint %64 %66 %21
+         %68 = OpLoad %v4uint %x
+         %69 = OpIEqual %v4bool %68 %21
+         %67 = OpSelect %v4uint %69 %66 %21
+         %71 = OpBitwiseOr %v4uint %22 %33
+         %72 = OpBitwiseOr %v4uint %71 %42
+         %73 = OpBitwiseOr %v4uint %72 %51
+         %74 = OpBitwiseOr %v4uint %73 %60
+         %75 = OpIAdd %v4uint %74 %67
+               OpReturnValue %75
                OpFunctionEnd
-%countLeadingZeros_f70103 = OpFunction %void None %73
-         %76 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %18
-        %res = OpVariable %_ptr_Function_v4uint Function %18
-               OpStore %arg_0 %63
-         %79 = OpLoad %v4uint %arg_0
-         %78 = OpFunctionCall %v4uint %tint_count_leading_zeros %79
-               OpStore %res %78
+%countLeadingZeros_f70103 = OpFunction %void None %76
+         %79 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %21
+        %res = OpVariable %_ptr_Function_v4uint Function %21
+               OpStore %arg_0 %66
+         %82 = OpLoad %v4uint %arg_0
+         %81 = OpFunctionCall %v4uint %tint_count_leading_zeros %82
+               OpStore %res %81
+         %86 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %87 = OpLoad %v4uint %res
+               OpStore %86 %87
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %81
-         %83 = OpLabel
-         %84 = OpFunctionCall %void %countLeadingZeros_f70103
+%vertex_main_inner = OpFunction %v4float None %88
+         %90 = OpLabel
+         %91 = OpFunctionCall %void %countLeadingZeros_f70103
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %73
-         %86 = OpLabel
-         %87 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %87
+%vertex_main = OpFunction %void None %76
+         %93 = OpLabel
+         %94 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %94
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %73
-         %90 = OpLabel
-         %91 = OpFunctionCall %void %countLeadingZeros_f70103
+%fragment_main = OpFunction %void None %76
+         %97 = OpLabel
+         %98 = OpFunctionCall %void %countLeadingZeros_f70103
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %73
-         %93 = OpLabel
-         %94 = OpFunctionCall %void %countLeadingZeros_f70103
+%compute_main = OpFunction %void None %76
+        %100 = OpLabel
+        %101 = OpFunctionCall %void %countLeadingZeros_f70103
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.wgsl
index 7ff370c..1c7aaf6 100644
--- a/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countLeadingZeros/f70103.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countLeadingZeros_f70103() {
   var arg_0 = vec4<u32>(1u);
   var res : vec4<u32> = countLeadingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countLeadingZeros_f70103();
diff --git a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl
index 7b2217f..c6ebfd0 100644
--- a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl
@@ -25,7 +25,9 @@
 fn countOneBits_0d0e46() {
   var arg_0 = vec4<u32>(1u);
   var res: vec4<u32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.dxc.hlsl
index 3c1a064..36da583 100644
--- a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_0d0e46() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = countbits(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.fxc.hlsl
index 3c1a064..36da583 100644
--- a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_0d0e46() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = countbits(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.glsl b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.glsl
index 72feada..e30480c 100644
--- a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countOneBits_0d0e46() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = uvec4(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countOneBits_0d0e46() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = uvec4(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countOneBits_0d0e46() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = uvec4(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.msl b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.msl
index d7e418d..be1a72e 100644
--- a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_0d0e46() {
+void countOneBits_0d0e46(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 res = popcount(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_0d0e46();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  countOneBits_0d0e46(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_0d0e46();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_0d0e46(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_0d0e46();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_0d0e46(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.spvasm
index 8ce7811..1e58846 100644
--- a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_0d0e46 "countOneBits_0d0e46"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_0d0e46 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %19
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v4uint %arg_0
-         %20 = OpBitCount %v4uint %21
-               OpStore %res %20
+%countOneBits_0d0e46 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %22
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v4uint %arg_0
+         %23 = OpBitCount %v4uint %24
+               OpStore %res %23
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %29 = OpLoad %v4uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %countOneBits_0d0e46
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %countOneBits_0d0e46
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_0d0e46
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countOneBits_0d0e46
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %countOneBits_0d0e46
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %countOneBits_0d0e46
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.wgsl
index af94001..1311bcc 100644
--- a/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/0d0e46.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countOneBits_0d0e46() {
   var arg_0 = vec4<u32>(1u);
   var res : vec4<u32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_0d0e46();
diff --git a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl
index b647821..e86f1d5 100644
--- a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl
@@ -25,7 +25,9 @@
 fn countOneBits_0f7980() {
   var arg_0 = vec4<i32>(1i);
   var res: vec4<i32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.dxc.hlsl
index 6e2d835..882b175 100644
--- a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_0f7980() {
   int4 arg_0 = (1).xxxx;
   int4 res = asint(countbits(asuint(arg_0)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.fxc.hlsl
index 6e2d835..882b175 100644
--- a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_0f7980() {
   int4 arg_0 = (1).xxxx;
   int4 res = asint(countbits(asuint(arg_0)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.glsl b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.glsl
index 693d84e..8be511d 100644
--- a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countOneBits_0f7980() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = ivec4(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countOneBits_0f7980() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = ivec4(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countOneBits_0f7980() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = ivec4(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.msl b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.msl
index f54cd90..dea5f19 100644
--- a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_0f7980() {
+void countOneBits_0f7980(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 res = popcount(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_0f7980();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  countOneBits_0f7980(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_0f7980();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_0f7980(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_0f7980();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_0f7980(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.spvasm
index b3ecc12..39c89f0 100644
--- a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_0f7980 "countOneBits_0f7980"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_0f7980 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v4int %arg_0
-         %20 = OpBitCount %v4int %21
-               OpStore %res %20
+%countOneBits_0f7980 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v4int %arg_0
+         %23 = OpBitCount %v4int %24
+               OpStore %res %23
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %30 = OpLoad %v4int %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %countOneBits_0f7980
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %countOneBits_0f7980
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_0f7980
+%fragment_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countOneBits_0f7980
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %countOneBits_0f7980
+%compute_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %countOneBits_0f7980
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.wgsl
index a2477c3..43ec27f 100644
--- a/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/0f7980.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countOneBits_0f7980() {
   var arg_0 = vec4<i32>(1i);
   var res : vec4<i32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_0f7980();
diff --git a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl
index 37d61ed..bb88b7e 100644
--- a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl
@@ -25,7 +25,9 @@
 fn countOneBits_65d2ae() {
   var arg_0 = vec3<i32>(1i);
   var res: vec3<i32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.dxc.hlsl
index ef6ef81..e15b5bd 100644
--- a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_65d2ae() {
   int3 arg_0 = (1).xxx;
   int3 res = asint(countbits(asuint(arg_0)));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.fxc.hlsl
index ef6ef81..e15b5bd 100644
--- a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_65d2ae() {
   int3 arg_0 = (1).xxx;
   int3 res = asint(countbits(asuint(arg_0)));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.glsl b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.glsl
index 62f967f..1efff3f 100644
--- a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countOneBits_65d2ae() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = ivec3(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countOneBits_65d2ae() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = ivec3(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countOneBits_65d2ae() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = ivec3(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.msl b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.msl
index e1151d4..812a954 100644
--- a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_65d2ae() {
+void countOneBits_65d2ae(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 res = popcount(arg_0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_65d2ae();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  countOneBits_65d2ae(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_65d2ae();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_65d2ae(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_65d2ae();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_65d2ae(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.spvasm
index 7b6122e..47e20a4 100644
--- a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_65d2ae "countOneBits_65d2ae"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_65d2ae = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v3int %arg_0
-         %20 = OpBitCount %v3int %21
-               OpStore %res %20
+%countOneBits_65d2ae = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v3int %arg_0
+         %23 = OpBitCount %v3int %24
+               OpStore %res %23
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %30 = OpLoad %v3int %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %countOneBits_65d2ae
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %countOneBits_65d2ae
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_65d2ae
+%fragment_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countOneBits_65d2ae
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %countOneBits_65d2ae
+%compute_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %countOneBits_65d2ae
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.wgsl
index d4b425f..2e14ce7 100644
--- a/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/65d2ae.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countOneBits_65d2ae() {
   var arg_0 = vec3<i32>(1i);
   var res : vec3<i32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_65d2ae();
diff --git a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl
index 9805d99..2587818 100644
--- a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl
@@ -25,7 +25,9 @@
 fn countOneBits_690cfc() {
   var arg_0 = vec3<u32>(1u);
   var res: vec3<u32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.dxc.hlsl
index cde2efd..d1b312d 100644
--- a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_690cfc() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = countbits(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.fxc.hlsl
index cde2efd..d1b312d 100644
--- a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_690cfc() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = countbits(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.glsl b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.glsl
index 583c4c9..38322fa 100644
--- a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countOneBits_690cfc() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = uvec3(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countOneBits_690cfc() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = uvec3(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countOneBits_690cfc() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = uvec3(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.msl b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.msl
index 9ac2be0..93701e2 100644
--- a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_690cfc() {
+void countOneBits_690cfc(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 res = popcount(arg_0);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_690cfc();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  countOneBits_690cfc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_690cfc();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_690cfc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_690cfc();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_690cfc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.spvasm
index 097fb8e..d2e953d 100644
--- a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_690cfc "countOneBits_690cfc"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_690cfc = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %19
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v3uint %arg_0
-         %20 = OpBitCount %v3uint %21
-               OpStore %res %20
+%countOneBits_690cfc = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %22
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v3uint %arg_0
+         %23 = OpBitCount %v3uint %24
+               OpStore %res %23
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %countOneBits_690cfc
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %countOneBits_690cfc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_690cfc
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countOneBits_690cfc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %countOneBits_690cfc
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %countOneBits_690cfc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.wgsl
index cf36f50..d95210d 100644
--- a/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/690cfc.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countOneBits_690cfc() {
   var arg_0 = vec3<u32>(1u);
   var res : vec3<u32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_690cfc();
diff --git a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl
index 55d2249..575ef90 100644
--- a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl
@@ -25,7 +25,9 @@
 fn countOneBits_94fd81() {
   var arg_0 = vec2<u32>(1u);
   var res: vec2<u32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.dxc.hlsl
index 016aa3c..396857c 100644
--- a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_94fd81() {
   uint2 arg_0 = (1u).xx;
   uint2 res = countbits(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.fxc.hlsl
index 016aa3c..396857c 100644
--- a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_94fd81() {
   uint2 arg_0 = (1u).xx;
   uint2 res = countbits(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.glsl b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.glsl
index e092a19..9e7779e 100644
--- a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countOneBits_94fd81() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = uvec2(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countOneBits_94fd81() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = uvec2(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countOneBits_94fd81() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = uvec2(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.msl b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.msl
index 7f22c6b..c22e1a4 100644
--- a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_94fd81() {
+void countOneBits_94fd81(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 res = popcount(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_94fd81();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  countOneBits_94fd81(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_94fd81();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_94fd81(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_94fd81();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_94fd81(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.spvasm
index 60720c8..2fea5a8 100644
--- a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_94fd81 "countOneBits_94fd81"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_94fd81 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %19
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v2uint %arg_0
-         %20 = OpBitCount %v2uint %21
-               OpStore %res %20
+%countOneBits_94fd81 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %22
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v2uint %arg_0
+         %23 = OpBitCount %v2uint %24
+               OpStore %res %23
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %countOneBits_94fd81
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %countOneBits_94fd81
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_94fd81
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %countOneBits_94fd81
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %countOneBits_94fd81
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %countOneBits_94fd81
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.wgsl
index e237e7a..4480749 100644
--- a/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/94fd81.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countOneBits_94fd81() {
   var arg_0 = vec2<u32>(1u);
   var res : vec2<u32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_94fd81();
diff --git a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl
index 0eb6ee0..e411344 100644
--- a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl
@@ -25,7 +25,9 @@
 fn countOneBits_ae44f9() {
   var arg_0 = 1u;
   var res: u32 = countOneBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.dxc.hlsl
index 5c19408..75a8914 100644
--- a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_ae44f9() {
   uint arg_0 = 1u;
   uint res = countbits(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.fxc.hlsl
index 5c19408..75a8914 100644
--- a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_ae44f9() {
   uint arg_0 = 1u;
   uint res = countbits(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.glsl b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.glsl
index c47d7d0..1719eb2 100644
--- a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countOneBits_ae44f9() {
   uint arg_0 = 1u;
   uint res = uint(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countOneBits_ae44f9() {
   uint arg_0 = 1u;
   uint res = uint(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countOneBits_ae44f9() {
   uint arg_0 = 1u;
   uint res = uint(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.msl b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.msl
index a04bb18..9509d4f 100644
--- a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_ae44f9() {
+void countOneBits_ae44f9(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint res = popcount(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_ae44f9();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  countOneBits_ae44f9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_ae44f9();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_ae44f9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_ae44f9();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_ae44f9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.spvasm
index 5879bf3..84a7dea 100644
--- a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_ae44f9 "countOneBits_ae44f9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,43 +36,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %21 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_ae44f9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+%countOneBits_ae44f9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
-         %19 = OpLoad %uint %arg_0
-         %18 = OpBitCount %uint %19
-               OpStore %res %18
+         %22 = OpLoad %uint %arg_0
+         %21 = OpBitCount %uint %22
+               OpStore %res %21
+         %26 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %27 = OpLoad %uint %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %countOneBits_ae44f9
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %countOneBits_ae44f9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countOneBits_ae44f9
+%fragment_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %countOneBits_ae44f9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %countOneBits_ae44f9
+%compute_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countOneBits_ae44f9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.wgsl
index 7d63e7b..c7afe5f 100644
--- a/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/ae44f9.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countOneBits_ae44f9() {
   var arg_0 = 1u;
   var res : u32 = countOneBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_ae44f9();
diff --git a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl
index 94f74b0..8f8e9a9 100644
--- a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl
@@ -25,7 +25,9 @@
 fn countOneBits_af90e2() {
   var arg_0 = vec2<i32>(1i);
   var res: vec2<i32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.dxc.hlsl
index 533b326..6dc1616 100644
--- a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_af90e2() {
   int2 arg_0 = (1).xx;
   int2 res = asint(countbits(asuint(arg_0)));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.fxc.hlsl
index 533b326..6dc1616 100644
--- a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_af90e2() {
   int2 arg_0 = (1).xx;
   int2 res = asint(countbits(asuint(arg_0)));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.glsl b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.glsl
index 3db2472..baf4f6b 100644
--- a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countOneBits_af90e2() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = ivec2(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countOneBits_af90e2() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = ivec2(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countOneBits_af90e2() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = ivec2(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.msl b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.msl
index afda652..d9b353d 100644
--- a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_af90e2() {
+void countOneBits_af90e2(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 res = popcount(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_af90e2();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  countOneBits_af90e2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_af90e2();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_af90e2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_af90e2();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_af90e2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.spvasm
index 814be8b..09615c3 100644
--- a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_af90e2 "countOneBits_af90e2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_af90e2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v2int %arg_0
-         %20 = OpBitCount %v2int %21
-               OpStore %res %20
+%countOneBits_af90e2 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v2int %arg_0
+         %23 = OpBitCount %v2int %24
+               OpStore %res %23
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %30 = OpLoad %v2int %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %countOneBits_af90e2
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %countOneBits_af90e2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %countOneBits_af90e2
+%fragment_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %countOneBits_af90e2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %countOneBits_af90e2
+%compute_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %countOneBits_af90e2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.wgsl
index 5a8973a..b74a076 100644
--- a/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/af90e2.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countOneBits_af90e2() {
   var arg_0 = vec2<i32>(1i);
   var res : vec2<i32> = countOneBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_af90e2();
diff --git a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl
index df8c24f..e8c79d6 100644
--- a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl
@@ -25,7 +25,9 @@
 fn countOneBits_fd88b2() {
   var arg_0 = 1i;
   var res: i32 = countOneBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.dxc.hlsl
index 7801d95..b0ccab3 100644
--- a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_fd88b2() {
   int arg_0 = 1;
   int res = asint(countbits(asuint(arg_0)));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.fxc.hlsl
index 7801d95..b0ccab3 100644
--- a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countOneBits_fd88b2() {
   int arg_0 = 1;
   int res = asint(countbits(asuint(arg_0)));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.glsl b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.glsl
index 7ef846b..c0732aa 100644
--- a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countOneBits_fd88b2() {
   int arg_0 = 1;
   int res = int(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countOneBits_fd88b2() {
   int arg_0 = 1;
   int res = int(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countOneBits_fd88b2() {
   int arg_0 = 1;
   int res = int(bitCount(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.msl b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.msl
index 5077121..1a615b7 100644
--- a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countOneBits_fd88b2() {
+void countOneBits_fd88b2(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int res = popcount(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countOneBits_fd88b2();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  countOneBits_fd88b2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countOneBits_fd88b2();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  countOneBits_fd88b2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countOneBits_fd88b2();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  countOneBits_fd88b2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.spvasm
index e3733f0..df89dcc 100644
--- a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %countOneBits_fd88b2 "countOneBits_fd88b2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,43 +36,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %21 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%countOneBits_fd88b2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %17
-        %res = OpVariable %_ptr_Function_int Function %17
+%countOneBits_fd88b2 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %20
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %arg_0 %int_1
-         %19 = OpLoad %int %arg_0
-         %18 = OpBitCount %int %19
-               OpStore %res %18
+         %22 = OpLoad %int %arg_0
+         %21 = OpBitCount %int %22
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %countOneBits_fd88b2
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %countOneBits_fd88b2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %countOneBits_fd88b2
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %countOneBits_fd88b2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %countOneBits_fd88b2
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %countOneBits_fd88b2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.wgsl
index 4ccb893..591197c 100644
--- a/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countOneBits/fd88b2.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countOneBits_fd88b2() {
   var arg_0 = 1i;
   var res : i32 = countOneBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countOneBits_fd88b2();
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl
index d5e221d..1b7c8ed 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl
@@ -25,7 +25,9 @@
 fn countTrailingZeros_1ad138() {
   var arg_0 = vec2<u32>(1u);
   var res: vec2<u32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.dxc.hlsl
index afb63e8..647f6f5 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_1ad138() {
   uint2 arg_0 = (1u).xx;
   uint2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.fxc.hlsl
index afb63e8..647f6f5 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_1ad138() {
   uint2 arg_0 = (1u).xx;
   uint2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.glsl b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.glsl
index e3cd7e9..94b429f 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_1ad138() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_1ad138() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_1ad138() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.msl b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.msl
index 347a560..d57163b 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_1ad138() {
+void countTrailingZeros_1ad138(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 res = ctz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_1ad138();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  countTrailingZeros_1ad138(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_1ad138();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_1ad138(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_1ad138();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_1ad138(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.spvasm
index beda11c..b88a0b0 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 98
+; Bound: 105
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_trailing_zeros "tint_count_trailing_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,109 +41,117 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-          %9 = OpTypeFunction %v2uint %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2uint %v2uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %18 = OpConstantNull %v2uint
+         %21 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
  %uint_65535 = OpConstant %uint 65535
-         %25 = OpConstantComposite %v2uint %uint_65535 %uint_65535
+         %28 = OpConstantComposite %v2uint %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %28 = OpConstantComposite %v2uint %uint_16 %uint_16
+         %31 = OpConstantComposite %v2uint %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %35 = OpConstantComposite %v2uint %uint_255 %uint_255
+         %38 = OpConstantComposite %v2uint %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v2uint %uint_8 %uint_8
+         %41 = OpConstantComposite %v2uint %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %45 = OpConstantComposite %v2uint %uint_15 %uint_15
+         %48 = OpConstantComposite %v2uint %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %48 = OpConstantComposite %v2uint %uint_4 %uint_4
+         %51 = OpConstantComposite %v2uint %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %55 = OpConstantComposite %v2uint %uint_3 %uint_3
+         %58 = OpConstantComposite %v2uint %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %58 = OpConstantComposite %v2uint %uint_2 %uint_2
+         %61 = OpConstantComposite %v2uint %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %68 = OpConstantComposite %v2uint %uint_1 %uint_1
        %void = OpTypeVoid
-         %76 = OpTypeFunction %void
-         %84 = OpTypeFunction %v4float
+         %79 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %91 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_trailing_zeros = OpFunction %v2uint None %9
+%tint_count_trailing_zeros = OpFunction %v2uint None %14
           %v = OpFunctionParameter %v2uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v2uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v2uint Function %21
                OpStore %x %v
-         %23 = OpLoad %v2uint %x
-         %26 = OpBitwiseAnd %v2uint %23 %25
-         %20 = OpINotEqual %v2bool %26 %18
-         %19 = OpSelect %v2uint %20 %18 %28
-         %29 = OpLoad %v2uint %x
-         %30 = OpShiftRightLogical %v2uint %29 %19
-               OpStore %x %30
-         %33 = OpLoad %v2uint %x
-         %36 = OpBitwiseAnd %v2uint %33 %35
-         %32 = OpINotEqual %v2bool %36 %18
-         %31 = OpSelect %v2uint %32 %18 %38
-         %39 = OpLoad %v2uint %x
-         %40 = OpShiftRightLogical %v2uint %39 %31
-               OpStore %x %40
-         %43 = OpLoad %v2uint %x
-         %46 = OpBitwiseAnd %v2uint %43 %45
-         %42 = OpINotEqual %v2bool %46 %18
-         %41 = OpSelect %v2uint %42 %18 %48
-         %49 = OpLoad %v2uint %x
-         %50 = OpShiftRightLogical %v2uint %49 %41
-               OpStore %x %50
-         %53 = OpLoad %v2uint %x
-         %56 = OpBitwiseAnd %v2uint %53 %55
-         %52 = OpINotEqual %v2bool %56 %18
-         %51 = OpSelect %v2uint %52 %18 %58
-         %59 = OpLoad %v2uint %x
-         %60 = OpShiftRightLogical %v2uint %59 %51
-               OpStore %x %60
-         %63 = OpLoad %v2uint %x
-         %66 = OpBitwiseAnd %v2uint %63 %65
-         %62 = OpINotEqual %v2bool %66 %18
-         %61 = OpSelect %v2uint %62 %18 %65
-         %68 = OpLoad %v2uint %x
-         %69 = OpIEqual %v2bool %68 %18
-         %67 = OpSelect %v2uint %69 %65 %18
-         %71 = OpBitwiseOr %v2uint %19 %31
-         %72 = OpBitwiseOr %v2uint %71 %41
-         %73 = OpBitwiseOr %v2uint %72 %51
-         %74 = OpBitwiseOr %v2uint %73 %61
-         %75 = OpIAdd %v2uint %74 %67
-               OpReturnValue %75
+         %26 = OpLoad %v2uint %x
+         %29 = OpBitwiseAnd %v2uint %26 %28
+         %23 = OpINotEqual %v2bool %29 %21
+         %22 = OpSelect %v2uint %23 %21 %31
+         %32 = OpLoad %v2uint %x
+         %33 = OpShiftRightLogical %v2uint %32 %22
+               OpStore %x %33
+         %36 = OpLoad %v2uint %x
+         %39 = OpBitwiseAnd %v2uint %36 %38
+         %35 = OpINotEqual %v2bool %39 %21
+         %34 = OpSelect %v2uint %35 %21 %41
+         %42 = OpLoad %v2uint %x
+         %43 = OpShiftRightLogical %v2uint %42 %34
+               OpStore %x %43
+         %46 = OpLoad %v2uint %x
+         %49 = OpBitwiseAnd %v2uint %46 %48
+         %45 = OpINotEqual %v2bool %49 %21
+         %44 = OpSelect %v2uint %45 %21 %51
+         %52 = OpLoad %v2uint %x
+         %53 = OpShiftRightLogical %v2uint %52 %44
+               OpStore %x %53
+         %56 = OpLoad %v2uint %x
+         %59 = OpBitwiseAnd %v2uint %56 %58
+         %55 = OpINotEqual %v2bool %59 %21
+         %54 = OpSelect %v2uint %55 %21 %61
+         %62 = OpLoad %v2uint %x
+         %63 = OpShiftRightLogical %v2uint %62 %54
+               OpStore %x %63
+         %66 = OpLoad %v2uint %x
+         %69 = OpBitwiseAnd %v2uint %66 %68
+         %65 = OpINotEqual %v2bool %69 %21
+         %64 = OpSelect %v2uint %65 %21 %68
+         %71 = OpLoad %v2uint %x
+         %72 = OpIEqual %v2bool %71 %21
+         %70 = OpSelect %v2uint %72 %68 %21
+         %74 = OpBitwiseOr %v2uint %22 %34
+         %75 = OpBitwiseOr %v2uint %74 %44
+         %76 = OpBitwiseOr %v2uint %75 %54
+         %77 = OpBitwiseOr %v2uint %76 %64
+         %78 = OpIAdd %v2uint %77 %70
+               OpReturnValue %78
                OpFunctionEnd
-%countTrailingZeros_1ad138 = OpFunction %void None %76
-         %79 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %18
-        %res = OpVariable %_ptr_Function_v2uint Function %18
-               OpStore %arg_0 %65
-         %82 = OpLoad %v2uint %arg_0
-         %81 = OpFunctionCall %v2uint %tint_count_trailing_zeros %82
-               OpStore %res %81
+%countTrailingZeros_1ad138 = OpFunction %void None %79
+         %82 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %21
+        %res = OpVariable %_ptr_Function_v2uint Function %21
+               OpStore %arg_0 %68
+         %85 = OpLoad %v2uint %arg_0
+         %84 = OpFunctionCall %v2uint %tint_count_trailing_zeros %85
+               OpStore %res %84
+         %89 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %90 = OpLoad %v2uint %res
+               OpStore %89 %90
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %84
-         %86 = OpLabel
-         %87 = OpFunctionCall %void %countTrailingZeros_1ad138
+%vertex_main_inner = OpFunction %v4float None %91
+         %93 = OpLabel
+         %94 = OpFunctionCall %void %countTrailingZeros_1ad138
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %76
-         %89 = OpLabel
-         %90 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %90
+%vertex_main = OpFunction %void None %79
+         %96 = OpLabel
+         %97 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %97
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %76
-         %93 = OpLabel
-         %94 = OpFunctionCall %void %countTrailingZeros_1ad138
+%fragment_main = OpFunction %void None %79
+        %100 = OpLabel
+        %101 = OpFunctionCall %void %countTrailingZeros_1ad138
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %76
-         %96 = OpLabel
-         %97 = OpFunctionCall %void %countTrailingZeros_1ad138
+%compute_main = OpFunction %void None %79
+        %103 = OpLabel
+        %104 = OpFunctionCall %void %countTrailingZeros_1ad138
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.wgsl
index e80e5fe..4122c36 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1ad138.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countTrailingZeros_1ad138() {
   var arg_0 = vec2<u32>(1u);
   var res : vec2<u32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_1ad138();
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl
index a7937e9..dba2323 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl
@@ -25,7 +25,9 @@
 fn countTrailingZeros_1dc84a() {
   var arg_0 = vec4<i32>(1i);
   var res: vec4<i32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.dxc.hlsl
index 596f211..92f69e7 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_1dc84a() {
   int4 arg_0 = (1).xxxx;
   int4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.fxc.hlsl
index 596f211..92f69e7 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_1dc84a() {
   int4 arg_0 = (1).xxxx;
   int4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.glsl b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.glsl
index c94ebd8..70f5d7e 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_1dc84a() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_1dc84a() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_1dc84a() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.msl b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.msl
index a7c8581..f8a66f3 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_1dc84a() {
+void countTrailingZeros_1dc84a(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 res = ctz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_1dc84a();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  countTrailingZeros_1dc84a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_1dc84a();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_1dc84a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_1dc84a();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_1dc84a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.spvasm
index f3f97a8..c89c1a3 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 104
+; Bound: 111
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_trailing_zeros "tint_count_trailing_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,117 +41,125 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-          %9 = OpTypeFunction %v4int %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4int %v4int
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %20 = OpConstantNull %v4uint
+         %23 = OpConstantNull %v4uint
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
  %uint_65535 = OpConstant %uint 65535
-         %27 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
+         %30 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %30 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
+         %33 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %37 = OpConstantComposite %v4uint %uint_255 %uint_255 %uint_255 %uint_255
+         %40 = OpConstantComposite %v4uint %uint_255 %uint_255 %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %40 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
+         %43 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %47 = OpConstantComposite %v4uint %uint_15 %uint_15 %uint_15 %uint_15
+         %50 = OpConstantComposite %v4uint %uint_15 %uint_15 %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %50 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
+         %53 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %57 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
+         %60 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %60 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
+         %63 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %67 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %70 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
        %void = OpTypeVoid
-         %78 = OpTypeFunction %void
+         %81 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %83 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %86 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %86 = OpConstantNull %v4int
-         %90 = OpTypeFunction %v4float
+         %89 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %97 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_trailing_zeros = OpFunction %v4int None %9
+%tint_count_trailing_zeros = OpFunction %v4int None %14
           %v = OpFunctionParameter %v4int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v4uint Function %20
-         %15 = OpBitcast %v4uint %v
-               OpStore %x %15
-         %25 = OpLoad %v4uint %x
-         %28 = OpBitwiseAnd %v4uint %25 %27
-         %22 = OpINotEqual %v4bool %28 %20
-         %21 = OpSelect %v4uint %22 %20 %30
-         %31 = OpLoad %v4uint %x
-         %32 = OpShiftRightLogical %v4uint %31 %21
-               OpStore %x %32
-         %35 = OpLoad %v4uint %x
-         %38 = OpBitwiseAnd %v4uint %35 %37
-         %34 = OpINotEqual %v4bool %38 %20
-         %33 = OpSelect %v4uint %34 %20 %40
-         %41 = OpLoad %v4uint %x
-         %42 = OpShiftRightLogical %v4uint %41 %33
-               OpStore %x %42
-         %45 = OpLoad %v4uint %x
-         %48 = OpBitwiseAnd %v4uint %45 %47
-         %44 = OpINotEqual %v4bool %48 %20
-         %43 = OpSelect %v4uint %44 %20 %50
-         %51 = OpLoad %v4uint %x
-         %52 = OpShiftRightLogical %v4uint %51 %43
-               OpStore %x %52
-         %55 = OpLoad %v4uint %x
-         %58 = OpBitwiseAnd %v4uint %55 %57
-         %54 = OpINotEqual %v4bool %58 %20
-         %53 = OpSelect %v4uint %54 %20 %60
-         %61 = OpLoad %v4uint %x
-         %62 = OpShiftRightLogical %v4uint %61 %53
-               OpStore %x %62
-         %65 = OpLoad %v4uint %x
-         %68 = OpBitwiseAnd %v4uint %65 %67
-         %64 = OpINotEqual %v4bool %68 %20
-         %63 = OpSelect %v4uint %64 %20 %67
-         %70 = OpLoad %v4uint %x
-         %71 = OpIEqual %v4bool %70 %20
-         %69 = OpSelect %v4uint %71 %67 %20
-         %73 = OpBitwiseOr %v4uint %21 %33
-         %74 = OpBitwiseOr %v4uint %73 %43
-         %75 = OpBitwiseOr %v4uint %74 %53
-         %76 = OpBitwiseOr %v4uint %75 %63
-         %77 = OpIAdd %v4uint %76 %69
-         %72 = OpBitcast %v4int %77
-               OpReturnValue %72
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v4uint Function %23
+         %18 = OpBitcast %v4uint %v
+               OpStore %x %18
+         %28 = OpLoad %v4uint %x
+         %31 = OpBitwiseAnd %v4uint %28 %30
+         %25 = OpINotEqual %v4bool %31 %23
+         %24 = OpSelect %v4uint %25 %23 %33
+         %34 = OpLoad %v4uint %x
+         %35 = OpShiftRightLogical %v4uint %34 %24
+               OpStore %x %35
+         %38 = OpLoad %v4uint %x
+         %41 = OpBitwiseAnd %v4uint %38 %40
+         %37 = OpINotEqual %v4bool %41 %23
+         %36 = OpSelect %v4uint %37 %23 %43
+         %44 = OpLoad %v4uint %x
+         %45 = OpShiftRightLogical %v4uint %44 %36
+               OpStore %x %45
+         %48 = OpLoad %v4uint %x
+         %51 = OpBitwiseAnd %v4uint %48 %50
+         %47 = OpINotEqual %v4bool %51 %23
+         %46 = OpSelect %v4uint %47 %23 %53
+         %54 = OpLoad %v4uint %x
+         %55 = OpShiftRightLogical %v4uint %54 %46
+               OpStore %x %55
+         %58 = OpLoad %v4uint %x
+         %61 = OpBitwiseAnd %v4uint %58 %60
+         %57 = OpINotEqual %v4bool %61 %23
+         %56 = OpSelect %v4uint %57 %23 %63
+         %64 = OpLoad %v4uint %x
+         %65 = OpShiftRightLogical %v4uint %64 %56
+               OpStore %x %65
+         %68 = OpLoad %v4uint %x
+         %71 = OpBitwiseAnd %v4uint %68 %70
+         %67 = OpINotEqual %v4bool %71 %23
+         %66 = OpSelect %v4uint %67 %23 %70
+         %73 = OpLoad %v4uint %x
+         %74 = OpIEqual %v4bool %73 %23
+         %72 = OpSelect %v4uint %74 %70 %23
+         %76 = OpBitwiseOr %v4uint %24 %36
+         %77 = OpBitwiseOr %v4uint %76 %46
+         %78 = OpBitwiseOr %v4uint %77 %56
+         %79 = OpBitwiseOr %v4uint %78 %66
+         %80 = OpIAdd %v4uint %79 %72
+         %75 = OpBitcast %v4int %80
+               OpReturnValue %75
                OpFunctionEnd
-%countTrailingZeros_1dc84a = OpFunction %void None %78
-         %81 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %86
-        %res = OpVariable %_ptr_Function_v4int Function %86
-               OpStore %arg_0 %83
-         %88 = OpLoad %v4int %arg_0
-         %87 = OpFunctionCall %v4int %tint_count_trailing_zeros %88
-               OpStore %res %87
+%countTrailingZeros_1dc84a = OpFunction %void None %81
+         %84 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %89
+        %res = OpVariable %_ptr_Function_v4int Function %89
+               OpStore %arg_0 %86
+         %91 = OpLoad %v4int %arg_0
+         %90 = OpFunctionCall %v4int %tint_count_trailing_zeros %91
+               OpStore %res %90
+         %95 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %96 = OpLoad %v4int %res
+               OpStore %95 %96
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %90
-         %92 = OpLabel
-         %93 = OpFunctionCall %void %countTrailingZeros_1dc84a
+%vertex_main_inner = OpFunction %v4float None %97
+         %99 = OpLabel
+        %100 = OpFunctionCall %void %countTrailingZeros_1dc84a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %78
-         %95 = OpLabel
-         %96 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %96
+%vertex_main = OpFunction %void None %81
+        %102 = OpLabel
+        %103 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %103
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %78
-         %99 = OpLabel
-        %100 = OpFunctionCall %void %countTrailingZeros_1dc84a
+%fragment_main = OpFunction %void None %81
+        %106 = OpLabel
+        %107 = OpFunctionCall %void %countTrailingZeros_1dc84a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %78
-        %102 = OpLabel
-        %103 = OpFunctionCall %void %countTrailingZeros_1dc84a
+%compute_main = OpFunction %void None %81
+        %109 = OpLabel
+        %110 = OpFunctionCall %void %countTrailingZeros_1dc84a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.wgsl
index cb3d741..c13dbd6 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/1dc84a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countTrailingZeros_1dc84a() {
   var arg_0 = vec4<i32>(1i);
   var res : vec4<i32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_1dc84a();
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl
index bceddce..36de44f 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl
@@ -25,7 +25,9 @@
 fn countTrailingZeros_21e394() {
   var arg_0 = 1u;
   var res: u32 = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.dxc.hlsl
index 4581899..426bd45 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_21e394() {
   uint arg_0 = 1u;
   uint res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.fxc.hlsl
index 4581899..426bd45 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_21e394() {
   uint arg_0 = 1u;
   uint res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.glsl b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.glsl
index 8995ab5..e7cfae2 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countTrailingZeros_21e394() {
   uint arg_0 = 1u;
   uint res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countTrailingZeros_21e394() {
   uint arg_0 = 1u;
   uint res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void countTrailingZeros_21e394() {
   uint arg_0 = 1u;
   uint res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.msl b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.msl
index 6c9c987..0ded145 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_21e394() {
+void countTrailingZeros_21e394(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint res = ctz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_21e394();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  countTrailingZeros_21e394(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_21e394();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_21e394(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_21e394();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_21e394(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.spvasm
index afa8fca..fabc953 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 87
+; Bound: 94
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_trailing_zeros "tint_count_trailing_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,9 +40,12 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %uint %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %uint %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
+         %20 = OpConstantNull %uint
        %bool = OpTypeBool
  %uint_65535 = OpConstant %uint 65535
     %uint_16 = OpConstant %uint 16
@@ -47,85 +57,90 @@
      %uint_2 = OpConstant %uint 2
      %uint_1 = OpConstant %uint 1
        %void = OpTypeVoid
-         %65 = OpTypeFunction %void
-         %73 = OpTypeFunction %v4float
+         %68 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %80 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_trailing_zeros = OpFunction %uint None %9
+%tint_count_trailing_zeros = OpFunction %uint None %13
           %v = OpFunctionParameter %uint
-         %13 = OpLabel
-          %x = OpVariable %_ptr_Function_uint Function %17
+         %16 = OpLabel
+          %x = OpVariable %_ptr_Function_uint Function %20
                OpStore %x %v
-         %21 = OpLoad %uint %x
-         %23 = OpBitwiseAnd %uint %21 %uint_65535
-         %19 = OpINotEqual %bool %23 %17
-         %18 = OpSelect %uint %19 %17 %uint_16
-         %25 = OpLoad %uint %x
-         %26 = OpShiftRightLogical %uint %25 %18
-               OpStore %x %26
-         %29 = OpLoad %uint %x
-         %31 = OpBitwiseAnd %uint %29 %uint_255
-         %28 = OpINotEqual %bool %31 %17
-         %27 = OpSelect %uint %28 %17 %uint_8
-         %33 = OpLoad %uint %x
-         %34 = OpShiftRightLogical %uint %33 %27
-               OpStore %x %34
-         %37 = OpLoad %uint %x
-         %39 = OpBitwiseAnd %uint %37 %uint_15
-         %36 = OpINotEqual %bool %39 %17
-         %35 = OpSelect %uint %36 %17 %uint_4
-         %41 = OpLoad %uint %x
-         %42 = OpShiftRightLogical %uint %41 %35
-               OpStore %x %42
-         %45 = OpLoad %uint %x
-         %47 = OpBitwiseAnd %uint %45 %uint_3
-         %44 = OpINotEqual %bool %47 %17
-         %43 = OpSelect %uint %44 %17 %uint_2
-         %49 = OpLoad %uint %x
-         %50 = OpShiftRightLogical %uint %49 %43
-               OpStore %x %50
-         %53 = OpLoad %uint %x
-         %55 = OpBitwiseAnd %uint %53 %uint_1
-         %52 = OpINotEqual %bool %55 %17
-         %51 = OpSelect %uint %52 %17 %uint_1
-         %57 = OpLoad %uint %x
-         %58 = OpIEqual %bool %57 %17
-         %56 = OpSelect %uint %58 %uint_1 %17
-         %60 = OpBitwiseOr %uint %18 %27
-         %61 = OpBitwiseOr %uint %60 %35
-         %62 = OpBitwiseOr %uint %61 %43
-         %63 = OpBitwiseOr %uint %62 %51
-         %64 = OpIAdd %uint %63 %56
-               OpReturnValue %64
+         %24 = OpLoad %uint %x
+         %26 = OpBitwiseAnd %uint %24 %uint_65535
+         %22 = OpINotEqual %bool %26 %20
+         %21 = OpSelect %uint %22 %20 %uint_16
+         %28 = OpLoad %uint %x
+         %29 = OpShiftRightLogical %uint %28 %21
+               OpStore %x %29
+         %32 = OpLoad %uint %x
+         %34 = OpBitwiseAnd %uint %32 %uint_255
+         %31 = OpINotEqual %bool %34 %20
+         %30 = OpSelect %uint %31 %20 %uint_8
+         %36 = OpLoad %uint %x
+         %37 = OpShiftRightLogical %uint %36 %30
+               OpStore %x %37
+         %40 = OpLoad %uint %x
+         %42 = OpBitwiseAnd %uint %40 %uint_15
+         %39 = OpINotEqual %bool %42 %20
+         %38 = OpSelect %uint %39 %20 %uint_4
+         %44 = OpLoad %uint %x
+         %45 = OpShiftRightLogical %uint %44 %38
+               OpStore %x %45
+         %48 = OpLoad %uint %x
+         %50 = OpBitwiseAnd %uint %48 %uint_3
+         %47 = OpINotEqual %bool %50 %20
+         %46 = OpSelect %uint %47 %20 %uint_2
+         %52 = OpLoad %uint %x
+         %53 = OpShiftRightLogical %uint %52 %46
+               OpStore %x %53
+         %56 = OpLoad %uint %x
+         %58 = OpBitwiseAnd %uint %56 %uint_1
+         %55 = OpINotEqual %bool %58 %20
+         %54 = OpSelect %uint %55 %20 %uint_1
+         %60 = OpLoad %uint %x
+         %61 = OpIEqual %bool %60 %20
+         %59 = OpSelect %uint %61 %uint_1 %20
+         %63 = OpBitwiseOr %uint %21 %30
+         %64 = OpBitwiseOr %uint %63 %38
+         %65 = OpBitwiseOr %uint %64 %46
+         %66 = OpBitwiseOr %uint %65 %54
+         %67 = OpIAdd %uint %66 %59
+               OpReturnValue %67
                OpFunctionEnd
-%countTrailingZeros_21e394 = OpFunction %void None %65
-         %68 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+%countTrailingZeros_21e394 = OpFunction %void None %68
+         %71 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
-         %71 = OpLoad %uint %arg_0
-         %70 = OpFunctionCall %uint %tint_count_trailing_zeros %71
-               OpStore %res %70
+         %74 = OpLoad %uint %arg_0
+         %73 = OpFunctionCall %uint %tint_count_trailing_zeros %74
+               OpStore %res %73
+         %78 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %79 = OpLoad %uint %res
+               OpStore %78 %79
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %73
-         %75 = OpLabel
-         %76 = OpFunctionCall %void %countTrailingZeros_21e394
+%vertex_main_inner = OpFunction %v4float None %80
+         %82 = OpLabel
+         %83 = OpFunctionCall %void %countTrailingZeros_21e394
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %65
-         %78 = OpLabel
-         %79 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %79
+%vertex_main = OpFunction %void None %68
+         %85 = OpLabel
+         %86 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %86
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %65
-         %82 = OpLabel
-         %83 = OpFunctionCall %void %countTrailingZeros_21e394
+%fragment_main = OpFunction %void None %68
+         %89 = OpLabel
+         %90 = OpFunctionCall %void %countTrailingZeros_21e394
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %65
-         %85 = OpLabel
-         %86 = OpFunctionCall %void %countTrailingZeros_21e394
+%compute_main = OpFunction %void None %68
+         %92 = OpLabel
+         %93 = OpFunctionCall %void %countTrailingZeros_21e394
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.wgsl
index cafc47e..ed323d6 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/21e394.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countTrailingZeros_21e394() {
   var arg_0 = 1u;
   var res : u32 = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_21e394();
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl
index 776ef4f..6239f66 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl
@@ -25,7 +25,9 @@
 fn countTrailingZeros_327c37() {
   var arg_0 = vec2<i32>(1i);
   var res: vec2<i32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.dxc.hlsl
index 0e85869..70a6226 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_327c37() {
   int2 arg_0 = (1).xx;
   int2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.fxc.hlsl
index 0e85869..70a6226 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_327c37() {
   int2 arg_0 = (1).xx;
   int2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.glsl b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.glsl
index 8dd2979..297d6da 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_327c37() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_327c37() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void countTrailingZeros_327c37() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.msl b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.msl
index fb1d1df..44afa50 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_327c37() {
+void countTrailingZeros_327c37(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 res = ctz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_327c37();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  countTrailingZeros_327c37(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_327c37();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_327c37(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_327c37();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_327c37(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.spvasm
index d086314..e288bd6 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 104
+; Bound: 111
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_trailing_zeros "tint_count_trailing_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,117 +41,125 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-          %9 = OpTypeFunction %v2int %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2int %v2int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %20 = OpConstantNull %v2uint
+         %23 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
  %uint_65535 = OpConstant %uint 65535
-         %27 = OpConstantComposite %v2uint %uint_65535 %uint_65535
+         %30 = OpConstantComposite %v2uint %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %30 = OpConstantComposite %v2uint %uint_16 %uint_16
+         %33 = OpConstantComposite %v2uint %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %37 = OpConstantComposite %v2uint %uint_255 %uint_255
+         %40 = OpConstantComposite %v2uint %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %40 = OpConstantComposite %v2uint %uint_8 %uint_8
+         %43 = OpConstantComposite %v2uint %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %47 = OpConstantComposite %v2uint %uint_15 %uint_15
+         %50 = OpConstantComposite %v2uint %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %50 = OpConstantComposite %v2uint %uint_4 %uint_4
+         %53 = OpConstantComposite %v2uint %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %57 = OpConstantComposite %v2uint %uint_3 %uint_3
+         %60 = OpConstantComposite %v2uint %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %60 = OpConstantComposite %v2uint %uint_2 %uint_2
+         %63 = OpConstantComposite %v2uint %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %67 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %70 = OpConstantComposite %v2uint %uint_1 %uint_1
        %void = OpTypeVoid
-         %78 = OpTypeFunction %void
+         %81 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %83 = OpConstantComposite %v2int %int_1 %int_1
+         %86 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %86 = OpConstantNull %v2int
-         %90 = OpTypeFunction %v4float
+         %89 = OpConstantNull %v2int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %97 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_trailing_zeros = OpFunction %v2int None %9
+%tint_count_trailing_zeros = OpFunction %v2int None %14
           %v = OpFunctionParameter %v2int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v2uint Function %20
-         %15 = OpBitcast %v2uint %v
-               OpStore %x %15
-         %25 = OpLoad %v2uint %x
-         %28 = OpBitwiseAnd %v2uint %25 %27
-         %22 = OpINotEqual %v2bool %28 %20
-         %21 = OpSelect %v2uint %22 %20 %30
-         %31 = OpLoad %v2uint %x
-         %32 = OpShiftRightLogical %v2uint %31 %21
-               OpStore %x %32
-         %35 = OpLoad %v2uint %x
-         %38 = OpBitwiseAnd %v2uint %35 %37
-         %34 = OpINotEqual %v2bool %38 %20
-         %33 = OpSelect %v2uint %34 %20 %40
-         %41 = OpLoad %v2uint %x
-         %42 = OpShiftRightLogical %v2uint %41 %33
-               OpStore %x %42
-         %45 = OpLoad %v2uint %x
-         %48 = OpBitwiseAnd %v2uint %45 %47
-         %44 = OpINotEqual %v2bool %48 %20
-         %43 = OpSelect %v2uint %44 %20 %50
-         %51 = OpLoad %v2uint %x
-         %52 = OpShiftRightLogical %v2uint %51 %43
-               OpStore %x %52
-         %55 = OpLoad %v2uint %x
-         %58 = OpBitwiseAnd %v2uint %55 %57
-         %54 = OpINotEqual %v2bool %58 %20
-         %53 = OpSelect %v2uint %54 %20 %60
-         %61 = OpLoad %v2uint %x
-         %62 = OpShiftRightLogical %v2uint %61 %53
-               OpStore %x %62
-         %65 = OpLoad %v2uint %x
-         %68 = OpBitwiseAnd %v2uint %65 %67
-         %64 = OpINotEqual %v2bool %68 %20
-         %63 = OpSelect %v2uint %64 %20 %67
-         %70 = OpLoad %v2uint %x
-         %71 = OpIEqual %v2bool %70 %20
-         %69 = OpSelect %v2uint %71 %67 %20
-         %73 = OpBitwiseOr %v2uint %21 %33
-         %74 = OpBitwiseOr %v2uint %73 %43
-         %75 = OpBitwiseOr %v2uint %74 %53
-         %76 = OpBitwiseOr %v2uint %75 %63
-         %77 = OpIAdd %v2uint %76 %69
-         %72 = OpBitcast %v2int %77
-               OpReturnValue %72
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v2uint Function %23
+         %18 = OpBitcast %v2uint %v
+               OpStore %x %18
+         %28 = OpLoad %v2uint %x
+         %31 = OpBitwiseAnd %v2uint %28 %30
+         %25 = OpINotEqual %v2bool %31 %23
+         %24 = OpSelect %v2uint %25 %23 %33
+         %34 = OpLoad %v2uint %x
+         %35 = OpShiftRightLogical %v2uint %34 %24
+               OpStore %x %35
+         %38 = OpLoad %v2uint %x
+         %41 = OpBitwiseAnd %v2uint %38 %40
+         %37 = OpINotEqual %v2bool %41 %23
+         %36 = OpSelect %v2uint %37 %23 %43
+         %44 = OpLoad %v2uint %x
+         %45 = OpShiftRightLogical %v2uint %44 %36
+               OpStore %x %45
+         %48 = OpLoad %v2uint %x
+         %51 = OpBitwiseAnd %v2uint %48 %50
+         %47 = OpINotEqual %v2bool %51 %23
+         %46 = OpSelect %v2uint %47 %23 %53
+         %54 = OpLoad %v2uint %x
+         %55 = OpShiftRightLogical %v2uint %54 %46
+               OpStore %x %55
+         %58 = OpLoad %v2uint %x
+         %61 = OpBitwiseAnd %v2uint %58 %60
+         %57 = OpINotEqual %v2bool %61 %23
+         %56 = OpSelect %v2uint %57 %23 %63
+         %64 = OpLoad %v2uint %x
+         %65 = OpShiftRightLogical %v2uint %64 %56
+               OpStore %x %65
+         %68 = OpLoad %v2uint %x
+         %71 = OpBitwiseAnd %v2uint %68 %70
+         %67 = OpINotEqual %v2bool %71 %23
+         %66 = OpSelect %v2uint %67 %23 %70
+         %73 = OpLoad %v2uint %x
+         %74 = OpIEqual %v2bool %73 %23
+         %72 = OpSelect %v2uint %74 %70 %23
+         %76 = OpBitwiseOr %v2uint %24 %36
+         %77 = OpBitwiseOr %v2uint %76 %46
+         %78 = OpBitwiseOr %v2uint %77 %56
+         %79 = OpBitwiseOr %v2uint %78 %66
+         %80 = OpIAdd %v2uint %79 %72
+         %75 = OpBitcast %v2int %80
+               OpReturnValue %75
                OpFunctionEnd
-%countTrailingZeros_327c37 = OpFunction %void None %78
-         %81 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %86
-        %res = OpVariable %_ptr_Function_v2int Function %86
-               OpStore %arg_0 %83
-         %88 = OpLoad %v2int %arg_0
-         %87 = OpFunctionCall %v2int %tint_count_trailing_zeros %88
-               OpStore %res %87
+%countTrailingZeros_327c37 = OpFunction %void None %81
+         %84 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %89
+        %res = OpVariable %_ptr_Function_v2int Function %89
+               OpStore %arg_0 %86
+         %91 = OpLoad %v2int %arg_0
+         %90 = OpFunctionCall %v2int %tint_count_trailing_zeros %91
+               OpStore %res %90
+         %95 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %96 = OpLoad %v2int %res
+               OpStore %95 %96
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %90
-         %92 = OpLabel
-         %93 = OpFunctionCall %void %countTrailingZeros_327c37
+%vertex_main_inner = OpFunction %v4float None %97
+         %99 = OpLabel
+        %100 = OpFunctionCall %void %countTrailingZeros_327c37
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %78
-         %95 = OpLabel
-         %96 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %96
+%vertex_main = OpFunction %void None %81
+        %102 = OpLabel
+        %103 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %103
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %78
-         %99 = OpLabel
-        %100 = OpFunctionCall %void %countTrailingZeros_327c37
+%fragment_main = OpFunction %void None %81
+        %106 = OpLabel
+        %107 = OpFunctionCall %void %countTrailingZeros_327c37
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %78
-        %102 = OpLabel
-        %103 = OpFunctionCall %void %countTrailingZeros_327c37
+%compute_main = OpFunction %void None %81
+        %109 = OpLabel
+        %110 = OpFunctionCall %void %countTrailingZeros_327c37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.wgsl
index 6ef3225..370d225 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/327c37.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countTrailingZeros_327c37() {
   var arg_0 = vec2<i32>(1i);
   var res : vec2<i32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_327c37();
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl
index 7764842..3ebfe0e3 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl
@@ -25,7 +25,9 @@
 fn countTrailingZeros_42fed6() {
   var arg_0 = 1i;
   var res: i32 = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.dxc.hlsl
index 464986a..939308f 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_42fed6() {
   int arg_0 = 1;
   int res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.fxc.hlsl
index 464986a..939308f 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_42fed6() {
   int arg_0 = 1;
   int res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.glsl b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.glsl
index 80ff533..d2807ad 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countTrailingZeros_42fed6() {
   int arg_0 = 1;
   int res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countTrailingZeros_42fed6() {
   int arg_0 = 1;
   int res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void countTrailingZeros_42fed6() {
   int arg_0 = 1;
   int res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.msl b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.msl
index 6811b6b..dfdc3b3 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_42fed6() {
+void countTrailingZeros_42fed6(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int res = ctz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_42fed6();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  countTrailingZeros_42fed6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_42fed6();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_42fed6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_42fed6();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_42fed6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.spvasm
index f727b4e..3aa21db 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 91
+; Bound: 98
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_trailing_zeros "tint_count_trailing_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,10 +40,13 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
-          %9 = OpTypeFunction %int %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %int %int
        %uint = OpTypeInt 32 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
+         %21 = OpConstantNull %uint
        %bool = OpTypeBool
  %uint_65535 = OpConstant %uint 65535
     %uint_16 = OpConstant %uint 16
@@ -48,90 +58,95 @@
      %uint_2 = OpConstant %uint 2
      %uint_1 = OpConstant %uint 1
        %void = OpTypeVoid
-         %66 = OpTypeFunction %void
+         %69 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %73 = OpConstantNull %int
-         %77 = OpTypeFunction %v4float
+         %76 = OpConstantNull %int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %84 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_trailing_zeros = OpFunction %int None %9
+%tint_count_trailing_zeros = OpFunction %int None %13
           %v = OpFunctionParameter %int
-         %13 = OpLabel
-          %x = OpVariable %_ptr_Function_uint Function %18
-         %14 = OpBitcast %uint %v
-               OpStore %x %14
-         %22 = OpLoad %uint %x
-         %24 = OpBitwiseAnd %uint %22 %uint_65535
-         %20 = OpINotEqual %bool %24 %18
-         %19 = OpSelect %uint %20 %18 %uint_16
-         %26 = OpLoad %uint %x
-         %27 = OpShiftRightLogical %uint %26 %19
-               OpStore %x %27
-         %30 = OpLoad %uint %x
-         %32 = OpBitwiseAnd %uint %30 %uint_255
-         %29 = OpINotEqual %bool %32 %18
-         %28 = OpSelect %uint %29 %18 %uint_8
-         %34 = OpLoad %uint %x
-         %35 = OpShiftRightLogical %uint %34 %28
-               OpStore %x %35
-         %38 = OpLoad %uint %x
-         %40 = OpBitwiseAnd %uint %38 %uint_15
-         %37 = OpINotEqual %bool %40 %18
-         %36 = OpSelect %uint %37 %18 %uint_4
-         %42 = OpLoad %uint %x
-         %43 = OpShiftRightLogical %uint %42 %36
-               OpStore %x %43
-         %46 = OpLoad %uint %x
-         %48 = OpBitwiseAnd %uint %46 %uint_3
-         %45 = OpINotEqual %bool %48 %18
-         %44 = OpSelect %uint %45 %18 %uint_2
-         %50 = OpLoad %uint %x
-         %51 = OpShiftRightLogical %uint %50 %44
-               OpStore %x %51
-         %54 = OpLoad %uint %x
-         %56 = OpBitwiseAnd %uint %54 %uint_1
-         %53 = OpINotEqual %bool %56 %18
-         %52 = OpSelect %uint %53 %18 %uint_1
-         %58 = OpLoad %uint %x
-         %59 = OpIEqual %bool %58 %18
-         %57 = OpSelect %uint %59 %uint_1 %18
-         %61 = OpBitwiseOr %uint %19 %28
-         %62 = OpBitwiseOr %uint %61 %36
-         %63 = OpBitwiseOr %uint %62 %44
-         %64 = OpBitwiseOr %uint %63 %52
-         %65 = OpIAdd %uint %64 %57
-         %60 = OpBitcast %int %65
-               OpReturnValue %60
+         %16 = OpLabel
+          %x = OpVariable %_ptr_Function_uint Function %21
+         %17 = OpBitcast %uint %v
+               OpStore %x %17
+         %25 = OpLoad %uint %x
+         %27 = OpBitwiseAnd %uint %25 %uint_65535
+         %23 = OpINotEqual %bool %27 %21
+         %22 = OpSelect %uint %23 %21 %uint_16
+         %29 = OpLoad %uint %x
+         %30 = OpShiftRightLogical %uint %29 %22
+               OpStore %x %30
+         %33 = OpLoad %uint %x
+         %35 = OpBitwiseAnd %uint %33 %uint_255
+         %32 = OpINotEqual %bool %35 %21
+         %31 = OpSelect %uint %32 %21 %uint_8
+         %37 = OpLoad %uint %x
+         %38 = OpShiftRightLogical %uint %37 %31
+               OpStore %x %38
+         %41 = OpLoad %uint %x
+         %43 = OpBitwiseAnd %uint %41 %uint_15
+         %40 = OpINotEqual %bool %43 %21
+         %39 = OpSelect %uint %40 %21 %uint_4
+         %45 = OpLoad %uint %x
+         %46 = OpShiftRightLogical %uint %45 %39
+               OpStore %x %46
+         %49 = OpLoad %uint %x
+         %51 = OpBitwiseAnd %uint %49 %uint_3
+         %48 = OpINotEqual %bool %51 %21
+         %47 = OpSelect %uint %48 %21 %uint_2
+         %53 = OpLoad %uint %x
+         %54 = OpShiftRightLogical %uint %53 %47
+               OpStore %x %54
+         %57 = OpLoad %uint %x
+         %59 = OpBitwiseAnd %uint %57 %uint_1
+         %56 = OpINotEqual %bool %59 %21
+         %55 = OpSelect %uint %56 %21 %uint_1
+         %61 = OpLoad %uint %x
+         %62 = OpIEqual %bool %61 %21
+         %60 = OpSelect %uint %62 %uint_1 %21
+         %64 = OpBitwiseOr %uint %22 %31
+         %65 = OpBitwiseOr %uint %64 %39
+         %66 = OpBitwiseOr %uint %65 %47
+         %67 = OpBitwiseOr %uint %66 %55
+         %68 = OpIAdd %uint %67 %60
+         %63 = OpBitcast %int %68
+               OpReturnValue %63
                OpFunctionEnd
-%countTrailingZeros_42fed6 = OpFunction %void None %66
-         %69 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %73
-        %res = OpVariable %_ptr_Function_int Function %73
+%countTrailingZeros_42fed6 = OpFunction %void None %69
+         %72 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %76
+        %res = OpVariable %_ptr_Function_int Function %76
                OpStore %arg_0 %int_1
-         %75 = OpLoad %int %arg_0
-         %74 = OpFunctionCall %int %tint_count_trailing_zeros %75
-               OpStore %res %74
+         %78 = OpLoad %int %arg_0
+         %77 = OpFunctionCall %int %tint_count_trailing_zeros %78
+               OpStore %res %77
+         %82 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %83 = OpLoad %int %res
+               OpStore %82 %83
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %77
-         %79 = OpLabel
-         %80 = OpFunctionCall %void %countTrailingZeros_42fed6
+%vertex_main_inner = OpFunction %v4float None %84
+         %86 = OpLabel
+         %87 = OpFunctionCall %void %countTrailingZeros_42fed6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %66
-         %82 = OpLabel
-         %83 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %83
+%vertex_main = OpFunction %void None %69
+         %89 = OpLabel
+         %90 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %90
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %66
-         %86 = OpLabel
-         %87 = OpFunctionCall %void %countTrailingZeros_42fed6
+%fragment_main = OpFunction %void None %69
+         %93 = OpLabel
+         %94 = OpFunctionCall %void %countTrailingZeros_42fed6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %66
-         %89 = OpLabel
-         %90 = OpFunctionCall %void %countTrailingZeros_42fed6
+%compute_main = OpFunction %void None %69
+         %96 = OpLabel
+         %97 = OpFunctionCall %void %countTrailingZeros_42fed6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.wgsl
index dff5522..dbe020c 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/42fed6.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countTrailingZeros_42fed6() {
   var arg_0 = 1i;
   var res : i32 = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_42fed6();
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl
index 5f63575..077f285 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl
@@ -25,7 +25,9 @@
 fn countTrailingZeros_8ed26f() {
   var arg_0 = vec3<u32>(1u);
   var res: vec3<u32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.dxc.hlsl
index 12171a8..311e116 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_8ed26f() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.fxc.hlsl
index 12171a8..311e116 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_8ed26f() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.glsl b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.glsl
index 0fcada9..6e7954b 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_8ed26f() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_8ed26f() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_8ed26f() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.msl b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.msl
index 2545f18..754dc31 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_8ed26f() {
+void countTrailingZeros_8ed26f(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 res = ctz(arg_0);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_8ed26f();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  countTrailingZeros_8ed26f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_8ed26f();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_8ed26f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_8ed26f();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_8ed26f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.spvasm
index 37e4948..d8e8273 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 98
+; Bound: 105
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_trailing_zeros "tint_count_trailing_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,109 +41,117 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-          %9 = OpTypeFunction %v3uint %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3uint %v3uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %18 = OpConstantNull %v3uint
+         %21 = OpConstantNull %v3uint
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
  %uint_65535 = OpConstant %uint 65535
-         %25 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
+         %28 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %28 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
+         %31 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %35 = OpConstantComposite %v3uint %uint_255 %uint_255 %uint_255
+         %38 = OpConstantComposite %v3uint %uint_255 %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
+         %41 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %45 = OpConstantComposite %v3uint %uint_15 %uint_15 %uint_15
+         %48 = OpConstantComposite %v3uint %uint_15 %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %48 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
+         %51 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %55 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
+         %58 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %58 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
+         %61 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %68 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
        %void = OpTypeVoid
-         %76 = OpTypeFunction %void
-         %84 = OpTypeFunction %v4float
+         %79 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %91 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_trailing_zeros = OpFunction %v3uint None %9
+%tint_count_trailing_zeros = OpFunction %v3uint None %14
           %v = OpFunctionParameter %v3uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v3uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v3uint Function %21
                OpStore %x %v
-         %23 = OpLoad %v3uint %x
-         %26 = OpBitwiseAnd %v3uint %23 %25
-         %20 = OpINotEqual %v3bool %26 %18
-         %19 = OpSelect %v3uint %20 %18 %28
-         %29 = OpLoad %v3uint %x
-         %30 = OpShiftRightLogical %v3uint %29 %19
-               OpStore %x %30
-         %33 = OpLoad %v3uint %x
-         %36 = OpBitwiseAnd %v3uint %33 %35
-         %32 = OpINotEqual %v3bool %36 %18
-         %31 = OpSelect %v3uint %32 %18 %38
-         %39 = OpLoad %v3uint %x
-         %40 = OpShiftRightLogical %v3uint %39 %31
-               OpStore %x %40
-         %43 = OpLoad %v3uint %x
-         %46 = OpBitwiseAnd %v3uint %43 %45
-         %42 = OpINotEqual %v3bool %46 %18
-         %41 = OpSelect %v3uint %42 %18 %48
-         %49 = OpLoad %v3uint %x
-         %50 = OpShiftRightLogical %v3uint %49 %41
-               OpStore %x %50
-         %53 = OpLoad %v3uint %x
-         %56 = OpBitwiseAnd %v3uint %53 %55
-         %52 = OpINotEqual %v3bool %56 %18
-         %51 = OpSelect %v3uint %52 %18 %58
-         %59 = OpLoad %v3uint %x
-         %60 = OpShiftRightLogical %v3uint %59 %51
-               OpStore %x %60
-         %63 = OpLoad %v3uint %x
-         %66 = OpBitwiseAnd %v3uint %63 %65
-         %62 = OpINotEqual %v3bool %66 %18
-         %61 = OpSelect %v3uint %62 %18 %65
-         %68 = OpLoad %v3uint %x
-         %69 = OpIEqual %v3bool %68 %18
-         %67 = OpSelect %v3uint %69 %65 %18
-         %71 = OpBitwiseOr %v3uint %19 %31
-         %72 = OpBitwiseOr %v3uint %71 %41
-         %73 = OpBitwiseOr %v3uint %72 %51
-         %74 = OpBitwiseOr %v3uint %73 %61
-         %75 = OpIAdd %v3uint %74 %67
-               OpReturnValue %75
+         %26 = OpLoad %v3uint %x
+         %29 = OpBitwiseAnd %v3uint %26 %28
+         %23 = OpINotEqual %v3bool %29 %21
+         %22 = OpSelect %v3uint %23 %21 %31
+         %32 = OpLoad %v3uint %x
+         %33 = OpShiftRightLogical %v3uint %32 %22
+               OpStore %x %33
+         %36 = OpLoad %v3uint %x
+         %39 = OpBitwiseAnd %v3uint %36 %38
+         %35 = OpINotEqual %v3bool %39 %21
+         %34 = OpSelect %v3uint %35 %21 %41
+         %42 = OpLoad %v3uint %x
+         %43 = OpShiftRightLogical %v3uint %42 %34
+               OpStore %x %43
+         %46 = OpLoad %v3uint %x
+         %49 = OpBitwiseAnd %v3uint %46 %48
+         %45 = OpINotEqual %v3bool %49 %21
+         %44 = OpSelect %v3uint %45 %21 %51
+         %52 = OpLoad %v3uint %x
+         %53 = OpShiftRightLogical %v3uint %52 %44
+               OpStore %x %53
+         %56 = OpLoad %v3uint %x
+         %59 = OpBitwiseAnd %v3uint %56 %58
+         %55 = OpINotEqual %v3bool %59 %21
+         %54 = OpSelect %v3uint %55 %21 %61
+         %62 = OpLoad %v3uint %x
+         %63 = OpShiftRightLogical %v3uint %62 %54
+               OpStore %x %63
+         %66 = OpLoad %v3uint %x
+         %69 = OpBitwiseAnd %v3uint %66 %68
+         %65 = OpINotEqual %v3bool %69 %21
+         %64 = OpSelect %v3uint %65 %21 %68
+         %71 = OpLoad %v3uint %x
+         %72 = OpIEqual %v3bool %71 %21
+         %70 = OpSelect %v3uint %72 %68 %21
+         %74 = OpBitwiseOr %v3uint %22 %34
+         %75 = OpBitwiseOr %v3uint %74 %44
+         %76 = OpBitwiseOr %v3uint %75 %54
+         %77 = OpBitwiseOr %v3uint %76 %64
+         %78 = OpIAdd %v3uint %77 %70
+               OpReturnValue %78
                OpFunctionEnd
-%countTrailingZeros_8ed26f = OpFunction %void None %76
-         %79 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %18
-        %res = OpVariable %_ptr_Function_v3uint Function %18
-               OpStore %arg_0 %65
-         %82 = OpLoad %v3uint %arg_0
-         %81 = OpFunctionCall %v3uint %tint_count_trailing_zeros %82
-               OpStore %res %81
+%countTrailingZeros_8ed26f = OpFunction %void None %79
+         %82 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %21
+        %res = OpVariable %_ptr_Function_v3uint Function %21
+               OpStore %arg_0 %68
+         %85 = OpLoad %v3uint %arg_0
+         %84 = OpFunctionCall %v3uint %tint_count_trailing_zeros %85
+               OpStore %res %84
+         %89 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %90 = OpLoad %v3uint %res
+               OpStore %89 %90
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %84
-         %86 = OpLabel
-         %87 = OpFunctionCall %void %countTrailingZeros_8ed26f
+%vertex_main_inner = OpFunction %v4float None %91
+         %93 = OpLabel
+         %94 = OpFunctionCall %void %countTrailingZeros_8ed26f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %76
-         %89 = OpLabel
-         %90 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %90
+%vertex_main = OpFunction %void None %79
+         %96 = OpLabel
+         %97 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %97
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %76
-         %93 = OpLabel
-         %94 = OpFunctionCall %void %countTrailingZeros_8ed26f
+%fragment_main = OpFunction %void None %79
+        %100 = OpLabel
+        %101 = OpFunctionCall %void %countTrailingZeros_8ed26f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %76
-         %96 = OpLabel
-         %97 = OpFunctionCall %void %countTrailingZeros_8ed26f
+%compute_main = OpFunction %void None %79
+        %103 = OpLabel
+        %104 = OpFunctionCall %void %countTrailingZeros_8ed26f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.wgsl
index b3d15ef..251d690a 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/8ed26f.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countTrailingZeros_8ed26f() {
   var arg_0 = vec3<u32>(1u);
   var res : vec3<u32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_8ed26f();
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl
index 149d6ef..1fdbe84 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl
@@ -25,7 +25,9 @@
 fn countTrailingZeros_acfacb() {
   var arg_0 = vec3<i32>(1i);
   var res: vec3<i32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.dxc.hlsl
index 54a0737..635bc77 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_acfacb() {
   int3 arg_0 = (1).xxx;
   int3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.fxc.hlsl
index 54a0737..635bc77 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_acfacb() {
   int3 arg_0 = (1).xxx;
   int3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.glsl b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.glsl
index 78fee76..3f285e7 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_acfacb() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_acfacb() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void countTrailingZeros_acfacb() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.msl b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.msl
index ed30e64..980ad45 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_acfacb() {
+void countTrailingZeros_acfacb(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 res = ctz(arg_0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_acfacb();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  countTrailingZeros_acfacb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_acfacb();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_acfacb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_acfacb();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_acfacb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.spvasm
index 4413853..b05e214 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 104
+; Bound: 111
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_trailing_zeros "tint_count_trailing_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,117 +41,125 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-          %9 = OpTypeFunction %v3int %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3int %v3int
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %20 = OpConstantNull %v3uint
+         %23 = OpConstantNull %v3uint
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
  %uint_65535 = OpConstant %uint 65535
-         %27 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
+         %30 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %30 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
+         %33 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %37 = OpConstantComposite %v3uint %uint_255 %uint_255 %uint_255
+         %40 = OpConstantComposite %v3uint %uint_255 %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %40 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
+         %43 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %47 = OpConstantComposite %v3uint %uint_15 %uint_15 %uint_15
+         %50 = OpConstantComposite %v3uint %uint_15 %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %50 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
+         %53 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %57 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
+         %60 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %60 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
+         %63 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %67 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %70 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
        %void = OpTypeVoid
-         %78 = OpTypeFunction %void
+         %81 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %83 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %86 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %86 = OpConstantNull %v3int
-         %90 = OpTypeFunction %v4float
+         %89 = OpConstantNull %v3int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %97 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_trailing_zeros = OpFunction %v3int None %9
+%tint_count_trailing_zeros = OpFunction %v3int None %14
           %v = OpFunctionParameter %v3int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v3uint Function %20
-         %15 = OpBitcast %v3uint %v
-               OpStore %x %15
-         %25 = OpLoad %v3uint %x
-         %28 = OpBitwiseAnd %v3uint %25 %27
-         %22 = OpINotEqual %v3bool %28 %20
-         %21 = OpSelect %v3uint %22 %20 %30
-         %31 = OpLoad %v3uint %x
-         %32 = OpShiftRightLogical %v3uint %31 %21
-               OpStore %x %32
-         %35 = OpLoad %v3uint %x
-         %38 = OpBitwiseAnd %v3uint %35 %37
-         %34 = OpINotEqual %v3bool %38 %20
-         %33 = OpSelect %v3uint %34 %20 %40
-         %41 = OpLoad %v3uint %x
-         %42 = OpShiftRightLogical %v3uint %41 %33
-               OpStore %x %42
-         %45 = OpLoad %v3uint %x
-         %48 = OpBitwiseAnd %v3uint %45 %47
-         %44 = OpINotEqual %v3bool %48 %20
-         %43 = OpSelect %v3uint %44 %20 %50
-         %51 = OpLoad %v3uint %x
-         %52 = OpShiftRightLogical %v3uint %51 %43
-               OpStore %x %52
-         %55 = OpLoad %v3uint %x
-         %58 = OpBitwiseAnd %v3uint %55 %57
-         %54 = OpINotEqual %v3bool %58 %20
-         %53 = OpSelect %v3uint %54 %20 %60
-         %61 = OpLoad %v3uint %x
-         %62 = OpShiftRightLogical %v3uint %61 %53
-               OpStore %x %62
-         %65 = OpLoad %v3uint %x
-         %68 = OpBitwiseAnd %v3uint %65 %67
-         %64 = OpINotEqual %v3bool %68 %20
-         %63 = OpSelect %v3uint %64 %20 %67
-         %70 = OpLoad %v3uint %x
-         %71 = OpIEqual %v3bool %70 %20
-         %69 = OpSelect %v3uint %71 %67 %20
-         %73 = OpBitwiseOr %v3uint %21 %33
-         %74 = OpBitwiseOr %v3uint %73 %43
-         %75 = OpBitwiseOr %v3uint %74 %53
-         %76 = OpBitwiseOr %v3uint %75 %63
-         %77 = OpIAdd %v3uint %76 %69
-         %72 = OpBitcast %v3int %77
-               OpReturnValue %72
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v3uint Function %23
+         %18 = OpBitcast %v3uint %v
+               OpStore %x %18
+         %28 = OpLoad %v3uint %x
+         %31 = OpBitwiseAnd %v3uint %28 %30
+         %25 = OpINotEqual %v3bool %31 %23
+         %24 = OpSelect %v3uint %25 %23 %33
+         %34 = OpLoad %v3uint %x
+         %35 = OpShiftRightLogical %v3uint %34 %24
+               OpStore %x %35
+         %38 = OpLoad %v3uint %x
+         %41 = OpBitwiseAnd %v3uint %38 %40
+         %37 = OpINotEqual %v3bool %41 %23
+         %36 = OpSelect %v3uint %37 %23 %43
+         %44 = OpLoad %v3uint %x
+         %45 = OpShiftRightLogical %v3uint %44 %36
+               OpStore %x %45
+         %48 = OpLoad %v3uint %x
+         %51 = OpBitwiseAnd %v3uint %48 %50
+         %47 = OpINotEqual %v3bool %51 %23
+         %46 = OpSelect %v3uint %47 %23 %53
+         %54 = OpLoad %v3uint %x
+         %55 = OpShiftRightLogical %v3uint %54 %46
+               OpStore %x %55
+         %58 = OpLoad %v3uint %x
+         %61 = OpBitwiseAnd %v3uint %58 %60
+         %57 = OpINotEqual %v3bool %61 %23
+         %56 = OpSelect %v3uint %57 %23 %63
+         %64 = OpLoad %v3uint %x
+         %65 = OpShiftRightLogical %v3uint %64 %56
+               OpStore %x %65
+         %68 = OpLoad %v3uint %x
+         %71 = OpBitwiseAnd %v3uint %68 %70
+         %67 = OpINotEqual %v3bool %71 %23
+         %66 = OpSelect %v3uint %67 %23 %70
+         %73 = OpLoad %v3uint %x
+         %74 = OpIEqual %v3bool %73 %23
+         %72 = OpSelect %v3uint %74 %70 %23
+         %76 = OpBitwiseOr %v3uint %24 %36
+         %77 = OpBitwiseOr %v3uint %76 %46
+         %78 = OpBitwiseOr %v3uint %77 %56
+         %79 = OpBitwiseOr %v3uint %78 %66
+         %80 = OpIAdd %v3uint %79 %72
+         %75 = OpBitcast %v3int %80
+               OpReturnValue %75
                OpFunctionEnd
-%countTrailingZeros_acfacb = OpFunction %void None %78
-         %81 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %86
-        %res = OpVariable %_ptr_Function_v3int Function %86
-               OpStore %arg_0 %83
-         %88 = OpLoad %v3int %arg_0
-         %87 = OpFunctionCall %v3int %tint_count_trailing_zeros %88
-               OpStore %res %87
+%countTrailingZeros_acfacb = OpFunction %void None %81
+         %84 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %89
+        %res = OpVariable %_ptr_Function_v3int Function %89
+               OpStore %arg_0 %86
+         %91 = OpLoad %v3int %arg_0
+         %90 = OpFunctionCall %v3int %tint_count_trailing_zeros %91
+               OpStore %res %90
+         %95 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %96 = OpLoad %v3int %res
+               OpStore %95 %96
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %90
-         %92 = OpLabel
-         %93 = OpFunctionCall %void %countTrailingZeros_acfacb
+%vertex_main_inner = OpFunction %v4float None %97
+         %99 = OpLabel
+        %100 = OpFunctionCall %void %countTrailingZeros_acfacb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %78
-         %95 = OpLabel
-         %96 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %96
+%vertex_main = OpFunction %void None %81
+        %102 = OpLabel
+        %103 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %103
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %78
-         %99 = OpLabel
-        %100 = OpFunctionCall %void %countTrailingZeros_acfacb
+%fragment_main = OpFunction %void None %81
+        %106 = OpLabel
+        %107 = OpFunctionCall %void %countTrailingZeros_acfacb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %78
-        %102 = OpLabel
-        %103 = OpFunctionCall %void %countTrailingZeros_acfacb
+%compute_main = OpFunction %void None %81
+        %109 = OpLabel
+        %110 = OpFunctionCall %void %countTrailingZeros_acfacb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.wgsl
index af100cc..f85bd74 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/acfacb.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countTrailingZeros_acfacb() {
   var arg_0 = vec3<i32>(1i);
   var res : vec3<i32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_acfacb();
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl
index 0d1622d..18af947 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl
@@ -25,7 +25,9 @@
 fn countTrailingZeros_d2b4a0() {
   var arg_0 = vec4<u32>(1u);
   var res: vec4<u32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.dxc.hlsl
index 2af8797..c4c7d4f 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_d2b4a0() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.fxc.hlsl
index 2af8797..c4c7d4f 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void countTrailingZeros_d2b4a0() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.glsl b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.glsl
index 474e8d5..0e62166 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_d2b4a0() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_d2b4a0() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) + is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void countTrailingZeros_d2b4a0() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_count_trailing_zeros(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.msl b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.msl
index f6ae4d0..0911239 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void countTrailingZeros_d2b4a0() {
+void countTrailingZeros_d2b4a0(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 res = ctz(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  countTrailingZeros_d2b4a0();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  countTrailingZeros_d2b4a0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  countTrailingZeros_d2b4a0();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  countTrailingZeros_d2b4a0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  countTrailingZeros_d2b4a0();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  countTrailingZeros_d2b4a0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.spvasm
index cd58a15..9e7504d 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 98
+; Bound: 105
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_count_trailing_zeros "tint_count_trailing_zeros"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,109 +41,117 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-          %9 = OpTypeFunction %v4uint %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4uint %v4uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %18 = OpConstantNull %v4uint
+         %21 = OpConstantNull %v4uint
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
  %uint_65535 = OpConstant %uint 65535
-         %25 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
+         %28 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %28 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
+         %31 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %35 = OpConstantComposite %v4uint %uint_255 %uint_255 %uint_255 %uint_255
+         %38 = OpConstantComposite %v4uint %uint_255 %uint_255 %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
+         %41 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %45 = OpConstantComposite %v4uint %uint_15 %uint_15 %uint_15 %uint_15
+         %48 = OpConstantComposite %v4uint %uint_15 %uint_15 %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %48 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
+         %51 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %55 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
+         %58 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %58 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
+         %61 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %68 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
        %void = OpTypeVoid
-         %76 = OpTypeFunction %void
-         %84 = OpTypeFunction %v4float
+         %79 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %91 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_count_trailing_zeros = OpFunction %v4uint None %9
+%tint_count_trailing_zeros = OpFunction %v4uint None %14
           %v = OpFunctionParameter %v4uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v4uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v4uint Function %21
                OpStore %x %v
-         %23 = OpLoad %v4uint %x
-         %26 = OpBitwiseAnd %v4uint %23 %25
-         %20 = OpINotEqual %v4bool %26 %18
-         %19 = OpSelect %v4uint %20 %18 %28
-         %29 = OpLoad %v4uint %x
-         %30 = OpShiftRightLogical %v4uint %29 %19
-               OpStore %x %30
-         %33 = OpLoad %v4uint %x
-         %36 = OpBitwiseAnd %v4uint %33 %35
-         %32 = OpINotEqual %v4bool %36 %18
-         %31 = OpSelect %v4uint %32 %18 %38
-         %39 = OpLoad %v4uint %x
-         %40 = OpShiftRightLogical %v4uint %39 %31
-               OpStore %x %40
-         %43 = OpLoad %v4uint %x
-         %46 = OpBitwiseAnd %v4uint %43 %45
-         %42 = OpINotEqual %v4bool %46 %18
-         %41 = OpSelect %v4uint %42 %18 %48
-         %49 = OpLoad %v4uint %x
-         %50 = OpShiftRightLogical %v4uint %49 %41
-               OpStore %x %50
-         %53 = OpLoad %v4uint %x
-         %56 = OpBitwiseAnd %v4uint %53 %55
-         %52 = OpINotEqual %v4bool %56 %18
-         %51 = OpSelect %v4uint %52 %18 %58
-         %59 = OpLoad %v4uint %x
-         %60 = OpShiftRightLogical %v4uint %59 %51
-               OpStore %x %60
-         %63 = OpLoad %v4uint %x
-         %66 = OpBitwiseAnd %v4uint %63 %65
-         %62 = OpINotEqual %v4bool %66 %18
-         %61 = OpSelect %v4uint %62 %18 %65
-         %68 = OpLoad %v4uint %x
-         %69 = OpIEqual %v4bool %68 %18
-         %67 = OpSelect %v4uint %69 %65 %18
-         %71 = OpBitwiseOr %v4uint %19 %31
-         %72 = OpBitwiseOr %v4uint %71 %41
-         %73 = OpBitwiseOr %v4uint %72 %51
-         %74 = OpBitwiseOr %v4uint %73 %61
-         %75 = OpIAdd %v4uint %74 %67
-               OpReturnValue %75
+         %26 = OpLoad %v4uint %x
+         %29 = OpBitwiseAnd %v4uint %26 %28
+         %23 = OpINotEqual %v4bool %29 %21
+         %22 = OpSelect %v4uint %23 %21 %31
+         %32 = OpLoad %v4uint %x
+         %33 = OpShiftRightLogical %v4uint %32 %22
+               OpStore %x %33
+         %36 = OpLoad %v4uint %x
+         %39 = OpBitwiseAnd %v4uint %36 %38
+         %35 = OpINotEqual %v4bool %39 %21
+         %34 = OpSelect %v4uint %35 %21 %41
+         %42 = OpLoad %v4uint %x
+         %43 = OpShiftRightLogical %v4uint %42 %34
+               OpStore %x %43
+         %46 = OpLoad %v4uint %x
+         %49 = OpBitwiseAnd %v4uint %46 %48
+         %45 = OpINotEqual %v4bool %49 %21
+         %44 = OpSelect %v4uint %45 %21 %51
+         %52 = OpLoad %v4uint %x
+         %53 = OpShiftRightLogical %v4uint %52 %44
+               OpStore %x %53
+         %56 = OpLoad %v4uint %x
+         %59 = OpBitwiseAnd %v4uint %56 %58
+         %55 = OpINotEqual %v4bool %59 %21
+         %54 = OpSelect %v4uint %55 %21 %61
+         %62 = OpLoad %v4uint %x
+         %63 = OpShiftRightLogical %v4uint %62 %54
+               OpStore %x %63
+         %66 = OpLoad %v4uint %x
+         %69 = OpBitwiseAnd %v4uint %66 %68
+         %65 = OpINotEqual %v4bool %69 %21
+         %64 = OpSelect %v4uint %65 %21 %68
+         %71 = OpLoad %v4uint %x
+         %72 = OpIEqual %v4bool %71 %21
+         %70 = OpSelect %v4uint %72 %68 %21
+         %74 = OpBitwiseOr %v4uint %22 %34
+         %75 = OpBitwiseOr %v4uint %74 %44
+         %76 = OpBitwiseOr %v4uint %75 %54
+         %77 = OpBitwiseOr %v4uint %76 %64
+         %78 = OpIAdd %v4uint %77 %70
+               OpReturnValue %78
                OpFunctionEnd
-%countTrailingZeros_d2b4a0 = OpFunction %void None %76
-         %79 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %18
-        %res = OpVariable %_ptr_Function_v4uint Function %18
-               OpStore %arg_0 %65
-         %82 = OpLoad %v4uint %arg_0
-         %81 = OpFunctionCall %v4uint %tint_count_trailing_zeros %82
-               OpStore %res %81
+%countTrailingZeros_d2b4a0 = OpFunction %void None %79
+         %82 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %21
+        %res = OpVariable %_ptr_Function_v4uint Function %21
+               OpStore %arg_0 %68
+         %85 = OpLoad %v4uint %arg_0
+         %84 = OpFunctionCall %v4uint %tint_count_trailing_zeros %85
+               OpStore %res %84
+         %89 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %90 = OpLoad %v4uint %res
+               OpStore %89 %90
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %84
-         %86 = OpLabel
-         %87 = OpFunctionCall %void %countTrailingZeros_d2b4a0
+%vertex_main_inner = OpFunction %v4float None %91
+         %93 = OpLabel
+         %94 = OpFunctionCall %void %countTrailingZeros_d2b4a0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %76
-         %89 = OpLabel
-         %90 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %90
+%vertex_main = OpFunction %void None %79
+         %96 = OpLabel
+         %97 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %97
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %76
-         %93 = OpLabel
-         %94 = OpFunctionCall %void %countTrailingZeros_d2b4a0
+%fragment_main = OpFunction %void None %79
+        %100 = OpLabel
+        %101 = OpFunctionCall %void %countTrailingZeros_d2b4a0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %76
-         %96 = OpLabel
-         %97 = OpFunctionCall %void %countTrailingZeros_d2b4a0
+%compute_main = OpFunction %void None %79
+        %103 = OpLabel
+        %104 = OpFunctionCall %void %countTrailingZeros_d2b4a0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.wgsl
index 940212d..80f75da 100644
--- a/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/countTrailingZeros/d2b4a0.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn countTrailingZeros_d2b4a0() {
   var arg_0 = vec4<u32>(1u);
   var res : vec4<u32> = countTrailingZeros(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   countTrailingZeros_d2b4a0();
diff --git a/test/tint/builtins/gen/var/cross/041cb0.wgsl b/test/tint/builtins/gen/var/cross/041cb0.wgsl
index d9899e3..63e6973 100644
--- a/test/tint/builtins/gen/var/cross/041cb0.wgsl
+++ b/test/tint/builtins/gen/var/cross/041cb0.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: vec3<f32> = cross(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.dxc.hlsl
index 01264e7..e9d6343 100644
--- a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cross_041cb0() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = cross(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.fxc.hlsl
index 01264e7..e9d6343 100644
--- a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cross_041cb0() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = cross(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.glsl b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.glsl
index f31f8e1..dc87e92 100644
--- a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cross_041cb0() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = cross(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cross_041cb0() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = cross(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void cross_041cb0() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = cross(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.msl b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.msl
index 657d9cb..9d8593c 100644
--- a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cross_041cb0() {
+void cross_041cb0(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 res = cross(arg_0, arg_1);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cross_041cb0();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  cross_041cb0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cross_041cb0();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  cross_041cb0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cross_041cb0();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  cross_041cb0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.spvasm
index 3fe3bc6..5c76195 100644
--- a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cross_041cb0 "cross_041cb0"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %25 = OpTypeFunction %v4float
-%cross_041cb0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v3float %arg_0
-         %23 = OpLoad %v3float %arg_1
-         %20 = OpExtInst %v3float %21 Cross %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %33 = OpTypeFunction %v4float
+%cross_041cb0 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v3float %arg_0
+         %26 = OpLoad %v3float %arg_1
+         %23 = OpExtInst %v3float %24 Cross %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %32 = OpLoad %v3float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %cross_041cb0
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %cross_041cb0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %cross_041cb0
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %cross_041cb0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %cross_041cb0
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %cross_041cb0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.wgsl
index fa2f691..6c6f3a2 100644
--- a/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cross/041cb0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : vec3<f32> = cross(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cross_041cb0();
diff --git a/test/tint/builtins/gen/var/cross/1d7933.wgsl b/test/tint/builtins/gen/var/cross/1d7933.wgsl
index 204ef2c..b304488 100644
--- a/test/tint/builtins/gen/var/cross/1d7933.wgsl
+++ b/test/tint/builtins/gen/var/cross/1d7933.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = cross(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cross_1d7933();
diff --git a/test/tint/builtins/gen/var/cross/9857cb.wgsl b/test/tint/builtins/gen/var/cross/9857cb.wgsl
index c369045..be0d70b 100644
--- a/test/tint/builtins/gen/var/cross/9857cb.wgsl
+++ b/test/tint/builtins/gen/var/cross/9857cb.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: vec3<f16> = cross(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.dxc.hlsl
index c612c29..8888365 100644
--- a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cross_9857cb() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = cross(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.fxc.hlsl
index 056bcc1..00b2910 100644
--- a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void cross_9857cb() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = cross(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.glsl b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.glsl
index b5f1a53..23aa5e2 100644
--- a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cross_9857cb() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = cross(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cross_9857cb() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = cross(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void cross_9857cb() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = cross(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.msl b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.msl
index d977572..1e39694 100644
--- a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void cross_9857cb() {
+void cross_9857cb(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 res = cross(arg_0, arg_1);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  cross_9857cb();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  cross_9857cb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  cross_9857cb();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  cross_9857cb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  cross_9857cb();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  cross_9857cb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.spvasm
index 3d4096e..990b63f 100644
--- a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %cross_9857cb "cross_9857cb"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%cross_9857cb = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3half %arg_0
-         %24 = OpLoad %v3half %arg_1
-         %21 = OpExtInst %v3half %22 Cross %23 %24
-               OpStore %res %21
+%cross_9857cb = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3half %arg_0
+         %27 = OpLoad %v3half %arg_1
+         %24 = OpExtInst %v3half %25 Cross %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %33 = OpLoad %v3half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %cross_9857cb
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %cross_9857cb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %cross_9857cb
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %cross_9857cb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %cross_9857cb
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %cross_9857cb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.wgsl
index 6fdeaeb..cde1627 100644
--- a/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/cross/9857cb.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : vec3<f16> = cross(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   cross_9857cb();
diff --git a/test/tint/builtins/gen/var/degrees/0d170c.wgsl b/test/tint/builtins/gen/var/degrees/0d170c.wgsl
index 95a3e92..dac91ee 100644
--- a/test/tint/builtins/gen/var/degrees/0d170c.wgsl
+++ b/test/tint/builtins/gen/var/degrees/0d170c.wgsl
@@ -25,7 +25,9 @@
 fn degrees_0d170c() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = degrees(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.dxc.hlsl
index 83247a1..77ca98f 100644
--- a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_0d170c() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tint_degrees(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.fxc.hlsl
index 83247a1..77ca98f 100644
--- a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_0d170c() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tint_degrees(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.glsl b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.glsl
index 157c71b..ba39aff 100644
--- a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void degrees_0d170c() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void degrees_0d170c() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void degrees_0d170c() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.msl b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.msl
index 7b84a39..e70882b 100644
--- a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 57.29577951308232286465;
 }
 
-void degrees_0d170c() {
+void degrees_0d170c(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = tint_degrees(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_0d170c();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  degrees_0d170c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_0d170c();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  degrees_0d170c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_0d170c();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  degrees_0d170c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.spvasm
index ebb45b3..2c7c718 100644
--- a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_0d170c "degrees_0d170c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%degrees_0d170c = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%degrees_0d170c = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Degrees %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Degrees %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %degrees_0d170c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %degrees_0d170c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %degrees_0d170c
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %degrees_0d170c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %degrees_0d170c
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %degrees_0d170c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.wgsl
index 27c944e..b064ef7 100644
--- a/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/degrees/0d170c.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn degrees_0d170c() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = degrees(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_0d170c();
diff --git a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl
index b0a2860..3e59872 100644
--- a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl
+++ b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl
@@ -25,7 +25,9 @@
 fn degrees_1ad5df() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = degrees(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.dxc.hlsl
index efc3f4b..c6622aa 100644
--- a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_1ad5df() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tint_degrees(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.fxc.hlsl
index efc3f4b..c6622aa 100644
--- a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_1ad5df() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tint_degrees(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.glsl b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.glsl
index 223d36b..91078c5 100644
--- a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void degrees_1ad5df() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void degrees_1ad5df() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void degrees_1ad5df() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.msl b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.msl
index 3aed1e1..460415c 100644
--- a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 57.29577951308232286465;
 }
 
-void degrees_1ad5df() {
+void degrees_1ad5df(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = tint_degrees(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_1ad5df();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  degrees_1ad5df(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_1ad5df();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  degrees_1ad5df(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_1ad5df();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  degrees_1ad5df(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.spvasm b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.spvasm
index b941f0c..130e907 100644
--- a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_1ad5df "degrees_1ad5df"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%degrees_1ad5df = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Degrees %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%degrees_1ad5df = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Degrees %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %degrees_1ad5df
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %degrees_1ad5df
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %degrees_1ad5df
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %degrees_1ad5df
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %degrees_1ad5df
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %degrees_1ad5df
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.wgsl b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.wgsl
index b1ee3c9..edbd0ee 100644
--- a/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/degrees/1ad5df.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn degrees_1ad5df() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = degrees(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_1ad5df();
diff --git a/test/tint/builtins/gen/var/degrees/2af623.wgsl b/test/tint/builtins/gen/var/degrees/2af623.wgsl
index ea3e24b..3efc5b5 100644
--- a/test/tint/builtins/gen/var/degrees/2af623.wgsl
+++ b/test/tint/builtins/gen/var/degrees/2af623.wgsl
@@ -25,7 +25,9 @@
 fn degrees_2af623() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = degrees(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.dxc.hlsl
index 44e1d00..0ba1790 100644
--- a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_2af623() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tint_degrees(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.fxc.hlsl
index 44e1d00..0ba1790 100644
--- a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_2af623() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tint_degrees(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.glsl b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.glsl
index f8f8766..67b66ce 100644
--- a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void degrees_2af623() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void degrees_2af623() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void degrees_2af623() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.msl b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.msl
index 1b34ae4..27a1c25 100644
--- a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 57.29577951308232286465;
 }
 
-void degrees_2af623() {
+void degrees_2af623(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = tint_degrees(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_2af623();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  degrees_2af623(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_2af623();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  degrees_2af623(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_2af623();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  degrees_2af623(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.spvasm b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.spvasm
index 65830c8..e890a77 100644
--- a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_2af623 "degrees_2af623"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%degrees_2af623 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Degrees %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%degrees_2af623 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Degrees %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %degrees_2af623
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %degrees_2af623
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %degrees_2af623
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %degrees_2af623
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %degrees_2af623
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %degrees_2af623
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.wgsl b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.wgsl
index 20f580e..c83aecc 100644
--- a/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/degrees/2af623.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn degrees_2af623() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = degrees(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_2af623();
diff --git a/test/tint/builtins/gen/var/degrees/3055d3.wgsl b/test/tint/builtins/gen/var/degrees/3055d3.wgsl
index 0929dda..088caa4 100644
--- a/test/tint/builtins/gen/var/degrees/3055d3.wgsl
+++ b/test/tint/builtins/gen/var/degrees/3055d3.wgsl
@@ -27,7 +27,9 @@
 fn degrees_3055d3() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = degrees(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.dxc.hlsl
index d11272f..8c36406 100644
--- a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_3055d3() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tint_degrees(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.fxc.hlsl
index 92e8dd8..32f84dc 100644
--- a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.fxc.hlsl
@@ -1,12 +1,15 @@
 SKIP: FAILED
 
 vector<float16_t, 4> tint_degrees(vector<float16_t, 4> param_0) {
-  return param_0 * 57.295779513082323;
+  return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_3055d3() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tint_degrees(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.glsl b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.glsl
index c510a02..12b4ecf 100644
--- a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.glsl
@@ -6,9 +6,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void degrees_3055d3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -33,9 +38,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void degrees_3055d3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -54,9 +64,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void degrees_3055d3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.msl b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.msl
index 8fdf025..a326c3f 100644
--- a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 57.29577951308232286465;
 }
 
-void degrees_3055d3() {
+void degrees_3055d3(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = tint_degrees(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_3055d3();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  degrees_3055d3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_3055d3();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  degrees_3055d3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_3055d3();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  degrees_3055d3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.spvasm
index f7b5aa1..6a9ba33 100644
--- a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_3055d3 "degrees_3055d3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_3055d3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Degrees %22
-               OpStore %res %20
+%degrees_3055d3 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Degrees %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %degrees_3055d3
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %degrees_3055d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %degrees_3055d3
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %degrees_3055d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %degrees_3055d3
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %degrees_3055d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.wgsl
index b0f9f14..e3f323c 100644
--- a/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/degrees/3055d3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn degrees_3055d3() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = degrees(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_3055d3();
diff --git a/test/tint/builtins/gen/var/degrees/51f705.wgsl b/test/tint/builtins/gen/var/degrees/51f705.wgsl
index fdda236..be7b47f 100644
--- a/test/tint/builtins/gen/var/degrees/51f705.wgsl
+++ b/test/tint/builtins/gen/var/degrees/51f705.wgsl
@@ -25,7 +25,9 @@
 fn degrees_51f705() {
   var arg_0 = 1.f;
   var res: f32 = degrees(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.dxc.hlsl
index dc451cc..8d09931 100644
--- a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_51f705() {
   float arg_0 = 1.0f;
   float res = tint_degrees(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.fxc.hlsl
index dc451cc..8d09931 100644
--- a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_51f705() {
   float arg_0 = 1.0f;
   float res = tint_degrees(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.glsl b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.glsl
index accb07d..4e8dfba 100644
--- a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void degrees_51f705() {
   float arg_0 = 1.0f;
   float res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void degrees_51f705() {
   float arg_0 = 1.0f;
   float res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void degrees_51f705() {
   float arg_0 = 1.0f;
   float res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.msl b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.msl
index ede7730..90603ca 100644
--- a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 57.29577951308232286465;
 }
 
-void degrees_51f705() {
+void degrees_51f705(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = tint_degrees(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_51f705();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  degrees_51f705(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_51f705();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  degrees_51f705(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_51f705();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  degrees_51f705(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.spvasm b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.spvasm
index 10bc58e..ebceeaa 100644
--- a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_51f705 "degrees_51f705"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%degrees_51f705 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%degrees_51f705 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Degrees %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Degrees %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %degrees_51f705
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %degrees_51f705
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %degrees_51f705
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %degrees_51f705
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %degrees_51f705
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %degrees_51f705
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.wgsl b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.wgsl
index 5321c3a..f64bfc2 100644
--- a/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/degrees/51f705.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn degrees_51f705() {
   var arg_0 = 1.0f;
   var res : f32 = degrees(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_51f705();
diff --git a/test/tint/builtins/gen/var/degrees/5e9805.wgsl b/test/tint/builtins/gen/var/degrees/5e9805.wgsl
index 736d6cc..2953ee6 100644
--- a/test/tint/builtins/gen/var/degrees/5e9805.wgsl
+++ b/test/tint/builtins/gen/var/degrees/5e9805.wgsl
@@ -27,7 +27,9 @@
 fn degrees_5e9805() {
   var arg_0 = 1.h;
   var res: f16 = degrees(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.dxc.hlsl
index 36c3263..71e6cc6 100644
--- a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_5e9805() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tint_degrees(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.fxc.hlsl
index dadf881..ab23597 100644
--- a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.fxc.hlsl
@@ -1,12 +1,15 @@
 SKIP: FAILED
 
 float16_t tint_degrees(float16_t param_0) {
-  return param_0 * 57.295779513082323;
+  return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_5e9805() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tint_degrees(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.glsl b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.glsl
index fd062d1..f0676b0 100644
--- a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.glsl
@@ -6,9 +6,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void degrees_5e9805() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -33,9 +38,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void degrees_5e9805() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -54,9 +64,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void degrees_5e9805() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.msl b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.msl
index 266913a..e530258 100644
--- a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 57.29577951308232286465;
 }
 
-void degrees_5e9805() {
+void degrees_5e9805(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = tint_degrees(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_5e9805();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  degrees_5e9805(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_5e9805();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  degrees_5e9805(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_5e9805();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  degrees_5e9805(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.spvasm b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.spvasm
index a27b49a..2033708 100644
--- a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_5e9805 "degrees_5e9805"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_5e9805 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%degrees_5e9805 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Degrees %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Degrees %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %degrees_5e9805
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %degrees_5e9805
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %degrees_5e9805
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %degrees_5e9805
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %degrees_5e9805
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %degrees_5e9805
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.wgsl b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.wgsl
index 76d31b9..49c30d7 100644
--- a/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/degrees/5e9805.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn degrees_5e9805() {
   var arg_0 = 1.0h;
   var res : f16 = degrees(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_5e9805();
diff --git a/test/tint/builtins/gen/var/degrees/810467.wgsl b/test/tint/builtins/gen/var/degrees/810467.wgsl
index 96858d0..ced5c55 100644
--- a/test/tint/builtins/gen/var/degrees/810467.wgsl
+++ b/test/tint/builtins/gen/var/degrees/810467.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = degrees(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_810467();
diff --git a/test/tint/builtins/gen/var/degrees/c0880c.wgsl b/test/tint/builtins/gen/var/degrees/c0880c.wgsl
index 708f776..2a3b046 100644
--- a/test/tint/builtins/gen/var/degrees/c0880c.wgsl
+++ b/test/tint/builtins/gen/var/degrees/c0880c.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = degrees(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_c0880c();
diff --git a/test/tint/builtins/gen/var/degrees/d43a49.wgsl b/test/tint/builtins/gen/var/degrees/d43a49.wgsl
index 3184f24..fb4c628 100644
--- a/test/tint/builtins/gen/var/degrees/d43a49.wgsl
+++ b/test/tint/builtins/gen/var/degrees/d43a49.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = degrees(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_d43a49();
diff --git a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl
index fea71fe..3d540b7 100644
--- a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl
+++ b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl
@@ -27,7 +27,9 @@
 fn degrees_dfe8f4() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = degrees(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.dxc.hlsl
index 179583d..b3540cf 100644
--- a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_dfe8f4() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tint_degrees(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.fxc.hlsl
index 62b4e4a..59879a2 100644
--- a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.fxc.hlsl
@@ -1,12 +1,15 @@
 SKIP: FAILED
 
 vector<float16_t, 3> tint_degrees(vector<float16_t, 3> param_0) {
-  return param_0 * 57.295779513082323;
+  return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_dfe8f4() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tint_degrees(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.glsl b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.glsl
index 8b1e365..03a7f35 100644
--- a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.glsl
@@ -6,9 +6,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void degrees_dfe8f4() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -33,9 +38,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void degrees_dfe8f4() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -54,9 +64,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void degrees_dfe8f4() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.msl b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.msl
index 6bffc90..d44112b 100644
--- a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 57.29577951308232286465;
 }
 
-void degrees_dfe8f4() {
+void degrees_dfe8f4(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = tint_degrees(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_dfe8f4();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  degrees_dfe8f4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_dfe8f4();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  degrees_dfe8f4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_dfe8f4();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  degrees_dfe8f4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.spvasm
index bb67782..bfd9d33 100644
--- a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_dfe8f4 "degrees_dfe8f4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_dfe8f4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Degrees %22
-               OpStore %res %20
+%degrees_dfe8f4 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Degrees %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %degrees_dfe8f4
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %degrees_dfe8f4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %degrees_dfe8f4
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %degrees_dfe8f4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %degrees_dfe8f4
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %degrees_dfe8f4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.wgsl
index 7cdbf02..e99892d 100644
--- a/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/degrees/dfe8f4.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn degrees_dfe8f4() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = degrees(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_dfe8f4();
diff --git a/test/tint/builtins/gen/var/degrees/f59715.wgsl b/test/tint/builtins/gen/var/degrees/f59715.wgsl
index 4cb5747..c7f11c4 100644
--- a/test/tint/builtins/gen/var/degrees/f59715.wgsl
+++ b/test/tint/builtins/gen/var/degrees/f59715.wgsl
@@ -27,7 +27,9 @@
 fn degrees_f59715() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = degrees(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.dxc.hlsl
index 2a22fda..ccdd637 100644
--- a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_f59715() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tint_degrees(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.fxc.hlsl
index 8199c95..dec4ccb 100644
--- a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.fxc.hlsl
@@ -1,12 +1,15 @@
 SKIP: FAILED
 
 vector<float16_t, 2> tint_degrees(vector<float16_t, 2> param_0) {
-  return param_0 * 57.295779513082323;
+  return param_0 * 57.29577951308232286465;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void degrees_f59715() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tint_degrees(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.glsl b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.glsl
index b481d7f..4011fbb 100644
--- a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.glsl
@@ -6,9 +6,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void degrees_f59715() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -33,9 +38,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void degrees_f59715() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -54,9 +64,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void degrees_f59715() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tint_degrees(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.msl b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.msl
index b9ad03f..00f8f97 100644
--- a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 57.29577951308232286465;
 }
 
-void degrees_f59715() {
+void degrees_f59715(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = tint_degrees(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  degrees_f59715();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  degrees_f59715(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  degrees_f59715();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  degrees_f59715(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  degrees_f59715();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  degrees_f59715(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.spvasm b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.spvasm
index fec5d9f..407153b 100644
--- a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %degrees_f59715 "degrees_f59715"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%degrees_f59715 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Degrees %22
-               OpStore %res %20
+%degrees_f59715 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Degrees %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %degrees_f59715
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %degrees_f59715
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %degrees_f59715
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %degrees_f59715
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %degrees_f59715
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %degrees_f59715
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.wgsl b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.wgsl
index 80f75e6..0b82470 100644
--- a/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/degrees/f59715.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn degrees_f59715() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = degrees(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_f59715();
diff --git a/test/tint/builtins/gen/var/degrees/fafa7e.wgsl b/test/tint/builtins/gen/var/degrees/fafa7e.wgsl
index f1adddc..f843b3f 100644
--- a/test/tint/builtins/gen/var/degrees/fafa7e.wgsl
+++ b/test/tint/builtins/gen/var/degrees/fafa7e.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = degrees(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   degrees_fafa7e();
diff --git a/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl
index a10c782..d224916 100644
--- a/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl
+++ b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat2x2(1., 1., 1., 1.);
   var res = determinant(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_1bf6e7();
diff --git a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl
index 30a6d55..5ca6369 100644
--- a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl
+++ b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl
@@ -25,7 +25,9 @@
 fn determinant_2b62ba() {
   var arg_0 = mat3x3<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: f32 = determinant(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.dxc.hlsl
index 4d562cd..6b82f98 100644
--- a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_2b62ba() {
   float3x3 arg_0 = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
   float res = determinant(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.fxc.hlsl
index 4d562cd..6b82f98 100644
--- a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_2b62ba() {
   float3x3 arg_0 = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
   float res = determinant(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.glsl
index 618def4..aa3b347 100644
--- a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_2b62ba() {
   mat3 arg_0 = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_2b62ba() {
   mat3 arg_0 = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_2b62ba() {
   mat3 arg_0 = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.msl
index d04b49c..d46ce71 100644
--- a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_2b62ba() {
+void determinant_2b62ba(device float* const tint_symbol_1) {
   float3x3 arg_0 = float3x3(float3(1.0f), float3(1.0f), float3(1.0f));
   float res = determinant(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_2b62ba();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  determinant_2b62ba(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_2b62ba();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  determinant_2b62ba(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_2b62ba();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  determinant_2b62ba(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.spvasm
index 6d9142b..7661305 100644
--- a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_2b62ba "determinant_2b62ba"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,46 +37,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat3v3float = OpTypeMatrix %v3float 3
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %17 = OpConstantComposite %mat3v3float %16 %16 %16
+         %19 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %20 = OpConstantComposite %mat3v3float %19 %19 %19
 %_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
-         %20 = OpConstantNull %mat3v3float
+         %23 = OpConstantNull %mat3v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %26 = OpTypeFunction %v4float
-%determinant_2b62ba = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat3v3float Function %20
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
+%determinant_2b62ba = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat3v3float Function %23
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %17
-         %23 = OpLoad %mat3v3float %arg_0
-         %21 = OpExtInst %float %22 Determinant %23
-               OpStore %res %21
+               OpStore %arg_0 %20
+         %26 = OpLoad %mat3v3float %arg_0
+         %24 = OpExtInst %float %25 Determinant %26
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %determinant_2b62ba
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %determinant_2b62ba
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %determinant_2b62ba
+%fragment_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %determinant_2b62ba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %determinant_2b62ba
+%compute_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %determinant_2b62ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.wgsl
index effc94f..2d0dced 100644
--- a/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/determinant/2b62ba.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn determinant_2b62ba() {
   var arg_0 = mat3x3<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : f32 = determinant(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_2b62ba();
diff --git a/test/tint/builtins/gen/var/determinant/32bfde.wgsl b/test/tint/builtins/gen/var/determinant/32bfde.wgsl
index 93c2ccf..8eb5301 100644
--- a/test/tint/builtins/gen/var/determinant/32bfde.wgsl
+++ b/test/tint/builtins/gen/var/determinant/32bfde.wgsl
@@ -27,7 +27,9 @@
 fn determinant_32bfde() {
   var arg_0 = mat4x4<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: f16 = determinant(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.dxc.hlsl
index a2bf98f..209b710 100644
--- a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_32bfde() {
   matrix<float16_t, 4, 4> arg_0 = matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
   float16_t res = determinant(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.fxc.hlsl
index fe01952..2e01c7a 100644
--- a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_32bfde() {
   matrix<float16_t, 4, 4> arg_0 = matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
   float16_t res = determinant(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.glsl
index ecf8080..a3686d7 100644
--- a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_32bfde() {
   f16mat4 arg_0 = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_32bfde() {
   f16mat4 arg_0 = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_32bfde() {
   f16mat4 arg_0 = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.msl
index 78edf50..5b9d181 100644
--- a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_32bfde() {
+void determinant_32bfde(device half* const tint_symbol_1) {
   half4x4 arg_0 = half4x4(half4(1.0h), half4(1.0h), half4(1.0h), half4(1.0h));
   half res = determinant(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_32bfde();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  determinant_32bfde(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_32bfde();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  determinant_32bfde(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_32bfde();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  determinant_32bfde(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.spvasm
index 9e1612e..54dfabb 100644
--- a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_32bfde "determinant_32bfde"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v4half = OpTypeVector %half 4
  %mat4v4half = OpTypeMatrix %v4half 4
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat4v4half %17 %17 %17 %17
+         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat4v4half %20 %20 %20 %20
 %_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
-         %21 = OpConstantNull %mat4v4half
+         %24 = OpConstantNull %mat4v4half
 %_ptr_Function_half = OpTypePointer Function %half
-         %27 = OpConstantNull %half
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_32bfde = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat4v4half Function %21
-        %res = OpVariable %_ptr_Function_half Function %27
-               OpStore %arg_0 %18
-         %24 = OpLoad %mat4v4half %arg_0
-         %22 = OpExtInst %half %23 Determinant %24
-               OpStore %res %22
+%determinant_32bfde = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat4v4half Function %24
+        %res = OpVariable %_ptr_Function_half Function %30
+               OpStore %arg_0 %21
+         %27 = OpLoad %mat4v4half %arg_0
+         %25 = OpExtInst %half %26 Determinant %27
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %determinant_32bfde
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %determinant_32bfde
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %determinant_32bfde
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %determinant_32bfde
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %determinant_32bfde
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %determinant_32bfde
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.wgsl
index e172f25..23d1860 100644
--- a/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/determinant/32bfde.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn determinant_32bfde() {
   var arg_0 = mat4x4<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : f16 = determinant(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_32bfde();
diff --git a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl
index cf826df..2eceea6 100644
--- a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl
+++ b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl
@@ -25,7 +25,9 @@
 fn determinant_a0a87c() {
   var arg_0 = mat4x4<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: f32 = determinant(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.dxc.hlsl
index dfae910..58fb9e6 100644
--- a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_a0a87c() {
   float4x4 arg_0 = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
   float res = determinant(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.fxc.hlsl
index dfae910..58fb9e6 100644
--- a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_a0a87c() {
   float4x4 arg_0 = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
   float res = determinant(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.glsl
index 3428e8a..884f420 100644
--- a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_a0a87c() {
   mat4 arg_0 = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_a0a87c() {
   mat4 arg_0 = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_a0a87c() {
   mat4 arg_0 = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.msl
index 470aa40..b4a36be 100644
--- a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_a0a87c() {
+void determinant_a0a87c(device float* const tint_symbol_1) {
   float4x4 arg_0 = float4x4(float4(1.0f), float4(1.0f), float4(1.0f), float4(1.0f));
   float res = determinant(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_a0a87c();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  determinant_a0a87c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_a0a87c();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  determinant_a0a87c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_a0a87c();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  determinant_a0a87c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.spvasm
index 6c4acf3..42961e6 100644
--- a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_a0a87c "determinant_a0a87c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %mat4v4float = OpTypeMatrix %v4float 4
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %16 = OpConstantComposite %mat4v4float %15 %15 %15 %15
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %19 = OpConstantComposite %mat4v4float %18 %18 %18 %18
 %_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
-         %19 = OpConstantNull %mat4v4float
+         %22 = OpConstantNull %mat4v4float
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpTypeFunction %v4float
-%determinant_a0a87c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat4v4float Function %19
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %33 = OpTypeFunction %v4float
+%determinant_a0a87c = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat4v4float Function %22
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %16
-         %22 = OpLoad %mat4v4float %arg_0
-         %20 = OpExtInst %float %21 Determinant %22
-               OpStore %res %20
+               OpStore %arg_0 %19
+         %25 = OpLoad %mat4v4float %arg_0
+         %23 = OpExtInst %float %24 Determinant %25
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %32 = OpLoad %float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %determinant_a0a87c
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %determinant_a0a87c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %determinant_a0a87c
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %determinant_a0a87c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %determinant_a0a87c
+%compute_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %determinant_a0a87c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.wgsl
index 5409069..56f9c40 100644
--- a/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/determinant/a0a87c.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn determinant_a0a87c() {
   var arg_0 = mat4x4<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : f32 = determinant(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_a0a87c();
diff --git a/test/tint/builtins/gen/var/determinant/c8251d.wgsl b/test/tint/builtins/gen/var/determinant/c8251d.wgsl
index 63743dd..bf181b6 100644
--- a/test/tint/builtins/gen/var/determinant/c8251d.wgsl
+++ b/test/tint/builtins/gen/var/determinant/c8251d.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat3x3(1., 1., 1., 1., 1., 1., 1., 1., 1.);
   var res = determinant(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_c8251d();
diff --git a/test/tint/builtins/gen/var/determinant/cefdf3.wgsl b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl
index 3a38f3d..9bcdfb6 100644
--- a/test/tint/builtins/gen/var/determinant/cefdf3.wgsl
+++ b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat4x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.);
   var res = determinant(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_cefdf3();
diff --git a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl
index 35a33c8..b9649e2 100644
--- a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl
+++ b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl
@@ -27,7 +27,9 @@
 fn determinant_d7c86f() {
   var arg_0 = mat3x3<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: f16 = determinant(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.dxc.hlsl
index 5abf230..af59f8f 100644
--- a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_d7c86f() {
   matrix<float16_t, 3, 3> arg_0 = matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
   float16_t res = determinant(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.fxc.hlsl
index 268dad4..a0f3431 100644
--- a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_d7c86f() {
   matrix<float16_t, 3, 3> arg_0 = matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
   float16_t res = determinant(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.glsl
index e1423fd..8848abc 100644
--- a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_d7c86f() {
   f16mat3 arg_0 = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_d7c86f() {
   f16mat3 arg_0 = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_d7c86f() {
   f16mat3 arg_0 = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.msl
index 789c6f1..dd063a9 100644
--- a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_d7c86f() {
+void determinant_d7c86f(device half* const tint_symbol_1) {
   half3x3 arg_0 = half3x3(half3(1.0h), half3(1.0h), half3(1.0h));
   half res = determinant(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_d7c86f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  determinant_d7c86f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_d7c86f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  determinant_d7c86f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_d7c86f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  determinant_d7c86f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.spvasm
index 931fae8..f0d1c23 100644
--- a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_d7c86f "determinant_d7c86f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v3half = OpTypeVector %half 3
  %mat3v3half = OpTypeMatrix %v3half 3
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat3v3half %17 %17 %17
+         %20 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat3v3half %20 %20 %20
 %_ptr_Function_mat3v3half = OpTypePointer Function %mat3v3half
-         %21 = OpConstantNull %mat3v3half
+         %24 = OpConstantNull %mat3v3half
 %_ptr_Function_half = OpTypePointer Function %half
-         %27 = OpConstantNull %half
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_d7c86f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat3v3half Function %21
-        %res = OpVariable %_ptr_Function_half Function %27
-               OpStore %arg_0 %18
-         %24 = OpLoad %mat3v3half %arg_0
-         %22 = OpExtInst %half %23 Determinant %24
-               OpStore %res %22
+%determinant_d7c86f = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat3v3half Function %24
+        %res = OpVariable %_ptr_Function_half Function %30
+               OpStore %arg_0 %21
+         %27 = OpLoad %mat3v3half %arg_0
+         %25 = OpExtInst %half %26 Determinant %27
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %determinant_d7c86f
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %determinant_d7c86f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %determinant_d7c86f
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %determinant_d7c86f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %determinant_d7c86f
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %determinant_d7c86f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.wgsl
index 2c27978..81a1062 100644
--- a/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/determinant/d7c86f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn determinant_d7c86f() {
   var arg_0 = mat3x3<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : f16 = determinant(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_d7c86f();
diff --git a/test/tint/builtins/gen/var/determinant/e19305.wgsl b/test/tint/builtins/gen/var/determinant/e19305.wgsl
index 54a6399..828a0ea 100644
--- a/test/tint/builtins/gen/var/determinant/e19305.wgsl
+++ b/test/tint/builtins/gen/var/determinant/e19305.wgsl
@@ -25,7 +25,9 @@
 fn determinant_e19305() {
   var arg_0 = mat2x2<f32>(1.f, 1.f, 1.f, 1.f);
   var res: f32 = determinant(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.dxc.hlsl
index 2869e99..7d18b7f 100644
--- a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_e19305() {
   float2x2 arg_0 = float2x2((1.0f).xx, (1.0f).xx);
   float res = determinant(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.fxc.hlsl
index 2869e99..7d18b7f 100644
--- a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_e19305() {
   float2x2 arg_0 = float2x2((1.0f).xx, (1.0f).xx);
   float res = determinant(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.glsl
index 4834f5e..30512ac 100644
--- a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_e19305() {
   mat2 arg_0 = mat2(vec2(1.0f), vec2(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_e19305() {
   mat2 arg_0 = mat2(vec2(1.0f), vec2(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void determinant_e19305() {
   mat2 arg_0 = mat2(vec2(1.0f), vec2(1.0f));
   float res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.msl
index 9a9604b..c1d81f2 100644
--- a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_e19305() {
+void determinant_e19305(device float* const tint_symbol_1) {
   float2x2 arg_0 = float2x2(float2(1.0f), float2(1.0f));
   float res = determinant(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_e19305();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  determinant_e19305(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_e19305();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  determinant_e19305(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_e19305();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  determinant_e19305(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.spvasm
index f0741cb..b3014c9 100644
--- a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_e19305 "determinant_e19305"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,46 +37,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat2v2float = OpTypeMatrix %v2float 2
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
-         %17 = OpConstantComposite %mat2v2float %16 %16
+         %19 = OpConstantComposite %v2float %float_1 %float_1
+         %20 = OpConstantComposite %mat2v2float %19 %19
 %_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
-         %20 = OpConstantNull %mat2v2float
+         %23 = OpConstantNull %mat2v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %26 = OpTypeFunction %v4float
-%determinant_e19305 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat2v2float Function %20
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
+%determinant_e19305 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat2v2float Function %23
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %17
-         %23 = OpLoad %mat2v2float %arg_0
-         %21 = OpExtInst %float %22 Determinant %23
-               OpStore %res %21
+               OpStore %arg_0 %20
+         %26 = OpLoad %mat2v2float %arg_0
+         %24 = OpExtInst %float %25 Determinant %26
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %determinant_e19305
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %determinant_e19305
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %determinant_e19305
+%fragment_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %determinant_e19305
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %determinant_e19305
+%compute_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %determinant_e19305
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.wgsl
index fa8b4f6..5c96a49 100644
--- a/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/determinant/e19305.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn determinant_e19305() {
   var arg_0 = mat2x2<f32>(1.0f, 1.0f, 1.0f, 1.0f);
   var res : f32 = determinant(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_e19305();
diff --git a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl
index c2a57d6..cc8acbb 100644
--- a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl
+++ b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl
@@ -27,7 +27,9 @@
 fn determinant_fc12a5() {
   var arg_0 = mat2x2<f16>(1.h, 1.h, 1.h, 1.h);
   var res: f16 = determinant(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.dxc.hlsl
index 691fa80..2bb4af9 100644
--- a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_fc12a5() {
   matrix<float16_t, 2, 2> arg_0 = matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
   float16_t res = determinant(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.fxc.hlsl
index 40b6555..b31a601 100644
--- a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void determinant_fc12a5() {
   matrix<float16_t, 2, 2> arg_0 = matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
   float16_t res = determinant(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.glsl
index 9cfd014..2a0188f 100644
--- a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_fc12a5() {
   f16mat2 arg_0 = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_fc12a5() {
   f16mat2 arg_0 = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void determinant_fc12a5() {
   f16mat2 arg_0 = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
   float16_t res = determinant(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.msl
index 4c6e8ca..d8f7bfb 100644
--- a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void determinant_fc12a5() {
+void determinant_fc12a5(device half* const tint_symbol_1) {
   half2x2 arg_0 = half2x2(half2(1.0h), half2(1.0h));
   half res = determinant(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  determinant_fc12a5();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  determinant_fc12a5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  determinant_fc12a5();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  determinant_fc12a5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  determinant_fc12a5();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  determinant_fc12a5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.spvasm
index aa2d81f..41ba371 100644
--- a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %determinant_fc12a5 "determinant_fc12a5"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v2half = OpTypeVector %half 2
  %mat2v2half = OpTypeMatrix %v2half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat2v2half %17 %17
+         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat2v2half %20 %20
 %_ptr_Function_mat2v2half = OpTypePointer Function %mat2v2half
-         %21 = OpConstantNull %mat2v2half
+         %24 = OpConstantNull %mat2v2half
 %_ptr_Function_half = OpTypePointer Function %half
-         %27 = OpConstantNull %half
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%determinant_fc12a5 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat2v2half Function %21
-        %res = OpVariable %_ptr_Function_half Function %27
-               OpStore %arg_0 %18
-         %24 = OpLoad %mat2v2half %arg_0
-         %22 = OpExtInst %half %23 Determinant %24
-               OpStore %res %22
+%determinant_fc12a5 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat2v2half Function %24
+        %res = OpVariable %_ptr_Function_half Function %30
+               OpStore %arg_0 %21
+         %27 = OpLoad %mat2v2half %arg_0
+         %25 = OpExtInst %half %26 Determinant %27
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %determinant_fc12a5
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %determinant_fc12a5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %determinant_fc12a5
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %determinant_fc12a5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %determinant_fc12a5
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %determinant_fc12a5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.wgsl
index 26cd988..7b44346 100644
--- a/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/determinant/fc12a5.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn determinant_fc12a5() {
   var arg_0 = mat2x2<f16>(1.0h, 1.0h, 1.0h, 1.0h);
   var res : f16 = determinant(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   determinant_fc12a5();
diff --git a/test/tint/builtins/gen/var/distance/0657d4.wgsl b/test/tint/builtins/gen/var/distance/0657d4.wgsl
index 31f6abe..0eea63e 100644
--- a/test/tint/builtins/gen/var/distance/0657d4.wgsl
+++ b/test/tint/builtins/gen/var/distance/0657d4.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: f32 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.dxc.hlsl
index d6d090c..9ffbf62 100644
--- a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_0657d4() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float res = distance(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.fxc.hlsl
index d6d090c..9ffbf62 100644
--- a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_0657d4() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float res = distance(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.glsl b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.glsl
index 6ce3dea..af70a29 100644
--- a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_0657d4() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_0657d4() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_0657d4() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.msl b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.msl
index caefb1a..4db9504 100644
--- a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_0657d4() {
+void distance_0657d4(device float* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float res = distance(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_0657d4();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  distance_0657d4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_0657d4();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  distance_0657d4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_0657d4();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  distance_0657d4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.spvasm
index 41dfc73..60f4d3a 100644
--- a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_0657d4 "distance_0657d4"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,47 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %26 = OpTypeFunction %v4float
-%distance_0657d4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
+%distance_0657d4 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v3float %arg_0
-         %23 = OpLoad %v3float %arg_1
-         %20 = OpExtInst %float %21 Distance %22 %23
-               OpStore %res %20
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v3float %arg_0
+         %26 = OpLoad %v3float %arg_1
+         %23 = OpExtInst %float %24 Distance %25 %26
+               OpStore %res %23
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %distance_0657d4
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %distance_0657d4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %distance_0657d4
+%fragment_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %distance_0657d4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %distance_0657d4
+%compute_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %distance_0657d4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.wgsl
index 8a96f48..ff2a8aa 100644
--- a/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/distance/0657d4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : f32 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_0657d4();
diff --git a/test/tint/builtins/gen/var/distance/3a175a.wgsl b/test/tint/builtins/gen/var/distance/3a175a.wgsl
index 03422ed..d5d6ad9 100644
--- a/test/tint/builtins/gen/var/distance/3a175a.wgsl
+++ b/test/tint/builtins/gen/var/distance/3a175a.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1.);
   var res = distance(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_3a175a();
diff --git a/test/tint/builtins/gen/var/distance/7272f3.wgsl b/test/tint/builtins/gen/var/distance/7272f3.wgsl
index 40cdbe5..40083afc 100644
--- a/test/tint/builtins/gen/var/distance/7272f3.wgsl
+++ b/test/tint/builtins/gen/var/distance/7272f3.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<f16>(1.h);
   var res: f16 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.dxc.hlsl
index ddcf49a..ed6188d 100644
--- a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_7272f3() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.fxc.hlsl
index e477148..e9f331a 100644
--- a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_7272f3() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.glsl
index 6f171d7..fcdb4e1 100644
--- a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7272f3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7272f3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7272f3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.msl b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.msl
index 6f0a7c1..d04d356 100644
--- a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_7272f3() {
+void distance_7272f3(device half* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half res = distance(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_7272f3();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  distance_7272f3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_7272f3();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  distance_7272f3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_7272f3();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  distance_7272f3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.spvasm
index 457f5d5..333e7bc 100644
--- a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_7272f3 "distance_7272f3"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v4half = OpTypeVector %half 4
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
 %_ptr_Function_half = OpTypePointer Function %half
-         %27 = OpConstantNull %half
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_7272f3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_half Function %27
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4half %arg_0
-         %24 = OpLoad %v4half %arg_1
-         %21 = OpExtInst %half %22 Distance %23 %24
-               OpStore %res %21
+%distance_7272f3 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_half Function %30
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4half %arg_0
+         %27 = OpLoad %v4half %arg_1
+         %24 = OpExtInst %half %25 Distance %26 %27
+               OpStore %res %24
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %distance_7272f3
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %distance_7272f3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %distance_7272f3
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %distance_7272f3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %distance_7272f3
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %distance_7272f3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.wgsl
index 0b7e377..ebfd514 100644
--- a/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/distance/7272f3.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<f16>(1.0h);
   var res : f16 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_7272f3();
diff --git a/test/tint/builtins/gen/var/distance/7d201f.wgsl b/test/tint/builtins/gen/var/distance/7d201f.wgsl
index 2d8cad9..ac02db0 100644
--- a/test/tint/builtins/gen/var/distance/7d201f.wgsl
+++ b/test/tint/builtins/gen/var/distance/7d201f.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1.h;
   var arg_1 = 1.h;
   var res: f16 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.dxc.hlsl
index c3c38ad..571353b 100644
--- a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_7d201f() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.fxc.hlsl
index 2082da1..6e8f923 100644
--- a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_7d201f() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.glsl b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.glsl
index 83f64d9..40e8aca 100644
--- a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7d201f() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7d201f() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_7d201f() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.msl b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.msl
index cb18d26..d182ef6 100644
--- a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_7d201f() {
+void distance_7d201f(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half res = fabs(arg_0 - arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_7d201f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  distance_7d201f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_7d201f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  distance_7d201f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_7d201f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  distance_7d201f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.spvasm
index 1718943..284dd34 100644
--- a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_7d201f "distance_7d201f"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,46 +42,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_7d201f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%distance_7d201f = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
-         %21 = OpLoad %half %arg_0
-         %22 = OpLoad %half %arg_1
-         %19 = OpExtInst %half %20 Distance %21 %22
-               OpStore %res %19
+         %24 = OpLoad %half %arg_0
+         %25 = OpLoad %half %arg_1
+         %22 = OpExtInst %half %23 Distance %24 %25
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %distance_7d201f
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %distance_7d201f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %distance_7d201f
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %distance_7d201f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %distance_7d201f
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %distance_7d201f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.wgsl
index 01bd486..47a52d3 100644
--- a/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/distance/7d201f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1.0h;
   var arg_1 = 1.0h;
   var res : f16 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_7d201f();
diff --git a/test/tint/builtins/gen/var/distance/83911f.wgsl b/test/tint/builtins/gen/var/distance/83911f.wgsl
index 578ee8d..687e714 100644
--- a/test/tint/builtins/gen/var/distance/83911f.wgsl
+++ b/test/tint/builtins/gen/var/distance/83911f.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = distance(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_83911f();
diff --git a/test/tint/builtins/gen/var/distance/892a5d.wgsl b/test/tint/builtins/gen/var/distance/892a5d.wgsl
index 457acd1..7fd2e69 100644
--- a/test/tint/builtins/gen/var/distance/892a5d.wgsl
+++ b/test/tint/builtins/gen/var/distance/892a5d.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<f16>(1.h);
   var res: f16 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.dxc.hlsl
index e3a0d1a..0b0022f 100644
--- a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_892a5d() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.fxc.hlsl
index 9248050..7a85c04 100644
--- a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_892a5d() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.glsl b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.glsl
index aeb2c00..aae24b5 100644
--- a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_892a5d() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_892a5d() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_892a5d() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.msl b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.msl
index 29351e7..6124058 100644
--- a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_892a5d() {
+void distance_892a5d(device half* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half res = distance(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_892a5d();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  distance_892a5d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_892a5d();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  distance_892a5d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_892a5d();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  distance_892a5d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.spvasm
index 2beafc3..a8da17e 100644
--- a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_892a5d "distance_892a5d"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v2half = OpTypeVector %half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
 %_ptr_Function_half = OpTypePointer Function %half
-         %27 = OpConstantNull %half
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_892a5d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_half Function %27
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2half %arg_0
-         %24 = OpLoad %v2half %arg_1
-         %21 = OpExtInst %half %22 Distance %23 %24
-               OpStore %res %21
+%distance_892a5d = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_half Function %30
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2half %arg_0
+         %27 = OpLoad %v2half %arg_1
+         %24 = OpExtInst %half %25 Distance %26 %27
+               OpStore %res %24
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %distance_892a5d
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %distance_892a5d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %distance_892a5d
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %distance_892a5d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %distance_892a5d
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %distance_892a5d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.wgsl
index dac66dc..2fe5d29 100644
--- a/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/distance/892a5d.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<f16>(1.0h);
   var res : f16 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_892a5d();
diff --git a/test/tint/builtins/gen/var/distance/928fa0.wgsl b/test/tint/builtins/gen/var/distance/928fa0.wgsl
index 3c115bb..de5897a 100644
--- a/test/tint/builtins/gen/var/distance/928fa0.wgsl
+++ b/test/tint/builtins/gen/var/distance/928fa0.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: f16 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.dxc.hlsl
index 00de962..b2b0ed4 100644
--- a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_928fa0() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.fxc.hlsl
index a269e71..ba84e32 100644
--- a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_928fa0() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.glsl b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.glsl
index 52fedf6..90f99d6 100644
--- a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_928fa0() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_928fa0() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void distance_928fa0() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.msl b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.msl
index 79b06d8..a4c3b2a 100644
--- a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_928fa0() {
+void distance_928fa0(device half* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half res = distance(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_928fa0();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  distance_928fa0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_928fa0();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  distance_928fa0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_928fa0();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  distance_928fa0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.spvasm
index 18c6a14..eb0d1be 100644
--- a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_928fa0 "distance_928fa0"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v3half = OpTypeVector %half 3
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
 %_ptr_Function_half = OpTypePointer Function %half
-         %27 = OpConstantNull %half
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%distance_928fa0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_half Function %27
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3half %arg_0
-         %24 = OpLoad %v3half %arg_1
-         %21 = OpExtInst %half %22 Distance %23 %24
-               OpStore %res %21
+%distance_928fa0 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_half Function %30
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3half %arg_0
+         %27 = OpLoad %v3half %arg_1
+         %24 = OpExtInst %half %25 Distance %26 %27
+               OpStore %res %24
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %distance_928fa0
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %distance_928fa0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %distance_928fa0
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %distance_928fa0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %distance_928fa0
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %distance_928fa0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.wgsl
index de4c41d..048a774 100644
--- a/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/distance/928fa0.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : f16 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_928fa0();
diff --git a/test/tint/builtins/gen/var/distance/9646ea.wgsl b/test/tint/builtins/gen/var/distance/9646ea.wgsl
index b60b963..0eff883 100644
--- a/test/tint/builtins/gen/var/distance/9646ea.wgsl
+++ b/test/tint/builtins/gen/var/distance/9646ea.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<f32>(1.f);
   var res: f32 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.dxc.hlsl
index d4f1a67..0f5216d 100644
--- a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_9646ea() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float res = distance(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.fxc.hlsl
index d4f1a67..0f5216d 100644
--- a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_9646ea() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float res = distance(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.glsl b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.glsl
index 6d31f7e..a0cf63f 100644
--- a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_9646ea() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_9646ea() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_9646ea() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.msl b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.msl
index e2657c4..879a675 100644
--- a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_9646ea() {
+void distance_9646ea(device float* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float res = distance(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_9646ea();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  distance_9646ea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_9646ea();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  distance_9646ea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_9646ea();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  distance_9646ea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.spvasm
index 733a196..3d7e8a8 100644
--- a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_9646ea "distance_9646ea"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,45 +38,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Function_float = OpTypePointer Function %float
-         %24 = OpTypeFunction %v4float
-%distance_9646ea = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %32 = OpTypeFunction %v4float
+%distance_9646ea = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-         %20 = OpLoad %v4float %arg_0
-         %21 = OpLoad %v4float %arg_1
-         %18 = OpExtInst %float %19 Distance %20 %21
-               OpStore %res %18
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+         %23 = OpLoad %v4float %arg_0
+         %24 = OpLoad %v4float %arg_1
+         %21 = OpExtInst %float %22 Distance %23 %24
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %31 = OpLoad %float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %distance_9646ea
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %distance_9646ea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %distance_9646ea
+%fragment_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %distance_9646ea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %distance_9646ea
+%compute_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %distance_9646ea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.wgsl
index fc9c86a..83ca3ae 100644
--- a/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/distance/9646ea.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<f32>(1.0f);
   var res : f32 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_9646ea();
diff --git a/test/tint/builtins/gen/var/distance/aa4055.wgsl b/test/tint/builtins/gen/var/distance/aa4055.wgsl
index 7326822..ea09bbb 100644
--- a/test/tint/builtins/gen/var/distance/aa4055.wgsl
+++ b/test/tint/builtins/gen/var/distance/aa4055.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<f32>(1.f);
   var res: f32 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.dxc.hlsl
index f9cc0da..56338f4 100644
--- a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_aa4055() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float res = distance(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.fxc.hlsl
index f9cc0da..56338f4 100644
--- a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_aa4055() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float res = distance(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.glsl b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.glsl
index a16e7bb..413df52 100644
--- a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_aa4055() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_aa4055() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_aa4055() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.msl b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.msl
index 0bd15e1..6721501 100644
--- a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_aa4055() {
+void distance_aa4055(device float* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float res = distance(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_aa4055();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  distance_aa4055(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_aa4055();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  distance_aa4055(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_aa4055();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  distance_aa4055(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.spvasm b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.spvasm
index 0bc74bc..73d0a96 100644
--- a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_aa4055 "distance_aa4055"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,47 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %26 = OpTypeFunction %v4float
-%distance_aa4055 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
+%distance_aa4055 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v2float %arg_0
-         %23 = OpLoad %v2float %arg_1
-         %20 = OpExtInst %float %21 Distance %22 %23
-               OpStore %res %20
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v2float %arg_0
+         %26 = OpLoad %v2float %arg_1
+         %23 = OpExtInst %float %24 Distance %25 %26
+               OpStore %res %23
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %distance_aa4055
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %distance_aa4055
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %distance_aa4055
+%fragment_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %distance_aa4055
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %distance_aa4055
+%compute_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %distance_aa4055
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.wgsl b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.wgsl
index 9846b11..bf3ca99 100644
--- a/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/distance/aa4055.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<f32>(1.0f);
   var res : f32 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_aa4055();
diff --git a/test/tint/builtins/gen/var/distance/ac5535.wgsl b/test/tint/builtins/gen/var/distance/ac5535.wgsl
index 86d6549..1015c05 100644
--- a/test/tint/builtins/gen/var/distance/ac5535.wgsl
+++ b/test/tint/builtins/gen/var/distance/ac5535.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1.);
   var res = distance(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_ac5535();
diff --git a/test/tint/builtins/gen/var/distance/cfed73.wgsl b/test/tint/builtins/gen/var/distance/cfed73.wgsl
index 3f3d1d2..56ea30f 100644
--- a/test/tint/builtins/gen/var/distance/cfed73.wgsl
+++ b/test/tint/builtins/gen/var/distance/cfed73.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1.f;
   var arg_1 = 1.f;
   var res: f32 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.dxc.hlsl
index b2345aa..d8132f4 100644
--- a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_cfed73() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = distance(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.fxc.hlsl
index b2345aa..d8132f4 100644
--- a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void distance_cfed73() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = distance(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.glsl b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.glsl
index 916a23d..32b9870 100644
--- a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_cfed73() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_cfed73() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void distance_cfed73() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = distance(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.msl b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.msl
index 5f68fe88..cbd1acb 100644
--- a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void distance_cfed73() {
+void distance_cfed73(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = fabs(arg_0 - arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  distance_cfed73();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  distance_cfed73(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  distance_cfed73();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  distance_cfed73(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  distance_cfed73();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  distance_cfed73(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.spvasm b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.spvasm
index 49a0f98..26ff0a4 100644
--- a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %distance_cfed73 "distance_cfed73"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,43 +38,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpTypeFunction %v4float
-%distance_cfed73 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
+%distance_cfed73 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
-         %19 = OpLoad %float %arg_0
-         %20 = OpLoad %float %arg_1
-         %17 = OpExtInst %float %18 Distance %19 %20
-               OpStore %res %17
+         %22 = OpLoad %float %arg_0
+         %23 = OpLoad %float %arg_1
+         %20 = OpExtInst %float %21 Distance %22 %23
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %distance_cfed73
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %distance_cfed73
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %distance_cfed73
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %distance_cfed73
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %distance_cfed73
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %distance_cfed73
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.wgsl b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.wgsl
index e52cb2a..cfff9baf 100644
--- a/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/distance/cfed73.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1.0f;
   var arg_1 = 1.0f;
   var res : f32 = distance(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_cfed73();
diff --git a/test/tint/builtins/gen/var/distance/f9c9ee.wgsl b/test/tint/builtins/gen/var/distance/f9c9ee.wgsl
index a72a3e3..3a242c3 100644
--- a/test/tint/builtins/gen/var/distance/f9c9ee.wgsl
+++ b/test/tint/builtins/gen/var/distance/f9c9ee.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1.;
   var res = distance(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   distance_f9c9ee();
diff --git a/test/tint/builtins/gen/var/dot/08eb56.wgsl b/test/tint/builtins/gen/var/dot/08eb56.wgsl
index 950d853..b66f02c 100644
--- a/test/tint/builtins/gen/var/dot/08eb56.wgsl
+++ b/test/tint/builtins/gen/var/dot/08eb56.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1.);
   var res = dot(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_08eb56();
diff --git a/test/tint/builtins/gen/var/dot/0c577b.wgsl b/test/tint/builtins/gen/var/dot/0c577b.wgsl
index ab16fb2..a62b1b8 100644
--- a/test/tint/builtins/gen/var/dot/0c577b.wgsl
+++ b/test/tint/builtins/gen/var/dot/0c577b.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<f32>(1.f);
   var res: f32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.dxc.hlsl
index 8487fa9..99c2215 100644
--- a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_0c577b() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.fxc.hlsl
index 8487fa9..99c2215 100644
--- a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_0c577b() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.glsl
index f469ef1..78d65f9 100644
--- a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_0c577b() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_0c577b() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_0c577b() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.msl
index f9d4bd8..7530fe3 100644
--- a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_0c577b() {
+void dot_0c577b(device float* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float res = dot(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_0c577b();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  dot_0c577b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_0c577b();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  dot_0c577b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_0c577b();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  dot_0c577b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.spvasm
index 9b003e9..6c9f90c 100644
--- a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_0c577b "dot_0c577b"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Function_float = OpTypePointer Function %float
-         %23 = OpTypeFunction %v4float
- %dot_0c577b = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %31 = OpTypeFunction %v4float
+ %dot_0c577b = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-         %19 = OpLoad %v4float %arg_0
-         %20 = OpLoad %v4float %arg_1
-         %18 = OpDot %float %19 %20
-               OpStore %res %18
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+         %22 = OpLoad %v4float %arg_0
+         %23 = OpLoad %v4float %arg_1
+         %21 = OpDot %float %22 %23
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %30 = OpLoad %float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %dot_0c577b
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %dot_0c577b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %dot_0c577b
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %dot_0c577b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %dot_0c577b
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %dot_0c577b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.wgsl
index 69cc640..79d655d 100644
--- a/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/0c577b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<f32>(1.0f);
   var res : f32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_0c577b();
diff --git a/test/tint/builtins/gen/var/dot/0d2c2e.wgsl b/test/tint/builtins/gen/var/dot/0d2c2e.wgsl
index 5c444c5..ae3059b 100644
--- a/test/tint/builtins/gen/var/dot/0d2c2e.wgsl
+++ b/test/tint/builtins/gen/var/dot/0d2c2e.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1.);
   var res = dot(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_0d2c2e();
diff --git a/test/tint/builtins/gen/var/dot/14bc63.wgsl b/test/tint/builtins/gen/var/dot/14bc63.wgsl
index c90dd8e..8b9d7e1 100644
--- a/test/tint/builtins/gen/var/dot/14bc63.wgsl
+++ b/test/tint/builtins/gen/var/dot/14bc63.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1);
   var res = dot(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_14bc63();
diff --git a/test/tint/builtins/gen/var/dot/5a4c8f.wgsl b/test/tint/builtins/gen/var/dot/5a4c8f.wgsl
index c20c848..af85533 100644
--- a/test/tint/builtins/gen/var/dot/5a4c8f.wgsl
+++ b/test/tint/builtins/gen/var/dot/5a4c8f.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = dot(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_5a4c8f();
diff --git a/test/tint/builtins/gen/var/dot/7548a0.wgsl b/test/tint/builtins/gen/var/dot/7548a0.wgsl
index 2f59af9..c7a6868 100644
--- a/test/tint/builtins/gen/var/dot/7548a0.wgsl
+++ b/test/tint/builtins/gen/var/dot/7548a0.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<u32>(1u);
   var arg_1 = vec3<u32>(1u);
   var res: u32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.dxc.hlsl
index 5f70435..4d7960a 100644
--- a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_7548a0() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.fxc.hlsl
index 5f70435..4d7960a 100644
--- a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_7548a0() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.glsl
index 45a7402..e71c1c4 100644
--- a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.glsl
@@ -4,10 +4,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_7548a0() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,10 +35,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_7548a0() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -50,10 +60,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_7548a0() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.msl
index 6649a39..f00d6fd 100644
--- a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.msl
@@ -6,35 +6,36 @@
 T tint_dot3(vec<T,3> a, vec<T,3> b) {
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
 }
-void dot_7548a0() {
+void dot_7548a0(device uint* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 arg_1 = uint3(1u);
   uint res = tint_dot3(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_7548a0();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  dot_7548a0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_7548a0();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  dot_7548a0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_7548a0();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  dot_7548a0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.spvasm
index 23f432b..b0fe18d 100644
--- a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_7548a0 "dot_7548a0"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,60 +37,68 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
+         %22 = OpConstantNull %v3uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %36 = OpConstantNull %uint
-         %37 = OpTypeFunction %v4float
+         %39 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_7548a0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %19
-        %res = OpVariable %_ptr_Function_uint Function %36
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v3uint %arg_0
-         %23 = OpLoad %v3uint %arg_1
-         %24 = OpCompositeExtract %uint %22 0
-         %25 = OpCompositeExtract %uint %23 0
-         %26 = OpIMul %uint %24 %25
-         %27 = OpCompositeExtract %uint %22 1
-         %28 = OpCompositeExtract %uint %23 1
+ %dot_7548a0 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
+        %res = OpVariable %_ptr_Function_uint Function %39
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v3uint %arg_0
+         %26 = OpLoad %v3uint %arg_1
+         %27 = OpCompositeExtract %uint %25 0
+         %28 = OpCompositeExtract %uint %26 0
          %29 = OpIMul %uint %27 %28
-         %30 = OpIAdd %uint %26 %29
-         %31 = OpCompositeExtract %uint %22 2
-         %32 = OpCompositeExtract %uint %23 2
-         %33 = OpIMul %uint %31 %32
-         %21 = OpIAdd %uint %30 %33
-               OpStore %res %21
+         %30 = OpCompositeExtract %uint %25 1
+         %31 = OpCompositeExtract %uint %26 1
+         %32 = OpIMul %uint %30 %31
+         %33 = OpIAdd %uint %29 %32
+         %34 = OpCompositeExtract %uint %25 2
+         %35 = OpCompositeExtract %uint %26 2
+         %36 = OpIMul %uint %34 %35
+         %24 = OpIAdd %uint %33 %36
+               OpStore %res %24
+         %42 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %43 = OpLoad %uint %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %dot_7548a0
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %dot_7548a0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %13
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %dot_7548a0
+%fragment_main = OpFunction %void None %13
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %dot_7548a0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %dot_7548a0
+%compute_main = OpFunction %void None %13
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %dot_7548a0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.wgsl
index 0ff92a3..8fc8637 100644
--- a/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/7548a0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<u32>(1u);
   var arg_1 = vec3<u32>(1u);
   var res : u32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_7548a0();
diff --git a/test/tint/builtins/gen/var/dot/883f0e.wgsl b/test/tint/builtins/gen/var/dot/883f0e.wgsl
index 638c1bd..ca93ebe 100644
--- a/test/tint/builtins/gen/var/dot/883f0e.wgsl
+++ b/test/tint/builtins/gen/var/dot/883f0e.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<f32>(1.f);
   var res: f32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.dxc.hlsl
index dea3692..9d62b9a 100644
--- a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_883f0e() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.fxc.hlsl
index dea3692..9d62b9a 100644
--- a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_883f0e() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.glsl
index 05ac5dd..75b8216 100644
--- a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_883f0e() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_883f0e() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_883f0e() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.msl
index 0c1415d..bb201d3 100644
--- a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_883f0e() {
+void dot_883f0e(device float* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float res = dot(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_883f0e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  dot_883f0e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_883f0e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  dot_883f0e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_883f0e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  dot_883f0e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.spvasm
index 10882a0..f319611 100644
--- a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_883f0e "dot_883f0e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,47 +37,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpTypeFunction %v4float
- %dot_883f0e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %33 = OpTypeFunction %v4float
+ %dot_883f0e = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %21 = OpLoad %v2float %arg_0
-         %22 = OpLoad %v2float %arg_1
-         %20 = OpDot %float %21 %22
-               OpStore %res %20
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %24 = OpLoad %v2float %arg_0
+         %25 = OpLoad %v2float %arg_1
+         %23 = OpDot %float %24 %25
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %32 = OpLoad %float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_883f0e
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot_883f0e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %dot_883f0e
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %dot_883f0e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %dot_883f0e
+%compute_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %dot_883f0e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.wgsl
index 263f3dd..eefa9ea 100644
--- a/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/883f0e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<f32>(1.0f);
   var res : f32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_883f0e();
diff --git a/test/tint/builtins/gen/var/dot/8e40f1.wgsl b/test/tint/builtins/gen/var/dot/8e40f1.wgsl
index 7ddd2b0..17b5dbc 100644
--- a/test/tint/builtins/gen/var/dot/8e40f1.wgsl
+++ b/test/tint/builtins/gen/var/dot/8e40f1.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: f16 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.dxc.hlsl
index 7d4895c..37a0728 100644
--- a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_8e40f1() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.fxc.hlsl
index eebcbd1..5dcb619 100644
--- a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_8e40f1() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.glsl
index 2443ac5..26e79af 100644
--- a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_8e40f1() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_8e40f1() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_8e40f1() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.msl
index d4618ea..f4d1bad 100644
--- a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_8e40f1() {
+void dot_8e40f1(device half* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half res = dot(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_8e40f1();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  dot_8e40f1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_8e40f1();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  dot_8e40f1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_8e40f1();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  dot_8e40f1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.spvasm
index e11563e..c40a310 100644
--- a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_8e40f1 "dot_8e40f1"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,50 +41,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v3half = OpTypeVector %half 3
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
 %_ptr_Function_half = OpTypePointer Function %half
-         %26 = OpConstantNull %half
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_8e40f1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_half Function %26
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v3half %arg_0
-         %23 = OpLoad %v3half %arg_1
-         %21 = OpDot %half %22 %23
-               OpStore %res %21
+ %dot_8e40f1 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_half Function %29
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v3half %arg_0
+         %26 = OpLoad %v3half %arg_1
+         %24 = OpDot %half %25 %26
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %34 = OpLoad %half %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %dot_8e40f1
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %dot_8e40f1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %dot_8e40f1
+%fragment_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %dot_8e40f1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %dot_8e40f1
+%compute_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %dot_8e40f1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.wgsl
index 4fb113c..1a89d8b 100644
--- a/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/8e40f1.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : f16 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_8e40f1();
diff --git a/test/tint/builtins/gen/var/dot/97c7ee.wgsl b/test/tint/builtins/gen/var/dot/97c7ee.wgsl
index bcfec67..5b49b53 100644
--- a/test/tint/builtins/gen/var/dot/97c7ee.wgsl
+++ b/test/tint/builtins/gen/var/dot/97c7ee.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<u32>(1u);
   var arg_1 = vec2<u32>(1u);
   var res: u32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.dxc.hlsl
index f537c33..037763d 100644
--- a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_97c7ee() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.fxc.hlsl
index f537c33..037763d 100644
--- a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_97c7ee() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.glsl
index 246c21b..fa31042 100644
--- a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.glsl
@@ -4,10 +4,15 @@
   return a[0]*b[0] + a[1]*b[1];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_97c7ee() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,10 +35,15 @@
   return a[0]*b[0] + a[1]*b[1];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_97c7ee() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -50,10 +60,15 @@
   return a[0]*b[0] + a[1]*b[1];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_97c7ee() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.msl
index 6957fe4..7f9588d 100644
--- a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.msl
@@ -6,35 +6,36 @@
 T tint_dot2(vec<T,2> a, vec<T,2> b) {
   return a[0]*b[0] + a[1]*b[1];
 }
-void dot_97c7ee() {
+void dot_97c7ee(device uint* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 arg_1 = uint2(1u);
   uint res = tint_dot2(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_97c7ee();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  dot_97c7ee(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_97c7ee();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  dot_97c7ee(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_97c7ee();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  dot_97c7ee(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.spvasm
index 480735d..d869404 100644
--- a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_97c7ee "dot_97c7ee"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,56 +37,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
+         %22 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %32 = OpConstantNull %uint
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_97c7ee = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %19
-        %res = OpVariable %_ptr_Function_uint Function %32
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v2uint %arg_0
-         %23 = OpLoad %v2uint %arg_1
-         %24 = OpCompositeExtract %uint %22 0
-         %25 = OpCompositeExtract %uint %23 0
-         %26 = OpIMul %uint %24 %25
-         %27 = OpCompositeExtract %uint %22 1
-         %28 = OpCompositeExtract %uint %23 1
+ %dot_97c7ee = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+        %res = OpVariable %_ptr_Function_uint Function %35
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v2uint %arg_0
+         %26 = OpLoad %v2uint %arg_1
+         %27 = OpCompositeExtract %uint %25 0
+         %28 = OpCompositeExtract %uint %26 0
          %29 = OpIMul %uint %27 %28
-         %21 = OpIAdd %uint %26 %29
-               OpStore %res %21
+         %30 = OpCompositeExtract %uint %25 1
+         %31 = OpCompositeExtract %uint %26 1
+         %32 = OpIMul %uint %30 %31
+         %24 = OpIAdd %uint %29 %32
+               OpStore %res %24
+         %38 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %39 = OpLoad %uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %dot_97c7ee
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %dot_97c7ee
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %dot_97c7ee
+%fragment_main = OpFunction %void None %13
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %dot_97c7ee
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %dot_97c7ee
+%compute_main = OpFunction %void None %13
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %dot_97c7ee
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.wgsl
index 9c2b5c2..da04c41 100644
--- a/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/97c7ee.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<u32>(1u);
   var arg_1 = vec2<u32>(1u);
   var res : u32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_97c7ee();
diff --git a/test/tint/builtins/gen/var/dot/ba4246.wgsl b/test/tint/builtins/gen/var/dot/ba4246.wgsl
index a0a9b32..f4ee121 100644
--- a/test/tint/builtins/gen/var/dot/ba4246.wgsl
+++ b/test/tint/builtins/gen/var/dot/ba4246.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: f32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.dxc.hlsl
index a69fd9e..8bb8ee2 100644
--- a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_ba4246() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.fxc.hlsl
index a69fd9e..8bb8ee2 100644
--- a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_ba4246() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.glsl
index a43c686..a91a9e6 100644
--- a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_ba4246() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_ba4246() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dot_ba4246() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.msl
index 7a789d0..1d5a3af 100644
--- a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_ba4246() {
+void dot_ba4246(device float* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float res = dot(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_ba4246();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  dot_ba4246(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_ba4246();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  dot_ba4246(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_ba4246();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  dot_ba4246(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.spvasm
index ebb73d6..c1616df 100644
--- a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_ba4246 "dot_ba4246"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,47 +37,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpTypeFunction %v4float
- %dot_ba4246 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %33 = OpTypeFunction %v4float
+ %dot_ba4246 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %21 = OpLoad %v3float %arg_0
-         %22 = OpLoad %v3float %arg_1
-         %20 = OpDot %float %21 %22
-               OpStore %res %20
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %24 = OpLoad %v3float %arg_0
+         %25 = OpLoad %v3float %arg_1
+         %23 = OpDot %float %24 %25
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %32 = OpLoad %float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %dot_ba4246
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot_ba4246
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %dot_ba4246
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %dot_ba4246
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %dot_ba4246
+%compute_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %dot_ba4246
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.wgsl
index 9964247..6b4eb6d 100644
--- a/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/ba4246.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : f32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_ba4246();
diff --git a/test/tint/builtins/gen/var/dot/c11efe.wgsl b/test/tint/builtins/gen/var/dot/c11efe.wgsl
index 3b6ba52..aeddee6 100644
--- a/test/tint/builtins/gen/var/dot/c11efe.wgsl
+++ b/test/tint/builtins/gen/var/dot/c11efe.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1);
   var res = dot(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_c11efe();
diff --git a/test/tint/builtins/gen/var/dot/cd5a04.wgsl b/test/tint/builtins/gen/var/dot/cd5a04.wgsl
index a5899b8..612d69a 100644
--- a/test/tint/builtins/gen/var/dot/cd5a04.wgsl
+++ b/test/tint/builtins/gen/var/dot/cd5a04.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<f16>(1.h);
   var res: f16 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.dxc.hlsl
index 8a4975f..edb6d30 100644
--- a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_cd5a04() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.fxc.hlsl
index 19b031c..53945e1 100644
--- a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_cd5a04() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.glsl
index 9016385..4f7d403 100644
--- a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_cd5a04() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_cd5a04() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_cd5a04() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.msl
index 7c6e7b8..e872a97 100644
--- a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_cd5a04() {
+void dot_cd5a04(device half* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half res = dot(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_cd5a04();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  dot_cd5a04(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_cd5a04();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  dot_cd5a04(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_cd5a04();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  dot_cd5a04(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.spvasm
index 6375b60..00881f1 100644
--- a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_cd5a04 "dot_cd5a04"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,50 +41,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v2half = OpTypeVector %half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
 %_ptr_Function_half = OpTypePointer Function %half
-         %26 = OpConstantNull %half
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_cd5a04 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_half Function %26
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v2half %arg_0
-         %23 = OpLoad %v2half %arg_1
-         %21 = OpDot %half %22 %23
-               OpStore %res %21
+ %dot_cd5a04 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_half Function %29
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v2half %arg_0
+         %26 = OpLoad %v2half %arg_1
+         %24 = OpDot %half %25 %26
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %34 = OpLoad %half %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %dot_cd5a04
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %dot_cd5a04
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %dot_cd5a04
+%fragment_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %dot_cd5a04
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %dot_cd5a04
+%compute_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %dot_cd5a04
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.wgsl
index feadf79..a01a2d2 100644
--- a/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/cd5a04.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<f16>(1.0h);
   var res : f16 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_cd5a04();
diff --git a/test/tint/builtins/gen/var/dot/d0d179.wgsl b/test/tint/builtins/gen/var/dot/d0d179.wgsl
index b0d97df..dd0273e 100644
--- a/test/tint/builtins/gen/var/dot/d0d179.wgsl
+++ b/test/tint/builtins/gen/var/dot/d0d179.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<f16>(1.h);
   var res: f16 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.dxc.hlsl
index 15b532b..04e2010 100644
--- a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_d0d179() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.fxc.hlsl
index 4d83a3d..cbac95a 100644
--- a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_d0d179() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.glsl
index 6401f34..78c791e 100644
--- a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_d0d179() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_d0d179() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void dot_d0d179() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t res = dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.msl
index 0f8b6a0..27503ac 100644
--- a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dot_d0d179() {
+void dot_d0d179(device half* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half res = dot(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_d0d179();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  dot_d0d179(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_d0d179();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  dot_d0d179(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_d0d179();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  dot_d0d179(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.spvasm
index c3516fa..e847c2c 100644
--- a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_d0d179 "dot_d0d179"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,50 +41,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v4half = OpTypeVector %half 4
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
 %_ptr_Function_half = OpTypePointer Function %half
-         %26 = OpConstantNull %half
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_d0d179 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_half Function %26
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v4half %arg_0
-         %23 = OpLoad %v4half %arg_1
-         %21 = OpDot %half %22 %23
-               OpStore %res %21
+ %dot_d0d179 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_half Function %29
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v4half %arg_0
+         %26 = OpLoad %v4half %arg_1
+         %24 = OpDot %half %25 %26
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %34 = OpLoad %half %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %dot_d0d179
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %dot_d0d179
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %dot_d0d179
+%fragment_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %dot_d0d179
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %dot_d0d179
+%compute_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %dot_d0d179
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.wgsl
index c5cc59e..46e0809 100644
--- a/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/d0d179.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<f16>(1.0h);
   var res : f16 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_d0d179();
diff --git a/test/tint/builtins/gen/var/dot/e994c7.wgsl b/test/tint/builtins/gen/var/dot/e994c7.wgsl
index 9b70a9f0..d6862a1 100644
--- a/test/tint/builtins/gen/var/dot/e994c7.wgsl
+++ b/test/tint/builtins/gen/var/dot/e994c7.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<u32>(1u);
   var arg_1 = vec4<u32>(1u);
   var res: u32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.dxc.hlsl
index c75a1db..4836149 100644
--- a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_e994c7() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.fxc.hlsl
index c75a1db..4836149 100644
--- a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_e994c7() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.glsl
index 9a4aa4d..75900ed 100644
--- a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.glsl
@@ -4,10 +4,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_e994c7() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,10 +35,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_e994c7() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -50,10 +60,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void dot_e994c7() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uint res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.msl
index 6429d76..a81d581 100644
--- a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.msl
@@ -6,35 +6,36 @@
 T tint_dot4(vec<T,4> a, vec<T,4> b) {
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
 }
-void dot_e994c7() {
+void dot_e994c7(device uint* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 arg_1 = uint4(1u);
   uint res = tint_dot4(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_e994c7();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  dot_e994c7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_e994c7();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  dot_e994c7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_e994c7();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  dot_e994c7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.spvasm
index e285599..5f40b1b 100644
--- a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_e994c7 "dot_e994c7"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,64 +37,72 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v4uint = OpTypeVector %uint 4
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
+         %22 = OpConstantNull %v4uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %40 = OpConstantNull %uint
-         %41 = OpTypeFunction %v4float
+         %43 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %48 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_e994c7 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4uint Function %19
-        %res = OpVariable %_ptr_Function_uint Function %40
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v4uint %arg_0
-         %23 = OpLoad %v4uint %arg_1
-         %24 = OpCompositeExtract %uint %22 0
-         %25 = OpCompositeExtract %uint %23 0
-         %26 = OpIMul %uint %24 %25
-         %27 = OpCompositeExtract %uint %22 1
-         %28 = OpCompositeExtract %uint %23 1
+ %dot_e994c7 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4uint Function %22
+        %res = OpVariable %_ptr_Function_uint Function %43
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v4uint %arg_0
+         %26 = OpLoad %v4uint %arg_1
+         %27 = OpCompositeExtract %uint %25 0
+         %28 = OpCompositeExtract %uint %26 0
          %29 = OpIMul %uint %27 %28
-         %30 = OpIAdd %uint %26 %29
-         %31 = OpCompositeExtract %uint %22 2
-         %32 = OpCompositeExtract %uint %23 2
-         %33 = OpIMul %uint %31 %32
-         %34 = OpIAdd %uint %30 %33
-         %35 = OpCompositeExtract %uint %22 3
-         %36 = OpCompositeExtract %uint %23 3
-         %37 = OpIMul %uint %35 %36
-         %21 = OpIAdd %uint %34 %37
-               OpStore %res %21
+         %30 = OpCompositeExtract %uint %25 1
+         %31 = OpCompositeExtract %uint %26 1
+         %32 = OpIMul %uint %30 %31
+         %33 = OpIAdd %uint %29 %32
+         %34 = OpCompositeExtract %uint %25 2
+         %35 = OpCompositeExtract %uint %26 2
+         %36 = OpIMul %uint %34 %35
+         %37 = OpIAdd %uint %33 %36
+         %38 = OpCompositeExtract %uint %25 3
+         %39 = OpCompositeExtract %uint %26 3
+         %40 = OpIMul %uint %38 %39
+         %24 = OpIAdd %uint %37 %40
+               OpStore %res %24
+         %46 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %47 = OpLoad %uint %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %dot_e994c7
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %dot_e994c7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %13
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %dot_e994c7
+%fragment_main = OpFunction %void None %13
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %dot_e994c7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %dot_e994c7
+%compute_main = OpFunction %void None %13
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %dot_e994c7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.wgsl
index 9deb599..8b3540a 100644
--- a/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/e994c7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<u32>(1u);
   var arg_1 = vec4<u32>(1u);
   var res : u32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_e994c7();
diff --git a/test/tint/builtins/gen/var/dot/eb9fbf.wgsl b/test/tint/builtins/gen/var/dot/eb9fbf.wgsl
index 27e1ae9..bcc9b9d 100644
--- a/test/tint/builtins/gen/var/dot/eb9fbf.wgsl
+++ b/test/tint/builtins/gen/var/dot/eb9fbf.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1);
   var res = dot(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_eb9fbf();
diff --git a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl
index d21b1e2..c2a944f 100644
--- a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl
+++ b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<i32>(1i);
   var arg_1 = vec4<i32>(1i);
   var res: i32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.dxc.hlsl
index 96174b6..28e59b5 100644
--- a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_ef6b1d() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   int res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.fxc.hlsl
index 96174b6..28e59b5 100644
--- a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_ef6b1d() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   int res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.glsl
index f5ab0f2..63b3882 100644
--- a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.glsl
@@ -4,10 +4,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_ef6b1d() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,10 +35,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_ef6b1d() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -50,10 +60,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_ef6b1d() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.msl
index 700a2af..9ea57c9 100644
--- a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.msl
@@ -6,35 +6,36 @@
 T tint_dot4(vec<T,4> a, vec<T,4> b) {
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
 }
-void dot_ef6b1d() {
+void dot_ef6b1d(device int* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 arg_1 = int4(1);
   int res = tint_dot4(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_ef6b1d();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  dot_ef6b1d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_ef6b1d();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  dot_ef6b1d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_ef6b1d();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  dot_ef6b1d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.spvasm
index a640cfb..f71d113 100644
--- a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_ef6b1d "dot_ef6b1d"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,64 +37,73 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %v4int = OpTypeVector %int 4
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
+         %22 = OpConstantNull %v4int
 %_ptr_Function_int = OpTypePointer Function %int
-         %40 = OpConstantNull %int
-         %41 = OpTypeFunction %v4float
+         %43 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_ef6b1d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %19
-        %res = OpVariable %_ptr_Function_int Function %40
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v4int %arg_0
-         %23 = OpLoad %v4int %arg_1
-         %24 = OpCompositeExtract %int %22 0
-         %25 = OpCompositeExtract %int %23 0
-         %26 = OpIMul %int %24 %25
-         %27 = OpCompositeExtract %int %22 1
-         %28 = OpCompositeExtract %int %23 1
+ %dot_ef6b1d = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %22
+        %res = OpVariable %_ptr_Function_int Function %43
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v4int %arg_0
+         %26 = OpLoad %v4int %arg_1
+         %27 = OpCompositeExtract %int %25 0
+         %28 = OpCompositeExtract %int %26 0
          %29 = OpIMul %int %27 %28
-         %30 = OpIAdd %int %26 %29
-         %31 = OpCompositeExtract %int %22 2
-         %32 = OpCompositeExtract %int %23 2
-         %33 = OpIMul %int %31 %32
-         %34 = OpIAdd %int %30 %33
-         %35 = OpCompositeExtract %int %22 3
-         %36 = OpCompositeExtract %int %23 3
-         %37 = OpIMul %int %35 %36
-         %21 = OpIAdd %int %34 %37
-               OpStore %res %21
+         %30 = OpCompositeExtract %int %25 1
+         %31 = OpCompositeExtract %int %26 1
+         %32 = OpIMul %int %30 %31
+         %33 = OpIAdd %int %29 %32
+         %34 = OpCompositeExtract %int %25 2
+         %35 = OpCompositeExtract %int %26 2
+         %36 = OpIMul %int %34 %35
+         %37 = OpIAdd %int %33 %36
+         %38 = OpCompositeExtract %int %25 3
+         %39 = OpCompositeExtract %int %26 3
+         %40 = OpIMul %int %38 %39
+         %24 = OpIAdd %int %37 %40
+               OpStore %res %24
+         %47 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %48 = OpLoad %int %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %dot_ef6b1d
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %dot_ef6b1d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %13
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %dot_ef6b1d
+%fragment_main = OpFunction %void None %13
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %dot_ef6b1d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %dot_ef6b1d
+%compute_main = OpFunction %void None %13
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %dot_ef6b1d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.wgsl
index 91534d9..5ae72af 100644
--- a/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/ef6b1d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<i32>(1i);
   var arg_1 = vec4<i32>(1i);
   var res : i32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_ef6b1d();
diff --git a/test/tint/builtins/gen/var/dot/f1312c.wgsl b/test/tint/builtins/gen/var/dot/f1312c.wgsl
index 22d8c7a..cd274d8 100644
--- a/test/tint/builtins/gen/var/dot/f1312c.wgsl
+++ b/test/tint/builtins/gen/var/dot/f1312c.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<i32>(1i);
   var arg_1 = vec3<i32>(1i);
   var res: i32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.dxc.hlsl
index 68dde1e..831c078 100644
--- a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_f1312c() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   int res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.fxc.hlsl
index 68dde1e..831c078 100644
--- a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_f1312c() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   int res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.glsl
index 24335d9..5bc8b7d 100644
--- a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.glsl
@@ -4,10 +4,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_f1312c() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,10 +35,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_f1312c() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -50,10 +60,15 @@
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_f1312c() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.msl
index 4707e73..df358bb 100644
--- a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.msl
@@ -6,35 +6,36 @@
 T tint_dot3(vec<T,3> a, vec<T,3> b) {
   return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
 }
-void dot_f1312c() {
+void dot_f1312c(device int* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 arg_1 = int3(1);
   int res = tint_dot3(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_f1312c();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  dot_f1312c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_f1312c();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  dot_f1312c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_f1312c();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  dot_f1312c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.spvasm
index 9a72f60..cfcfe04 100644
--- a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_f1312c "dot_f1312c"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,60 +37,69 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
+         %22 = OpConstantNull %v3int
 %_ptr_Function_int = OpTypePointer Function %int
-         %36 = OpConstantNull %int
-         %37 = OpTypeFunction %v4float
+         %39 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %45 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_f1312c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %19
-        %res = OpVariable %_ptr_Function_int Function %36
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v3int %arg_0
-         %23 = OpLoad %v3int %arg_1
-         %24 = OpCompositeExtract %int %22 0
-         %25 = OpCompositeExtract %int %23 0
-         %26 = OpIMul %int %24 %25
-         %27 = OpCompositeExtract %int %22 1
-         %28 = OpCompositeExtract %int %23 1
+ %dot_f1312c = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
+        %res = OpVariable %_ptr_Function_int Function %39
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v3int %arg_0
+         %26 = OpLoad %v3int %arg_1
+         %27 = OpCompositeExtract %int %25 0
+         %28 = OpCompositeExtract %int %26 0
          %29 = OpIMul %int %27 %28
-         %30 = OpIAdd %int %26 %29
-         %31 = OpCompositeExtract %int %22 2
-         %32 = OpCompositeExtract %int %23 2
-         %33 = OpIMul %int %31 %32
-         %21 = OpIAdd %int %30 %33
-               OpStore %res %21
+         %30 = OpCompositeExtract %int %25 1
+         %31 = OpCompositeExtract %int %26 1
+         %32 = OpIMul %int %30 %31
+         %33 = OpIAdd %int %29 %32
+         %34 = OpCompositeExtract %int %25 2
+         %35 = OpCompositeExtract %int %26 2
+         %36 = OpIMul %int %34 %35
+         %24 = OpIAdd %int %33 %36
+               OpStore %res %24
+         %43 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %44 = OpLoad %int %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %dot_f1312c
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %dot_f1312c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %dot_f1312c
+%fragment_main = OpFunction %void None %13
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %dot_f1312c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %dot_f1312c
+%compute_main = OpFunction %void None %13
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %dot_f1312c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.wgsl
index d8c56b3..9dffd99 100644
--- a/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/f1312c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<i32>(1i);
   var arg_1 = vec3<i32>(1i);
   var res : i32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_f1312c();
diff --git a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl
index e5f0702..79d86d0 100644
--- a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl
+++ b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<i32>(1i);
   var arg_1 = vec2<i32>(1i);
   var res: i32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.dxc.hlsl
index 14ede0a..692fde0 100644
--- a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_fc5f7c() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   int res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.fxc.hlsl
index 14ede0a..692fde0 100644
--- a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot_fc5f7c() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   int res = dot(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.glsl b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.glsl
index b83abe5..5cc486b 100644
--- a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.glsl
@@ -4,10 +4,15 @@
   return a[0]*b[0] + a[1]*b[1];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_fc5f7c() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -30,10 +35,15 @@
   return a[0]*b[0] + a[1]*b[1];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_fc5f7c() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -50,10 +60,15 @@
   return a[0]*b[0] + a[1]*b[1];
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void dot_fc5f7c() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   int res = tint_int_dot(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.msl b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.msl
index e3da2a2..1ba8a68 100644
--- a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.msl
@@ -6,35 +6,36 @@
 T tint_dot2(vec<T,2> a, vec<T,2> b) {
   return a[0]*b[0] + a[1]*b[1];
 }
-void dot_fc5f7c() {
+void dot_fc5f7c(device int* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 arg_1 = int2(1);
   int res = tint_dot2(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  dot_fc5f7c();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  dot_fc5f7c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  dot_fc5f7c();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  dot_fc5f7c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  dot_fc5f7c();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  dot_fc5f7c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.spvasm
index 8406ecc..1ca9b63 100644
--- a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot_fc5f7c "dot_fc5f7c"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,56 +37,65 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
+         %22 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %32 = OpConstantNull %int
-         %33 = OpTypeFunction %v4float
+         %35 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %dot_fc5f7c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %19
-        %res = OpVariable %_ptr_Function_int Function %32
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %22 = OpLoad %v2int %arg_0
-         %23 = OpLoad %v2int %arg_1
-         %24 = OpCompositeExtract %int %22 0
-         %25 = OpCompositeExtract %int %23 0
-         %26 = OpIMul %int %24 %25
-         %27 = OpCompositeExtract %int %22 1
-         %28 = OpCompositeExtract %int %23 1
+ %dot_fc5f7c = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+        %res = OpVariable %_ptr_Function_int Function %35
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %25 = OpLoad %v2int %arg_0
+         %26 = OpLoad %v2int %arg_1
+         %27 = OpCompositeExtract %int %25 0
+         %28 = OpCompositeExtract %int %26 0
          %29 = OpIMul %int %27 %28
-         %21 = OpIAdd %int %26 %29
-               OpStore %res %21
+         %30 = OpCompositeExtract %int %25 1
+         %31 = OpCompositeExtract %int %26 1
+         %32 = OpIMul %int %30 %31
+         %24 = OpIAdd %int %29 %32
+               OpStore %res %24
+         %39 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %40 = OpLoad %int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %dot_fc5f7c
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %dot_fc5f7c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %dot_fc5f7c
+%fragment_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %dot_fc5f7c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %dot_fc5f7c
+%compute_main = OpFunction %void None %13
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %dot_fc5f7c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.wgsl
index 207146c..51f868a 100644
--- a/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot/fc5f7c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<i32>(1i);
   var arg_1 = vec2<i32>(1i);
   var res : i32 = dot(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot_fc5f7c();
diff --git a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl
index 73fd181..76caf77 100644
--- a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl
+++ b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1u;
   var arg_1 = 1u;
   var res: i32 = dot4I8Packed(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.dxc.hlsl
index 16555b7..6a0bbe3 100644
--- a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.dxc.hlsl
@@ -1,12 +1,17 @@
+SKIP: FAILED
+
 int tint_dot4I8Packed(uint param_0, uint param_1) {
   int accumulator = 0;
   return dot4add_i8packed(param_0, param_1, accumulator);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot4I8Packed_881e62() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   int res = tint_dot4I8Packed(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -35,3 +40,31 @@
   dot4I8Packed_881e62();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddI8Packed not valid in shader model vs_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 163, i32 0, i32 1, i32 1)' in block '#0' of function 'vertex_main'.
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddI8Packed not valid in shader model ps_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 163, i32 0, i32 1, i32 1)' in block '#0' of function 'fragment_main'.
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddI8Packed not valid in shader model cs_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 163, i32 0, i32 1, i32 1)' in block '#0' of function 'compute_main'.
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.fxc.hlsl
index b5bc698..8b17f40 100644
--- a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.fxc.hlsl
@@ -5,10 +5,13 @@
   return dot4add_i8packed(param_0, param_1, accumulator);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot4I8Packed_881e62() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   int res = tint_dot4I8Packed(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.spvasm
index 075bf9b..86aed7d 100644
--- a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability DotProduct
@@ -15,6 +15,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot4I8Packed_881e62 "dot4I8Packed_881e62"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -25,6 +28,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,49 +40,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-        %int = OpTypeInt 32 1
+         %21 = OpConstantNull %uint
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%dot4I8Packed_881e62 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-      %arg_1 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_int Function %25
+%dot4I8Packed_881e62 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %21
+      %arg_1 = OpVariable %_ptr_Function_uint Function %21
+        %res = OpVariable %_ptr_Function_int Function %28
                OpStore %arg_0 %uint_1
                OpStore %arg_1 %uint_1
-         %21 = OpLoad %uint %arg_0
-         %22 = OpLoad %uint %arg_1
-         %19 = OpSDot %int %21 %22 PackedVectorFormat4x8Bit
-               OpStore %res %19
+         %24 = OpLoad %uint %arg_0
+         %25 = OpLoad %uint %arg_1
+         %23 = OpSDot %int %24 %25 PackedVectorFormat4x8Bit
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %32 = OpLoad %int %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %dot4I8Packed_881e62
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %dot4I8Packed_881e62
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %dot4I8Packed_881e62
+%fragment_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %dot4I8Packed_881e62
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %dot4I8Packed_881e62
+%compute_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %dot4I8Packed_881e62
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.wgsl
index ba5f0a7..44f1a1d 100644
--- a/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot4I8Packed/881e62.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1u;
   var arg_1 = 1u;
   var res : i32 = dot4I8Packed(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot4I8Packed_881e62();
diff --git a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl
index 8c90e74..d524ff0 100644
--- a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl
+++ b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1u;
   var arg_1 = 1u;
   var res: u32 = dot4U8Packed(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.dxc.hlsl
index 4b66aa9..2161d00 100644
--- a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.dxc.hlsl
@@ -1,12 +1,17 @@
+SKIP: FAILED
+
 uint tint_dot4U8Packed(uint param_0, uint param_1) {
   uint accumulator = 0u;
   return dot4add_u8packed(param_0, param_1, accumulator);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot4U8Packed_fbed7b() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = tint_dot4U8Packed(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -35,3 +40,31 @@
   dot4U8Packed_fbed7b();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddU8Packed not valid in shader model vs_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 164, i32 0, i32 1, i32 1)' in block '#0' of function 'vertex_main'.
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddU8Packed not valid in shader model ps_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 164, i32 0, i32 1, i32 1)' in block '#0' of function 'fragment_main'.
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+shader.hlsl:3:10: error: Opcode Dot4AddU8Packed not valid in shader model cs_6_0.
+note: at '%2 = call i32 @dx.op.dot4AddPacked.i32(i32 164, i32 0, i32 1, i32 1)' in block '#0' of function 'compute_main'.
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.fxc.hlsl
index fb71ba6..173ac8f 100644
--- a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.fxc.hlsl
@@ -5,10 +5,13 @@
   return dot4add_u8packed(param_0, param_1, accumulator);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dot4U8Packed_fbed7b() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = tint_dot4U8Packed(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.spvasm
index b0a4f48..7849f91 100644
--- a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability DotProduct
@@ -15,6 +15,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dot4U8Packed_fbed7b "dot4U8Packed_fbed7b"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -25,6 +28,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,46 +40,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%dot4U8Packed_fbed7b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-      %arg_1 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+%dot4U8Packed_fbed7b = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+      %arg_1 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
                OpStore %arg_1 %uint_1
-         %20 = OpLoad %uint %arg_0
-         %21 = OpLoad %uint %arg_1
-         %19 = OpUDot %uint %20 %21 PackedVectorFormat4x8Bit
-               OpStore %res %19
+         %23 = OpLoad %uint %arg_0
+         %24 = OpLoad %uint %arg_1
+         %22 = OpUDot %uint %23 %24 PackedVectorFormat4x8Bit
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %dot4U8Packed_fbed7b
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %dot4U8Packed_fbed7b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %dot4U8Packed_fbed7b
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %dot4U8Packed_fbed7b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %dot4U8Packed_fbed7b
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %dot4U8Packed_fbed7b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.wgsl
index dc9897f..6b62568 100644
--- a/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dot4U8Packed/fbed7b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1u;
   var arg_1 = 1u;
   var res : u32 = dot4U8Packed(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   dot4U8Packed_fbed7b();
diff --git a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl
index 18f9430..5597241 100644
--- a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl
+++ b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl
@@ -25,7 +25,9 @@
 fn dpdx_0763f7() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = dpdx(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.dxc.hlsl
index 8b7fe53..4e17fc8 100644
--- a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_0763f7() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddx(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.fxc.hlsl
index 8b7fe53..4e17fc8 100644
--- a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_0763f7() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddx(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.glsl
index 2bfea7d..9a0aac2 100644
--- a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdx_0763f7() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.msl
index 2cacfcd..8a49864 100644
--- a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdx_0763f7() {
+void dpdx_0763f7(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = dfdx(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdx_0763f7();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdx_0763f7(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.spvasm
index cdcc699..06b204b 100644
--- a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdx_0763f7 "dpdx_0763f7"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%dpdx_0763f7 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpDPdx %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdx_0763f7 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpDPdx %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdx_0763f7
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdx_0763f7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.wgsl
index 9fff661..a446f05 100644
--- a/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdx/0763f7.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdx_0763f7() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = dpdx(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdx_0763f7();
diff --git a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl
index b767d36..21eda05 100644
--- a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl
+++ b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl
@@ -25,7 +25,9 @@
 fn dpdx_99edb1() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = dpdx(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.dxc.hlsl
index d63d96b..301cd54 100644
--- a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_99edb1() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddx(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.fxc.hlsl
index d63d96b..301cd54 100644
--- a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_99edb1() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddx(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.glsl
index 4229e0f..d5d850f 100644
--- a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdx_99edb1() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.msl
index e48ad6b..749e9d8 100644
--- a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdx_99edb1() {
+void dpdx_99edb1(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdx_99edb1();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdx_99edb1(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.spvasm
index 8740414..3c9356f 100644
--- a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdx_99edb1 "dpdx_99edb1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%dpdx_99edb1 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpDPdx %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdx_99edb1 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpDPdx %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdx_99edb1
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdx_99edb1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.wgsl
index fe4f948..5593a84 100644
--- a/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdx/99edb1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdx_99edb1() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = dpdx(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdx_99edb1();
diff --git a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl
index ef67228..12a591d 100644
--- a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl
+++ b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl
@@ -25,7 +25,9 @@
 fn dpdx_c487fa() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = dpdx(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.dxc.hlsl
index 00894e7..b0d7456 100644
--- a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_c487fa() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddx(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.fxc.hlsl
index 00894e7..b0d7456 100644
--- a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_c487fa() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddx(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.glsl
index 6991ecb..d41b8f9 100644
--- a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdx_c487fa() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.msl
index b6af68c..e4ac223 100644
--- a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdx_c487fa() {
+void dpdx_c487fa(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdx_c487fa();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdx_c487fa(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.spvasm
index 7eb29801..b8870a5 100644
--- a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdx_c487fa "dpdx_c487fa"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%dpdx_c487fa = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpDPdx %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdx_c487fa = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpDPdx %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdx_c487fa
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdx_c487fa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.wgsl
index 24dead7..69e3fac 100644
--- a/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdx/c487fa.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdx_c487fa() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = dpdx(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdx_c487fa();
diff --git a/test/tint/builtins/gen/var/dpdx/e263de.wgsl b/test/tint/builtins/gen/var/dpdx/e263de.wgsl
index b9ba1cc..66174f0 100644
--- a/test/tint/builtins/gen/var/dpdx/e263de.wgsl
+++ b/test/tint/builtins/gen/var/dpdx/e263de.wgsl
@@ -25,7 +25,9 @@
 fn dpdx_e263de() {
   var arg_0 = 1.f;
   var res: f32 = dpdx(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.dxc.hlsl
index ef8ef06..062ed8f 100644
--- a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_e263de() {
   float arg_0 = 1.0f;
   float res = ddx(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.fxc.hlsl
index ef8ef06..062ed8f 100644
--- a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdx_e263de() {
   float arg_0 = 1.0f;
   float res = ddx(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.glsl
index 7debcdb..e8cdd73 100644
--- a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdx_e263de() {
   float arg_0 = 1.0f;
   float res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.msl
index 81401f4..b841dd0 100644
--- a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdx_e263de() {
+void dpdx_e263de(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdx_e263de();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdx_e263de(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.spvasm
index 8346357..9c1fc36 100644
--- a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.spvasm
@@ -1,34 +1,50 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdx_e263de "dpdx_e263de"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%dpdx_e263de = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdx_e263de = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpDPdx %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpDPdx %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdx_e263de
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdx_e263de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.wgsl
index 803a3d3..1ca8db2 100644
--- a/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdx/e263de.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdx_e263de() {
   var arg_0 = 1.0f;
   var res : f32 = dpdx(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdx_e263de();
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl
index cada76b..b68e34c 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl
@@ -25,7 +25,9 @@
 fn dpdxCoarse_029152() {
   var arg_0 = 1.f;
   var res: f32 = dpdxCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.dxc.hlsl
index e2ee497..15abfc4 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_029152() {
   float arg_0 = 1.0f;
   float res = ddx_coarse(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.fxc.hlsl
index e2ee497..15abfc4 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_029152() {
   float arg_0 = 1.0f;
   float res = ddx_coarse(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.glsl
index 22fcf55..4fb7498 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdxCoarse_029152() {
   float arg_0 = 1.0f;
   float res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.msl
index 82e95e8..a5df28e 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxCoarse_029152() {
+void dpdxCoarse_029152(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxCoarse_029152();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdxCoarse_029152(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.spvasm
index c61f62b..c73a9a3 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.spvasm
@@ -1,35 +1,51 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxCoarse_029152 "dpdxCoarse_029152"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%dpdxCoarse_029152 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdxCoarse_029152 = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpDPdxCoarse %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpDPdxCoarse %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdxCoarse_029152
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdxCoarse_029152
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.wgsl
index ff88b0e..58dea97 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/029152.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdxCoarse_029152() {
   var arg_0 = 1.0f;
   var res : f32 = dpdxCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdxCoarse_029152();
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl
index a6178ac..1ff546d 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl
@@ -25,7 +25,9 @@
 fn dpdxCoarse_9581cf() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = dpdxCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.dxc.hlsl
index b9505f1..3a7558a 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_9581cf() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddx_coarse(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.fxc.hlsl
index b9505f1..3a7558a 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_9581cf() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddx_coarse(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.glsl
index 47d14b3..3488992 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdxCoarse_9581cf() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.msl
index 334f231..0ba3a21 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxCoarse_9581cf() {
+void dpdxCoarse_9581cf(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxCoarse_9581cf();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdxCoarse_9581cf(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.spvasm
index b4a4163..ff3b6cb 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxCoarse_9581cf "dpdxCoarse_9581cf"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%dpdxCoarse_9581cf = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpDPdxCoarse %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdxCoarse_9581cf = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpDPdxCoarse %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdxCoarse_9581cf
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdxCoarse_9581cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.wgsl
index 75c0d80..c5f1afc 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/9581cf.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdxCoarse_9581cf() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = dpdxCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxCoarse_9581cf();
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl
index 61110d7..829881a 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl
@@ -25,7 +25,9 @@
 fn dpdxCoarse_c28641() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = dpdxCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.dxc.hlsl
index 1000e18..7ee06f9 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_c28641() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddx_coarse(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.fxc.hlsl
index 1000e18..7ee06f9 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_c28641() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddx_coarse(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.glsl
index 08f05dd..9d655b6 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdxCoarse_c28641() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.msl
index 84e40cd..8d00523 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxCoarse_c28641() {
+void dpdxCoarse_c28641(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxCoarse_c28641();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdxCoarse_c28641(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.spvasm
index 49d4ad6..fa90e55 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxCoarse_c28641 "dpdxCoarse_c28641"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%dpdxCoarse_c28641 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpDPdxCoarse %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdxCoarse_c28641 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpDPdxCoarse %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdxCoarse_c28641
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdxCoarse_c28641
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.wgsl
index 4cfb226..bbf12cf 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/c28641.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdxCoarse_c28641() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = dpdxCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxCoarse_c28641();
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl
index 81434d9..4573a27 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl
@@ -25,7 +25,9 @@
 fn dpdxCoarse_f64d7b() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = dpdxCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.dxc.hlsl
index fe12d76..0ee8f5a 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_f64d7b() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddx_coarse(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.fxc.hlsl
index fe12d76..0ee8f5a 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxCoarse_f64d7b() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddx_coarse(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.glsl
index bef053e..4f8071d 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdxCoarse_f64d7b() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.msl
index ef8fc27..472183b 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxCoarse_f64d7b() {
+void dpdxCoarse_f64d7b(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = dfdx(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdxCoarse_f64d7b();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdxCoarse_f64d7b(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.spvasm
index 79a6c09..f610c35 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxCoarse_f64d7b "dpdxCoarse_f64d7b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%dpdxCoarse_f64d7b = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpDPdxCoarse %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdxCoarse_f64d7b = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpDPdxCoarse %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdxCoarse_f64d7b
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdxCoarse_f64d7b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.wgsl
index b11e280..989ef95 100644
--- a/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdxCoarse/f64d7b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdxCoarse_f64d7b() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = dpdxCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxCoarse_f64d7b();
diff --git a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl
index 957fd01..5264e92 100644
--- a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl
+++ b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl
@@ -25,7 +25,9 @@
 fn dpdxFine_8c5069() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = dpdxFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.dxc.hlsl
index d95c391..3d92800 100644
--- a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_8c5069() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddx_fine(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.fxc.hlsl
index d95c391..3d92800 100644
--- a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_8c5069() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddx_fine(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.glsl
index 023e3be..ae8c057 100644
--- a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdxFine_8c5069() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.msl
index 80b43a1..15f09d7 100644
--- a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxFine_8c5069() {
+void dpdxFine_8c5069(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxFine_8c5069();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdxFine_8c5069(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.spvasm
index 2936fee..7192568 100644
--- a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxFine_8c5069 "dpdxFine_8c5069"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%dpdxFine_8c5069 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpDPdxFine %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdxFine_8c5069 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpDPdxFine %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdxFine_8c5069
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdxFine_8c5069
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.wgsl
index 4d35158..854e195 100644
--- a/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdxFine/8c5069.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdxFine_8c5069() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = dpdxFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxFine_8c5069();
diff --git a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl
index f7793e2..3d80e19 100644
--- a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl
+++ b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl
@@ -25,7 +25,9 @@
 fn dpdxFine_9631de() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = dpdxFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.dxc.hlsl
index 271d791..a9cf6df 100644
--- a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_9631de() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddx_fine(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.fxc.hlsl
index 271d791..a9cf6df 100644
--- a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_9631de() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddx_fine(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.glsl
index 53e7fb4..6a02cfc 100644
--- a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdxFine_9631de() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.msl
index 93b0911..b316aad 100644
--- a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxFine_9631de() {
+void dpdxFine_9631de(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxFine_9631de();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdxFine_9631de(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.spvasm
index dd97e0c..61b0ecb 100644
--- a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxFine_9631de "dpdxFine_9631de"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%dpdxFine_9631de = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpDPdxFine %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdxFine_9631de = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpDPdxFine %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdxFine_9631de
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdxFine_9631de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.wgsl
index e6a892f..e84f9e7 100644
--- a/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdxFine/9631de.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdxFine_9631de() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = dpdxFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxFine_9631de();
diff --git a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl
index db34836..ae340cc 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl
@@ -25,7 +25,9 @@
 fn dpdxFine_f401a2() {
   var arg_0 = 1.f;
   var res: f32 = dpdxFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.dxc.hlsl
index 4c1d8c4..41c03d4 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_f401a2() {
   float arg_0 = 1.0f;
   float res = ddx_fine(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.fxc.hlsl
index 4c1d8c4..41c03d4 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_f401a2() {
   float arg_0 = 1.0f;
   float res = ddx_fine(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.glsl
index 5840665..d0c93f2 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdxFine_f401a2() {
   float arg_0 = 1.0f;
   float res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.msl
index 6d33b99..bb7a076 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxFine_f401a2() {
+void dpdxFine_f401a2(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = dfdx(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdxFine_f401a2();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdxFine_f401a2(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.spvasm
index 3806d73..c2d2865 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.spvasm
@@ -1,35 +1,51 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxFine_f401a2 "dpdxFine_f401a2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%dpdxFine_f401a2 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdxFine_f401a2 = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpDPdxFine %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpDPdxFine %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdxFine_f401a2
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdxFine_f401a2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.wgsl
index b0842b2..479e4d0 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f401a2.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdxFine_f401a2() {
   var arg_0 = 1.0f;
   var res : f32 = dpdxFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdxFine_f401a2();
diff --git a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl
index 3f6cf35..2cbe4b8 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl
@@ -25,7 +25,9 @@
 fn dpdxFine_f92fb6() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = dpdxFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.dxc.hlsl
index 60d0b82..ce20c9d 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_f92fb6() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddx_fine(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.fxc.hlsl
index 60d0b82..ce20c9d 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdxFine_f92fb6() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddx_fine(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.glsl
index 4dab9bc..662b205 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdxFine_f92fb6() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = dFdx(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.msl
index 654abac..bc7f0ff 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdxFine_f92fb6() {
+void dpdxFine_f92fb6(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = dfdx(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdxFine_f92fb6();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdxFine_f92fb6(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.spvasm
index dee390d..2f123fb 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdxFine_f92fb6 "dpdxFine_f92fb6"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%dpdxFine_f92fb6 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpDPdxFine %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdxFine_f92fb6 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpDPdxFine %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdxFine_f92fb6
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdxFine_f92fb6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.wgsl
index 8c4849b..a39d7ec 100644
--- a/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdxFine/f92fb6.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdxFine_f92fb6() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = dpdxFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdxFine_f92fb6();
diff --git a/test/tint/builtins/gen/var/dpdy/699a05.wgsl b/test/tint/builtins/gen/var/dpdy/699a05.wgsl
index 80c7dff..829a749 100644
--- a/test/tint/builtins/gen/var/dpdy/699a05.wgsl
+++ b/test/tint/builtins/gen/var/dpdy/699a05.wgsl
@@ -25,7 +25,9 @@
 fn dpdy_699a05() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = dpdy(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.dxc.hlsl
index 8ba1841..9dbae18 100644
--- a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_699a05() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddy(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.fxc.hlsl
index 8ba1841..9dbae18 100644
--- a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_699a05() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddy(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.glsl
index dcb3024..9d3e66a 100644
--- a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdy_699a05() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.msl
index 3ac1a30..cf66e4c 100644
--- a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdy_699a05() {
+void dpdy_699a05(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdy_699a05();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdy_699a05(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.spvasm
index 66f3946..ca6434f 100644
--- a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdy_699a05 "dpdy_699a05"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%dpdy_699a05 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpDPdy %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdy_699a05 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpDPdy %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdy_699a05
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdy_699a05
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.wgsl
index a64ad34..bd1ca31 100644
--- a/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdy/699a05.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdy_699a05() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = dpdy(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdy_699a05();
diff --git a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl
index 763b514..d6a1ed2 100644
--- a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl
+++ b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl
@@ -25,7 +25,9 @@
 fn dpdy_7f8d84() {
   var arg_0 = 1.f;
   var res: f32 = dpdy(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.dxc.hlsl
index 566c64b..94bfc7c 100644
--- a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_7f8d84() {
   float arg_0 = 1.0f;
   float res = ddy(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.fxc.hlsl
index 566c64b..94bfc7c 100644
--- a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_7f8d84() {
   float arg_0 = 1.0f;
   float res = ddy(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.glsl
index 298a795..f948355 100644
--- a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdy_7f8d84() {
   float arg_0 = 1.0f;
   float res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.msl
index 5651aa7..9a2cde6 100644
--- a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdy_7f8d84() {
+void dpdy_7f8d84(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdy_7f8d84();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdy_7f8d84(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.spvasm
index 4480737..ca6cbc9 100644
--- a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.spvasm
@@ -1,34 +1,50 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdy_7f8d84 "dpdy_7f8d84"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%dpdy_7f8d84 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdy_7f8d84 = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpDPdy %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpDPdy %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdy_7f8d84
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdy_7f8d84
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.wgsl
index b538f0f..3bd7bbc 100644
--- a/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdy/7f8d84.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdy_7f8d84() {
   var arg_0 = 1.0f;
   var res : f32 = dpdy(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdy_7f8d84();
diff --git a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl
index ddfd0be..43be593 100644
--- a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl
+++ b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl
@@ -25,7 +25,9 @@
 fn dpdy_a8b56e() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = dpdy(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.dxc.hlsl
index fb0a299..9679c7b 100644
--- a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_a8b56e() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddy(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.fxc.hlsl
index fb0a299..9679c7b 100644
--- a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_a8b56e() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddy(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.glsl
index 5078de0..150eb1e 100644
--- a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdy_a8b56e() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.msl
index 0fdd938..f8aa085 100644
--- a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdy_a8b56e() {
+void dpdy_a8b56e(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdy_a8b56e();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdy_a8b56e(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.spvasm
index 62f7bb3..a567237 100644
--- a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdy_a8b56e "dpdy_a8b56e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%dpdy_a8b56e = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpDPdy %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdy_a8b56e = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpDPdy %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdy_a8b56e
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdy_a8b56e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.wgsl
index 772a595..56fbb33 100644
--- a/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdy/a8b56e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdy_a8b56e() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = dpdy(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdy_a8b56e();
diff --git a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl
index 41123f0..f903c86 100644
--- a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl
+++ b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl
@@ -25,7 +25,9 @@
 fn dpdy_feb40f() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = dpdy(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.dxc.hlsl
index 595c0af..6942081 100644
--- a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_feb40f() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddy(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.fxc.hlsl
index 595c0af..6942081 100644
--- a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdy_feb40f() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddy(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.glsl
index e7ff0a6..c57f293 100644
--- a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdy_feb40f() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.msl
index 786b30e..3de4d38 100644
--- a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdy_feb40f() {
+void dpdy_feb40f(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = dfdy(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdy_feb40f();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdy_feb40f(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.spvasm
index 1902607..70f29e0 100644
--- a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdy_feb40f "dpdy_feb40f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%dpdy_feb40f = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpDPdy %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdy_feb40f = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpDPdy %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdy_feb40f
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdy_feb40f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.wgsl
index f1d8470..b3f0d6c 100644
--- a/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdy/feb40f.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdy_feb40f() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = dpdy(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdy_feb40f();
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl
index 2b8f103..b603673 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl
@@ -25,7 +25,9 @@
 fn dpdyCoarse_3e1ab4() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = dpdyCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.dxc.hlsl
index c5a7e6f..a23f966 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_3e1ab4() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddy_coarse(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.fxc.hlsl
index c5a7e6f..a23f966 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_3e1ab4() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddy_coarse(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.glsl
index 0565b5b..330ffe1 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdyCoarse_3e1ab4() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.msl
index b36ba5d..da5f41b 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyCoarse_3e1ab4() {
+void dpdyCoarse_3e1ab4(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyCoarse_3e1ab4();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdyCoarse_3e1ab4(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.spvasm
index 55909a5..d5591aa 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyCoarse_3e1ab4 "dpdyCoarse_3e1ab4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%dpdyCoarse_3e1ab4 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpDPdyCoarse %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdyCoarse_3e1ab4 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpDPdyCoarse %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdyCoarse_3e1ab4
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdyCoarse_3e1ab4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.wgsl
index 4d32658..9929e78 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/3e1ab4.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdyCoarse_3e1ab4() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = dpdyCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyCoarse_3e1ab4();
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl
index e9aa22b..bddd4d6 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl
@@ -25,7 +25,9 @@
 fn dpdyCoarse_445d24() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = dpdyCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.dxc.hlsl
index e12a367..9b6db8f 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_445d24() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddy_coarse(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.fxc.hlsl
index e12a367..9b6db8f 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_445d24() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddy_coarse(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.glsl
index bf231ff..0ea0803 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdyCoarse_445d24() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.msl
index 9e132ba..11453c6 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyCoarse_445d24() {
+void dpdyCoarse_445d24(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyCoarse_445d24();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdyCoarse_445d24(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.spvasm
index 5a787f3..a34cffc 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyCoarse_445d24 "dpdyCoarse_445d24"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%dpdyCoarse_445d24 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpDPdyCoarse %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdyCoarse_445d24 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpDPdyCoarse %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdyCoarse_445d24
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdyCoarse_445d24
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.wgsl
index 58965af..f0b5553 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/445d24.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdyCoarse_445d24() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = dpdyCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyCoarse_445d24();
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl
index 28f7bf3..d2571fe 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl
@@ -25,7 +25,9 @@
 fn dpdyCoarse_870a7e() {
   var arg_0 = 1.f;
   var res: f32 = dpdyCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.dxc.hlsl
index c5c4e1e..0d2e44d 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_870a7e() {
   float arg_0 = 1.0f;
   float res = ddy_coarse(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.fxc.hlsl
index c5c4e1e..0d2e44d 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_870a7e() {
   float arg_0 = 1.0f;
   float res = ddy_coarse(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.glsl
index a0e2cd7..f04cb61 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdyCoarse_870a7e() {
   float arg_0 = 1.0f;
   float res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.msl
index 88e086c..459d2d0 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyCoarse_870a7e() {
+void dpdyCoarse_870a7e(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyCoarse_870a7e();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdyCoarse_870a7e(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.spvasm
index b0bc403..6e51c83 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.spvasm
@@ -1,35 +1,51 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyCoarse_870a7e "dpdyCoarse_870a7e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%dpdyCoarse_870a7e = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdyCoarse_870a7e = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpDPdyCoarse %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpDPdyCoarse %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdyCoarse_870a7e
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdyCoarse_870a7e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.wgsl
index cbb4a1f..5859e72 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/870a7e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdyCoarse_870a7e() {
   var arg_0 = 1.0f;
   var res : f32 = dpdyCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdyCoarse_870a7e();
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl
index 2c94cc3..d4f9a29 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl
@@ -25,7 +25,9 @@
 fn dpdyCoarse_ae1873() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = dpdyCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.dxc.hlsl
index 7fa49bf..3486a46 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_ae1873() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddy_coarse(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.fxc.hlsl
index 7fa49bf..3486a46 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyCoarse_ae1873() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddy_coarse(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.glsl
index 76f66f6..0926eb9 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdyCoarse_ae1873() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.msl
index 439b32e..11ef0c6 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyCoarse_ae1873() {
+void dpdyCoarse_ae1873(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = dfdy(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdyCoarse_ae1873();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdyCoarse_ae1873(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.spvasm
index 3b409ff..672c1fe 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyCoarse_ae1873 "dpdyCoarse_ae1873"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%dpdyCoarse_ae1873 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpDPdyCoarse %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdyCoarse_ae1873 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpDPdyCoarse %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdyCoarse_ae1873
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdyCoarse_ae1873
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.wgsl
index 8a04b99..6e38ba3 100644
--- a/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdyCoarse/ae1873.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdyCoarse_ae1873() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = dpdyCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyCoarse_ae1873();
diff --git a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl
index 6f6df2f..9b634e4 100644
--- a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl
+++ b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl
@@ -25,7 +25,9 @@
 fn dpdyFine_1fb7ab() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = dpdyFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.dxc.hlsl
index e5d56fa..6c36e7f 100644
--- a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_1fb7ab() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddy_fine(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.fxc.hlsl
index e5d56fa..6c36e7f 100644
--- a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_1fb7ab() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ddy_fine(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.glsl
index 6717b92..881e436 100644
--- a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void dpdyFine_1fb7ab() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.msl
index f4c0101..05e968f 100644
--- a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyFine_1fb7ab() {
+void dpdyFine_1fb7ab(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = dfdy(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  dpdyFine_1fb7ab();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  dpdyFine_1fb7ab(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.spvasm
index 3891288..91db6f0 100644
--- a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyFine_1fb7ab "dpdyFine_1fb7ab"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%dpdyFine_1fb7ab = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpDPdyFine %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%dpdyFine_1fb7ab = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpDPdyFine %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdyFine_1fb7ab
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdyFine_1fb7ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.wgsl
index 09af0c8..f7391f9 100644
--- a/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdyFine/1fb7ab.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdyFine_1fb7ab() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = dpdyFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyFine_1fb7ab();
diff --git a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl
index 3ae95b3..42c06ef 100644
--- a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl
+++ b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl
@@ -25,7 +25,9 @@
 fn dpdyFine_6eb673() {
   var arg_0 = 1.f;
   var res: f32 = dpdyFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.dxc.hlsl
index ddec210..3d21711 100644
--- a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_6eb673() {
   float arg_0 = 1.0f;
   float res = ddy_fine(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.fxc.hlsl
index ddec210..3d21711 100644
--- a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_6eb673() {
   float arg_0 = 1.0f;
   float res = ddy_fine(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.glsl
index 1762ecf..13d30c4 100644
--- a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void dpdyFine_6eb673() {
   float arg_0 = 1.0f;
   float res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.msl
index 57adf6b..15c1b94 100644
--- a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyFine_6eb673() {
+void dpdyFine_6eb673(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyFine_6eb673();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  dpdyFine_6eb673(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.spvasm
index cac131b..e3af17f 100644
--- a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.spvasm
@@ -1,35 +1,51 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyFine_6eb673 "dpdyFine_6eb673"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%dpdyFine_6eb673 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%dpdyFine_6eb673 = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpDPdyFine %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpDPdyFine %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %dpdyFine_6eb673
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %dpdyFine_6eb673
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.wgsl
index 2eeb69c..4ea8c26 100644
--- a/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdyFine/6eb673.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdyFine_6eb673() {
   var arg_0 = 1.0f;
   var res : f32 = dpdyFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   dpdyFine_6eb673();
diff --git a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl
index 07f1dd2..483c9c2 100644
--- a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl
+++ b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl
@@ -25,7 +25,9 @@
 fn dpdyFine_d0a648() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = dpdyFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.dxc.hlsl
index a0519e8..8d98d4a 100644
--- a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_d0a648() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddy_fine(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.fxc.hlsl
index a0519e8..8d98d4a 100644
--- a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_d0a648() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ddy_fine(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.glsl
index a641baa..5b3e747 100644
--- a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void dpdyFine_d0a648() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.msl
index ff8d727..a018202 100644
--- a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyFine_d0a648() {
+void dpdyFine_d0a648(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyFine_d0a648();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  dpdyFine_d0a648(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.spvasm
index c5aff59..a13242c 100644
--- a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyFine_d0a648 "dpdyFine_d0a648"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%dpdyFine_d0a648 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpDPdyFine %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%dpdyFine_d0a648 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpDPdyFine %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdyFine_d0a648
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdyFine_d0a648
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.wgsl
index 5587c56..739fa38 100644
--- a/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdyFine/d0a648.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdyFine_d0a648() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = dpdyFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyFine_d0a648();
diff --git a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl
index 1cf896d..39b912f 100644
--- a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl
+++ b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl
@@ -25,7 +25,9 @@
 fn dpdyFine_df33aa() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = dpdyFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.dxc.hlsl
index 22b13fd..e79d77c 100644
--- a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_df33aa() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddy_fine(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.fxc.hlsl
index 22b13fd..e79d77c 100644
--- a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void dpdyFine_df33aa() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ddy_fine(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.glsl b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.glsl
index fc4c4ab..bf741f4 100644
--- a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void dpdyFine_df33aa() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = dFdy(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.msl b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.msl
index 936c707..07ac5d1 100644
--- a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void dpdyFine_df33aa() {
+void dpdyFine_df33aa(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = dfdy(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  dpdyFine_df33aa();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  dpdyFine_df33aa(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.spvasm b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.spvasm
index eefe1d1..0110b83 100644
--- a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %dpdyFine_df33aa "dpdyFine_df33aa"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%dpdyFine_df33aa = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpDPdyFine %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%dpdyFine_df33aa = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpDPdyFine %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %dpdyFine_df33aa
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %dpdyFine_df33aa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.wgsl b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.wgsl
index 17ff43f..26380e7 100644
--- a/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/dpdyFine/df33aa.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn dpdyFine_df33aa() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = dpdyFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   dpdyFine_df33aa();
diff --git a/test/tint/builtins/gen/var/exp/0f70eb.wgsl b/test/tint/builtins/gen/var/exp/0f70eb.wgsl
index 8d7893e..65d6ff0 100644
--- a/test/tint/builtins/gen/var/exp/0f70eb.wgsl
+++ b/test/tint/builtins/gen/var/exp/0f70eb.wgsl
@@ -25,7 +25,9 @@
 fn exp_0f70eb() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = exp(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.dxc.hlsl
index 8aaf090..c34496f 100644
--- a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_0f70eb() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = exp(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.fxc.hlsl
index 8aaf090..c34496f 100644
--- a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_0f70eb() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = exp(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.glsl
index 23953b3..4fa45f3 100644
--- a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp_0f70eb() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp_0f70eb() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp_0f70eb() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.msl b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.msl
index 533177b..230715e 100644
--- a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_0f70eb() {
+void exp_0f70eb(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = exp(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_0f70eb();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  exp_0f70eb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_0f70eb();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  exp_0f70eb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_0f70eb();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  exp_0f70eb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.spvasm
index 9ce96e7..fc3fa99 100644
--- a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_0f70eb "exp_0f70eb"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
- %exp_0f70eb = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+ %exp_0f70eb = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Exp %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Exp %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %exp_0f70eb
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %exp_0f70eb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp_0f70eb
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp_0f70eb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %exp_0f70eb
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %exp_0f70eb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.wgsl
index 25f9404..b5cfc47 100644
--- a/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp/0f70eb.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn exp_0f70eb() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = exp(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_0f70eb();
diff --git a/test/tint/builtins/gen/var/exp/13806d.wgsl b/test/tint/builtins/gen/var/exp/13806d.wgsl
index d1a3936..492c167 100644
--- a/test/tint/builtins/gen/var/exp/13806d.wgsl
+++ b/test/tint/builtins/gen/var/exp/13806d.wgsl
@@ -27,7 +27,9 @@
 fn exp_13806d() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = exp(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.dxc.hlsl
index 6d669f8..055e243 100644
--- a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_13806d() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = exp(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.fxc.hlsl
index 0bde5ba..aa77d59 100644
--- a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_13806d() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = exp(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.glsl
index 5f834eb..63fed90 100644
--- a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp_13806d() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp_13806d() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp_13806d() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.msl b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.msl
index 9076003..0b7c6a4 100644
--- a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_13806d() {
+void exp_13806d(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = exp(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_13806d();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  exp_13806d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_13806d();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  exp_13806d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_13806d();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  exp_13806d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.spvasm
index 131c0ab..c3ea2dd 100644
--- a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_13806d "exp_13806d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_13806d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Exp %22
-               OpStore %res %20
+ %exp_13806d = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Exp %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %exp_13806d
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %exp_13806d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %exp_13806d
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %exp_13806d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %exp_13806d
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %exp_13806d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.wgsl
index 0004e77..a59b5c1 100644
--- a/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp/13806d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn exp_13806d() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = exp(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_13806d();
diff --git a/test/tint/builtins/gen/var/exp/1951e7.wgsl b/test/tint/builtins/gen/var/exp/1951e7.wgsl
index 16cfa21..30a6fb9 100644
--- a/test/tint/builtins/gen/var/exp/1951e7.wgsl
+++ b/test/tint/builtins/gen/var/exp/1951e7.wgsl
@@ -25,7 +25,9 @@
 fn exp_1951e7() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = exp(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.dxc.hlsl
index ab01f7f..a67a536 100644
--- a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_1951e7() {
   float2 arg_0 = (1.0f).xx;
   float2 res = exp(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.fxc.hlsl
index ab01f7f..a67a536 100644
--- a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_1951e7() {
   float2 arg_0 = (1.0f).xx;
   float2 res = exp(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.glsl
index 535a307..1725fbb 100644
--- a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp_1951e7() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp_1951e7() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp_1951e7() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.msl b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.msl
index 0f7df5c..16947c6 100644
--- a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_1951e7() {
+void exp_1951e7(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = exp(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_1951e7();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  exp_1951e7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_1951e7();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  exp_1951e7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_1951e7();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  exp_1951e7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.spvasm
index 0f4a41e..86ae9f0 100644
--- a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_1951e7 "exp_1951e7"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
- %exp_1951e7 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Exp %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+ %exp_1951e7 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Exp %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %exp_1951e7
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %exp_1951e7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp_1951e7
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp_1951e7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %exp_1951e7
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %exp_1951e7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.wgsl
index a72dfbf..b503bfb 100644
--- a/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp/1951e7.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn exp_1951e7() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = exp(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_1951e7();
diff --git a/test/tint/builtins/gen/var/exp/2e08e2.wgsl b/test/tint/builtins/gen/var/exp/2e08e2.wgsl
index a9ef44c..788a9cb 100644
--- a/test/tint/builtins/gen/var/exp/2e08e2.wgsl
+++ b/test/tint/builtins/gen/var/exp/2e08e2.wgsl
@@ -27,7 +27,9 @@
 fn exp_2e08e2() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = exp(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.dxc.hlsl
index 93cc7d9..806bc78 100644
--- a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_2e08e2() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = exp(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.fxc.hlsl
index f655757..9fef94a 100644
--- a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_2e08e2() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = exp(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.glsl
index ce344e1..85e6447 100644
--- a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp_2e08e2() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp_2e08e2() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp_2e08e2() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.msl b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.msl
index 0aee12f..04f1c2e 100644
--- a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_2e08e2() {
+void exp_2e08e2(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = exp(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_2e08e2();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  exp_2e08e2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_2e08e2();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  exp_2e08e2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_2e08e2();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  exp_2e08e2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.spvasm
index 1d2f8cc..0e8cfbb 100644
--- a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_2e08e2 "exp_2e08e2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_2e08e2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Exp %22
-               OpStore %res %20
+ %exp_2e08e2 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Exp %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %exp_2e08e2
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %exp_2e08e2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %exp_2e08e2
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %exp_2e08e2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %exp_2e08e2
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %exp_2e08e2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.wgsl
index c9f5542..e3f91f8 100644
--- a/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp/2e08e2.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn exp_2e08e2() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = exp(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_2e08e2();
diff --git a/test/tint/builtins/gen/var/exp/49e4c5.wgsl b/test/tint/builtins/gen/var/exp/49e4c5.wgsl
index 988e2f9..4e64184 100644
--- a/test/tint/builtins/gen/var/exp/49e4c5.wgsl
+++ b/test/tint/builtins/gen/var/exp/49e4c5.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = exp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_49e4c5();
diff --git a/test/tint/builtins/gen/var/exp/611a87.wgsl b/test/tint/builtins/gen/var/exp/611a87.wgsl
index 3e01f3e..19d1293 100644
--- a/test/tint/builtins/gen/var/exp/611a87.wgsl
+++ b/test/tint/builtins/gen/var/exp/611a87.wgsl
@@ -27,7 +27,9 @@
 fn exp_611a87() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = exp(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.dxc.hlsl
index bf65c06..e3ddaa8 100644
--- a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_611a87() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = exp(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.fxc.hlsl
index 18197eb..210d0ae 100644
--- a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_611a87() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = exp(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.glsl
index f0c864b..99ae8f9 100644
--- a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp_611a87() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp_611a87() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp_611a87() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.msl b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.msl
index de79282..d935396 100644
--- a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_611a87() {
+void exp_611a87(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = exp(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_611a87();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  exp_611a87(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_611a87();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  exp_611a87(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_611a87();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  exp_611a87(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.spvasm
index 64efbc3..1940887 100644
--- a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_611a87 "exp_611a87"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_611a87 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Exp %22
-               OpStore %res %20
+ %exp_611a87 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Exp %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %exp_611a87
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %exp_611a87
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %exp_611a87
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %exp_611a87
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %exp_611a87
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %exp_611a87
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.wgsl
index 5a865ff..f17e505 100644
--- a/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp/611a87.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn exp_611a87() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = exp(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_611a87();
diff --git a/test/tint/builtins/gen/var/exp/699629.wgsl b/test/tint/builtins/gen/var/exp/699629.wgsl
index 25854f1..6cb0d34 100644
--- a/test/tint/builtins/gen/var/exp/699629.wgsl
+++ b/test/tint/builtins/gen/var/exp/699629.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = exp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_699629();
diff --git a/test/tint/builtins/gen/var/exp/771fd2.wgsl b/test/tint/builtins/gen/var/exp/771fd2.wgsl
index 96ccf91..e0f751a 100644
--- a/test/tint/builtins/gen/var/exp/771fd2.wgsl
+++ b/test/tint/builtins/gen/var/exp/771fd2.wgsl
@@ -25,7 +25,9 @@
 fn exp_771fd2() {
   var arg_0 = 1.f;
   var res: f32 = exp(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.dxc.hlsl
index 578cedb..69d74f4 100644
--- a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_771fd2() {
   float arg_0 = 1.0f;
   float res = exp(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.fxc.hlsl
index 578cedb..69d74f4 100644
--- a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_771fd2() {
   float arg_0 = 1.0f;
   float res = exp(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.glsl
index 3c874f6..ed315e8 100644
--- a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp_771fd2() {
   float arg_0 = 1.0f;
   float res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp_771fd2() {
   float arg_0 = 1.0f;
   float res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp_771fd2() {
   float arg_0 = 1.0f;
   float res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.msl b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.msl
index 0e3c093..38f8862 100644
--- a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_771fd2() {
+void exp_771fd2(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = exp(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_771fd2();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  exp_771fd2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_771fd2();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  exp_771fd2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_771fd2();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  exp_771fd2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.spvasm
index 83173a6..e079458 100644
--- a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_771fd2 "exp_771fd2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
- %exp_771fd2 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+ %exp_771fd2 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Exp %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Exp %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %exp_771fd2
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %exp_771fd2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %exp_771fd2
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %exp_771fd2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp_771fd2
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp_771fd2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.wgsl
index 0e9c5f1..f01e34b 100644
--- a/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp/771fd2.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn exp_771fd2() {
   var arg_0 = 1.0f;
   var res : f32 = exp(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_771fd2();
diff --git a/test/tint/builtins/gen/var/exp/bda5bb.wgsl b/test/tint/builtins/gen/var/exp/bda5bb.wgsl
index 4cc1f52..dbcad01 100644
--- a/test/tint/builtins/gen/var/exp/bda5bb.wgsl
+++ b/test/tint/builtins/gen/var/exp/bda5bb.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = exp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_bda5bb();
diff --git a/test/tint/builtins/gen/var/exp/c18fe9.wgsl b/test/tint/builtins/gen/var/exp/c18fe9.wgsl
index 9b5eacd..963bf6d 100644
--- a/test/tint/builtins/gen/var/exp/c18fe9.wgsl
+++ b/test/tint/builtins/gen/var/exp/c18fe9.wgsl
@@ -27,7 +27,9 @@
 fn exp_c18fe9() {
   var arg_0 = 1.h;
   var res: f16 = exp(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.dxc.hlsl
index 990ca7f..023795a 100644
--- a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_c18fe9() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = exp(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.fxc.hlsl
index ef16570..66f50e2 100644
--- a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_c18fe9() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = exp(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.glsl
index 4d85adf..9214ca2 100644
--- a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp_c18fe9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp_c18fe9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp_c18fe9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.msl b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.msl
index aa36536..f52df56 100644
--- a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_c18fe9() {
+void exp_c18fe9(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = exp(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_c18fe9();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  exp_c18fe9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_c18fe9();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  exp_c18fe9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_c18fe9();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  exp_c18fe9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.spvasm
index f2899ba..e3a2362 100644
--- a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_c18fe9 "exp_c18fe9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %exp_c18fe9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %exp_c18fe9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Exp %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Exp %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %exp_c18fe9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %exp_c18fe9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp_c18fe9
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp_c18fe9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %exp_c18fe9
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %exp_c18fe9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.wgsl
index 1dc2377..f1b7265 100644
--- a/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp/c18fe9.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn exp_c18fe9() {
   var arg_0 = 1.0h;
   var res : f16 = exp(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_c18fe9();
diff --git a/test/tint/builtins/gen/var/exp/d98450.wgsl b/test/tint/builtins/gen/var/exp/d98450.wgsl
index 69ef9d9..280fb49 100644
--- a/test/tint/builtins/gen/var/exp/d98450.wgsl
+++ b/test/tint/builtins/gen/var/exp/d98450.wgsl
@@ -25,7 +25,9 @@
 fn exp_d98450() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = exp(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.dxc.hlsl
index 1b70b18..38d7427 100644
--- a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_d98450() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = exp(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.fxc.hlsl
index 1b70b18..38d7427 100644
--- a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp_d98450() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = exp(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.glsl
index 0ebf07e..72d6b7c 100644
--- a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp_d98450() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp_d98450() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp_d98450() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = exp(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.msl b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.msl
index 3044373..69c0bd2 100644
--- a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp_d98450() {
+void exp_d98450(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = exp(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp_d98450();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  exp_d98450(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp_d98450();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  exp_d98450(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp_d98450();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  exp_d98450(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.spvasm
index 12759c0..a3d33c7 100644
--- a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp_d98450 "exp_d98450"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
- %exp_d98450 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Exp %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+ %exp_d98450 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Exp %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %exp_d98450
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %exp_d98450
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp_d98450
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp_d98450
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %exp_d98450
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %exp_d98450
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.wgsl
index b37eb28..b762b9d 100644
--- a/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp/d98450.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn exp_d98450() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = exp(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_d98450();
diff --git a/test/tint/builtins/gen/var/exp/dad791.wgsl b/test/tint/builtins/gen/var/exp/dad791.wgsl
index 4977119..b9ff08c 100644
--- a/test/tint/builtins/gen/var/exp/dad791.wgsl
+++ b/test/tint/builtins/gen/var/exp/dad791.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = exp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp_dad791();
diff --git a/test/tint/builtins/gen/var/exp2/151a4c.wgsl b/test/tint/builtins/gen/var/exp2/151a4c.wgsl
index 624605c..9b12767 100644
--- a/test/tint/builtins/gen/var/exp2/151a4c.wgsl
+++ b/test/tint/builtins/gen/var/exp2/151a4c.wgsl
@@ -27,7 +27,9 @@
 fn exp2_151a4c() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = exp2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.dxc.hlsl
index 7dda4b2..46842c9 100644
--- a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_151a4c() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = exp2(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.fxc.hlsl
index 2dd1f47..a93a134 100644
--- a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_151a4c() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = exp2(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.glsl
index 8eac3ec..4b5503c 100644
--- a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp2_151a4c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp2_151a4c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void exp2_151a4c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.msl b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.msl
index f45a8f8..43cac11 100644
--- a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_151a4c() {
+void exp2_151a4c(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = exp2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_151a4c();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  exp2_151a4c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_151a4c();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  exp2_151a4c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_151a4c();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  exp2_151a4c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.spvasm
index e9cbdcb..98c3920 100644
--- a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_151a4c "exp2_151a4c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_151a4c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Exp2 %22
-               OpStore %res %20
+%exp2_151a4c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Exp2 %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %exp2_151a4c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %exp2_151a4c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %exp2_151a4c
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %exp2_151a4c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %exp2_151a4c
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %exp2_151a4c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.wgsl
index 83cb186..5d4b853 100644
--- a/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp2/151a4c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn exp2_151a4c() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = exp2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_151a4c();
diff --git a/test/tint/builtins/gen/var/exp2/18aa76.wgsl b/test/tint/builtins/gen/var/exp2/18aa76.wgsl
index 6121811..37bc559 100644
--- a/test/tint/builtins/gen/var/exp2/18aa76.wgsl
+++ b/test/tint/builtins/gen/var/exp2/18aa76.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = exp2(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_18aa76();
diff --git a/test/tint/builtins/gen/var/exp2/1f8680.wgsl b/test/tint/builtins/gen/var/exp2/1f8680.wgsl
index f42be18..884fdad 100644
--- a/test/tint/builtins/gen/var/exp2/1f8680.wgsl
+++ b/test/tint/builtins/gen/var/exp2/1f8680.wgsl
@@ -25,7 +25,9 @@
 fn exp2_1f8680() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = exp2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.dxc.hlsl
index ecfc371..6e578be 100644
--- a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_1f8680() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = exp2(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.fxc.hlsl
index ecfc371..6e578be 100644
--- a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_1f8680() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = exp2(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.glsl
index b22fada..9529513 100644
--- a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp2_1f8680() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp2_1f8680() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void exp2_1f8680() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.msl b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.msl
index 06fee44..3ecdba1 100644
--- a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_1f8680() {
+void exp2_1f8680(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = exp2(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_1f8680();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  exp2_1f8680(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_1f8680();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  exp2_1f8680(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_1f8680();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  exp2_1f8680(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.spvasm
index 7101abc..d36e736 100644
--- a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_1f8680 "exp2_1f8680"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%exp2_1f8680 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Exp2 %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%exp2_1f8680 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Exp2 %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %exp2_1f8680
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %exp2_1f8680
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp2_1f8680
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp2_1f8680
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %exp2_1f8680
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %exp2_1f8680
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.wgsl
index 409bfde..b694579 100644
--- a/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp2/1f8680.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn exp2_1f8680() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = exp2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_1f8680();
diff --git a/test/tint/builtins/gen/var/exp2/303753.wgsl b/test/tint/builtins/gen/var/exp2/303753.wgsl
index 8d144b1..83e6469 100644
--- a/test/tint/builtins/gen/var/exp2/303753.wgsl
+++ b/test/tint/builtins/gen/var/exp2/303753.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = exp2(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_303753();
diff --git a/test/tint/builtins/gen/var/exp2/751377.wgsl b/test/tint/builtins/gen/var/exp2/751377.wgsl
index 682fa91..2878b3d 100644
--- a/test/tint/builtins/gen/var/exp2/751377.wgsl
+++ b/test/tint/builtins/gen/var/exp2/751377.wgsl
@@ -27,7 +27,9 @@
 fn exp2_751377() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = exp2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.dxc.hlsl
index 4cecb51..86006eb 100644
--- a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_751377() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = exp2(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.fxc.hlsl
index 9e701cd..b4a7b8f 100644
--- a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_751377() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = exp2(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.glsl
index e11657e..bd13f74 100644
--- a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp2_751377() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp2_751377() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void exp2_751377() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.msl b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.msl
index b786beb..9ecafba 100644
--- a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_751377() {
+void exp2_751377(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = exp2(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_751377();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  exp2_751377(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_751377();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  exp2_751377(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_751377();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  exp2_751377(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.spvasm
index dc1d8c6..f9e895a 100644
--- a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_751377 "exp2_751377"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_751377 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Exp2 %22
-               OpStore %res %20
+%exp2_751377 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Exp2 %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %exp2_751377
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %exp2_751377
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %exp2_751377
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %exp2_751377
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %exp2_751377
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %exp2_751377
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.wgsl
index 600e491..8967865 100644
--- a/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp2/751377.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn exp2_751377() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = exp2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_751377();
diff --git a/test/tint/builtins/gen/var/exp2/8bd72d.wgsl b/test/tint/builtins/gen/var/exp2/8bd72d.wgsl
index 97bdbee..e8fb95b 100644
--- a/test/tint/builtins/gen/var/exp2/8bd72d.wgsl
+++ b/test/tint/builtins/gen/var/exp2/8bd72d.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = exp2(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_8bd72d();
diff --git a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl
index 5f58818..17c3836 100644
--- a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl
+++ b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl
@@ -25,7 +25,9 @@
 fn exp2_a9d0a7() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = exp2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.dxc.hlsl
index 18f11f2..cbcf21d 100644
--- a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_a9d0a7() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = exp2(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.fxc.hlsl
index 18f11f2..cbcf21d 100644
--- a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_a9d0a7() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = exp2(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.glsl
index 3fbbba0..b62cc29 100644
--- a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp2_a9d0a7() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp2_a9d0a7() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void exp2_a9d0a7() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.msl b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.msl
index c080701..34d62ba 100644
--- a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_a9d0a7() {
+void exp2_a9d0a7(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = exp2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_a9d0a7();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  exp2_a9d0a7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_a9d0a7();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  exp2_a9d0a7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_a9d0a7();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  exp2_a9d0a7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.spvasm
index 35fb41a..a60fd74 100644
--- a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_a9d0a7 "exp2_a9d0a7"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%exp2_a9d0a7 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%exp2_a9d0a7 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Exp2 %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Exp2 %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %exp2_a9d0a7
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %exp2_a9d0a7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %exp2_a9d0a7
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %exp2_a9d0a7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %exp2_a9d0a7
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %exp2_a9d0a7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.wgsl
index f10b3dd..255cc41 100644
--- a/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp2/a9d0a7.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn exp2_a9d0a7() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = exp2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_a9d0a7();
diff --git a/test/tint/builtins/gen/var/exp2/b408e4.wgsl b/test/tint/builtins/gen/var/exp2/b408e4.wgsl
index 61a04d5..688ea82 100644
--- a/test/tint/builtins/gen/var/exp2/b408e4.wgsl
+++ b/test/tint/builtins/gen/var/exp2/b408e4.wgsl
@@ -27,7 +27,9 @@
 fn exp2_b408e4() {
   var arg_0 = 1.h;
   var res: f16 = exp2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.dxc.hlsl
index bab994c..3654048 100644
--- a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_b408e4() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = exp2(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.fxc.hlsl
index cc6d586..8080c85 100644
--- a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_b408e4() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = exp2(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.glsl
index 573ddc0..0b247a6 100644
--- a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp2_b408e4() {
   float16_t arg_0 = 1.0hf;
   float16_t res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp2_b408e4() {
   float16_t arg_0 = 1.0hf;
   float16_t res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void exp2_b408e4() {
   float16_t arg_0 = 1.0hf;
   float16_t res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.msl b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.msl
index b0e32ac..d3c87b7 100644
--- a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_b408e4() {
+void exp2_b408e4(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = exp2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_b408e4();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  exp2_b408e4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_b408e4();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  exp2_b408e4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_b408e4();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  exp2_b408e4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.spvasm
index 73e5b91..2ed6fe5 100644
--- a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_b408e4 "exp2_b408e4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_b408e4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%exp2_b408e4 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Exp2 %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Exp2 %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %exp2_b408e4
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %exp2_b408e4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp2_b408e4
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp2_b408e4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %exp2_b408e4
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %exp2_b408e4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.wgsl
index d439dc5..c24b115 100644
--- a/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp2/b408e4.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn exp2_b408e4() {
   var arg_0 = 1.0h;
   var res : f16 = exp2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_b408e4();
diff --git a/test/tint/builtins/gen/var/exp2/d6777c.wgsl b/test/tint/builtins/gen/var/exp2/d6777c.wgsl
index 55df1ef..31a319d 100644
--- a/test/tint/builtins/gen/var/exp2/d6777c.wgsl
+++ b/test/tint/builtins/gen/var/exp2/d6777c.wgsl
@@ -25,7 +25,9 @@
 fn exp2_d6777c() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = exp2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.dxc.hlsl
index d70fa34..35acad2 100644
--- a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_d6777c() {
   float2 arg_0 = (1.0f).xx;
   float2 res = exp2(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.fxc.hlsl
index d70fa34..35acad2 100644
--- a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_d6777c() {
   float2 arg_0 = (1.0f).xx;
   float2 res = exp2(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.glsl
index 2367875..3f1e641 100644
--- a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp2_d6777c() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp2_d6777c() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void exp2_d6777c() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.msl b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.msl
index 93d9152..a715ea0 100644
--- a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_d6777c() {
+void exp2_d6777c(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = exp2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_d6777c();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  exp2_d6777c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_d6777c();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  exp2_d6777c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_d6777c();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  exp2_d6777c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.spvasm
index f2c0806..0999d7d 100644
--- a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_d6777c "exp2_d6777c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%exp2_d6777c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Exp2 %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%exp2_d6777c = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Exp2 %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %exp2_d6777c
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %exp2_d6777c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp2_d6777c
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp2_d6777c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %exp2_d6777c
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %exp2_d6777c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.wgsl
index 11b0aa5..f6d5b81 100644
--- a/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp2/d6777c.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn exp2_d6777c() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = exp2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_d6777c();
diff --git a/test/tint/builtins/gen/var/exp2/dea523.wgsl b/test/tint/builtins/gen/var/exp2/dea523.wgsl
index 2b8e608..d12bd61 100644
--- a/test/tint/builtins/gen/var/exp2/dea523.wgsl
+++ b/test/tint/builtins/gen/var/exp2/dea523.wgsl
@@ -25,7 +25,9 @@
 fn exp2_dea523() {
   var arg_0 = 1.f;
   var res: f32 = exp2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.dxc.hlsl
index d276db9..e3b185b 100644
--- a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_dea523() {
   float arg_0 = 1.0f;
   float res = exp2(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.fxc.hlsl
index d276db9..e3b185b 100644
--- a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_dea523() {
   float arg_0 = 1.0f;
   float res = exp2(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.glsl
index 0599396..d711fcb 100644
--- a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp2_dea523() {
   float arg_0 = 1.0f;
   float res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp2_dea523() {
   float arg_0 = 1.0f;
   float res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void exp2_dea523() {
   float arg_0 = 1.0f;
   float res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.msl b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.msl
index 38c0029..20dc865 100644
--- a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_dea523() {
+void exp2_dea523(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = exp2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_dea523();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  exp2_dea523(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_dea523();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  exp2_dea523(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_dea523();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  exp2_dea523(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.spvasm
index b350153..5395892 100644
--- a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_dea523 "exp2_dea523"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%exp2_dea523 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%exp2_dea523 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Exp2 %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Exp2 %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %exp2_dea523
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %exp2_dea523
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %exp2_dea523
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %exp2_dea523
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %exp2_dea523
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %exp2_dea523
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.wgsl
index b696280..5315c92 100644
--- a/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp2/dea523.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn exp2_dea523() {
   var arg_0 = 1.0f;
   var res : f32 = exp2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_dea523();
diff --git a/test/tint/builtins/gen/var/exp2/f4f0f1.wgsl b/test/tint/builtins/gen/var/exp2/f4f0f1.wgsl
index db9718d..5a3a9e6 100644
--- a/test/tint/builtins/gen/var/exp2/f4f0f1.wgsl
+++ b/test/tint/builtins/gen/var/exp2/f4f0f1.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = exp2(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_f4f0f1();
diff --git a/test/tint/builtins/gen/var/exp2/ffa827.wgsl b/test/tint/builtins/gen/var/exp2/ffa827.wgsl
index 1755b00..5c595e6 100644
--- a/test/tint/builtins/gen/var/exp2/ffa827.wgsl
+++ b/test/tint/builtins/gen/var/exp2/ffa827.wgsl
@@ -27,7 +27,9 @@
 fn exp2_ffa827() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = exp2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.dxc.hlsl
index b5bb9c2..6070877 100644
--- a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_ffa827() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = exp2(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.fxc.hlsl
index bc6ba12..0b8eb7d 100644
--- a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void exp2_ffa827() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = exp2(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.glsl b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.glsl
index 753e499..fb789c0 100644
--- a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp2_ffa827() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp2_ffa827() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void exp2_ffa827() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = exp2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.msl b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.msl
index 5258bd2..406c581 100644
--- a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void exp2_ffa827() {
+void exp2_ffa827(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = exp2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  exp2_ffa827();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  exp2_ffa827(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  exp2_ffa827();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  exp2_ffa827(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  exp2_ffa827();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  exp2_ffa827(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.spvasm b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.spvasm
index cd61ab5..f467c0e 100644
--- a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %exp2_ffa827 "exp2_ffa827"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%exp2_ffa827 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Exp2 %22
-               OpStore %res %20
+%exp2_ffa827 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Exp2 %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %exp2_ffa827
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %exp2_ffa827
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %exp2_ffa827
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %exp2_ffa827
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %exp2_ffa827
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %exp2_ffa827
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.wgsl b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.wgsl
index 8dccfdf..d300549 100644
--- a/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/exp2/ffa827.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn exp2_ffa827() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = exp2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   exp2_ffa827();
diff --git a/test/tint/builtins/gen/var/extractBits/12b197.wgsl b/test/tint/builtins/gen/var/extractBits/12b197.wgsl
index b7a2827..18761d2 100644
--- a/test/tint/builtins/gen/var/extractBits/12b197.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/12b197.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec3<u32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.dxc.hlsl
index 357f955..2edd33d 100644
--- a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.dxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint3((shr).xxx)) : ((shl_result >> (31u).xxx) >> (1u).xxx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_12b197() {
   uint3 arg_0 = (1u).xxx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.fxc.hlsl
index 357f955..2edd33d 100644
--- a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.fxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint3((shr).xxx)) : ((shl_result >> (31u).xxx) >> (1u).xxx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_12b197() {
   uint3 arg_0 = (1u).xxx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.glsl b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.glsl
index 6372fc9..bde2f9f 100644
--- a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.glsl
@@ -6,11 +6,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void extractBits_12b197() {
   uvec3 arg_0 = uvec3(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,11 +40,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void extractBits_12b197() {
   uvec3 arg_0 = uvec3(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -58,11 +68,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void extractBits_12b197() {
   uvec3 arg_0 = uvec3(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.msl b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.msl
index 9ef807a..6e85db5 100644
--- a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.msl
@@ -7,36 +7,37 @@
   return extract_bits(v, s, (e - s));
 }
 
-void extractBits_12b197() {
+void extractBits_12b197(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_12b197();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  extractBits_12b197(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_12b197();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_12b197(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_12b197();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_12b197(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.spvasm b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.spvasm
index 2038b02..d8a29ab 100644
--- a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_extract_bits "tint_extract_bits"
                OpName %v "v"
                OpName %offset "offset"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,65 +45,73 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-          %9 = OpTypeFunction %v3uint %v3uint %uint %uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3uint %v3uint %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %29 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %32 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %32 = OpConstantNull %v3uint
+         %35 = OpConstantNull %v3uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %35 = OpConstantNull %uint
-         %42 = OpTypeFunction %v4float
+         %38 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_extract_bits = OpFunction %v3uint None %9
+%tint_extract_bits = OpFunction %v3uint None %14
           %v = OpFunctionParameter %v3uint
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %16 = OpLabel
-         %17 = OpExtInst %uint %18 UMin %offset %uint_32
-         %21 = OpIAdd %uint %17 %count
-         %20 = OpExtInst %uint %18 UMin %uint_32 %21
-         %23 = OpISub %uint %20 %17
-         %22 = OpBitFieldUExtract %v3uint %v %17 %23
-               OpReturnValue %22
+         %19 = OpLabel
+         %20 = OpExtInst %uint %21 UMin %offset %uint_32
+         %24 = OpIAdd %uint %20 %count
+         %23 = OpExtInst %uint %21 UMin %uint_32 %24
+         %26 = OpISub %uint %23 %20
+         %25 = OpBitFieldUExtract %v3uint %v %20 %26
+               OpReturnValue %25
                OpFunctionEnd
-%extractBits_12b197 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %32
-      %arg_1 = OpVariable %_ptr_Function_uint Function %35
-      %arg_2 = OpVariable %_ptr_Function_uint Function %35
-        %res = OpVariable %_ptr_Function_v3uint Function %32
-               OpStore %arg_0 %29
+%extractBits_12b197 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %35
+      %arg_1 = OpVariable %_ptr_Function_uint Function %38
+      %arg_2 = OpVariable %_ptr_Function_uint Function %38
+        %res = OpVariable %_ptr_Function_v3uint Function %35
+               OpStore %arg_0 %32
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %38 = OpLoad %v3uint %arg_0
-         %39 = OpLoad %uint %arg_1
-         %40 = OpLoad %uint %arg_2
-         %37 = OpFunctionCall %v3uint %tint_extract_bits %38 %39 %40
-               OpStore %res %37
+         %41 = OpLoad %v3uint %arg_0
+         %42 = OpLoad %uint %arg_1
+         %43 = OpLoad %uint %arg_2
+         %40 = OpFunctionCall %v3uint %tint_extract_bits %41 %42 %43
+               OpStore %res %40
+         %47 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %48 = OpLoad %v3uint %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %extractBits_12b197
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %extractBits_12b197
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %27
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %extractBits_12b197
+%fragment_main = OpFunction %void None %27
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %extractBits_12b197
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %extractBits_12b197
+%compute_main = OpFunction %void None %27
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %extractBits_12b197
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.wgsl b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.wgsl
index 8728cc5..0902bc0 100644
--- a/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/12b197.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec3<u32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_12b197();
diff --git a/test/tint/builtins/gen/var/extractBits/249874.wgsl b/test/tint/builtins/gen/var/extractBits/249874.wgsl
index f9dfcf7..60c37e7 100644
--- a/test/tint/builtins/gen/var/extractBits/249874.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/249874.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: i32 = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.dxc.hlsl
index 0ae62b5..8b15fa8 100644
--- a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.dxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> shr) : ((shl_result >> 31u) >> 1u));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_249874() {
   int arg_0 = 1;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.fxc.hlsl
index 0ae62b5..8b15fa8 100644
--- a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.fxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> shr) : ((shl_result >> 31u) >> 1u));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_249874() {
   int arg_0 = 1;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.glsl b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.glsl
index 1c7b829..ef65566b9 100644
--- a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.glsl
@@ -6,11 +6,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void extractBits_249874() {
   int arg_0 = 1;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,11 +40,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void extractBits_249874() {
   int arg_0 = 1;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -58,11 +68,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void extractBits_249874() {
   int arg_0 = 1;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.msl b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.msl
index fe768fe..18ba18d 100644
--- a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.msl
@@ -7,36 +7,37 @@
   return extract_bits(v, s, (e - s));
 }
 
-void extractBits_249874() {
+void extractBits_249874(device int* const tint_symbol_1) {
   int arg_0 = 1;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int res = tint_extract_bits(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_249874();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  extractBits_249874(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_249874();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_249874(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_249874();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_249874(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.spvasm b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.spvasm
index 8b8dc87..dbbebbd 100644
--- a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_extract_bits "tint_extract_bits"
                OpName %v "v"
                OpName %offset "offset"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,66 +44,74 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %int %int %uint %uint
+         %13 = OpTypeFunction %int %int %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %31 = OpConstantNull %int
+         %34 = OpConstantNull %int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %35 = OpConstantNull %uint
-         %42 = OpTypeFunction %v4float
+         %38 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_extract_bits = OpFunction %int None %9
+%tint_extract_bits = OpFunction %int None %13
           %v = OpFunctionParameter %int
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %16 = OpLabel
-         %17 = OpExtInst %uint %18 UMin %offset %uint_32
-         %21 = OpIAdd %uint %17 %count
-         %20 = OpExtInst %uint %18 UMin %uint_32 %21
-         %23 = OpISub %uint %20 %17
-         %22 = OpBitFieldSExtract %int %v %17 %23
-               OpReturnValue %22
+         %19 = OpLabel
+         %20 = OpExtInst %uint %21 UMin %offset %uint_32
+         %24 = OpIAdd %uint %20 %count
+         %23 = OpExtInst %uint %21 UMin %uint_32 %24
+         %26 = OpISub %uint %23 %20
+         %25 = OpBitFieldSExtract %int %v %20 %26
+               OpReturnValue %25
                OpFunctionEnd
-%extractBits_249874 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %31
-      %arg_1 = OpVariable %_ptr_Function_uint Function %35
-      %arg_2 = OpVariable %_ptr_Function_uint Function %35
-        %res = OpVariable %_ptr_Function_int Function %31
+%extractBits_249874 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %34
+      %arg_1 = OpVariable %_ptr_Function_uint Function %38
+      %arg_2 = OpVariable %_ptr_Function_uint Function %38
+        %res = OpVariable %_ptr_Function_int Function %34
                OpStore %arg_0 %int_1
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %38 = OpLoad %int %arg_0
-         %39 = OpLoad %uint %arg_1
-         %40 = OpLoad %uint %arg_2
-         %37 = OpFunctionCall %int %tint_extract_bits %38 %39 %40
-               OpStore %res %37
+         %41 = OpLoad %int %arg_0
+         %42 = OpLoad %uint %arg_1
+         %43 = OpLoad %uint %arg_2
+         %40 = OpFunctionCall %int %tint_extract_bits %41 %42 %43
+               OpStore %res %40
+         %47 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %48 = OpLoad %int %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %extractBits_249874
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %extractBits_249874
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %27
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %extractBits_249874
+%fragment_main = OpFunction %void None %27
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %extractBits_249874
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %extractBits_249874
+%compute_main = OpFunction %void None %27
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %extractBits_249874
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.wgsl b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.wgsl
index 61dba12..ac29bf8 100644
--- a/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/249874.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : i32 = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_249874();
diff --git a/test/tint/builtins/gen/var/extractBits/631377.wgsl b/test/tint/builtins/gen/var/extractBits/631377.wgsl
index 42f17f6..8784612 100644
--- a/test/tint/builtins/gen/var/extractBits/631377.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/631377.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec4<u32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.dxc.hlsl
index fddff81..aebaa2d 100644
--- a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.dxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint4((shr).xxxx)) : ((shl_result >> (31u).xxxx) >> (1u).xxxx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_631377() {
   uint4 arg_0 = (1u).xxxx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.fxc.hlsl
index fddff81..aebaa2d 100644
--- a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.fxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint4((shr).xxxx)) : ((shl_result >> (31u).xxxx) >> (1u).xxxx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_631377() {
   uint4 arg_0 = (1u).xxxx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.glsl b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.glsl
index e8221d9..b10ac24 100644
--- a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.glsl
@@ -6,11 +6,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void extractBits_631377() {
   uvec4 arg_0 = uvec4(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,11 +40,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void extractBits_631377() {
   uvec4 arg_0 = uvec4(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -58,11 +68,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void extractBits_631377() {
   uvec4 arg_0 = uvec4(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.msl b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.msl
index e641ab5..4ecf566 100644
--- a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.msl
@@ -7,36 +7,37 @@
   return extract_bits(v, s, (e - s));
 }
 
-void extractBits_631377() {
+void extractBits_631377(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_631377();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  extractBits_631377(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_631377();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_631377(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_631377();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_631377(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.spvasm b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.spvasm
index 531a1c3..9609e77 100644
--- a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_extract_bits "tint_extract_bits"
                OpName %v "v"
                OpName %offset "offset"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,65 +45,73 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-          %9 = OpTypeFunction %v4uint %v4uint %uint %uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4uint %v4uint %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %29 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %32 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %32 = OpConstantNull %v4uint
+         %35 = OpConstantNull %v4uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %35 = OpConstantNull %uint
-         %42 = OpTypeFunction %v4float
+         %38 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_extract_bits = OpFunction %v4uint None %9
+%tint_extract_bits = OpFunction %v4uint None %14
           %v = OpFunctionParameter %v4uint
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %16 = OpLabel
-         %17 = OpExtInst %uint %18 UMin %offset %uint_32
-         %21 = OpIAdd %uint %17 %count
-         %20 = OpExtInst %uint %18 UMin %uint_32 %21
-         %23 = OpISub %uint %20 %17
-         %22 = OpBitFieldUExtract %v4uint %v %17 %23
-               OpReturnValue %22
+         %19 = OpLabel
+         %20 = OpExtInst %uint %21 UMin %offset %uint_32
+         %24 = OpIAdd %uint %20 %count
+         %23 = OpExtInst %uint %21 UMin %uint_32 %24
+         %26 = OpISub %uint %23 %20
+         %25 = OpBitFieldUExtract %v4uint %v %20 %26
+               OpReturnValue %25
                OpFunctionEnd
-%extractBits_631377 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %32
-      %arg_1 = OpVariable %_ptr_Function_uint Function %35
-      %arg_2 = OpVariable %_ptr_Function_uint Function %35
-        %res = OpVariable %_ptr_Function_v4uint Function %32
-               OpStore %arg_0 %29
+%extractBits_631377 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %35
+      %arg_1 = OpVariable %_ptr_Function_uint Function %38
+      %arg_2 = OpVariable %_ptr_Function_uint Function %38
+        %res = OpVariable %_ptr_Function_v4uint Function %35
+               OpStore %arg_0 %32
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %38 = OpLoad %v4uint %arg_0
-         %39 = OpLoad %uint %arg_1
-         %40 = OpLoad %uint %arg_2
-         %37 = OpFunctionCall %v4uint %tint_extract_bits %38 %39 %40
-               OpStore %res %37
+         %41 = OpLoad %v4uint %arg_0
+         %42 = OpLoad %uint %arg_1
+         %43 = OpLoad %uint %arg_2
+         %40 = OpFunctionCall %v4uint %tint_extract_bits %41 %42 %43
+               OpStore %res %40
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %48 = OpLoad %v4uint %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %extractBits_631377
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %extractBits_631377
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %27
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %extractBits_631377
+%fragment_main = OpFunction %void None %27
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %extractBits_631377
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %extractBits_631377
+%compute_main = OpFunction %void None %27
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %extractBits_631377
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.wgsl b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.wgsl
index f3136d9..0401b5a 100644
--- a/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/631377.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec4<u32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_631377();
diff --git a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl
index abab8fb..d9288a2 100644
--- a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec2<i32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.dxc.hlsl
index dc1c74d..aa857ee 100644
--- a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.dxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint2((shr).xx)) : ((shl_result >> (31u).xx) >> (1u).xx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_a99a8d() {
   int2 arg_0 = (1).xx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.fxc.hlsl
index dc1c74d..aa857ee 100644
--- a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.fxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint2((shr).xx)) : ((shl_result >> (31u).xx) >> (1u).xx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_a99a8d() {
   int2 arg_0 = (1).xx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.glsl b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.glsl
index 9cfb4f2..87dbdd7 100644
--- a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.glsl
@@ -6,11 +6,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void extractBits_a99a8d() {
   ivec2 arg_0 = ivec2(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,11 +40,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void extractBits_a99a8d() {
   ivec2 arg_0 = ivec2(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -58,11 +68,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void extractBits_a99a8d() {
   ivec2 arg_0 = ivec2(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.msl b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.msl
index 3aa841b..9c750f6 100644
--- a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.msl
@@ -7,36 +7,37 @@
   return extract_bits(v, s, (e - s));
 }
 
-void extractBits_a99a8d() {
+void extractBits_a99a8d(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_a99a8d();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  extractBits_a99a8d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_a99a8d();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_a99a8d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_a99a8d();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_a99a8d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.spvasm
index 135fd67..1584b71 100644
--- a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_extract_bits "tint_extract_bits"
                OpName %v "v"
                OpName %offset "offset"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,67 +45,75 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %v2int %v2int %uint %uint
+         %14 = OpTypeFunction %v2int %v2int %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %25 = OpTypeFunction %void
+         %28 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v2int %int_1 %int_1
+         %33 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %33 = OpConstantNull %v2int
+         %36 = OpConstantNull %v2int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %37 = OpConstantNull %uint
-         %44 = OpTypeFunction %v4float
+         %40 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_extract_bits = OpFunction %v2int None %9
+%tint_extract_bits = OpFunction %v2int None %14
           %v = OpFunctionParameter %v2int
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %17 = OpLabel
-         %18 = OpExtInst %uint %19 UMin %offset %uint_32
-         %22 = OpIAdd %uint %18 %count
-         %21 = OpExtInst %uint %19 UMin %uint_32 %22
-         %24 = OpISub %uint %21 %18
-         %23 = OpBitFieldSExtract %v2int %v %18 %24
-               OpReturnValue %23
+         %20 = OpLabel
+         %21 = OpExtInst %uint %22 UMin %offset %uint_32
+         %25 = OpIAdd %uint %21 %count
+         %24 = OpExtInst %uint %22 UMin %uint_32 %25
+         %27 = OpISub %uint %24 %21
+         %26 = OpBitFieldSExtract %v2int %v %21 %27
+               OpReturnValue %26
                OpFunctionEnd
-%extractBits_a99a8d = OpFunction %void None %25
-         %28 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %33
-      %arg_1 = OpVariable %_ptr_Function_uint Function %37
-      %arg_2 = OpVariable %_ptr_Function_uint Function %37
-        %res = OpVariable %_ptr_Function_v2int Function %33
-               OpStore %arg_0 %30
+%extractBits_a99a8d = OpFunction %void None %28
+         %31 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %36
+      %arg_1 = OpVariable %_ptr_Function_uint Function %40
+      %arg_2 = OpVariable %_ptr_Function_uint Function %40
+        %res = OpVariable %_ptr_Function_v2int Function %36
+               OpStore %arg_0 %33
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %40 = OpLoad %v2int %arg_0
-         %41 = OpLoad %uint %arg_1
-         %42 = OpLoad %uint %arg_2
-         %39 = OpFunctionCall %v2int %tint_extract_bits %40 %41 %42
-               OpStore %res %39
+         %43 = OpLoad %v2int %arg_0
+         %44 = OpLoad %uint %arg_1
+         %45 = OpLoad %uint %arg_2
+         %42 = OpFunctionCall %v2int %tint_extract_bits %43 %44 %45
+               OpStore %res %42
+         %49 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %50 = OpLoad %v2int %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %extractBits_a99a8d
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %extractBits_a99a8d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %25
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %28
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %25
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %extractBits_a99a8d
+%fragment_main = OpFunction %void None %28
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %extractBits_a99a8d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %25
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %extractBits_a99a8d
+%compute_main = OpFunction %void None %28
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %extractBits_a99a8d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.wgsl
index 2e68186..a5a0b55 100644
--- a/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/a99a8d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec2<i32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_a99a8d();
diff --git a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl
index 37cf6e5..9bf235f 100644
--- a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: u32 = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.dxc.hlsl
index 8fb330f..89f50f1 100644
--- a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.dxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> shr) : ((shl_result >> 31u) >> 1u));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_ce81f8() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.fxc.hlsl
index 8fb330f..89f50f1 100644
--- a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.fxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> shr) : ((shl_result >> 31u) >> 1u));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_ce81f8() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.glsl b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.glsl
index 117480c..5f37284 100644
--- a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.glsl
@@ -6,11 +6,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void extractBits_ce81f8() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,11 +40,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void extractBits_ce81f8() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -58,11 +68,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void extractBits_ce81f8() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.msl b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.msl
index 60f0680..c6c477b 100644
--- a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.msl
@@ -7,36 +7,37 @@
   return extract_bits(v, s, (e - s));
 }
 
-void extractBits_ce81f8() {
+void extractBits_ce81f8(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint res = tint_extract_bits(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_ce81f8();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  extractBits_ce81f8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_ce81f8();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_ce81f8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_ce81f8();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_ce81f8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.spvasm
index bd13e5e..084f233 100644
--- a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_extract_bits "tint_extract_bits"
                OpName %v "v"
                OpName %offset "offset"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,62 +44,70 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %uint %uint %uint %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %uint %uint %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %23 = OpTypeFunction %void
+         %26 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-         %38 = OpTypeFunction %v4float
+         %33 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %45 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_extract_bits = OpFunction %uint None %9
+%tint_extract_bits = OpFunction %uint None %13
           %v = OpFunctionParameter %uint
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %15 = OpLabel
-         %16 = OpExtInst %uint %17 UMin %offset %uint_32
-         %20 = OpIAdd %uint %16 %count
-         %19 = OpExtInst %uint %17 UMin %uint_32 %20
-         %22 = OpISub %uint %19 %16
-         %21 = OpBitFieldUExtract %uint %v %16 %22
-               OpReturnValue %21
+         %18 = OpLabel
+         %19 = OpExtInst %uint %20 UMin %offset %uint_32
+         %23 = OpIAdd %uint %19 %count
+         %22 = OpExtInst %uint %20 UMin %uint_32 %23
+         %25 = OpISub %uint %22 %19
+         %24 = OpBitFieldUExtract %uint %v %19 %25
+               OpReturnValue %24
                OpFunctionEnd
-%extractBits_ce81f8 = OpFunction %void None %23
-         %26 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %30
-      %arg_1 = OpVariable %_ptr_Function_uint Function %30
-      %arg_2 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_uint Function %30
+%extractBits_ce81f8 = OpFunction %void None %26
+         %29 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %33
+      %arg_1 = OpVariable %_ptr_Function_uint Function %33
+      %arg_2 = OpVariable %_ptr_Function_uint Function %33
+        %res = OpVariable %_ptr_Function_uint Function %33
                OpStore %arg_0 %uint_1
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %34 = OpLoad %uint %arg_0
-         %35 = OpLoad %uint %arg_1
-         %36 = OpLoad %uint %arg_2
-         %33 = OpFunctionCall %uint %tint_extract_bits %34 %35 %36
-               OpStore %res %33
+         %37 = OpLoad %uint %arg_0
+         %38 = OpLoad %uint %arg_1
+         %39 = OpLoad %uint %arg_2
+         %36 = OpFunctionCall %uint %tint_extract_bits %37 %38 %39
+               OpStore %res %36
+         %43 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %44 = OpLoad %uint %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %extractBits_ce81f8
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %extractBits_ce81f8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %23
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %26
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %23
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %extractBits_ce81f8
+%fragment_main = OpFunction %void None %26
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %extractBits_ce81f8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %23
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %extractBits_ce81f8
+%compute_main = OpFunction %void None %26
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %extractBits_ce81f8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.wgsl
index c99ed1a..d336bb3 100644
--- a/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/ce81f8.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : u32 = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_ce81f8();
diff --git a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl
index 3baa1dc..17f4c93 100644
--- a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec3<i32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.dxc.hlsl
index b0c453f..61dd953 100644
--- a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.dxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint3((shr).xxx)) : ((shl_result >> (31u).xxx) >> (1u).xxx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_e04f5d() {
   int3 arg_0 = (1).xxx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.fxc.hlsl
index b0c453f..61dd953 100644
--- a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.fxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint3((shr).xxx)) : ((shl_result >> (31u).xxx) >> (1u).xxx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_e04f5d() {
   int3 arg_0 = (1).xxx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.glsl b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.glsl
index 66f5308..547d5eb 100644
--- a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.glsl
@@ -6,11 +6,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void extractBits_e04f5d() {
   ivec3 arg_0 = ivec3(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,11 +40,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void extractBits_e04f5d() {
   ivec3 arg_0 = ivec3(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -58,11 +68,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void extractBits_e04f5d() {
   ivec3 arg_0 = ivec3(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.msl b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.msl
index bbc7412..3f79567 100644
--- a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.msl
@@ -7,36 +7,37 @@
   return extract_bits(v, s, (e - s));
 }
 
-void extractBits_e04f5d() {
+void extractBits_e04f5d(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int3 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_e04f5d();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  extractBits_e04f5d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_e04f5d();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_e04f5d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_e04f5d();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_e04f5d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.spvasm
index 3efe52e..7c01840 100644
--- a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_extract_bits "tint_extract_bits"
                OpName %v "v"
                OpName %offset "offset"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,67 +45,75 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %v3int %v3int %uint %uint
+         %14 = OpTypeFunction %v3int %v3int %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %25 = OpTypeFunction %void
+         %28 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %33 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %33 = OpConstantNull %v3int
+         %36 = OpConstantNull %v3int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %37 = OpConstantNull %uint
-         %44 = OpTypeFunction %v4float
+         %40 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_extract_bits = OpFunction %v3int None %9
+%tint_extract_bits = OpFunction %v3int None %14
           %v = OpFunctionParameter %v3int
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %17 = OpLabel
-         %18 = OpExtInst %uint %19 UMin %offset %uint_32
-         %22 = OpIAdd %uint %18 %count
-         %21 = OpExtInst %uint %19 UMin %uint_32 %22
-         %24 = OpISub %uint %21 %18
-         %23 = OpBitFieldSExtract %v3int %v %18 %24
-               OpReturnValue %23
+         %20 = OpLabel
+         %21 = OpExtInst %uint %22 UMin %offset %uint_32
+         %25 = OpIAdd %uint %21 %count
+         %24 = OpExtInst %uint %22 UMin %uint_32 %25
+         %27 = OpISub %uint %24 %21
+         %26 = OpBitFieldSExtract %v3int %v %21 %27
+               OpReturnValue %26
                OpFunctionEnd
-%extractBits_e04f5d = OpFunction %void None %25
-         %28 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %33
-      %arg_1 = OpVariable %_ptr_Function_uint Function %37
-      %arg_2 = OpVariable %_ptr_Function_uint Function %37
-        %res = OpVariable %_ptr_Function_v3int Function %33
-               OpStore %arg_0 %30
+%extractBits_e04f5d = OpFunction %void None %28
+         %31 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %36
+      %arg_1 = OpVariable %_ptr_Function_uint Function %40
+      %arg_2 = OpVariable %_ptr_Function_uint Function %40
+        %res = OpVariable %_ptr_Function_v3int Function %36
+               OpStore %arg_0 %33
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %40 = OpLoad %v3int %arg_0
-         %41 = OpLoad %uint %arg_1
-         %42 = OpLoad %uint %arg_2
-         %39 = OpFunctionCall %v3int %tint_extract_bits %40 %41 %42
-               OpStore %res %39
+         %43 = OpLoad %v3int %arg_0
+         %44 = OpLoad %uint %arg_1
+         %45 = OpLoad %uint %arg_2
+         %42 = OpFunctionCall %v3int %tint_extract_bits %43 %44 %45
+               OpStore %res %42
+         %49 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %50 = OpLoad %v3int %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %extractBits_e04f5d
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %extractBits_e04f5d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %25
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %28
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %25
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %extractBits_e04f5d
+%fragment_main = OpFunction %void None %28
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %extractBits_e04f5d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %25
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %extractBits_e04f5d
+%compute_main = OpFunction %void None %28
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %extractBits_e04f5d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.wgsl
index 12627f3..c1b4a98 100644
--- a/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/e04f5d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec3<i32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_e04f5d();
diff --git a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl
index a68e40b..dd9d465 100644
--- a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec2<u32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.dxc.hlsl
index 88b2c88..3a17ec7 100644
--- a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.dxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint2((shr).xx)) : ((shl_result >> (31u).xx) >> (1u).xx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_f28f69() {
   uint2 arg_0 = (1u).xx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.fxc.hlsl
index 88b2c88..3a17ec7 100644
--- a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.fxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint2((shr).xx)) : ((shl_result >> (31u).xx) >> (1u).xx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_f28f69() {
   uint2 arg_0 = (1u).xx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.glsl b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.glsl
index 019abe9..fc5d310 100644
--- a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.glsl
@@ -6,11 +6,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void extractBits_f28f69() {
   uvec2 arg_0 = uvec2(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,11 +40,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void extractBits_f28f69() {
   uvec2 arg_0 = uvec2(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -58,11 +68,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void extractBits_f28f69() {
   uvec2 arg_0 = uvec2(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.msl b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.msl
index 660fe43..9227e4b 100644
--- a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.msl
@@ -7,36 +7,37 @@
   return extract_bits(v, s, (e - s));
 }
 
-void extractBits_f28f69() {
+void extractBits_f28f69(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint2 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_f28f69();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  extractBits_f28f69(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_f28f69();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_f28f69(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_f28f69();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_f28f69(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.spvasm b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.spvasm
index 61e1149..c70ad63 100644
--- a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_extract_bits "tint_extract_bits"
                OpName %v "v"
                OpName %offset "offset"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,65 +45,73 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-          %9 = OpTypeFunction %v2uint %v2uint %uint %uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2uint %v2uint %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %29 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %32 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %32 = OpConstantNull %v2uint
+         %35 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %35 = OpConstantNull %uint
-         %42 = OpTypeFunction %v4float
+         %38 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_extract_bits = OpFunction %v2uint None %9
+%tint_extract_bits = OpFunction %v2uint None %14
           %v = OpFunctionParameter %v2uint
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %16 = OpLabel
-         %17 = OpExtInst %uint %18 UMin %offset %uint_32
-         %21 = OpIAdd %uint %17 %count
-         %20 = OpExtInst %uint %18 UMin %uint_32 %21
-         %23 = OpISub %uint %20 %17
-         %22 = OpBitFieldUExtract %v2uint %v %17 %23
-               OpReturnValue %22
+         %19 = OpLabel
+         %20 = OpExtInst %uint %21 UMin %offset %uint_32
+         %24 = OpIAdd %uint %20 %count
+         %23 = OpExtInst %uint %21 UMin %uint_32 %24
+         %26 = OpISub %uint %23 %20
+         %25 = OpBitFieldUExtract %v2uint %v %20 %26
+               OpReturnValue %25
                OpFunctionEnd
-%extractBits_f28f69 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %32
-      %arg_1 = OpVariable %_ptr_Function_uint Function %35
-      %arg_2 = OpVariable %_ptr_Function_uint Function %35
-        %res = OpVariable %_ptr_Function_v2uint Function %32
-               OpStore %arg_0 %29
+%extractBits_f28f69 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %35
+      %arg_1 = OpVariable %_ptr_Function_uint Function %38
+      %arg_2 = OpVariable %_ptr_Function_uint Function %38
+        %res = OpVariable %_ptr_Function_v2uint Function %35
+               OpStore %arg_0 %32
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %38 = OpLoad %v2uint %arg_0
-         %39 = OpLoad %uint %arg_1
-         %40 = OpLoad %uint %arg_2
-         %37 = OpFunctionCall %v2uint %tint_extract_bits %38 %39 %40
-               OpStore %res %37
+         %41 = OpLoad %v2uint %arg_0
+         %42 = OpLoad %uint %arg_1
+         %43 = OpLoad %uint %arg_2
+         %40 = OpFunctionCall %v2uint %tint_extract_bits %41 %42 %43
+               OpStore %res %40
+         %47 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %48 = OpLoad %v2uint %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %extractBits_f28f69
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %extractBits_f28f69
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %27
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %extractBits_f28f69
+%fragment_main = OpFunction %void None %27
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %extractBits_f28f69
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %extractBits_f28f69
+%compute_main = OpFunction %void None %27
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %extractBits_f28f69
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.wgsl b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.wgsl
index f3b0b7d..13f0851 100644
--- a/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/f28f69.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec2<u32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_f28f69();
diff --git a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl
index b87635e..1c06c63 100644
--- a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec4<i32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.dxc.hlsl
index b1452a7..f72fd47 100644
--- a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.dxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint4((shr).xxxx)) : ((shl_result >> (31u).xxxx) >> (1u).xxxx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_fb850f() {
   int4 arg_0 = (1).xxxx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.fxc.hlsl
index b1452a7..f72fd47 100644
--- a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.fxc.hlsl
@@ -7,11 +7,14 @@
   return ((shr < 32u) ? (shl_result >> uint4((shr).xxxx)) : ((shl_result >> (31u).xxxx) >> (1u).xxxx));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void extractBits_fb850f() {
   int4 arg_0 = (1).xxxx;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.glsl b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.glsl
index 36e4089..af6749d 100644
--- a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.glsl
@@ -6,11 +6,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void extractBits_fb850f() {
   ivec4 arg_0 = ivec4(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,11 +40,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void extractBits_fb850f() {
   ivec4 arg_0 = ivec4(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -58,11 +68,16 @@
   return bitfieldExtract(v, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void extractBits_fb850f() {
   ivec4 arg_0 = ivec4(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.msl b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.msl
index bc83c62..8273308 100644
--- a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.msl
@@ -7,36 +7,37 @@
   return extract_bits(v, s, (e - s));
 }
 
-void extractBits_fb850f() {
+void extractBits_fb850f(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int4 res = tint_extract_bits(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  extractBits_fb850f();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  extractBits_fb850f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  extractBits_fb850f();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  extractBits_fb850f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  extractBits_fb850f();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  extractBits_fb850f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.spvasm
index 0b66eed..a48b09e 100644
--- a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_extract_bits "tint_extract_bits"
                OpName %v "v"
                OpName %offset "offset"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,67 +45,75 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %v4int %v4int %uint %uint
+         %14 = OpTypeFunction %v4int %v4int %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %25 = OpTypeFunction %void
+         %28 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %30 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %33 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %33 = OpConstantNull %v4int
+         %36 = OpConstantNull %v4int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %37 = OpConstantNull %uint
-         %44 = OpTypeFunction %v4float
+         %40 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_extract_bits = OpFunction %v4int None %9
+%tint_extract_bits = OpFunction %v4int None %14
           %v = OpFunctionParameter %v4int
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %17 = OpLabel
-         %18 = OpExtInst %uint %19 UMin %offset %uint_32
-         %22 = OpIAdd %uint %18 %count
-         %21 = OpExtInst %uint %19 UMin %uint_32 %22
-         %24 = OpISub %uint %21 %18
-         %23 = OpBitFieldSExtract %v4int %v %18 %24
-               OpReturnValue %23
+         %20 = OpLabel
+         %21 = OpExtInst %uint %22 UMin %offset %uint_32
+         %25 = OpIAdd %uint %21 %count
+         %24 = OpExtInst %uint %22 UMin %uint_32 %25
+         %27 = OpISub %uint %24 %21
+         %26 = OpBitFieldSExtract %v4int %v %21 %27
+               OpReturnValue %26
                OpFunctionEnd
-%extractBits_fb850f = OpFunction %void None %25
-         %28 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %33
-      %arg_1 = OpVariable %_ptr_Function_uint Function %37
-      %arg_2 = OpVariable %_ptr_Function_uint Function %37
-        %res = OpVariable %_ptr_Function_v4int Function %33
-               OpStore %arg_0 %30
+%extractBits_fb850f = OpFunction %void None %28
+         %31 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %36
+      %arg_1 = OpVariable %_ptr_Function_uint Function %40
+      %arg_2 = OpVariable %_ptr_Function_uint Function %40
+        %res = OpVariable %_ptr_Function_v4int Function %36
+               OpStore %arg_0 %33
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %40 = OpLoad %v4int %arg_0
-         %41 = OpLoad %uint %arg_1
-         %42 = OpLoad %uint %arg_2
-         %39 = OpFunctionCall %v4int %tint_extract_bits %40 %41 %42
-               OpStore %res %39
+         %43 = OpLoad %v4int %arg_0
+         %44 = OpLoad %uint %arg_1
+         %45 = OpLoad %uint %arg_2
+         %42 = OpFunctionCall %v4int %tint_extract_bits %43 %44 %45
+               OpStore %res %42
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %50 = OpLoad %v4int %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %extractBits_fb850f
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %extractBits_fb850f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %25
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %28
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %25
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %extractBits_fb850f
+%fragment_main = OpFunction %void None %28
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %extractBits_fb850f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %25
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %extractBits_fb850f
+%compute_main = OpFunction %void None %28
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %extractBits_fb850f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.wgsl
index 2a702d0..61ea51b 100644
--- a/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/extractBits/fb850f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec4<i32> = extractBits(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   extractBits_fb850f();
diff --git a/test/tint/builtins/gen/var/faceForward/2c4d14.wgsl b/test/tint/builtins/gen/var/faceForward/2c4d14.wgsl
index 40b85e1..5066958 100644
--- a/test/tint/builtins/gen/var/faceForward/2c4d14.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/2c4d14.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec4(1.);
   var res = faceForward(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_2c4d14();
diff --git a/test/tint/builtins/gen/var/faceForward/524986.wgsl b/test/tint/builtins/gen/var/faceForward/524986.wgsl
index e1c67a7..62db55c 100644
--- a/test/tint/builtins/gen/var/faceForward/524986.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/524986.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(1.h);
   var arg_2 = vec3<f16>(1.h);
   var res: vec3<f16> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.dxc.hlsl
index 71085cb..f31a70a 100644
--- a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_524986() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.fxc.hlsl
index 9788453..ab717a9 100644
--- a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_524986() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.glsl b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.glsl
index 83a9c60..6c93c2c 100644
--- a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void faceForward_524986() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void faceForward_524986() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void faceForward_524986() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.msl b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.msl
index 141e5ae..3805b07 100644
--- a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_524986() {
+void faceForward_524986(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 arg_2 = half3(1.0h);
   half3 res = faceforward(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_524986();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  faceForward_524986(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_524986();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_524986(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_524986();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_524986(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.spvasm b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.spvasm
index 0bf053a..24fd2ad 100644
--- a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_524986 "faceForward_524986"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_524986 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v3half %arg_0
-         %25 = OpLoad %v3half %arg_1
-         %26 = OpLoad %v3half %arg_2
-         %22 = OpExtInst %v3half %23 FaceForward %24 %25 %26
-               OpStore %res %22
+%faceForward_524986 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v3half %arg_0
+         %28 = OpLoad %v3half %arg_1
+         %29 = OpLoad %v3half %arg_2
+         %25 = OpExtInst %v3half %26 FaceForward %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %35 = OpLoad %v3half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %faceForward_524986
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %faceForward_524986
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %faceForward_524986
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %faceForward_524986
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %faceForward_524986
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %faceForward_524986
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.wgsl b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.wgsl
index 578fa24..12893fe 100644
--- a/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/524986.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(1.0h);
   var arg_2 = vec3<f16>(1.0h);
   var res : vec3<f16> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_524986();
diff --git a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl
index e569e19..d1c7d94 100644
--- a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(1.f);
   var arg_2 = vec3<f32>(1.f);
   var res: vec3<f32> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.dxc.hlsl
index d4dbbc1..10e55d1 100644
--- a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_5afbd5() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 arg_2 = (1.0f).xxx;
   float3 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.fxc.hlsl
index d4dbbc1..10e55d1 100644
--- a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_5afbd5() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 arg_2 = (1.0f).xxx;
   float3 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.glsl b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.glsl
index cc2d73d..7962d54 100644
--- a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void faceForward_5afbd5() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void faceForward_5afbd5() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void faceForward_5afbd5() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.msl b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.msl
index adb259e..f387c64 100644
--- a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_5afbd5() {
+void faceForward_5afbd5(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 arg_2 = float3(1.0f);
   float3 res = faceforward(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_5afbd5();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  faceForward_5afbd5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_5afbd5();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_5afbd5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_5afbd5();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_5afbd5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.spvasm
index 3cfa489..1214d3d 100644
--- a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_5afbd5 "faceForward_5afbd5"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,49 +39,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %27 = OpTypeFunction %v4float
-%faceForward_5afbd5 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %15
-         %23 = OpLoad %v3float %arg_0
-         %24 = OpLoad %v3float %arg_1
-         %25 = OpLoad %v3float %arg_2
-         %21 = OpExtInst %v3float %22 FaceForward %23 %24 %25
-               OpStore %res %21
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %35 = OpTypeFunction %v4float
+%faceForward_5afbd5 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %18
+         %26 = OpLoad %v3float %arg_0
+         %27 = OpLoad %v3float %arg_1
+         %28 = OpLoad %v3float %arg_2
+         %24 = OpExtInst %v3float %25 FaceForward %26 %27 %28
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %34 = OpLoad %v3float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %faceForward_5afbd5
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %faceForward_5afbd5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %faceForward_5afbd5
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %faceForward_5afbd5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %faceForward_5afbd5
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %faceForward_5afbd5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.wgsl
index 56a1589..315e522 100644
--- a/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/5afbd5.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(1.0f);
   var arg_2 = vec3<f32>(1.0f);
   var res : vec3<f32> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_5afbd5();
diff --git a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl
index 06da297..592556c 100644
--- a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(1.f);
   var arg_2 = vec4<f32>(1.f);
   var res: vec4<f32> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.dxc.hlsl
index 1ec3bc9..0e435a8 100644
--- a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_b316e5() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 arg_2 = (1.0f).xxxx;
   float4 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.fxc.hlsl
index 1ec3bc9..0e435a8 100644
--- a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_b316e5() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 arg_2 = (1.0f).xxxx;
   float4 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.glsl b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.glsl
index 2df8c57..5cf09f7 100644
--- a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void faceForward_b316e5() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void faceForward_b316e5() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void faceForward_b316e5() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.msl b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.msl
index d94bb16..5cb6b06 100644
--- a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_b316e5() {
+void faceForward_b316e5(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 arg_2 = float4(1.0f);
   float4 res = faceforward(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_b316e5();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  faceForward_b316e5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_b316e5();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_b316e5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_b316e5();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_b316e5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.spvasm
index 9baaf65..645b1c6 100644
--- a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_b316e5 "faceForward_b316e5"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,47 +39,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %25 = OpTypeFunction %v4float
-%faceForward_b316e5 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
+%faceForward_b316e5 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
       %arg_2 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-               OpStore %arg_2 %14
-         %21 = OpLoad %v4float %arg_0
-         %22 = OpLoad %v4float %arg_1
-         %23 = OpLoad %v4float %arg_2
-         %19 = OpExtInst %v4float %20 FaceForward %21 %22 %23
-               OpStore %res %19
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+               OpStore %arg_2 %17
+         %24 = OpLoad %v4float %arg_0
+         %25 = OpLoad %v4float %arg_1
+         %26 = OpLoad %v4float %arg_2
+         %22 = OpExtInst %v4float %23 FaceForward %24 %25 %26
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %faceForward_b316e5
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %faceForward_b316e5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %faceForward_b316e5
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %faceForward_b316e5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %faceForward_b316e5
+%compute_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %faceForward_b316e5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.wgsl
index cc70986..843a918 100644
--- a/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/b316e5.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(1.0f);
   var arg_2 = vec4<f32>(1.0f);
   var res : vec4<f32> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_b316e5();
diff --git a/test/tint/builtins/gen/var/faceForward/b42ef3.wgsl b/test/tint/builtins/gen/var/faceForward/b42ef3.wgsl
index c069475..e341e31 100644
--- a/test/tint/builtins/gen/var/faceForward/b42ef3.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/b42ef3.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec2(1.);
   var res = faceForward(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_b42ef3();
diff --git a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl
index 7b8d403..e667acf 100644
--- a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(1.h);
   var arg_2 = vec4<f16>(1.h);
   var res: vec4<f16> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.dxc.hlsl
index ffcbad2..01fde89 100644
--- a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_cc63dc() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.fxc.hlsl
index fa40b32..5257819 100644
--- a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_cc63dc() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.glsl b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.glsl
index 2c6a87d..331af8c 100644
--- a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void faceForward_cc63dc() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void faceForward_cc63dc() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void faceForward_cc63dc() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.msl b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.msl
index 21b9800..af62d5f 100644
--- a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_cc63dc() {
+void faceForward_cc63dc(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 arg_2 = half4(1.0h);
   half4 res = faceforward(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_cc63dc();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  faceForward_cc63dc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_cc63dc();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_cc63dc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_cc63dc();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_cc63dc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.spvasm
index bff0d15..a5353b9 100644
--- a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_cc63dc "faceForward_cc63dc"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_cc63dc = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v4half %arg_0
-         %25 = OpLoad %v4half %arg_1
-         %26 = OpLoad %v4half %arg_2
-         %22 = OpExtInst %v4half %23 FaceForward %24 %25 %26
-               OpStore %res %22
+%faceForward_cc63dc = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v4half %arg_0
+         %28 = OpLoad %v4half %arg_1
+         %29 = OpLoad %v4half %arg_2
+         %25 = OpExtInst %v4half %26 FaceForward %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %35 = OpLoad %v4half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %faceForward_cc63dc
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %faceForward_cc63dc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %faceForward_cc63dc
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %faceForward_cc63dc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %faceForward_cc63dc
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %faceForward_cc63dc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.wgsl
index 2622013..b0876ed 100644
--- a/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/cc63dc.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(1.0h);
   var arg_2 = vec4<f16>(1.0h);
   var res : vec4<f16> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_cc63dc();
diff --git a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl
index ae429ac..a2cd44a 100644
--- a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(1.f);
   var arg_2 = vec2<f32>(1.f);
   var res: vec2<f32> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.dxc.hlsl
index 420451b..cdb1fc1 100644
--- a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_e6908b() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 arg_2 = (1.0f).xx;
   float2 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.fxc.hlsl
index 420451b..cdb1fc1 100644
--- a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_e6908b() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 arg_2 = (1.0f).xx;
   float2 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.glsl b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.glsl
index d15e8d6..d3497c8 100644
--- a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void faceForward_e6908b() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void faceForward_e6908b() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void faceForward_e6908b() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.msl b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.msl
index a932e4f..fc44941 100644
--- a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_e6908b() {
+void faceForward_e6908b(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 arg_2 = float2(1.0f);
   float2 res = faceforward(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_e6908b();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  faceForward_e6908b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_e6908b();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_e6908b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_e6908b();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_e6908b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.spvasm
index e02d85e..bfc3197 100644
--- a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_e6908b "faceForward_e6908b"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,49 +39,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %27 = OpTypeFunction %v4float
-%faceForward_e6908b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %15
-         %23 = OpLoad %v2float %arg_0
-         %24 = OpLoad %v2float %arg_1
-         %25 = OpLoad %v2float %arg_2
-         %21 = OpExtInst %v2float %22 FaceForward %23 %24 %25
-               OpStore %res %21
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %35 = OpTypeFunction %v4float
+%faceForward_e6908b = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %18
+         %26 = OpLoad %v2float %arg_0
+         %27 = OpLoad %v2float %arg_1
+         %28 = OpLoad %v2float %arg_2
+         %24 = OpExtInst %v2float %25 FaceForward %26 %27 %28
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %34 = OpLoad %v2float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %faceForward_e6908b
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %faceForward_e6908b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %faceForward_e6908b
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %faceForward_e6908b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %faceForward_e6908b
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %faceForward_e6908b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.wgsl
index b2a922b..0b7f494 100644
--- a/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/e6908b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(1.0f);
   var arg_2 = vec2<f32>(1.0f);
   var res : vec2<f32> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_e6908b();
diff --git a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl
index 8e54844..0fe2baf 100644
--- a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(1.h);
   var arg_2 = vec2<f16>(1.h);
   var res: vec2<f16> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.dxc.hlsl
index 82fcd39..832e4ba 100644
--- a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_fb0f2e() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.fxc.hlsl
index 040f38b..c604f00 100644
--- a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void faceForward_fb0f2e() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.glsl b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.glsl
index 8ebf21e..f3d6e75 100644
--- a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void faceForward_fb0f2e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void faceForward_fb0f2e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void faceForward_fb0f2e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = faceforward(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.msl b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.msl
index 68d7ad2..99864b1 100644
--- a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void faceForward_fb0f2e() {
+void faceForward_fb0f2e(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 arg_2 = half2(1.0h);
   half2 res = faceforward(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  faceForward_fb0f2e();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  faceForward_fb0f2e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  faceForward_fb0f2e();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  faceForward_fb0f2e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  faceForward_fb0f2e();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  faceForward_fb0f2e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.spvasm
index 8939181..642f7dc 100644
--- a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %faceForward_fb0f2e "faceForward_fb0f2e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%faceForward_fb0f2e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v2half %arg_0
-         %25 = OpLoad %v2half %arg_1
-         %26 = OpLoad %v2half %arg_2
-         %22 = OpExtInst %v2half %23 FaceForward %24 %25 %26
-               OpStore %res %22
+%faceForward_fb0f2e = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v2half %arg_0
+         %28 = OpLoad %v2half %arg_1
+         %29 = OpLoad %v2half %arg_2
+         %25 = OpExtInst %v2half %26 FaceForward %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %35 = OpLoad %v2half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %faceForward_fb0f2e
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %faceForward_fb0f2e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %faceForward_fb0f2e
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %faceForward_fb0f2e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %faceForward_fb0f2e
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %faceForward_fb0f2e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.wgsl
index 70ca64b..845c7c6 100644
--- a/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/fb0f2e.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(1.0h);
   var arg_2 = vec2<f16>(1.0h);
   var res : vec2<f16> = faceForward(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_fb0f2e();
diff --git a/test/tint/builtins/gen/var/faceForward/fe522b.wgsl b/test/tint/builtins/gen/var/faceForward/fe522b.wgsl
index 62d967d..071cf4f 100644
--- a/test/tint/builtins/gen/var/faceForward/fe522b.wgsl
+++ b/test/tint/builtins/gen/var/faceForward/fe522b.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec3(1.);
   var res = faceForward(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   faceForward_fe522b();
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl
index 50f579e..5f4e29e 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl
@@ -25,7 +25,9 @@
 fn firstLeadingBit_000ff3() {
   var arg_0 = vec4<u32>(1u);
   var res: vec4<u32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.dxc.hlsl
index a7aba55..374dc5a 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_000ff3() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.fxc.hlsl
index a7aba55..374dc5a 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_000ff3() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.glsl
index f468c8a..a88db52 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_000ff3() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_000ff3() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_000ff3() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.msl b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.msl
index cdf2e4b..748154d 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstLeadingBit_000ff3() {
+void firstLeadingBit_000ff3(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 res = tint_first_leading_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_000ff3();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  firstLeadingBit_000ff3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_000ff3();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_000ff3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_000ff3();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_000ff3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.spvasm
index 99937e2..c7a1928 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 99
+; Bound: 106
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_leading_bit "tint_first_leading_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,111 +41,119 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-          %9 = OpTypeFunction %v4uint %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4uint %v4uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %17 = OpConstantNull %v4uint
+         %20 = OpConstantNull %v4uint
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
 %uint_4294901760 = OpConstant %uint 4294901760
-         %24 = OpConstantComposite %v4uint %uint_4294901760 %uint_4294901760 %uint_4294901760 %uint_4294901760
+         %27 = OpConstantComposite %v4uint %uint_4294901760 %uint_4294901760 %uint_4294901760 %uint_4294901760
     %uint_16 = OpConstant %uint 16
-         %27 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
+         %30 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
  %uint_65280 = OpConstant %uint 65280
-         %34 = OpConstantComposite %v4uint %uint_65280 %uint_65280 %uint_65280 %uint_65280
+         %37 = OpConstantComposite %v4uint %uint_65280 %uint_65280 %uint_65280 %uint_65280
      %uint_8 = OpConstant %uint 8
-         %37 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
+         %40 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
    %uint_240 = OpConstant %uint 240
-         %44 = OpConstantComposite %v4uint %uint_240 %uint_240 %uint_240 %uint_240
+         %47 = OpConstantComposite %v4uint %uint_240 %uint_240 %uint_240 %uint_240
      %uint_4 = OpConstant %uint 4
-         %47 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
+         %50 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
     %uint_12 = OpConstant %uint 12
-         %54 = OpConstantComposite %v4uint %uint_12 %uint_12 %uint_12 %uint_12
+         %57 = OpConstantComposite %v4uint %uint_12 %uint_12 %uint_12 %uint_12
      %uint_2 = OpConstant %uint 2
-         %57 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
+         %60 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %68 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %70 = OpConstantComposite %v4uint %uint_4294967295 %uint_4294967295 %uint_4294967295 %uint_4294967295
+         %73 = OpConstantComposite %v4uint %uint_4294967295 %uint_4294967295 %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %77 = OpTypeFunction %void
-         %85 = OpTypeFunction %v4float
+         %80 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %92 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_leading_bit = OpFunction %v4uint None %9
+%tint_first_leading_bit = OpFunction %v4uint None %14
           %v = OpFunctionParameter %v4uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v4uint Function %17
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v4uint Function %20
                OpStore %x %v
-         %22 = OpLoad %v4uint %x
-         %25 = OpBitwiseAnd %v4uint %22 %24
-         %19 = OpINotEqual %v4bool %25 %17
-         %18 = OpSelect %v4uint %19 %27 %17
-         %28 = OpLoad %v4uint %x
-         %29 = OpShiftRightLogical %v4uint %28 %18
-               OpStore %x %29
-         %32 = OpLoad %v4uint %x
-         %35 = OpBitwiseAnd %v4uint %32 %34
-         %31 = OpINotEqual %v4bool %35 %17
-         %30 = OpSelect %v4uint %31 %37 %17
-         %38 = OpLoad %v4uint %x
-         %39 = OpShiftRightLogical %v4uint %38 %30
-               OpStore %x %39
-         %42 = OpLoad %v4uint %x
-         %45 = OpBitwiseAnd %v4uint %42 %44
-         %41 = OpINotEqual %v4bool %45 %17
-         %40 = OpSelect %v4uint %41 %47 %17
-         %48 = OpLoad %v4uint %x
-         %49 = OpShiftRightLogical %v4uint %48 %40
-               OpStore %x %49
-         %52 = OpLoad %v4uint %x
-         %55 = OpBitwiseAnd %v4uint %52 %54
-         %51 = OpINotEqual %v4bool %55 %17
-         %50 = OpSelect %v4uint %51 %57 %17
-         %58 = OpLoad %v4uint %x
-         %59 = OpShiftRightLogical %v4uint %58 %50
-               OpStore %x %59
-         %62 = OpLoad %v4uint %x
-         %63 = OpBitwiseAnd %v4uint %62 %57
-         %61 = OpINotEqual %v4bool %63 %17
-         %60 = OpSelect %v4uint %61 %65 %17
-         %67 = OpLoad %v4uint %x
-         %68 = OpIEqual %v4bool %67 %17
-         %66 = OpSelect %v4uint %68 %70 %17
-         %72 = OpBitwiseOr %v4uint %18 %30
-         %73 = OpBitwiseOr %v4uint %72 %40
-         %74 = OpBitwiseOr %v4uint %73 %50
-         %75 = OpBitwiseOr %v4uint %74 %60
-         %76 = OpBitwiseOr %v4uint %75 %66
-               OpReturnValue %76
+         %25 = OpLoad %v4uint %x
+         %28 = OpBitwiseAnd %v4uint %25 %27
+         %22 = OpINotEqual %v4bool %28 %20
+         %21 = OpSelect %v4uint %22 %30 %20
+         %31 = OpLoad %v4uint %x
+         %32 = OpShiftRightLogical %v4uint %31 %21
+               OpStore %x %32
+         %35 = OpLoad %v4uint %x
+         %38 = OpBitwiseAnd %v4uint %35 %37
+         %34 = OpINotEqual %v4bool %38 %20
+         %33 = OpSelect %v4uint %34 %40 %20
+         %41 = OpLoad %v4uint %x
+         %42 = OpShiftRightLogical %v4uint %41 %33
+               OpStore %x %42
+         %45 = OpLoad %v4uint %x
+         %48 = OpBitwiseAnd %v4uint %45 %47
+         %44 = OpINotEqual %v4bool %48 %20
+         %43 = OpSelect %v4uint %44 %50 %20
+         %51 = OpLoad %v4uint %x
+         %52 = OpShiftRightLogical %v4uint %51 %43
+               OpStore %x %52
+         %55 = OpLoad %v4uint %x
+         %58 = OpBitwiseAnd %v4uint %55 %57
+         %54 = OpINotEqual %v4bool %58 %20
+         %53 = OpSelect %v4uint %54 %60 %20
+         %61 = OpLoad %v4uint %x
+         %62 = OpShiftRightLogical %v4uint %61 %53
+               OpStore %x %62
+         %65 = OpLoad %v4uint %x
+         %66 = OpBitwiseAnd %v4uint %65 %60
+         %64 = OpINotEqual %v4bool %66 %20
+         %63 = OpSelect %v4uint %64 %68 %20
+         %70 = OpLoad %v4uint %x
+         %71 = OpIEqual %v4bool %70 %20
+         %69 = OpSelect %v4uint %71 %73 %20
+         %75 = OpBitwiseOr %v4uint %21 %33
+         %76 = OpBitwiseOr %v4uint %75 %43
+         %77 = OpBitwiseOr %v4uint %76 %53
+         %78 = OpBitwiseOr %v4uint %77 %63
+         %79 = OpBitwiseOr %v4uint %78 %69
+               OpReturnValue %79
                OpFunctionEnd
-%firstLeadingBit_000ff3 = OpFunction %void None %77
-         %80 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %17
-        %res = OpVariable %_ptr_Function_v4uint Function %17
-               OpStore %arg_0 %65
-         %83 = OpLoad %v4uint %arg_0
-         %82 = OpFunctionCall %v4uint %tint_first_leading_bit %83
-               OpStore %res %82
+%firstLeadingBit_000ff3 = OpFunction %void None %80
+         %83 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %20
+        %res = OpVariable %_ptr_Function_v4uint Function %20
+               OpStore %arg_0 %68
+         %86 = OpLoad %v4uint %arg_0
+         %85 = OpFunctionCall %v4uint %tint_first_leading_bit %86
+               OpStore %res %85
+         %90 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %91 = OpLoad %v4uint %res
+               OpStore %90 %91
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %85
-         %87 = OpLabel
-         %88 = OpFunctionCall %void %firstLeadingBit_000ff3
+%vertex_main_inner = OpFunction %v4float None %92
+         %94 = OpLabel
+         %95 = OpFunctionCall %void %firstLeadingBit_000ff3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %77
-         %90 = OpLabel
-         %91 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %91
+%vertex_main = OpFunction %void None %80
+         %97 = OpLabel
+         %98 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %98
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %77
-         %94 = OpLabel
-         %95 = OpFunctionCall %void %firstLeadingBit_000ff3
+%fragment_main = OpFunction %void None %80
+        %101 = OpLabel
+        %102 = OpFunctionCall %void %firstLeadingBit_000ff3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %77
-         %97 = OpLabel
-         %98 = OpFunctionCall %void %firstLeadingBit_000ff3
+%compute_main = OpFunction %void None %80
+        %104 = OpLabel
+        %105 = OpFunctionCall %void %firstLeadingBit_000ff3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.wgsl
index a3a7d0c..ebf01d5 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/000ff3.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstLeadingBit_000ff3() {
   var arg_0 = vec4<u32>(1u);
   var res : vec4<u32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_000ff3();
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl
index 0a97f65..c4b7a51 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl
@@ -25,7 +25,9 @@
 fn firstLeadingBit_35053e() {
   var arg_0 = vec3<i32>(1i);
   var res: vec3<i32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.dxc.hlsl
index 2a9bbbc..df41956 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_35053e() {
   int3 arg_0 = (1).xxx;
   int3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.fxc.hlsl
index 2a9bbbc..df41956 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_35053e() {
   int3 arg_0 = (1).xxx;
   int3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.glsl
index 4fa2383..ffe0d7b 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_35053e() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_35053e() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_35053e() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.msl b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.msl
index 584154a..05fa028 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstLeadingBit_35053e() {
+void firstLeadingBit_35053e(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 res = tint_first_leading_bit(arg_0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_35053e();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  firstLeadingBit_35053e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_35053e();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_35053e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_35053e();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_35053e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.spvasm
index ca524f3..6a5d4ef 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 110
+; Bound: 117
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_leading_bit "tint_first_leading_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,123 +41,131 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-          %9 = OpTypeFunction %v3int %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3int %v3int
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-         %18 = OpConstantNull %v3int
+         %21 = OpConstantNull %v3int
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %27 = OpConstantNull %v3uint
+         %30 = OpConstantNull %v3uint
 %uint_4294901760 = OpConstant %uint 4294901760
-         %32 = OpConstantComposite %v3uint %uint_4294901760 %uint_4294901760 %uint_4294901760
+         %35 = OpConstantComposite %v3uint %uint_4294901760 %uint_4294901760 %uint_4294901760
     %uint_16 = OpConstant %uint 16
-         %35 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
+         %38 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
  %uint_65280 = OpConstant %uint 65280
-         %42 = OpConstantComposite %v3uint %uint_65280 %uint_65280 %uint_65280
+         %45 = OpConstantComposite %v3uint %uint_65280 %uint_65280 %uint_65280
      %uint_8 = OpConstant %uint 8
-         %45 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
+         %48 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
    %uint_240 = OpConstant %uint 240
-         %52 = OpConstantComposite %v3uint %uint_240 %uint_240 %uint_240
+         %55 = OpConstantComposite %v3uint %uint_240 %uint_240 %uint_240
      %uint_4 = OpConstant %uint 4
-         %55 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
+         %58 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
     %uint_12 = OpConstant %uint 12
-         %62 = OpConstantComposite %v3uint %uint_12 %uint_12 %uint_12
+         %65 = OpConstantComposite %v3uint %uint_12 %uint_12 %uint_12
      %uint_2 = OpConstant %uint 2
-         %65 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
+         %68 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %73 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %76 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %78 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295
+         %81 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %85 = OpTypeFunction %void
+         %88 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %90 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %93 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %96 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+        %103 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_leading_bit = OpFunction %v3int None %9
+%tint_first_leading_bit = OpFunction %v3int None %14
           %v = OpFunctionParameter %v3int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v3uint Function %27
-         %19 = OpSLessThan %v3bool %v %18
-         %23 = OpNot %v3int %v
-         %22 = OpBitcast %v3uint %23
-         %24 = OpBitcast %v3uint %v
-         %15 = OpSelect %v3uint %19 %22 %24
-               OpStore %x %15
-         %30 = OpLoad %v3uint %x
-         %33 = OpBitwiseAnd %v3uint %30 %32
-         %29 = OpINotEqual %v3bool %33 %27
-         %28 = OpSelect %v3uint %29 %35 %27
-         %36 = OpLoad %v3uint %x
-         %37 = OpShiftRightLogical %v3uint %36 %28
-               OpStore %x %37
-         %40 = OpLoad %v3uint %x
-         %43 = OpBitwiseAnd %v3uint %40 %42
-         %39 = OpINotEqual %v3bool %43 %27
-         %38 = OpSelect %v3uint %39 %45 %27
-         %46 = OpLoad %v3uint %x
-         %47 = OpShiftRightLogical %v3uint %46 %38
-               OpStore %x %47
-         %50 = OpLoad %v3uint %x
-         %53 = OpBitwiseAnd %v3uint %50 %52
-         %49 = OpINotEqual %v3bool %53 %27
-         %48 = OpSelect %v3uint %49 %55 %27
-         %56 = OpLoad %v3uint %x
-         %57 = OpShiftRightLogical %v3uint %56 %48
-               OpStore %x %57
-         %60 = OpLoad %v3uint %x
-         %63 = OpBitwiseAnd %v3uint %60 %62
-         %59 = OpINotEqual %v3bool %63 %27
-         %58 = OpSelect %v3uint %59 %65 %27
-         %66 = OpLoad %v3uint %x
-         %67 = OpShiftRightLogical %v3uint %66 %58
-               OpStore %x %67
-         %70 = OpLoad %v3uint %x
-         %71 = OpBitwiseAnd %v3uint %70 %65
-         %69 = OpINotEqual %v3bool %71 %27
-         %68 = OpSelect %v3uint %69 %73 %27
-         %75 = OpLoad %v3uint %x
-         %76 = OpIEqual %v3bool %75 %27
-         %74 = OpSelect %v3uint %76 %78 %27
-         %80 = OpBitwiseOr %v3uint %28 %38
-         %81 = OpBitwiseOr %v3uint %80 %48
-         %82 = OpBitwiseOr %v3uint %81 %58
-         %83 = OpBitwiseOr %v3uint %82 %68
-         %84 = OpBitwiseOr %v3uint %83 %74
-         %79 = OpBitcast %v3int %84
-               OpReturnValue %79
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v3uint Function %30
+         %22 = OpSLessThan %v3bool %v %21
+         %26 = OpNot %v3int %v
+         %25 = OpBitcast %v3uint %26
+         %27 = OpBitcast %v3uint %v
+         %18 = OpSelect %v3uint %22 %25 %27
+               OpStore %x %18
+         %33 = OpLoad %v3uint %x
+         %36 = OpBitwiseAnd %v3uint %33 %35
+         %32 = OpINotEqual %v3bool %36 %30
+         %31 = OpSelect %v3uint %32 %38 %30
+         %39 = OpLoad %v3uint %x
+         %40 = OpShiftRightLogical %v3uint %39 %31
+               OpStore %x %40
+         %43 = OpLoad %v3uint %x
+         %46 = OpBitwiseAnd %v3uint %43 %45
+         %42 = OpINotEqual %v3bool %46 %30
+         %41 = OpSelect %v3uint %42 %48 %30
+         %49 = OpLoad %v3uint %x
+         %50 = OpShiftRightLogical %v3uint %49 %41
+               OpStore %x %50
+         %53 = OpLoad %v3uint %x
+         %56 = OpBitwiseAnd %v3uint %53 %55
+         %52 = OpINotEqual %v3bool %56 %30
+         %51 = OpSelect %v3uint %52 %58 %30
+         %59 = OpLoad %v3uint %x
+         %60 = OpShiftRightLogical %v3uint %59 %51
+               OpStore %x %60
+         %63 = OpLoad %v3uint %x
+         %66 = OpBitwiseAnd %v3uint %63 %65
+         %62 = OpINotEqual %v3bool %66 %30
+         %61 = OpSelect %v3uint %62 %68 %30
+         %69 = OpLoad %v3uint %x
+         %70 = OpShiftRightLogical %v3uint %69 %61
+               OpStore %x %70
+         %73 = OpLoad %v3uint %x
+         %74 = OpBitwiseAnd %v3uint %73 %68
+         %72 = OpINotEqual %v3bool %74 %30
+         %71 = OpSelect %v3uint %72 %76 %30
+         %78 = OpLoad %v3uint %x
+         %79 = OpIEqual %v3bool %78 %30
+         %77 = OpSelect %v3uint %79 %81 %30
+         %83 = OpBitwiseOr %v3uint %31 %41
+         %84 = OpBitwiseOr %v3uint %83 %51
+         %85 = OpBitwiseOr %v3uint %84 %61
+         %86 = OpBitwiseOr %v3uint %85 %71
+         %87 = OpBitwiseOr %v3uint %86 %77
+         %82 = OpBitcast %v3int %87
+               OpReturnValue %82
                OpFunctionEnd
-%firstLeadingBit_35053e = OpFunction %void None %85
-         %88 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %18
-        %res = OpVariable %_ptr_Function_v3int Function %18
-               OpStore %arg_0 %90
-         %94 = OpLoad %v3int %arg_0
-         %93 = OpFunctionCall %v3int %tint_first_leading_bit %94
-               OpStore %res %93
+%firstLeadingBit_35053e = OpFunction %void None %88
+         %91 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %21
+        %res = OpVariable %_ptr_Function_v3int Function %21
+               OpStore %arg_0 %93
+         %97 = OpLoad %v3int %arg_0
+         %96 = OpFunctionCall %v3int %tint_first_leading_bit %97
+               OpStore %res %96
+        %101 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+        %102 = OpLoad %v3int %res
+               OpStore %101 %102
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %96
-         %98 = OpLabel
-         %99 = OpFunctionCall %void %firstLeadingBit_35053e
+%vertex_main_inner = OpFunction %v4float None %103
+        %105 = OpLabel
+        %106 = OpFunctionCall %void %firstLeadingBit_35053e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %85
-        %101 = OpLabel
-        %102 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %102
+%vertex_main = OpFunction %void None %88
+        %108 = OpLabel
+        %109 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %109
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %85
-        %105 = OpLabel
-        %106 = OpFunctionCall %void %firstLeadingBit_35053e
+%fragment_main = OpFunction %void None %88
+        %112 = OpLabel
+        %113 = OpFunctionCall %void %firstLeadingBit_35053e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %85
-        %108 = OpLabel
-        %109 = OpFunctionCall %void %firstLeadingBit_35053e
+%compute_main = OpFunction %void None %88
+        %115 = OpLabel
+        %116 = OpFunctionCall %void %firstLeadingBit_35053e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.wgsl
index cbc60cf..69d5057 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/35053e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstLeadingBit_35053e() {
   var arg_0 = vec3<i32>(1i);
   var res : vec3<i32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_35053e();
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl
index 7a81f1b..1249a4a 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl
@@ -25,7 +25,9 @@
 fn firstLeadingBit_3fd7d0() {
   var arg_0 = vec3<u32>(1u);
   var res: vec3<u32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.dxc.hlsl
index f782560..33cbb76 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_3fd7d0() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.fxc.hlsl
index f782560..33cbb76 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_3fd7d0() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.glsl
index a1f7c6f..d2240c7 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_3fd7d0() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_3fd7d0() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstLeadingBit_3fd7d0() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.msl b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.msl
index 2a6a836..02ec93c 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstLeadingBit_3fd7d0() {
+void firstLeadingBit_3fd7d0(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 res = tint_first_leading_bit(arg_0);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_3fd7d0();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  firstLeadingBit_3fd7d0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_3fd7d0();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_3fd7d0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_3fd7d0();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_3fd7d0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.spvasm
index 43a1b12..9d02076 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 99
+; Bound: 106
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_leading_bit "tint_first_leading_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,111 +41,119 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-          %9 = OpTypeFunction %v3uint %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3uint %v3uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %17 = OpConstantNull %v3uint
+         %20 = OpConstantNull %v3uint
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
 %uint_4294901760 = OpConstant %uint 4294901760
-         %24 = OpConstantComposite %v3uint %uint_4294901760 %uint_4294901760 %uint_4294901760
+         %27 = OpConstantComposite %v3uint %uint_4294901760 %uint_4294901760 %uint_4294901760
     %uint_16 = OpConstant %uint 16
-         %27 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
+         %30 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
  %uint_65280 = OpConstant %uint 65280
-         %34 = OpConstantComposite %v3uint %uint_65280 %uint_65280 %uint_65280
+         %37 = OpConstantComposite %v3uint %uint_65280 %uint_65280 %uint_65280
      %uint_8 = OpConstant %uint 8
-         %37 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
+         %40 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
    %uint_240 = OpConstant %uint 240
-         %44 = OpConstantComposite %v3uint %uint_240 %uint_240 %uint_240
+         %47 = OpConstantComposite %v3uint %uint_240 %uint_240 %uint_240
      %uint_4 = OpConstant %uint 4
-         %47 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
+         %50 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
     %uint_12 = OpConstant %uint 12
-         %54 = OpConstantComposite %v3uint %uint_12 %uint_12 %uint_12
+         %57 = OpConstantComposite %v3uint %uint_12 %uint_12 %uint_12
      %uint_2 = OpConstant %uint 2
-         %57 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
+         %60 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %68 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %70 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295
+         %73 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %77 = OpTypeFunction %void
-         %85 = OpTypeFunction %v4float
+         %80 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %92 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_leading_bit = OpFunction %v3uint None %9
+%tint_first_leading_bit = OpFunction %v3uint None %14
           %v = OpFunctionParameter %v3uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v3uint Function %17
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v3uint Function %20
                OpStore %x %v
-         %22 = OpLoad %v3uint %x
-         %25 = OpBitwiseAnd %v3uint %22 %24
-         %19 = OpINotEqual %v3bool %25 %17
-         %18 = OpSelect %v3uint %19 %27 %17
-         %28 = OpLoad %v3uint %x
-         %29 = OpShiftRightLogical %v3uint %28 %18
-               OpStore %x %29
-         %32 = OpLoad %v3uint %x
-         %35 = OpBitwiseAnd %v3uint %32 %34
-         %31 = OpINotEqual %v3bool %35 %17
-         %30 = OpSelect %v3uint %31 %37 %17
-         %38 = OpLoad %v3uint %x
-         %39 = OpShiftRightLogical %v3uint %38 %30
-               OpStore %x %39
-         %42 = OpLoad %v3uint %x
-         %45 = OpBitwiseAnd %v3uint %42 %44
-         %41 = OpINotEqual %v3bool %45 %17
-         %40 = OpSelect %v3uint %41 %47 %17
-         %48 = OpLoad %v3uint %x
-         %49 = OpShiftRightLogical %v3uint %48 %40
-               OpStore %x %49
-         %52 = OpLoad %v3uint %x
-         %55 = OpBitwiseAnd %v3uint %52 %54
-         %51 = OpINotEqual %v3bool %55 %17
-         %50 = OpSelect %v3uint %51 %57 %17
-         %58 = OpLoad %v3uint %x
-         %59 = OpShiftRightLogical %v3uint %58 %50
-               OpStore %x %59
-         %62 = OpLoad %v3uint %x
-         %63 = OpBitwiseAnd %v3uint %62 %57
-         %61 = OpINotEqual %v3bool %63 %17
-         %60 = OpSelect %v3uint %61 %65 %17
-         %67 = OpLoad %v3uint %x
-         %68 = OpIEqual %v3bool %67 %17
-         %66 = OpSelect %v3uint %68 %70 %17
-         %72 = OpBitwiseOr %v3uint %18 %30
-         %73 = OpBitwiseOr %v3uint %72 %40
-         %74 = OpBitwiseOr %v3uint %73 %50
-         %75 = OpBitwiseOr %v3uint %74 %60
-         %76 = OpBitwiseOr %v3uint %75 %66
-               OpReturnValue %76
+         %25 = OpLoad %v3uint %x
+         %28 = OpBitwiseAnd %v3uint %25 %27
+         %22 = OpINotEqual %v3bool %28 %20
+         %21 = OpSelect %v3uint %22 %30 %20
+         %31 = OpLoad %v3uint %x
+         %32 = OpShiftRightLogical %v3uint %31 %21
+               OpStore %x %32
+         %35 = OpLoad %v3uint %x
+         %38 = OpBitwiseAnd %v3uint %35 %37
+         %34 = OpINotEqual %v3bool %38 %20
+         %33 = OpSelect %v3uint %34 %40 %20
+         %41 = OpLoad %v3uint %x
+         %42 = OpShiftRightLogical %v3uint %41 %33
+               OpStore %x %42
+         %45 = OpLoad %v3uint %x
+         %48 = OpBitwiseAnd %v3uint %45 %47
+         %44 = OpINotEqual %v3bool %48 %20
+         %43 = OpSelect %v3uint %44 %50 %20
+         %51 = OpLoad %v3uint %x
+         %52 = OpShiftRightLogical %v3uint %51 %43
+               OpStore %x %52
+         %55 = OpLoad %v3uint %x
+         %58 = OpBitwiseAnd %v3uint %55 %57
+         %54 = OpINotEqual %v3bool %58 %20
+         %53 = OpSelect %v3uint %54 %60 %20
+         %61 = OpLoad %v3uint %x
+         %62 = OpShiftRightLogical %v3uint %61 %53
+               OpStore %x %62
+         %65 = OpLoad %v3uint %x
+         %66 = OpBitwiseAnd %v3uint %65 %60
+         %64 = OpINotEqual %v3bool %66 %20
+         %63 = OpSelect %v3uint %64 %68 %20
+         %70 = OpLoad %v3uint %x
+         %71 = OpIEqual %v3bool %70 %20
+         %69 = OpSelect %v3uint %71 %73 %20
+         %75 = OpBitwiseOr %v3uint %21 %33
+         %76 = OpBitwiseOr %v3uint %75 %43
+         %77 = OpBitwiseOr %v3uint %76 %53
+         %78 = OpBitwiseOr %v3uint %77 %63
+         %79 = OpBitwiseOr %v3uint %78 %69
+               OpReturnValue %79
                OpFunctionEnd
-%firstLeadingBit_3fd7d0 = OpFunction %void None %77
-         %80 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %17
-        %res = OpVariable %_ptr_Function_v3uint Function %17
-               OpStore %arg_0 %65
-         %83 = OpLoad %v3uint %arg_0
-         %82 = OpFunctionCall %v3uint %tint_first_leading_bit %83
-               OpStore %res %82
+%firstLeadingBit_3fd7d0 = OpFunction %void None %80
+         %83 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %20
+        %res = OpVariable %_ptr_Function_v3uint Function %20
+               OpStore %arg_0 %68
+         %86 = OpLoad %v3uint %arg_0
+         %85 = OpFunctionCall %v3uint %tint_first_leading_bit %86
+               OpStore %res %85
+         %90 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %91 = OpLoad %v3uint %res
+               OpStore %90 %91
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %85
-         %87 = OpLabel
-         %88 = OpFunctionCall %void %firstLeadingBit_3fd7d0
+%vertex_main_inner = OpFunction %v4float None %92
+         %94 = OpLabel
+         %95 = OpFunctionCall %void %firstLeadingBit_3fd7d0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %77
-         %90 = OpLabel
-         %91 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %91
+%vertex_main = OpFunction %void None %80
+         %97 = OpLabel
+         %98 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %98
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %77
-         %94 = OpLabel
-         %95 = OpFunctionCall %void %firstLeadingBit_3fd7d0
+%fragment_main = OpFunction %void None %80
+        %101 = OpLabel
+        %102 = OpFunctionCall %void %firstLeadingBit_3fd7d0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %77
-         %97 = OpLabel
-         %98 = OpFunctionCall %void %firstLeadingBit_3fd7d0
+%compute_main = OpFunction %void None %80
+        %104 = OpLabel
+        %105 = OpFunctionCall %void %firstLeadingBit_3fd7d0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.wgsl
index 9bf8154..b07912c 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/3fd7d0.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstLeadingBit_3fd7d0() {
   var arg_0 = vec3<u32>(1u);
   var res : vec3<u32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_3fd7d0();
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl
index ec54a30..69ade17 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl
@@ -25,7 +25,9 @@
 fn firstLeadingBit_57a1a3() {
   var arg_0 = 1i;
   var res: i32 = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.dxc.hlsl
index 34f27f0..a73633c 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_57a1a3() {
   int arg_0 = 1;
   int res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.fxc.hlsl
index 34f27f0..a73633c 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_57a1a3() {
   int arg_0 = 1;
   int res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.glsl
index 5a738fc..8ae1bd1 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstLeadingBit_57a1a3() {
   int arg_0 = 1;
   int res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstLeadingBit_57a1a3() {
   int arg_0 = 1;
   int res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstLeadingBit_57a1a3() {
   int arg_0 = 1;
   int res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.msl b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.msl
index cb6e84d..79743af 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstLeadingBit_57a1a3() {
+void firstLeadingBit_57a1a3(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int res = tint_first_leading_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_57a1a3();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  firstLeadingBit_57a1a3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_57a1a3();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_57a1a3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_57a1a3();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_57a1a3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.spvasm
index 8f38eac..f890bb0 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 96
+; Bound: 103
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_leading_bit "tint_first_leading_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,12 +40,15 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
-          %9 = OpTypeFunction %int %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %int %int
        %uint = OpTypeInt 32 0
-         %16 = OpConstantNull %int
+         %19 = OpConstantNull %int
        %bool = OpTypeBool
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
+         %27 = OpConstantNull %uint
 %uint_4294901760 = OpConstant %uint 4294901760
     %uint_16 = OpConstant %uint 16
  %uint_65280 = OpConstant %uint 65280
@@ -50,93 +60,98 @@
      %uint_1 = OpConstant %uint 1
 %uint_4294967295 = OpConstant %uint 4294967295
        %void = OpTypeVoid
-         %72 = OpTypeFunction %void
+         %75 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %82 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %89 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_leading_bit = OpFunction %int None %9
+%tint_first_leading_bit = OpFunction %int None %13
           %v = OpFunctionParameter %int
-         %13 = OpLabel
-          %x = OpVariable %_ptr_Function_uint Function %24
-         %17 = OpSLessThan %bool %v %16
-         %20 = OpNot %int %v
-         %19 = OpBitcast %uint %20
-         %21 = OpBitcast %uint %v
-         %14 = OpSelect %uint %17 %19 %21
-               OpStore %x %14
-         %27 = OpLoad %uint %x
-         %29 = OpBitwiseAnd %uint %27 %uint_4294901760
-         %26 = OpINotEqual %bool %29 %24
-         %25 = OpSelect %uint %26 %uint_16 %24
-         %31 = OpLoad %uint %x
-         %32 = OpShiftRightLogical %uint %31 %25
-               OpStore %x %32
-         %35 = OpLoad %uint %x
-         %37 = OpBitwiseAnd %uint %35 %uint_65280
-         %34 = OpINotEqual %bool %37 %24
-         %33 = OpSelect %uint %34 %uint_8 %24
-         %39 = OpLoad %uint %x
-         %40 = OpShiftRightLogical %uint %39 %33
-               OpStore %x %40
-         %43 = OpLoad %uint %x
-         %45 = OpBitwiseAnd %uint %43 %uint_240
-         %42 = OpINotEqual %bool %45 %24
-         %41 = OpSelect %uint %42 %uint_4 %24
-         %47 = OpLoad %uint %x
-         %48 = OpShiftRightLogical %uint %47 %41
-               OpStore %x %48
-         %51 = OpLoad %uint %x
-         %53 = OpBitwiseAnd %uint %51 %uint_12
-         %50 = OpINotEqual %bool %53 %24
-         %49 = OpSelect %uint %50 %uint_2 %24
-         %55 = OpLoad %uint %x
-         %56 = OpShiftRightLogical %uint %55 %49
-               OpStore %x %56
-         %59 = OpLoad %uint %x
-         %60 = OpBitwiseAnd %uint %59 %uint_2
-         %58 = OpINotEqual %bool %60 %24
-         %57 = OpSelect %uint %58 %uint_1 %24
-         %63 = OpLoad %uint %x
-         %64 = OpIEqual %bool %63 %24
-         %62 = OpSelect %uint %64 %uint_4294967295 %24
-         %67 = OpBitwiseOr %uint %25 %33
-         %68 = OpBitwiseOr %uint %67 %41
-         %69 = OpBitwiseOr %uint %68 %49
-         %70 = OpBitwiseOr %uint %69 %57
-         %71 = OpBitwiseOr %uint %70 %62
-         %66 = OpBitcast %int %71
-               OpReturnValue %66
+         %16 = OpLabel
+          %x = OpVariable %_ptr_Function_uint Function %27
+         %20 = OpSLessThan %bool %v %19
+         %23 = OpNot %int %v
+         %22 = OpBitcast %uint %23
+         %24 = OpBitcast %uint %v
+         %17 = OpSelect %uint %20 %22 %24
+               OpStore %x %17
+         %30 = OpLoad %uint %x
+         %32 = OpBitwiseAnd %uint %30 %uint_4294901760
+         %29 = OpINotEqual %bool %32 %27
+         %28 = OpSelect %uint %29 %uint_16 %27
+         %34 = OpLoad %uint %x
+         %35 = OpShiftRightLogical %uint %34 %28
+               OpStore %x %35
+         %38 = OpLoad %uint %x
+         %40 = OpBitwiseAnd %uint %38 %uint_65280
+         %37 = OpINotEqual %bool %40 %27
+         %36 = OpSelect %uint %37 %uint_8 %27
+         %42 = OpLoad %uint %x
+         %43 = OpShiftRightLogical %uint %42 %36
+               OpStore %x %43
+         %46 = OpLoad %uint %x
+         %48 = OpBitwiseAnd %uint %46 %uint_240
+         %45 = OpINotEqual %bool %48 %27
+         %44 = OpSelect %uint %45 %uint_4 %27
+         %50 = OpLoad %uint %x
+         %51 = OpShiftRightLogical %uint %50 %44
+               OpStore %x %51
+         %54 = OpLoad %uint %x
+         %56 = OpBitwiseAnd %uint %54 %uint_12
+         %53 = OpINotEqual %bool %56 %27
+         %52 = OpSelect %uint %53 %uint_2 %27
+         %58 = OpLoad %uint %x
+         %59 = OpShiftRightLogical %uint %58 %52
+               OpStore %x %59
+         %62 = OpLoad %uint %x
+         %63 = OpBitwiseAnd %uint %62 %uint_2
+         %61 = OpINotEqual %bool %63 %27
+         %60 = OpSelect %uint %61 %uint_1 %27
+         %66 = OpLoad %uint %x
+         %67 = OpIEqual %bool %66 %27
+         %65 = OpSelect %uint %67 %uint_4294967295 %27
+         %70 = OpBitwiseOr %uint %28 %36
+         %71 = OpBitwiseOr %uint %70 %44
+         %72 = OpBitwiseOr %uint %71 %52
+         %73 = OpBitwiseOr %uint %72 %60
+         %74 = OpBitwiseOr %uint %73 %65
+         %69 = OpBitcast %int %74
+               OpReturnValue %69
                OpFunctionEnd
-%firstLeadingBit_57a1a3 = OpFunction %void None %72
-         %75 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %16
-        %res = OpVariable %_ptr_Function_int Function %16
+%firstLeadingBit_57a1a3 = OpFunction %void None %75
+         %78 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %19
+        %res = OpVariable %_ptr_Function_int Function %19
                OpStore %arg_0 %int_1
-         %80 = OpLoad %int %arg_0
-         %79 = OpFunctionCall %int %tint_first_leading_bit %80
-               OpStore %res %79
+         %83 = OpLoad %int %arg_0
+         %82 = OpFunctionCall %int %tint_first_leading_bit %83
+               OpStore %res %82
+         %87 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %88 = OpLoad %int %res
+               OpStore %87 %88
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %82
-         %84 = OpLabel
-         %85 = OpFunctionCall %void %firstLeadingBit_57a1a3
+%vertex_main_inner = OpFunction %v4float None %89
+         %91 = OpLabel
+         %92 = OpFunctionCall %void %firstLeadingBit_57a1a3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %72
-         %87 = OpLabel
-         %88 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %88
+%vertex_main = OpFunction %void None %75
+         %94 = OpLabel
+         %95 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %95
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %72
-         %91 = OpLabel
-         %92 = OpFunctionCall %void %firstLeadingBit_57a1a3
+%fragment_main = OpFunction %void None %75
+         %98 = OpLabel
+         %99 = OpFunctionCall %void %firstLeadingBit_57a1a3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %72
-         %94 = OpLabel
-         %95 = OpFunctionCall %void %firstLeadingBit_57a1a3
+%compute_main = OpFunction %void None %75
+        %101 = OpLabel
+        %102 = OpFunctionCall %void %firstLeadingBit_57a1a3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.wgsl
index afc19e9..ba7698c 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/57a1a3.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstLeadingBit_57a1a3() {
   var arg_0 = 1i;
   var res : i32 = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_57a1a3();
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl
index 72c6c5f..c10d39b 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl
@@ -25,7 +25,9 @@
 fn firstLeadingBit_6fe804() {
   var arg_0 = vec2<u32>(1u);
   var res: vec2<u32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.dxc.hlsl
index 451630e..ec445c9 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_6fe804() {
   uint2 arg_0 = (1u).xx;
   uint2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.fxc.hlsl
index 451630e..ec445c9 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_6fe804() {
   uint2 arg_0 = (1u).xx;
   uint2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.glsl
index b45183b..21961cb 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_6fe804() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_6fe804() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_6fe804() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.msl b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.msl
index d81e180..1b4c2cf 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstLeadingBit_6fe804() {
+void firstLeadingBit_6fe804(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 res = tint_first_leading_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_6fe804();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  firstLeadingBit_6fe804(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_6fe804();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_6fe804(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_6fe804();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_6fe804(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.spvasm
index 2a85a2b..b1d3c65 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 99
+; Bound: 106
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_leading_bit "tint_first_leading_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,111 +41,119 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-          %9 = OpTypeFunction %v2uint %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2uint %v2uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %17 = OpConstantNull %v2uint
+         %20 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
 %uint_4294901760 = OpConstant %uint 4294901760
-         %24 = OpConstantComposite %v2uint %uint_4294901760 %uint_4294901760
+         %27 = OpConstantComposite %v2uint %uint_4294901760 %uint_4294901760
     %uint_16 = OpConstant %uint 16
-         %27 = OpConstantComposite %v2uint %uint_16 %uint_16
+         %30 = OpConstantComposite %v2uint %uint_16 %uint_16
  %uint_65280 = OpConstant %uint 65280
-         %34 = OpConstantComposite %v2uint %uint_65280 %uint_65280
+         %37 = OpConstantComposite %v2uint %uint_65280 %uint_65280
      %uint_8 = OpConstant %uint 8
-         %37 = OpConstantComposite %v2uint %uint_8 %uint_8
+         %40 = OpConstantComposite %v2uint %uint_8 %uint_8
    %uint_240 = OpConstant %uint 240
-         %44 = OpConstantComposite %v2uint %uint_240 %uint_240
+         %47 = OpConstantComposite %v2uint %uint_240 %uint_240
      %uint_4 = OpConstant %uint 4
-         %47 = OpConstantComposite %v2uint %uint_4 %uint_4
+         %50 = OpConstantComposite %v2uint %uint_4 %uint_4
     %uint_12 = OpConstant %uint 12
-         %54 = OpConstantComposite %v2uint %uint_12 %uint_12
+         %57 = OpConstantComposite %v2uint %uint_12 %uint_12
      %uint_2 = OpConstant %uint 2
-         %57 = OpConstantComposite %v2uint %uint_2 %uint_2
+         %60 = OpConstantComposite %v2uint %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %68 = OpConstantComposite %v2uint %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %70 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %73 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %77 = OpTypeFunction %void
-         %85 = OpTypeFunction %v4float
+         %80 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %92 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_leading_bit = OpFunction %v2uint None %9
+%tint_first_leading_bit = OpFunction %v2uint None %14
           %v = OpFunctionParameter %v2uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v2uint Function %17
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v2uint Function %20
                OpStore %x %v
-         %22 = OpLoad %v2uint %x
-         %25 = OpBitwiseAnd %v2uint %22 %24
-         %19 = OpINotEqual %v2bool %25 %17
-         %18 = OpSelect %v2uint %19 %27 %17
-         %28 = OpLoad %v2uint %x
-         %29 = OpShiftRightLogical %v2uint %28 %18
-               OpStore %x %29
-         %32 = OpLoad %v2uint %x
-         %35 = OpBitwiseAnd %v2uint %32 %34
-         %31 = OpINotEqual %v2bool %35 %17
-         %30 = OpSelect %v2uint %31 %37 %17
-         %38 = OpLoad %v2uint %x
-         %39 = OpShiftRightLogical %v2uint %38 %30
-               OpStore %x %39
-         %42 = OpLoad %v2uint %x
-         %45 = OpBitwiseAnd %v2uint %42 %44
-         %41 = OpINotEqual %v2bool %45 %17
-         %40 = OpSelect %v2uint %41 %47 %17
-         %48 = OpLoad %v2uint %x
-         %49 = OpShiftRightLogical %v2uint %48 %40
-               OpStore %x %49
-         %52 = OpLoad %v2uint %x
-         %55 = OpBitwiseAnd %v2uint %52 %54
-         %51 = OpINotEqual %v2bool %55 %17
-         %50 = OpSelect %v2uint %51 %57 %17
-         %58 = OpLoad %v2uint %x
-         %59 = OpShiftRightLogical %v2uint %58 %50
-               OpStore %x %59
-         %62 = OpLoad %v2uint %x
-         %63 = OpBitwiseAnd %v2uint %62 %57
-         %61 = OpINotEqual %v2bool %63 %17
-         %60 = OpSelect %v2uint %61 %65 %17
-         %67 = OpLoad %v2uint %x
-         %68 = OpIEqual %v2bool %67 %17
-         %66 = OpSelect %v2uint %68 %70 %17
-         %72 = OpBitwiseOr %v2uint %18 %30
-         %73 = OpBitwiseOr %v2uint %72 %40
-         %74 = OpBitwiseOr %v2uint %73 %50
-         %75 = OpBitwiseOr %v2uint %74 %60
-         %76 = OpBitwiseOr %v2uint %75 %66
-               OpReturnValue %76
+         %25 = OpLoad %v2uint %x
+         %28 = OpBitwiseAnd %v2uint %25 %27
+         %22 = OpINotEqual %v2bool %28 %20
+         %21 = OpSelect %v2uint %22 %30 %20
+         %31 = OpLoad %v2uint %x
+         %32 = OpShiftRightLogical %v2uint %31 %21
+               OpStore %x %32
+         %35 = OpLoad %v2uint %x
+         %38 = OpBitwiseAnd %v2uint %35 %37
+         %34 = OpINotEqual %v2bool %38 %20
+         %33 = OpSelect %v2uint %34 %40 %20
+         %41 = OpLoad %v2uint %x
+         %42 = OpShiftRightLogical %v2uint %41 %33
+               OpStore %x %42
+         %45 = OpLoad %v2uint %x
+         %48 = OpBitwiseAnd %v2uint %45 %47
+         %44 = OpINotEqual %v2bool %48 %20
+         %43 = OpSelect %v2uint %44 %50 %20
+         %51 = OpLoad %v2uint %x
+         %52 = OpShiftRightLogical %v2uint %51 %43
+               OpStore %x %52
+         %55 = OpLoad %v2uint %x
+         %58 = OpBitwiseAnd %v2uint %55 %57
+         %54 = OpINotEqual %v2bool %58 %20
+         %53 = OpSelect %v2uint %54 %60 %20
+         %61 = OpLoad %v2uint %x
+         %62 = OpShiftRightLogical %v2uint %61 %53
+               OpStore %x %62
+         %65 = OpLoad %v2uint %x
+         %66 = OpBitwiseAnd %v2uint %65 %60
+         %64 = OpINotEqual %v2bool %66 %20
+         %63 = OpSelect %v2uint %64 %68 %20
+         %70 = OpLoad %v2uint %x
+         %71 = OpIEqual %v2bool %70 %20
+         %69 = OpSelect %v2uint %71 %73 %20
+         %75 = OpBitwiseOr %v2uint %21 %33
+         %76 = OpBitwiseOr %v2uint %75 %43
+         %77 = OpBitwiseOr %v2uint %76 %53
+         %78 = OpBitwiseOr %v2uint %77 %63
+         %79 = OpBitwiseOr %v2uint %78 %69
+               OpReturnValue %79
                OpFunctionEnd
-%firstLeadingBit_6fe804 = OpFunction %void None %77
-         %80 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %17
-        %res = OpVariable %_ptr_Function_v2uint Function %17
-               OpStore %arg_0 %65
-         %83 = OpLoad %v2uint %arg_0
-         %82 = OpFunctionCall %v2uint %tint_first_leading_bit %83
-               OpStore %res %82
+%firstLeadingBit_6fe804 = OpFunction %void None %80
+         %83 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %20
+        %res = OpVariable %_ptr_Function_v2uint Function %20
+               OpStore %arg_0 %68
+         %86 = OpLoad %v2uint %arg_0
+         %85 = OpFunctionCall %v2uint %tint_first_leading_bit %86
+               OpStore %res %85
+         %90 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %91 = OpLoad %v2uint %res
+               OpStore %90 %91
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %85
-         %87 = OpLabel
-         %88 = OpFunctionCall %void %firstLeadingBit_6fe804
+%vertex_main_inner = OpFunction %v4float None %92
+         %94 = OpLabel
+         %95 = OpFunctionCall %void %firstLeadingBit_6fe804
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %77
-         %90 = OpLabel
-         %91 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %91
+%vertex_main = OpFunction %void None %80
+         %97 = OpLabel
+         %98 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %98
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %77
-         %94 = OpLabel
-         %95 = OpFunctionCall %void %firstLeadingBit_6fe804
+%fragment_main = OpFunction %void None %80
+        %101 = OpLabel
+        %102 = OpFunctionCall %void %firstLeadingBit_6fe804
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %77
-         %97 = OpLabel
-         %98 = OpFunctionCall %void %firstLeadingBit_6fe804
+%compute_main = OpFunction %void None %80
+        %104 = OpLabel
+        %105 = OpFunctionCall %void %firstLeadingBit_6fe804
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.wgsl
index 8ae1f87..4185a21 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/6fe804.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstLeadingBit_6fe804() {
   var arg_0 = vec2<u32>(1u);
   var res : vec2<u32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_6fe804();
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl
index 5bad165..7a56d65 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl
@@ -25,7 +25,9 @@
 fn firstLeadingBit_a622c2() {
   var arg_0 = vec2<i32>(1i);
   var res: vec2<i32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.dxc.hlsl
index 25765f1..bf4b353 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_a622c2() {
   int2 arg_0 = (1).xx;
   int2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.fxc.hlsl
index 25765f1..bf4b353 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_a622c2() {
   int2 arg_0 = (1).xx;
   int2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.glsl
index b893de3..ec78a1e 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_a622c2() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_a622c2() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstLeadingBit_a622c2() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.msl b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.msl
index 321198c..2e2e548 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstLeadingBit_a622c2() {
+void firstLeadingBit_a622c2(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 res = tint_first_leading_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_a622c2();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  firstLeadingBit_a622c2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_a622c2();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_a622c2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_a622c2();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_a622c2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.spvasm
index 908ce65..eaeef72 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 110
+; Bound: 117
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_leading_bit "tint_first_leading_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,123 +41,131 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-          %9 = OpTypeFunction %v2int %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2int %v2int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-         %18 = OpConstantNull %v2int
+         %21 = OpConstantNull %v2int
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %27 = OpConstantNull %v2uint
+         %30 = OpConstantNull %v2uint
 %uint_4294901760 = OpConstant %uint 4294901760
-         %32 = OpConstantComposite %v2uint %uint_4294901760 %uint_4294901760
+         %35 = OpConstantComposite %v2uint %uint_4294901760 %uint_4294901760
     %uint_16 = OpConstant %uint 16
-         %35 = OpConstantComposite %v2uint %uint_16 %uint_16
+         %38 = OpConstantComposite %v2uint %uint_16 %uint_16
  %uint_65280 = OpConstant %uint 65280
-         %42 = OpConstantComposite %v2uint %uint_65280 %uint_65280
+         %45 = OpConstantComposite %v2uint %uint_65280 %uint_65280
      %uint_8 = OpConstant %uint 8
-         %45 = OpConstantComposite %v2uint %uint_8 %uint_8
+         %48 = OpConstantComposite %v2uint %uint_8 %uint_8
    %uint_240 = OpConstant %uint 240
-         %52 = OpConstantComposite %v2uint %uint_240 %uint_240
+         %55 = OpConstantComposite %v2uint %uint_240 %uint_240
      %uint_4 = OpConstant %uint 4
-         %55 = OpConstantComposite %v2uint %uint_4 %uint_4
+         %58 = OpConstantComposite %v2uint %uint_4 %uint_4
     %uint_12 = OpConstant %uint 12
-         %62 = OpConstantComposite %v2uint %uint_12 %uint_12
+         %65 = OpConstantComposite %v2uint %uint_12 %uint_12
      %uint_2 = OpConstant %uint 2
-         %65 = OpConstantComposite %v2uint %uint_2 %uint_2
+         %68 = OpConstantComposite %v2uint %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %73 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %76 = OpConstantComposite %v2uint %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %78 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %81 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %85 = OpTypeFunction %void
+         %88 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %90 = OpConstantComposite %v2int %int_1 %int_1
+         %93 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %96 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+        %103 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_leading_bit = OpFunction %v2int None %9
+%tint_first_leading_bit = OpFunction %v2int None %14
           %v = OpFunctionParameter %v2int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v2uint Function %27
-         %19 = OpSLessThan %v2bool %v %18
-         %23 = OpNot %v2int %v
-         %22 = OpBitcast %v2uint %23
-         %24 = OpBitcast %v2uint %v
-         %15 = OpSelect %v2uint %19 %22 %24
-               OpStore %x %15
-         %30 = OpLoad %v2uint %x
-         %33 = OpBitwiseAnd %v2uint %30 %32
-         %29 = OpINotEqual %v2bool %33 %27
-         %28 = OpSelect %v2uint %29 %35 %27
-         %36 = OpLoad %v2uint %x
-         %37 = OpShiftRightLogical %v2uint %36 %28
-               OpStore %x %37
-         %40 = OpLoad %v2uint %x
-         %43 = OpBitwiseAnd %v2uint %40 %42
-         %39 = OpINotEqual %v2bool %43 %27
-         %38 = OpSelect %v2uint %39 %45 %27
-         %46 = OpLoad %v2uint %x
-         %47 = OpShiftRightLogical %v2uint %46 %38
-               OpStore %x %47
-         %50 = OpLoad %v2uint %x
-         %53 = OpBitwiseAnd %v2uint %50 %52
-         %49 = OpINotEqual %v2bool %53 %27
-         %48 = OpSelect %v2uint %49 %55 %27
-         %56 = OpLoad %v2uint %x
-         %57 = OpShiftRightLogical %v2uint %56 %48
-               OpStore %x %57
-         %60 = OpLoad %v2uint %x
-         %63 = OpBitwiseAnd %v2uint %60 %62
-         %59 = OpINotEqual %v2bool %63 %27
-         %58 = OpSelect %v2uint %59 %65 %27
-         %66 = OpLoad %v2uint %x
-         %67 = OpShiftRightLogical %v2uint %66 %58
-               OpStore %x %67
-         %70 = OpLoad %v2uint %x
-         %71 = OpBitwiseAnd %v2uint %70 %65
-         %69 = OpINotEqual %v2bool %71 %27
-         %68 = OpSelect %v2uint %69 %73 %27
-         %75 = OpLoad %v2uint %x
-         %76 = OpIEqual %v2bool %75 %27
-         %74 = OpSelect %v2uint %76 %78 %27
-         %80 = OpBitwiseOr %v2uint %28 %38
-         %81 = OpBitwiseOr %v2uint %80 %48
-         %82 = OpBitwiseOr %v2uint %81 %58
-         %83 = OpBitwiseOr %v2uint %82 %68
-         %84 = OpBitwiseOr %v2uint %83 %74
-         %79 = OpBitcast %v2int %84
-               OpReturnValue %79
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v2uint Function %30
+         %22 = OpSLessThan %v2bool %v %21
+         %26 = OpNot %v2int %v
+         %25 = OpBitcast %v2uint %26
+         %27 = OpBitcast %v2uint %v
+         %18 = OpSelect %v2uint %22 %25 %27
+               OpStore %x %18
+         %33 = OpLoad %v2uint %x
+         %36 = OpBitwiseAnd %v2uint %33 %35
+         %32 = OpINotEqual %v2bool %36 %30
+         %31 = OpSelect %v2uint %32 %38 %30
+         %39 = OpLoad %v2uint %x
+         %40 = OpShiftRightLogical %v2uint %39 %31
+               OpStore %x %40
+         %43 = OpLoad %v2uint %x
+         %46 = OpBitwiseAnd %v2uint %43 %45
+         %42 = OpINotEqual %v2bool %46 %30
+         %41 = OpSelect %v2uint %42 %48 %30
+         %49 = OpLoad %v2uint %x
+         %50 = OpShiftRightLogical %v2uint %49 %41
+               OpStore %x %50
+         %53 = OpLoad %v2uint %x
+         %56 = OpBitwiseAnd %v2uint %53 %55
+         %52 = OpINotEqual %v2bool %56 %30
+         %51 = OpSelect %v2uint %52 %58 %30
+         %59 = OpLoad %v2uint %x
+         %60 = OpShiftRightLogical %v2uint %59 %51
+               OpStore %x %60
+         %63 = OpLoad %v2uint %x
+         %66 = OpBitwiseAnd %v2uint %63 %65
+         %62 = OpINotEqual %v2bool %66 %30
+         %61 = OpSelect %v2uint %62 %68 %30
+         %69 = OpLoad %v2uint %x
+         %70 = OpShiftRightLogical %v2uint %69 %61
+               OpStore %x %70
+         %73 = OpLoad %v2uint %x
+         %74 = OpBitwiseAnd %v2uint %73 %68
+         %72 = OpINotEqual %v2bool %74 %30
+         %71 = OpSelect %v2uint %72 %76 %30
+         %78 = OpLoad %v2uint %x
+         %79 = OpIEqual %v2bool %78 %30
+         %77 = OpSelect %v2uint %79 %81 %30
+         %83 = OpBitwiseOr %v2uint %31 %41
+         %84 = OpBitwiseOr %v2uint %83 %51
+         %85 = OpBitwiseOr %v2uint %84 %61
+         %86 = OpBitwiseOr %v2uint %85 %71
+         %87 = OpBitwiseOr %v2uint %86 %77
+         %82 = OpBitcast %v2int %87
+               OpReturnValue %82
                OpFunctionEnd
-%firstLeadingBit_a622c2 = OpFunction %void None %85
-         %88 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %18
-        %res = OpVariable %_ptr_Function_v2int Function %18
-               OpStore %arg_0 %90
-         %94 = OpLoad %v2int %arg_0
-         %93 = OpFunctionCall %v2int %tint_first_leading_bit %94
-               OpStore %res %93
+%firstLeadingBit_a622c2 = OpFunction %void None %88
+         %91 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %21
+        %res = OpVariable %_ptr_Function_v2int Function %21
+               OpStore %arg_0 %93
+         %97 = OpLoad %v2int %arg_0
+         %96 = OpFunctionCall %v2int %tint_first_leading_bit %97
+               OpStore %res %96
+        %101 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+        %102 = OpLoad %v2int %res
+               OpStore %101 %102
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %96
-         %98 = OpLabel
-         %99 = OpFunctionCall %void %firstLeadingBit_a622c2
+%vertex_main_inner = OpFunction %v4float None %103
+        %105 = OpLabel
+        %106 = OpFunctionCall %void %firstLeadingBit_a622c2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %85
-        %101 = OpLabel
-        %102 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %102
+%vertex_main = OpFunction %void None %88
+        %108 = OpLabel
+        %109 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %109
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %85
-        %105 = OpLabel
-        %106 = OpFunctionCall %void %firstLeadingBit_a622c2
+%fragment_main = OpFunction %void None %88
+        %112 = OpLabel
+        %113 = OpFunctionCall %void %firstLeadingBit_a622c2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %85
-        %108 = OpLabel
-        %109 = OpFunctionCall %void %firstLeadingBit_a622c2
+%compute_main = OpFunction %void None %88
+        %115 = OpLabel
+        %116 = OpFunctionCall %void %firstLeadingBit_a622c2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.wgsl
index 0151285..1ec6433 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/a622c2.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstLeadingBit_a622c2() {
   var arg_0 = vec2<i32>(1i);
   var res : vec2<i32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_a622c2();
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl
index 01db1b2..eb4d355 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl
@@ -25,7 +25,9 @@
 fn firstLeadingBit_c1f940() {
   var arg_0 = vec4<i32>(1i);
   var res: vec4<i32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.dxc.hlsl
index c05d3dc..e249d07 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_c1f940() {
   int4 arg_0 = (1).xxxx;
   int4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.fxc.hlsl
index c05d3dc..e249d07 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_c1f940() {
   int4 arg_0 = (1).xxxx;
   int4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.glsl
index ef4ab88..45f044a 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_c1f940() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_c1f940() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstLeadingBit_c1f940() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.msl b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.msl
index 042e417..49772a0 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstLeadingBit_c1f940() {
+void firstLeadingBit_c1f940(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 res = tint_first_leading_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_c1f940();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  firstLeadingBit_c1f940(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_c1f940();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_c1f940(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_c1f940();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_c1f940(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.spvasm
index 581af1d..167e476 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 110
+; Bound: 117
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_leading_bit "tint_first_leading_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,123 +41,131 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-          %9 = OpTypeFunction %v4int %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4int %v4int
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-         %18 = OpConstantNull %v4int
+         %21 = OpConstantNull %v4int
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %27 = OpConstantNull %v4uint
+         %30 = OpConstantNull %v4uint
 %uint_4294901760 = OpConstant %uint 4294901760
-         %32 = OpConstantComposite %v4uint %uint_4294901760 %uint_4294901760 %uint_4294901760 %uint_4294901760
+         %35 = OpConstantComposite %v4uint %uint_4294901760 %uint_4294901760 %uint_4294901760 %uint_4294901760
     %uint_16 = OpConstant %uint 16
-         %35 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
+         %38 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
  %uint_65280 = OpConstant %uint 65280
-         %42 = OpConstantComposite %v4uint %uint_65280 %uint_65280 %uint_65280 %uint_65280
+         %45 = OpConstantComposite %v4uint %uint_65280 %uint_65280 %uint_65280 %uint_65280
      %uint_8 = OpConstant %uint 8
-         %45 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
+         %48 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
    %uint_240 = OpConstant %uint 240
-         %52 = OpConstantComposite %v4uint %uint_240 %uint_240 %uint_240 %uint_240
+         %55 = OpConstantComposite %v4uint %uint_240 %uint_240 %uint_240 %uint_240
      %uint_4 = OpConstant %uint 4
-         %55 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
+         %58 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
     %uint_12 = OpConstant %uint 12
-         %62 = OpConstantComposite %v4uint %uint_12 %uint_12 %uint_12 %uint_12
+         %65 = OpConstantComposite %v4uint %uint_12 %uint_12 %uint_12 %uint_12
      %uint_2 = OpConstant %uint 2
-         %65 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
+         %68 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %73 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %76 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %78 = OpConstantComposite %v4uint %uint_4294967295 %uint_4294967295 %uint_4294967295 %uint_4294967295
+         %81 = OpConstantComposite %v4uint %uint_4294967295 %uint_4294967295 %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %85 = OpTypeFunction %void
+         %88 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %90 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %93 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %96 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+        %103 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_leading_bit = OpFunction %v4int None %9
+%tint_first_leading_bit = OpFunction %v4int None %14
           %v = OpFunctionParameter %v4int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v4uint Function %27
-         %19 = OpSLessThan %v4bool %v %18
-         %23 = OpNot %v4int %v
-         %22 = OpBitcast %v4uint %23
-         %24 = OpBitcast %v4uint %v
-         %15 = OpSelect %v4uint %19 %22 %24
-               OpStore %x %15
-         %30 = OpLoad %v4uint %x
-         %33 = OpBitwiseAnd %v4uint %30 %32
-         %29 = OpINotEqual %v4bool %33 %27
-         %28 = OpSelect %v4uint %29 %35 %27
-         %36 = OpLoad %v4uint %x
-         %37 = OpShiftRightLogical %v4uint %36 %28
-               OpStore %x %37
-         %40 = OpLoad %v4uint %x
-         %43 = OpBitwiseAnd %v4uint %40 %42
-         %39 = OpINotEqual %v4bool %43 %27
-         %38 = OpSelect %v4uint %39 %45 %27
-         %46 = OpLoad %v4uint %x
-         %47 = OpShiftRightLogical %v4uint %46 %38
-               OpStore %x %47
-         %50 = OpLoad %v4uint %x
-         %53 = OpBitwiseAnd %v4uint %50 %52
-         %49 = OpINotEqual %v4bool %53 %27
-         %48 = OpSelect %v4uint %49 %55 %27
-         %56 = OpLoad %v4uint %x
-         %57 = OpShiftRightLogical %v4uint %56 %48
-               OpStore %x %57
-         %60 = OpLoad %v4uint %x
-         %63 = OpBitwiseAnd %v4uint %60 %62
-         %59 = OpINotEqual %v4bool %63 %27
-         %58 = OpSelect %v4uint %59 %65 %27
-         %66 = OpLoad %v4uint %x
-         %67 = OpShiftRightLogical %v4uint %66 %58
-               OpStore %x %67
-         %70 = OpLoad %v4uint %x
-         %71 = OpBitwiseAnd %v4uint %70 %65
-         %69 = OpINotEqual %v4bool %71 %27
-         %68 = OpSelect %v4uint %69 %73 %27
-         %75 = OpLoad %v4uint %x
-         %76 = OpIEqual %v4bool %75 %27
-         %74 = OpSelect %v4uint %76 %78 %27
-         %80 = OpBitwiseOr %v4uint %28 %38
-         %81 = OpBitwiseOr %v4uint %80 %48
-         %82 = OpBitwiseOr %v4uint %81 %58
-         %83 = OpBitwiseOr %v4uint %82 %68
-         %84 = OpBitwiseOr %v4uint %83 %74
-         %79 = OpBitcast %v4int %84
-               OpReturnValue %79
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v4uint Function %30
+         %22 = OpSLessThan %v4bool %v %21
+         %26 = OpNot %v4int %v
+         %25 = OpBitcast %v4uint %26
+         %27 = OpBitcast %v4uint %v
+         %18 = OpSelect %v4uint %22 %25 %27
+               OpStore %x %18
+         %33 = OpLoad %v4uint %x
+         %36 = OpBitwiseAnd %v4uint %33 %35
+         %32 = OpINotEqual %v4bool %36 %30
+         %31 = OpSelect %v4uint %32 %38 %30
+         %39 = OpLoad %v4uint %x
+         %40 = OpShiftRightLogical %v4uint %39 %31
+               OpStore %x %40
+         %43 = OpLoad %v4uint %x
+         %46 = OpBitwiseAnd %v4uint %43 %45
+         %42 = OpINotEqual %v4bool %46 %30
+         %41 = OpSelect %v4uint %42 %48 %30
+         %49 = OpLoad %v4uint %x
+         %50 = OpShiftRightLogical %v4uint %49 %41
+               OpStore %x %50
+         %53 = OpLoad %v4uint %x
+         %56 = OpBitwiseAnd %v4uint %53 %55
+         %52 = OpINotEqual %v4bool %56 %30
+         %51 = OpSelect %v4uint %52 %58 %30
+         %59 = OpLoad %v4uint %x
+         %60 = OpShiftRightLogical %v4uint %59 %51
+               OpStore %x %60
+         %63 = OpLoad %v4uint %x
+         %66 = OpBitwiseAnd %v4uint %63 %65
+         %62 = OpINotEqual %v4bool %66 %30
+         %61 = OpSelect %v4uint %62 %68 %30
+         %69 = OpLoad %v4uint %x
+         %70 = OpShiftRightLogical %v4uint %69 %61
+               OpStore %x %70
+         %73 = OpLoad %v4uint %x
+         %74 = OpBitwiseAnd %v4uint %73 %68
+         %72 = OpINotEqual %v4bool %74 %30
+         %71 = OpSelect %v4uint %72 %76 %30
+         %78 = OpLoad %v4uint %x
+         %79 = OpIEqual %v4bool %78 %30
+         %77 = OpSelect %v4uint %79 %81 %30
+         %83 = OpBitwiseOr %v4uint %31 %41
+         %84 = OpBitwiseOr %v4uint %83 %51
+         %85 = OpBitwiseOr %v4uint %84 %61
+         %86 = OpBitwiseOr %v4uint %85 %71
+         %87 = OpBitwiseOr %v4uint %86 %77
+         %82 = OpBitcast %v4int %87
+               OpReturnValue %82
                OpFunctionEnd
-%firstLeadingBit_c1f940 = OpFunction %void None %85
-         %88 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %18
-        %res = OpVariable %_ptr_Function_v4int Function %18
-               OpStore %arg_0 %90
-         %94 = OpLoad %v4int %arg_0
-         %93 = OpFunctionCall %v4int %tint_first_leading_bit %94
-               OpStore %res %93
+%firstLeadingBit_c1f940 = OpFunction %void None %88
+         %91 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %21
+        %res = OpVariable %_ptr_Function_v4int Function %21
+               OpStore %arg_0 %93
+         %97 = OpLoad %v4int %arg_0
+         %96 = OpFunctionCall %v4int %tint_first_leading_bit %97
+               OpStore %res %96
+        %101 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+        %102 = OpLoad %v4int %res
+               OpStore %101 %102
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %96
-         %98 = OpLabel
-         %99 = OpFunctionCall %void %firstLeadingBit_c1f940
+%vertex_main_inner = OpFunction %v4float None %103
+        %105 = OpLabel
+        %106 = OpFunctionCall %void %firstLeadingBit_c1f940
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %85
-        %101 = OpLabel
-        %102 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %102
+%vertex_main = OpFunction %void None %88
+        %108 = OpLabel
+        %109 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %109
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %85
-        %105 = OpLabel
-        %106 = OpFunctionCall %void %firstLeadingBit_c1f940
+%fragment_main = OpFunction %void None %88
+        %112 = OpLabel
+        %113 = OpFunctionCall %void %firstLeadingBit_c1f940
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %85
-        %108 = OpLabel
-        %109 = OpFunctionCall %void %firstLeadingBit_c1f940
+%compute_main = OpFunction %void None %88
+        %115 = OpLabel
+        %116 = OpFunctionCall %void %firstLeadingBit_c1f940
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.wgsl
index a5610d5..ca3923f 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/c1f940.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstLeadingBit_c1f940() {
   var arg_0 = vec4<i32>(1i);
   var res : vec4<i32> = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_c1f940();
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl
index 06814ef..5b92048 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl
@@ -25,7 +25,9 @@
 fn firstLeadingBit_f0779d() {
   var arg_0 = 1u;
   var res: u32 = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.dxc.hlsl
index 26c2ab9..ff7bac9 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_f0779d() {
   uint arg_0 = 1u;
   uint res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.fxc.hlsl
index 26c2ab9..ff7bac9 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstLeadingBit_f0779d() {
   uint arg_0 = 1u;
   uint res = tint_first_leading_bit(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.glsl
index fe38e68..b80060a 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstLeadingBit_f0779d() {
   uint arg_0 = 1u;
   uint res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstLeadingBit_f0779d() {
   uint arg_0 = 1u;
   uint res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstLeadingBit_f0779d() {
   uint arg_0 = 1u;
   uint res = tint_first_leading_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.msl b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.msl
index daac75a..8b7a45e 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstLeadingBit_f0779d() {
+void firstLeadingBit_f0779d(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint res = tint_first_leading_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstLeadingBit_f0779d();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  firstLeadingBit_f0779d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstLeadingBit_f0779d();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  firstLeadingBit_f0779d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstLeadingBit_f0779d();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  firstLeadingBit_f0779d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.spvasm
index 9236998..d0bffdb 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 87
+; Bound: 94
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_leading_bit "tint_first_leading_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,9 +40,12 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %uint %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %uint %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %16 = OpConstantNull %uint
+         %19 = OpConstantNull %uint
        %bool = OpTypeBool
 %uint_4294901760 = OpConstant %uint 4294901760
     %uint_16 = OpConstant %uint 16
@@ -48,85 +58,90 @@
      %uint_1 = OpConstant %uint 1
 %uint_4294967295 = OpConstant %uint 4294967295
        %void = OpTypeVoid
-         %65 = OpTypeFunction %void
-         %73 = OpTypeFunction %v4float
+         %68 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %80 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_leading_bit = OpFunction %uint None %9
+%tint_first_leading_bit = OpFunction %uint None %13
           %v = OpFunctionParameter %uint
-         %13 = OpLabel
-          %x = OpVariable %_ptr_Function_uint Function %16
+         %16 = OpLabel
+          %x = OpVariable %_ptr_Function_uint Function %19
                OpStore %x %v
-         %20 = OpLoad %uint %x
-         %22 = OpBitwiseAnd %uint %20 %uint_4294901760
-         %18 = OpINotEqual %bool %22 %16
-         %17 = OpSelect %uint %18 %uint_16 %16
-         %24 = OpLoad %uint %x
-         %25 = OpShiftRightLogical %uint %24 %17
-               OpStore %x %25
-         %28 = OpLoad %uint %x
-         %30 = OpBitwiseAnd %uint %28 %uint_65280
-         %27 = OpINotEqual %bool %30 %16
-         %26 = OpSelect %uint %27 %uint_8 %16
-         %32 = OpLoad %uint %x
-         %33 = OpShiftRightLogical %uint %32 %26
-               OpStore %x %33
-         %36 = OpLoad %uint %x
-         %38 = OpBitwiseAnd %uint %36 %uint_240
-         %35 = OpINotEqual %bool %38 %16
-         %34 = OpSelect %uint %35 %uint_4 %16
-         %40 = OpLoad %uint %x
-         %41 = OpShiftRightLogical %uint %40 %34
-               OpStore %x %41
-         %44 = OpLoad %uint %x
-         %46 = OpBitwiseAnd %uint %44 %uint_12
-         %43 = OpINotEqual %bool %46 %16
-         %42 = OpSelect %uint %43 %uint_2 %16
-         %48 = OpLoad %uint %x
-         %49 = OpShiftRightLogical %uint %48 %42
-               OpStore %x %49
-         %52 = OpLoad %uint %x
-         %53 = OpBitwiseAnd %uint %52 %uint_2
-         %51 = OpINotEqual %bool %53 %16
-         %50 = OpSelect %uint %51 %uint_1 %16
-         %56 = OpLoad %uint %x
-         %57 = OpIEqual %bool %56 %16
-         %55 = OpSelect %uint %57 %uint_4294967295 %16
-         %60 = OpBitwiseOr %uint %17 %26
-         %61 = OpBitwiseOr %uint %60 %34
-         %62 = OpBitwiseOr %uint %61 %42
-         %63 = OpBitwiseOr %uint %62 %50
-         %64 = OpBitwiseOr %uint %63 %55
-               OpReturnValue %64
+         %23 = OpLoad %uint %x
+         %25 = OpBitwiseAnd %uint %23 %uint_4294901760
+         %21 = OpINotEqual %bool %25 %19
+         %20 = OpSelect %uint %21 %uint_16 %19
+         %27 = OpLoad %uint %x
+         %28 = OpShiftRightLogical %uint %27 %20
+               OpStore %x %28
+         %31 = OpLoad %uint %x
+         %33 = OpBitwiseAnd %uint %31 %uint_65280
+         %30 = OpINotEqual %bool %33 %19
+         %29 = OpSelect %uint %30 %uint_8 %19
+         %35 = OpLoad %uint %x
+         %36 = OpShiftRightLogical %uint %35 %29
+               OpStore %x %36
+         %39 = OpLoad %uint %x
+         %41 = OpBitwiseAnd %uint %39 %uint_240
+         %38 = OpINotEqual %bool %41 %19
+         %37 = OpSelect %uint %38 %uint_4 %19
+         %43 = OpLoad %uint %x
+         %44 = OpShiftRightLogical %uint %43 %37
+               OpStore %x %44
+         %47 = OpLoad %uint %x
+         %49 = OpBitwiseAnd %uint %47 %uint_12
+         %46 = OpINotEqual %bool %49 %19
+         %45 = OpSelect %uint %46 %uint_2 %19
+         %51 = OpLoad %uint %x
+         %52 = OpShiftRightLogical %uint %51 %45
+               OpStore %x %52
+         %55 = OpLoad %uint %x
+         %56 = OpBitwiseAnd %uint %55 %uint_2
+         %54 = OpINotEqual %bool %56 %19
+         %53 = OpSelect %uint %54 %uint_1 %19
+         %59 = OpLoad %uint %x
+         %60 = OpIEqual %bool %59 %19
+         %58 = OpSelect %uint %60 %uint_4294967295 %19
+         %63 = OpBitwiseOr %uint %20 %29
+         %64 = OpBitwiseOr %uint %63 %37
+         %65 = OpBitwiseOr %uint %64 %45
+         %66 = OpBitwiseOr %uint %65 %53
+         %67 = OpBitwiseOr %uint %66 %58
+               OpReturnValue %67
                OpFunctionEnd
-%firstLeadingBit_f0779d = OpFunction %void None %65
-         %68 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %16
-        %res = OpVariable %_ptr_Function_uint Function %16
+%firstLeadingBit_f0779d = OpFunction %void None %68
+         %71 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %19
+        %res = OpVariable %_ptr_Function_uint Function %19
                OpStore %arg_0 %uint_1
-         %71 = OpLoad %uint %arg_0
-         %70 = OpFunctionCall %uint %tint_first_leading_bit %71
-               OpStore %res %70
+         %74 = OpLoad %uint %arg_0
+         %73 = OpFunctionCall %uint %tint_first_leading_bit %74
+               OpStore %res %73
+         %78 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %79 = OpLoad %uint %res
+               OpStore %78 %79
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %73
-         %75 = OpLabel
-         %76 = OpFunctionCall %void %firstLeadingBit_f0779d
+%vertex_main_inner = OpFunction %v4float None %80
+         %82 = OpLabel
+         %83 = OpFunctionCall %void %firstLeadingBit_f0779d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %65
-         %78 = OpLabel
-         %79 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %79
+%vertex_main = OpFunction %void None %68
+         %85 = OpLabel
+         %86 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %86
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %65
-         %82 = OpLabel
-         %83 = OpFunctionCall %void %firstLeadingBit_f0779d
+%fragment_main = OpFunction %void None %68
+         %89 = OpLabel
+         %90 = OpFunctionCall %void %firstLeadingBit_f0779d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %65
-         %85 = OpLabel
-         %86 = OpFunctionCall %void %firstLeadingBit_f0779d
+%compute_main = OpFunction %void None %68
+         %92 = OpLabel
+         %93 = OpFunctionCall %void %firstLeadingBit_f0779d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.wgsl
index b47e829..b1958bc 100644
--- a/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstLeadingBit/f0779d.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstLeadingBit_f0779d() {
   var arg_0 = 1u;
   var res : u32 = firstLeadingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstLeadingBit_f0779d();
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl
index 018a67a..e4001b1 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl
@@ -25,7 +25,9 @@
 fn firstTrailingBit_110f2c() {
   var arg_0 = vec4<u32>(1u);
   var res: vec4<u32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.dxc.hlsl
index 65939d8..cd6fb07 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_110f2c() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.fxc.hlsl
index 65939d8..cd6fb07 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_110f2c() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.glsl
index 907cba7..a6c5431 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_110f2c() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_110f2c() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_110f2c() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.msl b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.msl
index 7a1f158..e743908 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return uint4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstTrailingBit_110f2c() {
+void firstTrailingBit_110f2c(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 res = tint_first_trailing_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_110f2c();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  firstTrailingBit_110f2c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_110f2c();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_110f2c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_110f2c();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_110f2c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.spvasm
index aa68727..860aca4 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 100
+; Bound: 107
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_trailing_bit "tint_first_trailing_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,111 +41,119 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-          %9 = OpTypeFunction %v4uint %v4uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4uint %v4uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %18 = OpConstantNull %v4uint
+         %21 = OpConstantNull %v4uint
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
  %uint_65535 = OpConstant %uint 65535
-         %25 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
+         %28 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %28 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
+         %31 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %35 = OpConstantComposite %v4uint %uint_255 %uint_255 %uint_255 %uint_255
+         %38 = OpConstantComposite %v4uint %uint_255 %uint_255 %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
+         %41 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %45 = OpConstantComposite %v4uint %uint_15 %uint_15 %uint_15 %uint_15
+         %48 = OpConstantComposite %v4uint %uint_15 %uint_15 %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %48 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
+         %51 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %55 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
+         %58 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %58 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
+         %61 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %68 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %71 = OpConstantComposite %v4uint %uint_4294967295 %uint_4294967295 %uint_4294967295 %uint_4294967295
+         %74 = OpConstantComposite %v4uint %uint_4294967295 %uint_4294967295 %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %78 = OpTypeFunction %void
-         %86 = OpTypeFunction %v4float
+         %81 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %93 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_trailing_bit = OpFunction %v4uint None %9
+%tint_first_trailing_bit = OpFunction %v4uint None %14
           %v = OpFunctionParameter %v4uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v4uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v4uint Function %21
                OpStore %x %v
-         %23 = OpLoad %v4uint %x
-         %26 = OpBitwiseAnd %v4uint %23 %25
-         %20 = OpINotEqual %v4bool %26 %18
-         %19 = OpSelect %v4uint %20 %18 %28
-         %29 = OpLoad %v4uint %x
-         %30 = OpShiftRightLogical %v4uint %29 %19
-               OpStore %x %30
-         %33 = OpLoad %v4uint %x
-         %36 = OpBitwiseAnd %v4uint %33 %35
-         %32 = OpINotEqual %v4bool %36 %18
-         %31 = OpSelect %v4uint %32 %18 %38
-         %39 = OpLoad %v4uint %x
-         %40 = OpShiftRightLogical %v4uint %39 %31
-               OpStore %x %40
-         %43 = OpLoad %v4uint %x
-         %46 = OpBitwiseAnd %v4uint %43 %45
-         %42 = OpINotEqual %v4bool %46 %18
-         %41 = OpSelect %v4uint %42 %18 %48
-         %49 = OpLoad %v4uint %x
-         %50 = OpShiftRightLogical %v4uint %49 %41
-               OpStore %x %50
-         %53 = OpLoad %v4uint %x
-         %56 = OpBitwiseAnd %v4uint %53 %55
-         %52 = OpINotEqual %v4bool %56 %18
-         %51 = OpSelect %v4uint %52 %18 %58
-         %59 = OpLoad %v4uint %x
-         %60 = OpShiftRightLogical %v4uint %59 %51
-               OpStore %x %60
-         %63 = OpLoad %v4uint %x
-         %66 = OpBitwiseAnd %v4uint %63 %65
-         %62 = OpINotEqual %v4bool %66 %18
-         %61 = OpSelect %v4uint %62 %18 %65
-         %68 = OpLoad %v4uint %x
-         %69 = OpIEqual %v4bool %68 %18
-         %67 = OpSelect %v4uint %69 %71 %18
-         %73 = OpBitwiseOr %v4uint %19 %31
-         %74 = OpBitwiseOr %v4uint %73 %41
-         %75 = OpBitwiseOr %v4uint %74 %51
-         %76 = OpBitwiseOr %v4uint %75 %61
-         %77 = OpBitwiseOr %v4uint %76 %67
-               OpReturnValue %77
+         %26 = OpLoad %v4uint %x
+         %29 = OpBitwiseAnd %v4uint %26 %28
+         %23 = OpINotEqual %v4bool %29 %21
+         %22 = OpSelect %v4uint %23 %21 %31
+         %32 = OpLoad %v4uint %x
+         %33 = OpShiftRightLogical %v4uint %32 %22
+               OpStore %x %33
+         %36 = OpLoad %v4uint %x
+         %39 = OpBitwiseAnd %v4uint %36 %38
+         %35 = OpINotEqual %v4bool %39 %21
+         %34 = OpSelect %v4uint %35 %21 %41
+         %42 = OpLoad %v4uint %x
+         %43 = OpShiftRightLogical %v4uint %42 %34
+               OpStore %x %43
+         %46 = OpLoad %v4uint %x
+         %49 = OpBitwiseAnd %v4uint %46 %48
+         %45 = OpINotEqual %v4bool %49 %21
+         %44 = OpSelect %v4uint %45 %21 %51
+         %52 = OpLoad %v4uint %x
+         %53 = OpShiftRightLogical %v4uint %52 %44
+               OpStore %x %53
+         %56 = OpLoad %v4uint %x
+         %59 = OpBitwiseAnd %v4uint %56 %58
+         %55 = OpINotEqual %v4bool %59 %21
+         %54 = OpSelect %v4uint %55 %21 %61
+         %62 = OpLoad %v4uint %x
+         %63 = OpShiftRightLogical %v4uint %62 %54
+               OpStore %x %63
+         %66 = OpLoad %v4uint %x
+         %69 = OpBitwiseAnd %v4uint %66 %68
+         %65 = OpINotEqual %v4bool %69 %21
+         %64 = OpSelect %v4uint %65 %21 %68
+         %71 = OpLoad %v4uint %x
+         %72 = OpIEqual %v4bool %71 %21
+         %70 = OpSelect %v4uint %72 %74 %21
+         %76 = OpBitwiseOr %v4uint %22 %34
+         %77 = OpBitwiseOr %v4uint %76 %44
+         %78 = OpBitwiseOr %v4uint %77 %54
+         %79 = OpBitwiseOr %v4uint %78 %64
+         %80 = OpBitwiseOr %v4uint %79 %70
+               OpReturnValue %80
                OpFunctionEnd
-%firstTrailingBit_110f2c = OpFunction %void None %78
-         %81 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %18
-        %res = OpVariable %_ptr_Function_v4uint Function %18
-               OpStore %arg_0 %65
-         %84 = OpLoad %v4uint %arg_0
-         %83 = OpFunctionCall %v4uint %tint_first_trailing_bit %84
-               OpStore %res %83
+%firstTrailingBit_110f2c = OpFunction %void None %81
+         %84 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %21
+        %res = OpVariable %_ptr_Function_v4uint Function %21
+               OpStore %arg_0 %68
+         %87 = OpLoad %v4uint %arg_0
+         %86 = OpFunctionCall %v4uint %tint_first_trailing_bit %87
+               OpStore %res %86
+         %91 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %92 = OpLoad %v4uint %res
+               OpStore %91 %92
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %86
-         %88 = OpLabel
-         %89 = OpFunctionCall %void %firstTrailingBit_110f2c
+%vertex_main_inner = OpFunction %v4float None %93
+         %95 = OpLabel
+         %96 = OpFunctionCall %void %firstTrailingBit_110f2c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %78
-         %91 = OpLabel
-         %92 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %92
+%vertex_main = OpFunction %void None %81
+         %98 = OpLabel
+         %99 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %99
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %78
-         %95 = OpLabel
-         %96 = OpFunctionCall %void %firstTrailingBit_110f2c
+%fragment_main = OpFunction %void None %81
+        %102 = OpLabel
+        %103 = OpFunctionCall %void %firstTrailingBit_110f2c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %78
-         %98 = OpLabel
-         %99 = OpFunctionCall %void %firstTrailingBit_110f2c
+%compute_main = OpFunction %void None %81
+        %105 = OpLabel
+        %106 = OpFunctionCall %void %firstTrailingBit_110f2c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.wgsl
index 2cd770d..4f01c76 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/110f2c.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstTrailingBit_110f2c() {
   var arg_0 = vec4<u32>(1u);
   var res : vec4<u32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_110f2c();
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl
index 736ef90..81b0836 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl
@@ -25,7 +25,9 @@
 fn firstTrailingBit_3a2acc() {
   var arg_0 = 1i;
   var res: i32 = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.dxc.hlsl
index 18cddbf..4ffe427 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_3a2acc() {
   int arg_0 = 1;
   int res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.fxc.hlsl
index 18cddbf..4ffe427 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_3a2acc() {
   int arg_0 = 1;
   int res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.glsl
index 7bc6250..d795cd8 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstTrailingBit_3a2acc() {
   int arg_0 = 1;
   int res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstTrailingBit_3a2acc() {
   int arg_0 = 1;
   int res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void firstTrailingBit_3a2acc() {
   int arg_0 = 1;
   int res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.msl b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.msl
index 580ba30..0088995 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return int((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstTrailingBit_3a2acc() {
+void firstTrailingBit_3a2acc(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int res = tint_first_trailing_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_3a2acc();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  firstTrailingBit_3a2acc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_3a2acc();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_3a2acc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_3a2acc();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_3a2acc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.spvasm
index ba548bc..05af961 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 92
+; Bound: 99
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_trailing_bit "tint_first_trailing_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,10 +40,13 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
-          %9 = OpTypeFunction %int %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %int %int
        %uint = OpTypeInt 32 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %18 = OpConstantNull %uint
+         %21 = OpConstantNull %uint
        %bool = OpTypeBool
  %uint_65535 = OpConstant %uint 65535
     %uint_16 = OpConstant %uint 16
@@ -49,90 +59,95 @@
      %uint_1 = OpConstant %uint 1
 %uint_4294967295 = OpConstant %uint 4294967295
        %void = OpTypeVoid
-         %67 = OpTypeFunction %void
+         %70 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %74 = OpConstantNull %int
-         %78 = OpTypeFunction %v4float
+         %77 = OpConstantNull %int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %85 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_trailing_bit = OpFunction %int None %9
+%tint_first_trailing_bit = OpFunction %int None %13
           %v = OpFunctionParameter %int
-         %13 = OpLabel
-          %x = OpVariable %_ptr_Function_uint Function %18
-         %14 = OpBitcast %uint %v
-               OpStore %x %14
-         %22 = OpLoad %uint %x
-         %24 = OpBitwiseAnd %uint %22 %uint_65535
-         %20 = OpINotEqual %bool %24 %18
-         %19 = OpSelect %uint %20 %18 %uint_16
-         %26 = OpLoad %uint %x
-         %27 = OpShiftRightLogical %uint %26 %19
-               OpStore %x %27
-         %30 = OpLoad %uint %x
-         %32 = OpBitwiseAnd %uint %30 %uint_255
-         %29 = OpINotEqual %bool %32 %18
-         %28 = OpSelect %uint %29 %18 %uint_8
-         %34 = OpLoad %uint %x
-         %35 = OpShiftRightLogical %uint %34 %28
-               OpStore %x %35
-         %38 = OpLoad %uint %x
-         %40 = OpBitwiseAnd %uint %38 %uint_15
-         %37 = OpINotEqual %bool %40 %18
-         %36 = OpSelect %uint %37 %18 %uint_4
-         %42 = OpLoad %uint %x
-         %43 = OpShiftRightLogical %uint %42 %36
-               OpStore %x %43
-         %46 = OpLoad %uint %x
-         %48 = OpBitwiseAnd %uint %46 %uint_3
-         %45 = OpINotEqual %bool %48 %18
-         %44 = OpSelect %uint %45 %18 %uint_2
-         %50 = OpLoad %uint %x
-         %51 = OpShiftRightLogical %uint %50 %44
-               OpStore %x %51
-         %54 = OpLoad %uint %x
-         %56 = OpBitwiseAnd %uint %54 %uint_1
-         %53 = OpINotEqual %bool %56 %18
-         %52 = OpSelect %uint %53 %18 %uint_1
-         %58 = OpLoad %uint %x
-         %59 = OpIEqual %bool %58 %18
-         %57 = OpSelect %uint %59 %uint_4294967295 %18
-         %62 = OpBitwiseOr %uint %19 %28
-         %63 = OpBitwiseOr %uint %62 %36
-         %64 = OpBitwiseOr %uint %63 %44
-         %65 = OpBitwiseOr %uint %64 %52
-         %66 = OpBitwiseOr %uint %65 %57
-         %61 = OpBitcast %int %66
-               OpReturnValue %61
+         %16 = OpLabel
+          %x = OpVariable %_ptr_Function_uint Function %21
+         %17 = OpBitcast %uint %v
+               OpStore %x %17
+         %25 = OpLoad %uint %x
+         %27 = OpBitwiseAnd %uint %25 %uint_65535
+         %23 = OpINotEqual %bool %27 %21
+         %22 = OpSelect %uint %23 %21 %uint_16
+         %29 = OpLoad %uint %x
+         %30 = OpShiftRightLogical %uint %29 %22
+               OpStore %x %30
+         %33 = OpLoad %uint %x
+         %35 = OpBitwiseAnd %uint %33 %uint_255
+         %32 = OpINotEqual %bool %35 %21
+         %31 = OpSelect %uint %32 %21 %uint_8
+         %37 = OpLoad %uint %x
+         %38 = OpShiftRightLogical %uint %37 %31
+               OpStore %x %38
+         %41 = OpLoad %uint %x
+         %43 = OpBitwiseAnd %uint %41 %uint_15
+         %40 = OpINotEqual %bool %43 %21
+         %39 = OpSelect %uint %40 %21 %uint_4
+         %45 = OpLoad %uint %x
+         %46 = OpShiftRightLogical %uint %45 %39
+               OpStore %x %46
+         %49 = OpLoad %uint %x
+         %51 = OpBitwiseAnd %uint %49 %uint_3
+         %48 = OpINotEqual %bool %51 %21
+         %47 = OpSelect %uint %48 %21 %uint_2
+         %53 = OpLoad %uint %x
+         %54 = OpShiftRightLogical %uint %53 %47
+               OpStore %x %54
+         %57 = OpLoad %uint %x
+         %59 = OpBitwiseAnd %uint %57 %uint_1
+         %56 = OpINotEqual %bool %59 %21
+         %55 = OpSelect %uint %56 %21 %uint_1
+         %61 = OpLoad %uint %x
+         %62 = OpIEqual %bool %61 %21
+         %60 = OpSelect %uint %62 %uint_4294967295 %21
+         %65 = OpBitwiseOr %uint %22 %31
+         %66 = OpBitwiseOr %uint %65 %39
+         %67 = OpBitwiseOr %uint %66 %47
+         %68 = OpBitwiseOr %uint %67 %55
+         %69 = OpBitwiseOr %uint %68 %60
+         %64 = OpBitcast %int %69
+               OpReturnValue %64
                OpFunctionEnd
-%firstTrailingBit_3a2acc = OpFunction %void None %67
-         %70 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %74
-        %res = OpVariable %_ptr_Function_int Function %74
+%firstTrailingBit_3a2acc = OpFunction %void None %70
+         %73 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %77
+        %res = OpVariable %_ptr_Function_int Function %77
                OpStore %arg_0 %int_1
-         %76 = OpLoad %int %arg_0
-         %75 = OpFunctionCall %int %tint_first_trailing_bit %76
-               OpStore %res %75
+         %79 = OpLoad %int %arg_0
+         %78 = OpFunctionCall %int %tint_first_trailing_bit %79
+               OpStore %res %78
+         %83 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %84 = OpLoad %int %res
+               OpStore %83 %84
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %78
-         %80 = OpLabel
-         %81 = OpFunctionCall %void %firstTrailingBit_3a2acc
+%vertex_main_inner = OpFunction %v4float None %85
+         %87 = OpLabel
+         %88 = OpFunctionCall %void %firstTrailingBit_3a2acc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %67
-         %83 = OpLabel
-         %84 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %84
+%vertex_main = OpFunction %void None %70
+         %90 = OpLabel
+         %91 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %91
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %67
-         %87 = OpLabel
-         %88 = OpFunctionCall %void %firstTrailingBit_3a2acc
+%fragment_main = OpFunction %void None %70
+         %94 = OpLabel
+         %95 = OpFunctionCall %void %firstTrailingBit_3a2acc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %67
-         %90 = OpLabel
-         %91 = OpFunctionCall %void %firstTrailingBit_3a2acc
+%compute_main = OpFunction %void None %70
+         %97 = OpLabel
+         %98 = OpFunctionCall %void %firstTrailingBit_3a2acc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.wgsl
index 757cd6d..b421a5f 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/3a2acc.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstTrailingBit_3a2acc() {
   var arg_0 = 1i;
   var res : i32 = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_3a2acc();
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl
index 5a8dca4..6548d27 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl
@@ -25,7 +25,9 @@
 fn firstTrailingBit_45eb10() {
   var arg_0 = vec2<u32>(1u);
   var res: vec2<u32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.dxc.hlsl
index 2891be4..94a6ff5 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_45eb10() {
   uint2 arg_0 = (1u).xx;
   uint2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.fxc.hlsl
index 2891be4..94a6ff5 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_45eb10() {
   uint2 arg_0 = (1u).xx;
   uint2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.glsl
index 0675a95..c4c367d 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_45eb10() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_45eb10() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_45eb10() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.msl b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.msl
index 35d9b6a..00dbc3f 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return uint2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstTrailingBit_45eb10() {
+void firstTrailingBit_45eb10(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 res = tint_first_trailing_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_45eb10();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  firstTrailingBit_45eb10(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_45eb10();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_45eb10(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_45eb10();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_45eb10(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.spvasm
index c2e7c38..a880d85 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 100
+; Bound: 107
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_trailing_bit "tint_first_trailing_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,111 +41,119 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-          %9 = OpTypeFunction %v2uint %v2uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2uint %v2uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %18 = OpConstantNull %v2uint
+         %21 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
  %uint_65535 = OpConstant %uint 65535
-         %25 = OpConstantComposite %v2uint %uint_65535 %uint_65535
+         %28 = OpConstantComposite %v2uint %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %28 = OpConstantComposite %v2uint %uint_16 %uint_16
+         %31 = OpConstantComposite %v2uint %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %35 = OpConstantComposite %v2uint %uint_255 %uint_255
+         %38 = OpConstantComposite %v2uint %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v2uint %uint_8 %uint_8
+         %41 = OpConstantComposite %v2uint %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %45 = OpConstantComposite %v2uint %uint_15 %uint_15
+         %48 = OpConstantComposite %v2uint %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %48 = OpConstantComposite %v2uint %uint_4 %uint_4
+         %51 = OpConstantComposite %v2uint %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %55 = OpConstantComposite %v2uint %uint_3 %uint_3
+         %58 = OpConstantComposite %v2uint %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %58 = OpConstantComposite %v2uint %uint_2 %uint_2
+         %61 = OpConstantComposite %v2uint %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %68 = OpConstantComposite %v2uint %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %71 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %74 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %78 = OpTypeFunction %void
-         %86 = OpTypeFunction %v4float
+         %81 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %93 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_trailing_bit = OpFunction %v2uint None %9
+%tint_first_trailing_bit = OpFunction %v2uint None %14
           %v = OpFunctionParameter %v2uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v2uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v2uint Function %21
                OpStore %x %v
-         %23 = OpLoad %v2uint %x
-         %26 = OpBitwiseAnd %v2uint %23 %25
-         %20 = OpINotEqual %v2bool %26 %18
-         %19 = OpSelect %v2uint %20 %18 %28
-         %29 = OpLoad %v2uint %x
-         %30 = OpShiftRightLogical %v2uint %29 %19
-               OpStore %x %30
-         %33 = OpLoad %v2uint %x
-         %36 = OpBitwiseAnd %v2uint %33 %35
-         %32 = OpINotEqual %v2bool %36 %18
-         %31 = OpSelect %v2uint %32 %18 %38
-         %39 = OpLoad %v2uint %x
-         %40 = OpShiftRightLogical %v2uint %39 %31
-               OpStore %x %40
-         %43 = OpLoad %v2uint %x
-         %46 = OpBitwiseAnd %v2uint %43 %45
-         %42 = OpINotEqual %v2bool %46 %18
-         %41 = OpSelect %v2uint %42 %18 %48
-         %49 = OpLoad %v2uint %x
-         %50 = OpShiftRightLogical %v2uint %49 %41
-               OpStore %x %50
-         %53 = OpLoad %v2uint %x
-         %56 = OpBitwiseAnd %v2uint %53 %55
-         %52 = OpINotEqual %v2bool %56 %18
-         %51 = OpSelect %v2uint %52 %18 %58
-         %59 = OpLoad %v2uint %x
-         %60 = OpShiftRightLogical %v2uint %59 %51
-               OpStore %x %60
-         %63 = OpLoad %v2uint %x
-         %66 = OpBitwiseAnd %v2uint %63 %65
-         %62 = OpINotEqual %v2bool %66 %18
-         %61 = OpSelect %v2uint %62 %18 %65
-         %68 = OpLoad %v2uint %x
-         %69 = OpIEqual %v2bool %68 %18
-         %67 = OpSelect %v2uint %69 %71 %18
-         %73 = OpBitwiseOr %v2uint %19 %31
-         %74 = OpBitwiseOr %v2uint %73 %41
-         %75 = OpBitwiseOr %v2uint %74 %51
-         %76 = OpBitwiseOr %v2uint %75 %61
-         %77 = OpBitwiseOr %v2uint %76 %67
-               OpReturnValue %77
+         %26 = OpLoad %v2uint %x
+         %29 = OpBitwiseAnd %v2uint %26 %28
+         %23 = OpINotEqual %v2bool %29 %21
+         %22 = OpSelect %v2uint %23 %21 %31
+         %32 = OpLoad %v2uint %x
+         %33 = OpShiftRightLogical %v2uint %32 %22
+               OpStore %x %33
+         %36 = OpLoad %v2uint %x
+         %39 = OpBitwiseAnd %v2uint %36 %38
+         %35 = OpINotEqual %v2bool %39 %21
+         %34 = OpSelect %v2uint %35 %21 %41
+         %42 = OpLoad %v2uint %x
+         %43 = OpShiftRightLogical %v2uint %42 %34
+               OpStore %x %43
+         %46 = OpLoad %v2uint %x
+         %49 = OpBitwiseAnd %v2uint %46 %48
+         %45 = OpINotEqual %v2bool %49 %21
+         %44 = OpSelect %v2uint %45 %21 %51
+         %52 = OpLoad %v2uint %x
+         %53 = OpShiftRightLogical %v2uint %52 %44
+               OpStore %x %53
+         %56 = OpLoad %v2uint %x
+         %59 = OpBitwiseAnd %v2uint %56 %58
+         %55 = OpINotEqual %v2bool %59 %21
+         %54 = OpSelect %v2uint %55 %21 %61
+         %62 = OpLoad %v2uint %x
+         %63 = OpShiftRightLogical %v2uint %62 %54
+               OpStore %x %63
+         %66 = OpLoad %v2uint %x
+         %69 = OpBitwiseAnd %v2uint %66 %68
+         %65 = OpINotEqual %v2bool %69 %21
+         %64 = OpSelect %v2uint %65 %21 %68
+         %71 = OpLoad %v2uint %x
+         %72 = OpIEqual %v2bool %71 %21
+         %70 = OpSelect %v2uint %72 %74 %21
+         %76 = OpBitwiseOr %v2uint %22 %34
+         %77 = OpBitwiseOr %v2uint %76 %44
+         %78 = OpBitwiseOr %v2uint %77 %54
+         %79 = OpBitwiseOr %v2uint %78 %64
+         %80 = OpBitwiseOr %v2uint %79 %70
+               OpReturnValue %80
                OpFunctionEnd
-%firstTrailingBit_45eb10 = OpFunction %void None %78
-         %81 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %18
-        %res = OpVariable %_ptr_Function_v2uint Function %18
-               OpStore %arg_0 %65
-         %84 = OpLoad %v2uint %arg_0
-         %83 = OpFunctionCall %v2uint %tint_first_trailing_bit %84
-               OpStore %res %83
+%firstTrailingBit_45eb10 = OpFunction %void None %81
+         %84 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %21
+        %res = OpVariable %_ptr_Function_v2uint Function %21
+               OpStore %arg_0 %68
+         %87 = OpLoad %v2uint %arg_0
+         %86 = OpFunctionCall %v2uint %tint_first_trailing_bit %87
+               OpStore %res %86
+         %91 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %92 = OpLoad %v2uint %res
+               OpStore %91 %92
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %86
-         %88 = OpLabel
-         %89 = OpFunctionCall %void %firstTrailingBit_45eb10
+%vertex_main_inner = OpFunction %v4float None %93
+         %95 = OpLabel
+         %96 = OpFunctionCall %void %firstTrailingBit_45eb10
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %78
-         %91 = OpLabel
-         %92 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %92
+%vertex_main = OpFunction %void None %81
+         %98 = OpLabel
+         %99 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %99
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %78
-         %95 = OpLabel
-         %96 = OpFunctionCall %void %firstTrailingBit_45eb10
+%fragment_main = OpFunction %void None %81
+        %102 = OpLabel
+        %103 = OpFunctionCall %void %firstTrailingBit_45eb10
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %78
-         %98 = OpLabel
-         %99 = OpFunctionCall %void %firstTrailingBit_45eb10
+%compute_main = OpFunction %void None %81
+        %105 = OpLabel
+        %106 = OpFunctionCall %void %firstTrailingBit_45eb10
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.wgsl
index 8c02e95..152553d 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/45eb10.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstTrailingBit_45eb10() {
   var arg_0 = vec2<u32>(1u);
   var res : vec2<u32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_45eb10();
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl
index 1a84094..752914f 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl
@@ -25,7 +25,9 @@
 fn firstTrailingBit_47d475() {
   var arg_0 = 1u;
   var res: u32 = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.dxc.hlsl
index ba3f283..48f91d1 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_47d475() {
   uint arg_0 = 1u;
   uint res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.fxc.hlsl
index ba3f283..48f91d1 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_47d475() {
   uint arg_0 = 1u;
   uint res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.glsl
index 69af555..e906b13 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstTrailingBit_47d475() {
   uint arg_0 = 1u;
   uint res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstTrailingBit_47d475() {
   uint arg_0 = 1u;
   uint res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void firstTrailingBit_47d475() {
   uint arg_0 = 1u;
   uint res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.msl b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.msl
index 9053e17..860bb85 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return uint((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstTrailingBit_47d475() {
+void firstTrailingBit_47d475(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint res = tint_first_trailing_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_47d475();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  firstTrailingBit_47d475(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_47d475();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_47d475(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_47d475();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_47d475(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.spvasm
index fba4aa4..06fac6c 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 88
+; Bound: 95
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_trailing_bit "tint_first_trailing_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,9 +40,12 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %uint %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %uint %uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
+         %20 = OpConstantNull %uint
        %bool = OpTypeBool
  %uint_65535 = OpConstant %uint 65535
     %uint_16 = OpConstant %uint 16
@@ -48,85 +58,90 @@
      %uint_1 = OpConstant %uint 1
 %uint_4294967295 = OpConstant %uint 4294967295
        %void = OpTypeVoid
-         %66 = OpTypeFunction %void
-         %74 = OpTypeFunction %v4float
+         %69 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %81 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_trailing_bit = OpFunction %uint None %9
+%tint_first_trailing_bit = OpFunction %uint None %13
           %v = OpFunctionParameter %uint
-         %13 = OpLabel
-          %x = OpVariable %_ptr_Function_uint Function %17
+         %16 = OpLabel
+          %x = OpVariable %_ptr_Function_uint Function %20
                OpStore %x %v
-         %21 = OpLoad %uint %x
-         %23 = OpBitwiseAnd %uint %21 %uint_65535
-         %19 = OpINotEqual %bool %23 %17
-         %18 = OpSelect %uint %19 %17 %uint_16
-         %25 = OpLoad %uint %x
-         %26 = OpShiftRightLogical %uint %25 %18
-               OpStore %x %26
-         %29 = OpLoad %uint %x
-         %31 = OpBitwiseAnd %uint %29 %uint_255
-         %28 = OpINotEqual %bool %31 %17
-         %27 = OpSelect %uint %28 %17 %uint_8
-         %33 = OpLoad %uint %x
-         %34 = OpShiftRightLogical %uint %33 %27
-               OpStore %x %34
-         %37 = OpLoad %uint %x
-         %39 = OpBitwiseAnd %uint %37 %uint_15
-         %36 = OpINotEqual %bool %39 %17
-         %35 = OpSelect %uint %36 %17 %uint_4
-         %41 = OpLoad %uint %x
-         %42 = OpShiftRightLogical %uint %41 %35
-               OpStore %x %42
-         %45 = OpLoad %uint %x
-         %47 = OpBitwiseAnd %uint %45 %uint_3
-         %44 = OpINotEqual %bool %47 %17
-         %43 = OpSelect %uint %44 %17 %uint_2
-         %49 = OpLoad %uint %x
-         %50 = OpShiftRightLogical %uint %49 %43
-               OpStore %x %50
-         %53 = OpLoad %uint %x
-         %55 = OpBitwiseAnd %uint %53 %uint_1
-         %52 = OpINotEqual %bool %55 %17
-         %51 = OpSelect %uint %52 %17 %uint_1
-         %57 = OpLoad %uint %x
-         %58 = OpIEqual %bool %57 %17
-         %56 = OpSelect %uint %58 %uint_4294967295 %17
-         %61 = OpBitwiseOr %uint %18 %27
-         %62 = OpBitwiseOr %uint %61 %35
-         %63 = OpBitwiseOr %uint %62 %43
-         %64 = OpBitwiseOr %uint %63 %51
-         %65 = OpBitwiseOr %uint %64 %56
-               OpReturnValue %65
+         %24 = OpLoad %uint %x
+         %26 = OpBitwiseAnd %uint %24 %uint_65535
+         %22 = OpINotEqual %bool %26 %20
+         %21 = OpSelect %uint %22 %20 %uint_16
+         %28 = OpLoad %uint %x
+         %29 = OpShiftRightLogical %uint %28 %21
+               OpStore %x %29
+         %32 = OpLoad %uint %x
+         %34 = OpBitwiseAnd %uint %32 %uint_255
+         %31 = OpINotEqual %bool %34 %20
+         %30 = OpSelect %uint %31 %20 %uint_8
+         %36 = OpLoad %uint %x
+         %37 = OpShiftRightLogical %uint %36 %30
+               OpStore %x %37
+         %40 = OpLoad %uint %x
+         %42 = OpBitwiseAnd %uint %40 %uint_15
+         %39 = OpINotEqual %bool %42 %20
+         %38 = OpSelect %uint %39 %20 %uint_4
+         %44 = OpLoad %uint %x
+         %45 = OpShiftRightLogical %uint %44 %38
+               OpStore %x %45
+         %48 = OpLoad %uint %x
+         %50 = OpBitwiseAnd %uint %48 %uint_3
+         %47 = OpINotEqual %bool %50 %20
+         %46 = OpSelect %uint %47 %20 %uint_2
+         %52 = OpLoad %uint %x
+         %53 = OpShiftRightLogical %uint %52 %46
+               OpStore %x %53
+         %56 = OpLoad %uint %x
+         %58 = OpBitwiseAnd %uint %56 %uint_1
+         %55 = OpINotEqual %bool %58 %20
+         %54 = OpSelect %uint %55 %20 %uint_1
+         %60 = OpLoad %uint %x
+         %61 = OpIEqual %bool %60 %20
+         %59 = OpSelect %uint %61 %uint_4294967295 %20
+         %64 = OpBitwiseOr %uint %21 %30
+         %65 = OpBitwiseOr %uint %64 %38
+         %66 = OpBitwiseOr %uint %65 %46
+         %67 = OpBitwiseOr %uint %66 %54
+         %68 = OpBitwiseOr %uint %67 %59
+               OpReturnValue %68
                OpFunctionEnd
-%firstTrailingBit_47d475 = OpFunction %void None %66
-         %69 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+%firstTrailingBit_47d475 = OpFunction %void None %69
+         %72 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
-         %72 = OpLoad %uint %arg_0
-         %71 = OpFunctionCall %uint %tint_first_trailing_bit %72
-               OpStore %res %71
+         %75 = OpLoad %uint %arg_0
+         %74 = OpFunctionCall %uint %tint_first_trailing_bit %75
+               OpStore %res %74
+         %79 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %80 = OpLoad %uint %res
+               OpStore %79 %80
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %74
-         %76 = OpLabel
-         %77 = OpFunctionCall %void %firstTrailingBit_47d475
+%vertex_main_inner = OpFunction %v4float None %81
+         %83 = OpLabel
+         %84 = OpFunctionCall %void %firstTrailingBit_47d475
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %66
-         %79 = OpLabel
-         %80 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %80
+%vertex_main = OpFunction %void None %69
+         %86 = OpLabel
+         %87 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %87
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %66
-         %83 = OpLabel
-         %84 = OpFunctionCall %void %firstTrailingBit_47d475
+%fragment_main = OpFunction %void None %69
+         %90 = OpLabel
+         %91 = OpFunctionCall %void %firstTrailingBit_47d475
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %66
-         %86 = OpLabel
-         %87 = OpFunctionCall %void %firstTrailingBit_47d475
+%compute_main = OpFunction %void None %69
+         %93 = OpLabel
+         %94 = OpFunctionCall %void %firstTrailingBit_47d475
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.wgsl
index 4653891..3270f5e 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/47d475.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstTrailingBit_47d475() {
   var arg_0 = 1u;
   var res : u32 = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_47d475();
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl
index 5195122..504958c 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl
@@ -25,7 +25,9 @@
 fn firstTrailingBit_50c072() {
   var arg_0 = vec2<i32>(1i);
   var res: vec2<i32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.dxc.hlsl
index 85abd4a..bae8c92 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_50c072() {
   int2 arg_0 = (1).xx;
   int2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.fxc.hlsl
index 85abd4a..bae8c92 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_50c072() {
   int2 arg_0 = (1).xx;
   int2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.glsl
index 68c8393..f46b39f 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_50c072() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_50c072() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void firstTrailingBit_50c072() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.msl b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.msl
index 1b4e0cf..e1cf220 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return int2((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstTrailingBit_50c072() {
+void firstTrailingBit_50c072(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 res = tint_first_trailing_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_50c072();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  firstTrailingBit_50c072(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_50c072();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_50c072(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_50c072();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_50c072(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.spvasm
index c7663e1..bb911ba 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 106
+; Bound: 113
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_trailing_bit "tint_first_trailing_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,119 +41,127 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
-          %9 = OpTypeFunction %v2int %v2int
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2int %v2int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %20 = OpConstantNull %v2uint
+         %23 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
  %uint_65535 = OpConstant %uint 65535
-         %27 = OpConstantComposite %v2uint %uint_65535 %uint_65535
+         %30 = OpConstantComposite %v2uint %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %30 = OpConstantComposite %v2uint %uint_16 %uint_16
+         %33 = OpConstantComposite %v2uint %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %37 = OpConstantComposite %v2uint %uint_255 %uint_255
+         %40 = OpConstantComposite %v2uint %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %40 = OpConstantComposite %v2uint %uint_8 %uint_8
+         %43 = OpConstantComposite %v2uint %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %47 = OpConstantComposite %v2uint %uint_15 %uint_15
+         %50 = OpConstantComposite %v2uint %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %50 = OpConstantComposite %v2uint %uint_4 %uint_4
+         %53 = OpConstantComposite %v2uint %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %57 = OpConstantComposite %v2uint %uint_3 %uint_3
+         %60 = OpConstantComposite %v2uint %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %60 = OpConstantComposite %v2uint %uint_2 %uint_2
+         %63 = OpConstantComposite %v2uint %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %67 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %70 = OpConstantComposite %v2uint %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %73 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %76 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %80 = OpTypeFunction %void
+         %83 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %85 = OpConstantComposite %v2int %int_1 %int_1
+         %88 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %88 = OpConstantNull %v2int
-         %92 = OpTypeFunction %v4float
+         %91 = OpConstantNull %v2int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %99 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_trailing_bit = OpFunction %v2int None %9
+%tint_first_trailing_bit = OpFunction %v2int None %14
           %v = OpFunctionParameter %v2int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v2uint Function %20
-         %15 = OpBitcast %v2uint %v
-               OpStore %x %15
-         %25 = OpLoad %v2uint %x
-         %28 = OpBitwiseAnd %v2uint %25 %27
-         %22 = OpINotEqual %v2bool %28 %20
-         %21 = OpSelect %v2uint %22 %20 %30
-         %31 = OpLoad %v2uint %x
-         %32 = OpShiftRightLogical %v2uint %31 %21
-               OpStore %x %32
-         %35 = OpLoad %v2uint %x
-         %38 = OpBitwiseAnd %v2uint %35 %37
-         %34 = OpINotEqual %v2bool %38 %20
-         %33 = OpSelect %v2uint %34 %20 %40
-         %41 = OpLoad %v2uint %x
-         %42 = OpShiftRightLogical %v2uint %41 %33
-               OpStore %x %42
-         %45 = OpLoad %v2uint %x
-         %48 = OpBitwiseAnd %v2uint %45 %47
-         %44 = OpINotEqual %v2bool %48 %20
-         %43 = OpSelect %v2uint %44 %20 %50
-         %51 = OpLoad %v2uint %x
-         %52 = OpShiftRightLogical %v2uint %51 %43
-               OpStore %x %52
-         %55 = OpLoad %v2uint %x
-         %58 = OpBitwiseAnd %v2uint %55 %57
-         %54 = OpINotEqual %v2bool %58 %20
-         %53 = OpSelect %v2uint %54 %20 %60
-         %61 = OpLoad %v2uint %x
-         %62 = OpShiftRightLogical %v2uint %61 %53
-               OpStore %x %62
-         %65 = OpLoad %v2uint %x
-         %68 = OpBitwiseAnd %v2uint %65 %67
-         %64 = OpINotEqual %v2bool %68 %20
-         %63 = OpSelect %v2uint %64 %20 %67
-         %70 = OpLoad %v2uint %x
-         %71 = OpIEqual %v2bool %70 %20
-         %69 = OpSelect %v2uint %71 %73 %20
-         %75 = OpBitwiseOr %v2uint %21 %33
-         %76 = OpBitwiseOr %v2uint %75 %43
-         %77 = OpBitwiseOr %v2uint %76 %53
-         %78 = OpBitwiseOr %v2uint %77 %63
-         %79 = OpBitwiseOr %v2uint %78 %69
-         %74 = OpBitcast %v2int %79
-               OpReturnValue %74
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v2uint Function %23
+         %18 = OpBitcast %v2uint %v
+               OpStore %x %18
+         %28 = OpLoad %v2uint %x
+         %31 = OpBitwiseAnd %v2uint %28 %30
+         %25 = OpINotEqual %v2bool %31 %23
+         %24 = OpSelect %v2uint %25 %23 %33
+         %34 = OpLoad %v2uint %x
+         %35 = OpShiftRightLogical %v2uint %34 %24
+               OpStore %x %35
+         %38 = OpLoad %v2uint %x
+         %41 = OpBitwiseAnd %v2uint %38 %40
+         %37 = OpINotEqual %v2bool %41 %23
+         %36 = OpSelect %v2uint %37 %23 %43
+         %44 = OpLoad %v2uint %x
+         %45 = OpShiftRightLogical %v2uint %44 %36
+               OpStore %x %45
+         %48 = OpLoad %v2uint %x
+         %51 = OpBitwiseAnd %v2uint %48 %50
+         %47 = OpINotEqual %v2bool %51 %23
+         %46 = OpSelect %v2uint %47 %23 %53
+         %54 = OpLoad %v2uint %x
+         %55 = OpShiftRightLogical %v2uint %54 %46
+               OpStore %x %55
+         %58 = OpLoad %v2uint %x
+         %61 = OpBitwiseAnd %v2uint %58 %60
+         %57 = OpINotEqual %v2bool %61 %23
+         %56 = OpSelect %v2uint %57 %23 %63
+         %64 = OpLoad %v2uint %x
+         %65 = OpShiftRightLogical %v2uint %64 %56
+               OpStore %x %65
+         %68 = OpLoad %v2uint %x
+         %71 = OpBitwiseAnd %v2uint %68 %70
+         %67 = OpINotEqual %v2bool %71 %23
+         %66 = OpSelect %v2uint %67 %23 %70
+         %73 = OpLoad %v2uint %x
+         %74 = OpIEqual %v2bool %73 %23
+         %72 = OpSelect %v2uint %74 %76 %23
+         %78 = OpBitwiseOr %v2uint %24 %36
+         %79 = OpBitwiseOr %v2uint %78 %46
+         %80 = OpBitwiseOr %v2uint %79 %56
+         %81 = OpBitwiseOr %v2uint %80 %66
+         %82 = OpBitwiseOr %v2uint %81 %72
+         %77 = OpBitcast %v2int %82
+               OpReturnValue %77
                OpFunctionEnd
-%firstTrailingBit_50c072 = OpFunction %void None %80
-         %83 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %88
-        %res = OpVariable %_ptr_Function_v2int Function %88
-               OpStore %arg_0 %85
-         %90 = OpLoad %v2int %arg_0
-         %89 = OpFunctionCall %v2int %tint_first_trailing_bit %90
-               OpStore %res %89
+%firstTrailingBit_50c072 = OpFunction %void None %83
+         %86 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %91
+        %res = OpVariable %_ptr_Function_v2int Function %91
+               OpStore %arg_0 %88
+         %93 = OpLoad %v2int %arg_0
+         %92 = OpFunctionCall %v2int %tint_first_trailing_bit %93
+               OpStore %res %92
+         %97 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %98 = OpLoad %v2int %res
+               OpStore %97 %98
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %92
-         %94 = OpLabel
-         %95 = OpFunctionCall %void %firstTrailingBit_50c072
+%vertex_main_inner = OpFunction %v4float None %99
+        %101 = OpLabel
+        %102 = OpFunctionCall %void %firstTrailingBit_50c072
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %80
-         %97 = OpLabel
-         %98 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %98
+%vertex_main = OpFunction %void None %83
+        %104 = OpLabel
+        %105 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %105
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %80
-        %101 = OpLabel
-        %102 = OpFunctionCall %void %firstTrailingBit_50c072
+%fragment_main = OpFunction %void None %83
+        %108 = OpLabel
+        %109 = OpFunctionCall %void %firstTrailingBit_50c072
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %80
-        %104 = OpLabel
-        %105 = OpFunctionCall %void %firstTrailingBit_50c072
+%compute_main = OpFunction %void None %83
+        %111 = OpLabel
+        %112 = OpFunctionCall %void %firstTrailingBit_50c072
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.wgsl
index 13c690b..0e5b9c8 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/50c072.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstTrailingBit_50c072() {
   var arg_0 = vec2<i32>(1i);
   var res : vec2<i32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_50c072();
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl
index 8983aeb..a4e0eba 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl
@@ -25,7 +25,9 @@
 fn firstTrailingBit_7496d6() {
   var arg_0 = vec3<i32>(1i);
   var res: vec3<i32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.dxc.hlsl
index 91c45c1..657b17d 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_7496d6() {
   int3 arg_0 = (1).xxx;
   int3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.fxc.hlsl
index 91c45c1..657b17d 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_7496d6() {
   int3 arg_0 = (1).xxx;
   int3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.glsl
index 43ab7d8..62b124a 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_7496d6() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_7496d6() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_7496d6() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.msl b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.msl
index c1b2b08..740bbd7 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return int3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstTrailingBit_7496d6() {
+void firstTrailingBit_7496d6(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 res = tint_first_trailing_bit(arg_0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_7496d6();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  firstTrailingBit_7496d6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_7496d6();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_7496d6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_7496d6();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_7496d6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.spvasm
index de9c0d8..320557d 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 106
+; Bound: 113
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_trailing_bit "tint_first_trailing_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,119 +41,127 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
-          %9 = OpTypeFunction %v3int %v3int
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3int %v3int
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %20 = OpConstantNull %v3uint
+         %23 = OpConstantNull %v3uint
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
  %uint_65535 = OpConstant %uint 65535
-         %27 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
+         %30 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %30 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
+         %33 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %37 = OpConstantComposite %v3uint %uint_255 %uint_255 %uint_255
+         %40 = OpConstantComposite %v3uint %uint_255 %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %40 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
+         %43 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %47 = OpConstantComposite %v3uint %uint_15 %uint_15 %uint_15
+         %50 = OpConstantComposite %v3uint %uint_15 %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %50 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
+         %53 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %57 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
+         %60 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %60 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
+         %63 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %67 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %70 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %73 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295
+         %76 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %80 = OpTypeFunction %void
+         %83 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %85 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %88 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %88 = OpConstantNull %v3int
-         %92 = OpTypeFunction %v4float
+         %91 = OpConstantNull %v3int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %99 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_trailing_bit = OpFunction %v3int None %9
+%tint_first_trailing_bit = OpFunction %v3int None %14
           %v = OpFunctionParameter %v3int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v3uint Function %20
-         %15 = OpBitcast %v3uint %v
-               OpStore %x %15
-         %25 = OpLoad %v3uint %x
-         %28 = OpBitwiseAnd %v3uint %25 %27
-         %22 = OpINotEqual %v3bool %28 %20
-         %21 = OpSelect %v3uint %22 %20 %30
-         %31 = OpLoad %v3uint %x
-         %32 = OpShiftRightLogical %v3uint %31 %21
-               OpStore %x %32
-         %35 = OpLoad %v3uint %x
-         %38 = OpBitwiseAnd %v3uint %35 %37
-         %34 = OpINotEqual %v3bool %38 %20
-         %33 = OpSelect %v3uint %34 %20 %40
-         %41 = OpLoad %v3uint %x
-         %42 = OpShiftRightLogical %v3uint %41 %33
-               OpStore %x %42
-         %45 = OpLoad %v3uint %x
-         %48 = OpBitwiseAnd %v3uint %45 %47
-         %44 = OpINotEqual %v3bool %48 %20
-         %43 = OpSelect %v3uint %44 %20 %50
-         %51 = OpLoad %v3uint %x
-         %52 = OpShiftRightLogical %v3uint %51 %43
-               OpStore %x %52
-         %55 = OpLoad %v3uint %x
-         %58 = OpBitwiseAnd %v3uint %55 %57
-         %54 = OpINotEqual %v3bool %58 %20
-         %53 = OpSelect %v3uint %54 %20 %60
-         %61 = OpLoad %v3uint %x
-         %62 = OpShiftRightLogical %v3uint %61 %53
-               OpStore %x %62
-         %65 = OpLoad %v3uint %x
-         %68 = OpBitwiseAnd %v3uint %65 %67
-         %64 = OpINotEqual %v3bool %68 %20
-         %63 = OpSelect %v3uint %64 %20 %67
-         %70 = OpLoad %v3uint %x
-         %71 = OpIEqual %v3bool %70 %20
-         %69 = OpSelect %v3uint %71 %73 %20
-         %75 = OpBitwiseOr %v3uint %21 %33
-         %76 = OpBitwiseOr %v3uint %75 %43
-         %77 = OpBitwiseOr %v3uint %76 %53
-         %78 = OpBitwiseOr %v3uint %77 %63
-         %79 = OpBitwiseOr %v3uint %78 %69
-         %74 = OpBitcast %v3int %79
-               OpReturnValue %74
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v3uint Function %23
+         %18 = OpBitcast %v3uint %v
+               OpStore %x %18
+         %28 = OpLoad %v3uint %x
+         %31 = OpBitwiseAnd %v3uint %28 %30
+         %25 = OpINotEqual %v3bool %31 %23
+         %24 = OpSelect %v3uint %25 %23 %33
+         %34 = OpLoad %v3uint %x
+         %35 = OpShiftRightLogical %v3uint %34 %24
+               OpStore %x %35
+         %38 = OpLoad %v3uint %x
+         %41 = OpBitwiseAnd %v3uint %38 %40
+         %37 = OpINotEqual %v3bool %41 %23
+         %36 = OpSelect %v3uint %37 %23 %43
+         %44 = OpLoad %v3uint %x
+         %45 = OpShiftRightLogical %v3uint %44 %36
+               OpStore %x %45
+         %48 = OpLoad %v3uint %x
+         %51 = OpBitwiseAnd %v3uint %48 %50
+         %47 = OpINotEqual %v3bool %51 %23
+         %46 = OpSelect %v3uint %47 %23 %53
+         %54 = OpLoad %v3uint %x
+         %55 = OpShiftRightLogical %v3uint %54 %46
+               OpStore %x %55
+         %58 = OpLoad %v3uint %x
+         %61 = OpBitwiseAnd %v3uint %58 %60
+         %57 = OpINotEqual %v3bool %61 %23
+         %56 = OpSelect %v3uint %57 %23 %63
+         %64 = OpLoad %v3uint %x
+         %65 = OpShiftRightLogical %v3uint %64 %56
+               OpStore %x %65
+         %68 = OpLoad %v3uint %x
+         %71 = OpBitwiseAnd %v3uint %68 %70
+         %67 = OpINotEqual %v3bool %71 %23
+         %66 = OpSelect %v3uint %67 %23 %70
+         %73 = OpLoad %v3uint %x
+         %74 = OpIEqual %v3bool %73 %23
+         %72 = OpSelect %v3uint %74 %76 %23
+         %78 = OpBitwiseOr %v3uint %24 %36
+         %79 = OpBitwiseOr %v3uint %78 %46
+         %80 = OpBitwiseOr %v3uint %79 %56
+         %81 = OpBitwiseOr %v3uint %80 %66
+         %82 = OpBitwiseOr %v3uint %81 %72
+         %77 = OpBitcast %v3int %82
+               OpReturnValue %77
                OpFunctionEnd
-%firstTrailingBit_7496d6 = OpFunction %void None %80
-         %83 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %88
-        %res = OpVariable %_ptr_Function_v3int Function %88
-               OpStore %arg_0 %85
-         %90 = OpLoad %v3int %arg_0
-         %89 = OpFunctionCall %v3int %tint_first_trailing_bit %90
-               OpStore %res %89
+%firstTrailingBit_7496d6 = OpFunction %void None %83
+         %86 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %91
+        %res = OpVariable %_ptr_Function_v3int Function %91
+               OpStore %arg_0 %88
+         %93 = OpLoad %v3int %arg_0
+         %92 = OpFunctionCall %v3int %tint_first_trailing_bit %93
+               OpStore %res %92
+         %97 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %98 = OpLoad %v3int %res
+               OpStore %97 %98
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %92
-         %94 = OpLabel
-         %95 = OpFunctionCall %void %firstTrailingBit_7496d6
+%vertex_main_inner = OpFunction %v4float None %99
+        %101 = OpLabel
+        %102 = OpFunctionCall %void %firstTrailingBit_7496d6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %80
-         %97 = OpLabel
-         %98 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %98
+%vertex_main = OpFunction %void None %83
+        %104 = OpLabel
+        %105 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %105
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %80
-        %101 = OpLabel
-        %102 = OpFunctionCall %void %firstTrailingBit_7496d6
+%fragment_main = OpFunction %void None %83
+        %108 = OpLabel
+        %109 = OpFunctionCall %void %firstTrailingBit_7496d6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %80
-        %104 = OpLabel
-        %105 = OpFunctionCall %void %firstTrailingBit_7496d6
+%compute_main = OpFunction %void None %83
+        %111 = OpLabel
+        %112 = OpFunctionCall %void %firstTrailingBit_7496d6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.wgsl
index 3909fde..668d753 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/7496d6.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstTrailingBit_7496d6() {
   var arg_0 = vec3<i32>(1i);
   var res : vec3<i32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_7496d6();
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl
index bcb4bd0..8fde1a3 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl
@@ -25,7 +25,9 @@
 fn firstTrailingBit_86551b() {
   var arg_0 = vec4<i32>(1i);
   var res: vec4<i32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.dxc.hlsl
index 3af45b0..431725f 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_86551b() {
   int4 arg_0 = (1).xxxx;
   int4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.fxc.hlsl
index 3af45b0..431725f 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_86551b() {
   int4 arg_0 = (1).xxxx;
   int4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.glsl
index 5738b7c..2921255 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_86551b() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_86551b() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return ivec4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void firstTrailingBit_86551b() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.msl b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.msl
index a74be59..73dac4b 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return int4((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstTrailingBit_86551b() {
+void firstTrailingBit_86551b(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 res = tint_first_trailing_bit(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_86551b();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  firstTrailingBit_86551b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_86551b();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_86551b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_86551b();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_86551b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.spvasm
index b62d585..8ca505f 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 106
+; Bound: 113
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_trailing_bit "tint_first_trailing_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,119 +41,127 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
-          %9 = OpTypeFunction %v4int %v4int
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4int %v4int
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %20 = OpConstantNull %v4uint
+         %23 = OpConstantNull %v4uint
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
  %uint_65535 = OpConstant %uint 65535
-         %27 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
+         %30 = OpConstantComposite %v4uint %uint_65535 %uint_65535 %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %30 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
+         %33 = OpConstantComposite %v4uint %uint_16 %uint_16 %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %37 = OpConstantComposite %v4uint %uint_255 %uint_255 %uint_255 %uint_255
+         %40 = OpConstantComposite %v4uint %uint_255 %uint_255 %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %40 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
+         %43 = OpConstantComposite %v4uint %uint_8 %uint_8 %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %47 = OpConstantComposite %v4uint %uint_15 %uint_15 %uint_15 %uint_15
+         %50 = OpConstantComposite %v4uint %uint_15 %uint_15 %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %50 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
+         %53 = OpConstantComposite %v4uint %uint_4 %uint_4 %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %57 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
+         %60 = OpConstantComposite %v4uint %uint_3 %uint_3 %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %60 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
+         %63 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %67 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %70 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %73 = OpConstantComposite %v4uint %uint_4294967295 %uint_4294967295 %uint_4294967295 %uint_4294967295
+         %76 = OpConstantComposite %v4uint %uint_4294967295 %uint_4294967295 %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %80 = OpTypeFunction %void
+         %83 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %85 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %88 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %88 = OpConstantNull %v4int
-         %92 = OpTypeFunction %v4float
+         %91 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %99 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_trailing_bit = OpFunction %v4int None %9
+%tint_first_trailing_bit = OpFunction %v4int None %14
           %v = OpFunctionParameter %v4int
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v4uint Function %20
-         %15 = OpBitcast %v4uint %v
-               OpStore %x %15
-         %25 = OpLoad %v4uint %x
-         %28 = OpBitwiseAnd %v4uint %25 %27
-         %22 = OpINotEqual %v4bool %28 %20
-         %21 = OpSelect %v4uint %22 %20 %30
-         %31 = OpLoad %v4uint %x
-         %32 = OpShiftRightLogical %v4uint %31 %21
-               OpStore %x %32
-         %35 = OpLoad %v4uint %x
-         %38 = OpBitwiseAnd %v4uint %35 %37
-         %34 = OpINotEqual %v4bool %38 %20
-         %33 = OpSelect %v4uint %34 %20 %40
-         %41 = OpLoad %v4uint %x
-         %42 = OpShiftRightLogical %v4uint %41 %33
-               OpStore %x %42
-         %45 = OpLoad %v4uint %x
-         %48 = OpBitwiseAnd %v4uint %45 %47
-         %44 = OpINotEqual %v4bool %48 %20
-         %43 = OpSelect %v4uint %44 %20 %50
-         %51 = OpLoad %v4uint %x
-         %52 = OpShiftRightLogical %v4uint %51 %43
-               OpStore %x %52
-         %55 = OpLoad %v4uint %x
-         %58 = OpBitwiseAnd %v4uint %55 %57
-         %54 = OpINotEqual %v4bool %58 %20
-         %53 = OpSelect %v4uint %54 %20 %60
-         %61 = OpLoad %v4uint %x
-         %62 = OpShiftRightLogical %v4uint %61 %53
-               OpStore %x %62
-         %65 = OpLoad %v4uint %x
-         %68 = OpBitwiseAnd %v4uint %65 %67
-         %64 = OpINotEqual %v4bool %68 %20
-         %63 = OpSelect %v4uint %64 %20 %67
-         %70 = OpLoad %v4uint %x
-         %71 = OpIEqual %v4bool %70 %20
-         %69 = OpSelect %v4uint %71 %73 %20
-         %75 = OpBitwiseOr %v4uint %21 %33
-         %76 = OpBitwiseOr %v4uint %75 %43
-         %77 = OpBitwiseOr %v4uint %76 %53
-         %78 = OpBitwiseOr %v4uint %77 %63
-         %79 = OpBitwiseOr %v4uint %78 %69
-         %74 = OpBitcast %v4int %79
-               OpReturnValue %74
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v4uint Function %23
+         %18 = OpBitcast %v4uint %v
+               OpStore %x %18
+         %28 = OpLoad %v4uint %x
+         %31 = OpBitwiseAnd %v4uint %28 %30
+         %25 = OpINotEqual %v4bool %31 %23
+         %24 = OpSelect %v4uint %25 %23 %33
+         %34 = OpLoad %v4uint %x
+         %35 = OpShiftRightLogical %v4uint %34 %24
+               OpStore %x %35
+         %38 = OpLoad %v4uint %x
+         %41 = OpBitwiseAnd %v4uint %38 %40
+         %37 = OpINotEqual %v4bool %41 %23
+         %36 = OpSelect %v4uint %37 %23 %43
+         %44 = OpLoad %v4uint %x
+         %45 = OpShiftRightLogical %v4uint %44 %36
+               OpStore %x %45
+         %48 = OpLoad %v4uint %x
+         %51 = OpBitwiseAnd %v4uint %48 %50
+         %47 = OpINotEqual %v4bool %51 %23
+         %46 = OpSelect %v4uint %47 %23 %53
+         %54 = OpLoad %v4uint %x
+         %55 = OpShiftRightLogical %v4uint %54 %46
+               OpStore %x %55
+         %58 = OpLoad %v4uint %x
+         %61 = OpBitwiseAnd %v4uint %58 %60
+         %57 = OpINotEqual %v4bool %61 %23
+         %56 = OpSelect %v4uint %57 %23 %63
+         %64 = OpLoad %v4uint %x
+         %65 = OpShiftRightLogical %v4uint %64 %56
+               OpStore %x %65
+         %68 = OpLoad %v4uint %x
+         %71 = OpBitwiseAnd %v4uint %68 %70
+         %67 = OpINotEqual %v4bool %71 %23
+         %66 = OpSelect %v4uint %67 %23 %70
+         %73 = OpLoad %v4uint %x
+         %74 = OpIEqual %v4bool %73 %23
+         %72 = OpSelect %v4uint %74 %76 %23
+         %78 = OpBitwiseOr %v4uint %24 %36
+         %79 = OpBitwiseOr %v4uint %78 %46
+         %80 = OpBitwiseOr %v4uint %79 %56
+         %81 = OpBitwiseOr %v4uint %80 %66
+         %82 = OpBitwiseOr %v4uint %81 %72
+         %77 = OpBitcast %v4int %82
+               OpReturnValue %77
                OpFunctionEnd
-%firstTrailingBit_86551b = OpFunction %void None %80
-         %83 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %88
-        %res = OpVariable %_ptr_Function_v4int Function %88
-               OpStore %arg_0 %85
-         %90 = OpLoad %v4int %arg_0
-         %89 = OpFunctionCall %v4int %tint_first_trailing_bit %90
-               OpStore %res %89
+%firstTrailingBit_86551b = OpFunction %void None %83
+         %86 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %91
+        %res = OpVariable %_ptr_Function_v4int Function %91
+               OpStore %arg_0 %88
+         %93 = OpLoad %v4int %arg_0
+         %92 = OpFunctionCall %v4int %tint_first_trailing_bit %93
+               OpStore %res %92
+         %97 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %98 = OpLoad %v4int %res
+               OpStore %97 %98
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %92
-         %94 = OpLabel
-         %95 = OpFunctionCall %void %firstTrailingBit_86551b
+%vertex_main_inner = OpFunction %v4float None %99
+        %101 = OpLabel
+        %102 = OpFunctionCall %void %firstTrailingBit_86551b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %80
-         %97 = OpLabel
-         %98 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %98
+%vertex_main = OpFunction %void None %83
+        %104 = OpLabel
+        %105 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %105
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %80
-        %101 = OpLabel
-        %102 = OpFunctionCall %void %firstTrailingBit_86551b
+%fragment_main = OpFunction %void None %83
+        %108 = OpLabel
+        %109 = OpFunctionCall %void %firstTrailingBit_86551b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %80
-        %104 = OpLabel
-        %105 = OpFunctionCall %void %firstTrailingBit_86551b
+%compute_main = OpFunction %void None %83
+        %111 = OpLabel
+        %112 = OpFunctionCall %void %firstTrailingBit_86551b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.wgsl
index c6db87c..dad17ef 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/86551b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstTrailingBit_86551b() {
   var arg_0 = vec4<i32>(1i);
   var res : vec4<i32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_86551b();
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl
index 048b174..7ee728c 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl
@@ -25,7 +25,9 @@
 fn firstTrailingBit_cb51ce() {
   var arg_0 = vec3<u32>(1u);
   var res: vec3<u32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.dxc.hlsl
index 27105f4..65f5609 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.dxc.hlsl
@@ -13,9 +13,12 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_cb51ce() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.fxc.hlsl
index 27105f4..65f5609 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.fxc.hlsl
@@ -13,9 +13,12 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void firstTrailingBit_cb51ce() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.glsl
index 3afc2b0..d86aa92 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.glsl
@@ -15,9 +15,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_cb51ce() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -51,9 +56,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_cb51ce() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -81,9 +91,14 @@
   return uvec3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void firstTrailingBit_cb51ce() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = tint_first_trailing_bit(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.msl b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.msl
index d35012c..7d808d2 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.msl
@@ -16,34 +16,35 @@
   return uint3((((((b16 | b8) | b4) | b2) | b1) | is_zero));
 }
 
-void firstTrailingBit_cb51ce() {
+void firstTrailingBit_cb51ce(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 res = tint_first_trailing_bit(arg_0);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  firstTrailingBit_cb51ce();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  firstTrailingBit_cb51ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  firstTrailingBit_cb51ce();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  firstTrailingBit_cb51ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  firstTrailingBit_cb51ce();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  firstTrailingBit_cb51ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.spvasm
index e1d6269..225e928 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 100
+; Bound: 107
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_first_trailing_bit "tint_first_trailing_bit"
                OpName %v "v"
                OpName %x "x"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,111 +41,119 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-          %9 = OpTypeFunction %v3uint %v3uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3uint %v3uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %18 = OpConstantNull %v3uint
+         %21 = OpConstantNull %v3uint
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
  %uint_65535 = OpConstant %uint 65535
-         %25 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
+         %28 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
     %uint_16 = OpConstant %uint 16
-         %28 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
+         %31 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
    %uint_255 = OpConstant %uint 255
-         %35 = OpConstantComposite %v3uint %uint_255 %uint_255 %uint_255
+         %38 = OpConstantComposite %v3uint %uint_255 %uint_255 %uint_255
      %uint_8 = OpConstant %uint 8
-         %38 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
+         %41 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
     %uint_15 = OpConstant %uint 15
-         %45 = OpConstantComposite %v3uint %uint_15 %uint_15 %uint_15
+         %48 = OpConstantComposite %v3uint %uint_15 %uint_15 %uint_15
      %uint_4 = OpConstant %uint 4
-         %48 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
+         %51 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
      %uint_3 = OpConstant %uint 3
-         %55 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
+         %58 = OpConstantComposite %v3uint %uint_3 %uint_3 %uint_3
      %uint_2 = OpConstant %uint 2
-         %58 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
+         %61 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
      %uint_1 = OpConstant %uint 1
-         %65 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %68 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %uint_4294967295 = OpConstant %uint 4294967295
-         %71 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295
+         %74 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295
        %void = OpTypeVoid
-         %78 = OpTypeFunction %void
-         %86 = OpTypeFunction %v4float
+         %81 = OpTypeFunction %void
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %93 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_first_trailing_bit = OpFunction %v3uint None %9
+%tint_first_trailing_bit = OpFunction %v3uint None %14
           %v = OpFunctionParameter %v3uint
-         %14 = OpLabel
-          %x = OpVariable %_ptr_Function_v3uint Function %18
+         %17 = OpLabel
+          %x = OpVariable %_ptr_Function_v3uint Function %21
                OpStore %x %v
-         %23 = OpLoad %v3uint %x
-         %26 = OpBitwiseAnd %v3uint %23 %25
-         %20 = OpINotEqual %v3bool %26 %18
-         %19 = OpSelect %v3uint %20 %18 %28
-         %29 = OpLoad %v3uint %x
-         %30 = OpShiftRightLogical %v3uint %29 %19
-               OpStore %x %30
-         %33 = OpLoad %v3uint %x
-         %36 = OpBitwiseAnd %v3uint %33 %35
-         %32 = OpINotEqual %v3bool %36 %18
-         %31 = OpSelect %v3uint %32 %18 %38
-         %39 = OpLoad %v3uint %x
-         %40 = OpShiftRightLogical %v3uint %39 %31
-               OpStore %x %40
-         %43 = OpLoad %v3uint %x
-         %46 = OpBitwiseAnd %v3uint %43 %45
-         %42 = OpINotEqual %v3bool %46 %18
-         %41 = OpSelect %v3uint %42 %18 %48
-         %49 = OpLoad %v3uint %x
-         %50 = OpShiftRightLogical %v3uint %49 %41
-               OpStore %x %50
-         %53 = OpLoad %v3uint %x
-         %56 = OpBitwiseAnd %v3uint %53 %55
-         %52 = OpINotEqual %v3bool %56 %18
-         %51 = OpSelect %v3uint %52 %18 %58
-         %59 = OpLoad %v3uint %x
-         %60 = OpShiftRightLogical %v3uint %59 %51
-               OpStore %x %60
-         %63 = OpLoad %v3uint %x
-         %66 = OpBitwiseAnd %v3uint %63 %65
-         %62 = OpINotEqual %v3bool %66 %18
-         %61 = OpSelect %v3uint %62 %18 %65
-         %68 = OpLoad %v3uint %x
-         %69 = OpIEqual %v3bool %68 %18
-         %67 = OpSelect %v3uint %69 %71 %18
-         %73 = OpBitwiseOr %v3uint %19 %31
-         %74 = OpBitwiseOr %v3uint %73 %41
-         %75 = OpBitwiseOr %v3uint %74 %51
-         %76 = OpBitwiseOr %v3uint %75 %61
-         %77 = OpBitwiseOr %v3uint %76 %67
-               OpReturnValue %77
+         %26 = OpLoad %v3uint %x
+         %29 = OpBitwiseAnd %v3uint %26 %28
+         %23 = OpINotEqual %v3bool %29 %21
+         %22 = OpSelect %v3uint %23 %21 %31
+         %32 = OpLoad %v3uint %x
+         %33 = OpShiftRightLogical %v3uint %32 %22
+               OpStore %x %33
+         %36 = OpLoad %v3uint %x
+         %39 = OpBitwiseAnd %v3uint %36 %38
+         %35 = OpINotEqual %v3bool %39 %21
+         %34 = OpSelect %v3uint %35 %21 %41
+         %42 = OpLoad %v3uint %x
+         %43 = OpShiftRightLogical %v3uint %42 %34
+               OpStore %x %43
+         %46 = OpLoad %v3uint %x
+         %49 = OpBitwiseAnd %v3uint %46 %48
+         %45 = OpINotEqual %v3bool %49 %21
+         %44 = OpSelect %v3uint %45 %21 %51
+         %52 = OpLoad %v3uint %x
+         %53 = OpShiftRightLogical %v3uint %52 %44
+               OpStore %x %53
+         %56 = OpLoad %v3uint %x
+         %59 = OpBitwiseAnd %v3uint %56 %58
+         %55 = OpINotEqual %v3bool %59 %21
+         %54 = OpSelect %v3uint %55 %21 %61
+         %62 = OpLoad %v3uint %x
+         %63 = OpShiftRightLogical %v3uint %62 %54
+               OpStore %x %63
+         %66 = OpLoad %v3uint %x
+         %69 = OpBitwiseAnd %v3uint %66 %68
+         %65 = OpINotEqual %v3bool %69 %21
+         %64 = OpSelect %v3uint %65 %21 %68
+         %71 = OpLoad %v3uint %x
+         %72 = OpIEqual %v3bool %71 %21
+         %70 = OpSelect %v3uint %72 %74 %21
+         %76 = OpBitwiseOr %v3uint %22 %34
+         %77 = OpBitwiseOr %v3uint %76 %44
+         %78 = OpBitwiseOr %v3uint %77 %54
+         %79 = OpBitwiseOr %v3uint %78 %64
+         %80 = OpBitwiseOr %v3uint %79 %70
+               OpReturnValue %80
                OpFunctionEnd
-%firstTrailingBit_cb51ce = OpFunction %void None %78
-         %81 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %18
-        %res = OpVariable %_ptr_Function_v3uint Function %18
-               OpStore %arg_0 %65
-         %84 = OpLoad %v3uint %arg_0
-         %83 = OpFunctionCall %v3uint %tint_first_trailing_bit %84
-               OpStore %res %83
+%firstTrailingBit_cb51ce = OpFunction %void None %81
+         %84 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %21
+        %res = OpVariable %_ptr_Function_v3uint Function %21
+               OpStore %arg_0 %68
+         %87 = OpLoad %v3uint %arg_0
+         %86 = OpFunctionCall %v3uint %tint_first_trailing_bit %87
+               OpStore %res %86
+         %91 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %92 = OpLoad %v3uint %res
+               OpStore %91 %92
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %86
-         %88 = OpLabel
-         %89 = OpFunctionCall %void %firstTrailingBit_cb51ce
+%vertex_main_inner = OpFunction %v4float None %93
+         %95 = OpLabel
+         %96 = OpFunctionCall %void %firstTrailingBit_cb51ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %78
-         %91 = OpLabel
-         %92 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %92
+%vertex_main = OpFunction %void None %81
+         %98 = OpLabel
+         %99 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %99
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %78
-         %95 = OpLabel
-         %96 = OpFunctionCall %void %firstTrailingBit_cb51ce
+%fragment_main = OpFunction %void None %81
+        %102 = OpLabel
+        %103 = OpFunctionCall %void %firstTrailingBit_cb51ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %78
-         %98 = OpLabel
-         %99 = OpFunctionCall %void %firstTrailingBit_cb51ce
+%compute_main = OpFunction %void None %81
+        %105 = OpLabel
+        %106 = OpFunctionCall %void %firstTrailingBit_cb51ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.wgsl
index cb7c799..2eb3c32 100644
--- a/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/firstTrailingBit/cb51ce.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn firstTrailingBit_cb51ce() {
   var arg_0 = vec3<u32>(1u);
   var res : vec3<u32> = firstTrailingBit(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   firstTrailingBit_cb51ce();
diff --git a/test/tint/builtins/gen/var/floor/218952.wgsl b/test/tint/builtins/gen/var/floor/218952.wgsl
index f90b4af..f5682b3 100644
--- a/test/tint/builtins/gen/var/floor/218952.wgsl
+++ b/test/tint/builtins/gen/var/floor/218952.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.5);
   var res = floor(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_218952();
diff --git a/test/tint/builtins/gen/var/floor/3802c0.wgsl b/test/tint/builtins/gen/var/floor/3802c0.wgsl
index 220e79d..d1a7844 100644
--- a/test/tint/builtins/gen/var/floor/3802c0.wgsl
+++ b/test/tint/builtins/gen/var/floor/3802c0.wgsl
@@ -27,7 +27,9 @@
 fn floor_3802c0() {
   var arg_0 = vec3<f16>(1.5h);
   var res: vec3<f16> = floor(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.dxc.hlsl
index b1cd810..36592b2 100644
--- a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_3802c0() {
   vector<float16_t, 3> arg_0 = (float16_t(1.5h)).xxx;
   vector<float16_t, 3> res = floor(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.fxc.hlsl
index 7ce3aad..2fa208a 100644
--- a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_3802c0() {
   vector<float16_t, 3> arg_0 = (float16_t(1.5h)).xxx;
   vector<float16_t, 3> res = floor(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.glsl b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.glsl
index 6216160..c8322f6 100644
--- a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void floor_3802c0() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void floor_3802c0() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void floor_3802c0() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.msl b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.msl
index dd9f442..b284ebe 100644
--- a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_3802c0() {
+void floor_3802c0(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.5h);
   half3 res = floor(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_3802c0();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  floor_3802c0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_3802c0();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  floor_3802c0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_3802c0();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  floor_3802c0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.spvasm
index c903d74..98c237b 100644
--- a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_3802c0 "floor_3802c0"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v3half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v3half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_3802c0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Floor %22
-               OpStore %res %20
+%floor_3802c0 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Floor %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %floor_3802c0
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %floor_3802c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %floor_3802c0
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %floor_3802c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %floor_3802c0
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %floor_3802c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.wgsl
index 4ca298a..d9281f2 100644
--- a/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/floor/3802c0.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn floor_3802c0() {
   var arg_0 = vec3<f16>(1.5h);
   var res : vec3<f16> = floor(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_3802c0();
diff --git a/test/tint/builtins/gen/var/floor/3bccc4.wgsl b/test/tint/builtins/gen/var/floor/3bccc4.wgsl
index c6aaa67..136a178 100644
--- a/test/tint/builtins/gen/var/floor/3bccc4.wgsl
+++ b/test/tint/builtins/gen/var/floor/3bccc4.wgsl
@@ -25,7 +25,9 @@
 fn floor_3bccc4() {
   var arg_0 = vec4<f32>(1.5f);
   var res: vec4<f32> = floor(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.dxc.hlsl
index 210bcae..915e623 100644
--- a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_3bccc4() {
   float4 arg_0 = (1.5f).xxxx;
   float4 res = floor(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.fxc.hlsl
index 210bcae..915e623 100644
--- a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_3bccc4() {
   float4 arg_0 = (1.5f).xxxx;
   float4 res = floor(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.glsl b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.glsl
index 736b533..bd508f3 100644
--- a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void floor_3bccc4() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void floor_3bccc4() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void floor_3bccc4() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.msl b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.msl
index 95536b4..1f7e16a 100644
--- a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_3bccc4() {
+void floor_3bccc4(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.5f);
   float4 res = floor(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_3bccc4();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  floor_3bccc4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_3bccc4();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  floor_3bccc4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_3bccc4();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  floor_3bccc4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.spvasm
index 5d0dc06..feb1aaa 100644
--- a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_3bccc4 "floor_3bccc4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %14 = OpConstantComposite %v4float %float_1_5 %float_1_5 %float_1_5 %float_1_5
+         %17 = OpConstantComposite %v4float %float_1_5 %float_1_5 %float_1_5 %float_1_5
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_3bccc4 = OpFunction %void None %9
-         %12 = OpLabel
+%floor_3bccc4 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Floor %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Floor %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %floor_3bccc4
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %floor_3bccc4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %floor_3bccc4
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %floor_3bccc4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %floor_3bccc4
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %floor_3bccc4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.wgsl
index eaff135..dc7c959 100644
--- a/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/floor/3bccc4.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn floor_3bccc4() {
   var arg_0 = vec4<f32>(1.5f);
   var res : vec4<f32> = floor(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_3bccc4();
diff --git a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl
index 30aa2d3..771cdfc 100644
--- a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl
+++ b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl
@@ -25,7 +25,9 @@
 fn floor_5fc9ac() {
   var arg_0 = vec2<f32>(1.5f);
   var res: vec2<f32> = floor(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.dxc.hlsl
index 2a8816e..f85f8e8 100644
--- a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_5fc9ac() {
   float2 arg_0 = (1.5f).xx;
   float2 res = floor(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.fxc.hlsl
index 2a8816e..f85f8e8 100644
--- a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_5fc9ac() {
   float2 arg_0 = (1.5f).xx;
   float2 res = floor(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.glsl b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.glsl
index 5ee5c6f..2666908 100644
--- a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void floor_5fc9ac() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void floor_5fc9ac() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void floor_5fc9ac() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.msl b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.msl
index 73e10cc..8ebd691 100644
--- a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_5fc9ac() {
+void floor_5fc9ac(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.5f);
   float2 res = floor(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_5fc9ac();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  floor_5fc9ac(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_5fc9ac();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  floor_5fc9ac(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_5fc9ac();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  floor_5fc9ac(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.spvasm b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.spvasm
index 1790209..4d1ad26 100644
--- a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_5fc9ac "floor_5fc9ac"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %15 = OpConstantComposite %v2float %float_1_5 %float_1_5
+         %18 = OpConstantComposite %v2float %float_1_5 %float_1_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_5fc9ac = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Floor %21
-               OpStore %res %19
+%floor_5fc9ac = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Floor %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %floor_5fc9ac
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %floor_5fc9ac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %floor_5fc9ac
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %floor_5fc9ac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %floor_5fc9ac
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %floor_5fc9ac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.wgsl b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.wgsl
index 4d54928..59725f5 100644
--- a/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/floor/5fc9ac.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn floor_5fc9ac() {
   var arg_0 = vec2<f32>(1.5f);
   var res : vec2<f32> = floor(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_5fc9ac();
diff --git a/test/tint/builtins/gen/var/floor/60d7ea.wgsl b/test/tint/builtins/gen/var/floor/60d7ea.wgsl
index 02f51ae..3bbc891 100644
--- a/test/tint/builtins/gen/var/floor/60d7ea.wgsl
+++ b/test/tint/builtins/gen/var/floor/60d7ea.wgsl
@@ -25,7 +25,9 @@
 fn floor_60d7ea() {
   var arg_0 = vec3<f32>(1.5f);
   var res: vec3<f32> = floor(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.dxc.hlsl
index b9c579d..9a88b6d 100644
--- a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_60d7ea() {
   float3 arg_0 = (1.5f).xxx;
   float3 res = floor(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.fxc.hlsl
index b9c579d..9a88b6d 100644
--- a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_60d7ea() {
   float3 arg_0 = (1.5f).xxx;
   float3 res = floor(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.glsl b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.glsl
index 738c75c..7a52a77 100644
--- a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void floor_60d7ea() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void floor_60d7ea() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void floor_60d7ea() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.msl b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.msl
index fe334d7..3441ee4 100644
--- a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_60d7ea() {
+void floor_60d7ea(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.5f);
   float3 res = floor(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_60d7ea();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  floor_60d7ea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_60d7ea();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  floor_60d7ea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_60d7ea();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  floor_60d7ea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.spvasm
index a4445c3..0c5637f 100644
--- a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_60d7ea "floor_60d7ea"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %15 = OpConstantComposite %v3float %float_1_5 %float_1_5 %float_1_5
+         %18 = OpConstantComposite %v3float %float_1_5 %float_1_5 %float_1_5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_60d7ea = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Floor %21
-               OpStore %res %19
+%floor_60d7ea = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Floor %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %floor_60d7ea
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %floor_60d7ea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %floor_60d7ea
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %floor_60d7ea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %floor_60d7ea
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %floor_60d7ea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.wgsl
index a1337c9..9a1e78a 100644
--- a/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/floor/60d7ea.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn floor_60d7ea() {
   var arg_0 = vec3<f32>(1.5f);
   var res : vec3<f32> = floor(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_60d7ea();
diff --git a/test/tint/builtins/gen/var/floor/66f154.wgsl b/test/tint/builtins/gen/var/floor/66f154.wgsl
index e3d068a..42fb458 100644
--- a/test/tint/builtins/gen/var/floor/66f154.wgsl
+++ b/test/tint/builtins/gen/var/floor/66f154.wgsl
@@ -25,7 +25,9 @@
 fn floor_66f154() {
   var arg_0 = 1.5f;
   var res: f32 = floor(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.dxc.hlsl
index 75ca7db..4d1b4bf 100644
--- a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_66f154() {
   float arg_0 = 1.5f;
   float res = floor(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.fxc.hlsl
index 75ca7db..4d1b4bf 100644
--- a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_66f154() {
   float arg_0 = 1.5f;
   float res = floor(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.glsl b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.glsl
index 890782c..2308427 100644
--- a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void floor_66f154() {
   float arg_0 = 1.5f;
   float res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void floor_66f154() {
   float arg_0 = 1.5f;
   float res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void floor_66f154() {
   float arg_0 = 1.5f;
   float res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.msl b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.msl
index 26d2cac..ab4557a 100644
--- a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_66f154() {
+void floor_66f154(device float* const tint_symbol_1) {
   float arg_0 = 1.5f;
   float res = floor(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_66f154();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  floor_66f154(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_66f154();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  floor_66f154(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_66f154();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  floor_66f154(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.spvasm b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.spvasm
index 9d9ea6a..05f29e5 100644
--- a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_66f154 "floor_66f154"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_66f154 = OpFunction %void None %9
-         %12 = OpLabel
+%floor_66f154 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1_5
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Floor %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Floor %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %floor_66f154
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %floor_66f154
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %floor_66f154
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %floor_66f154
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %floor_66f154
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %floor_66f154
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.wgsl b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.wgsl
index c2a4db4..d3d9518 100644
--- a/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/floor/66f154.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn floor_66f154() {
   var arg_0 = 1.5f;
   var res : f32 = floor(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_66f154();
diff --git a/test/tint/builtins/gen/var/floor/84658c.wgsl b/test/tint/builtins/gen/var/floor/84658c.wgsl
index aa130e4..1825607 100644
--- a/test/tint/builtins/gen/var/floor/84658c.wgsl
+++ b/test/tint/builtins/gen/var/floor/84658c.wgsl
@@ -27,7 +27,9 @@
 fn floor_84658c() {
   var arg_0 = vec2<f16>(1.5h);
   var res: vec2<f16> = floor(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.dxc.hlsl
index 0ed6ecd..0060489 100644
--- a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_84658c() {
   vector<float16_t, 2> arg_0 = (float16_t(1.5h)).xx;
   vector<float16_t, 2> res = floor(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.fxc.hlsl
index b20ecfd..196909f 100644
--- a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_84658c() {
   vector<float16_t, 2> arg_0 = (float16_t(1.5h)).xx;
   vector<float16_t, 2> res = floor(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.glsl b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.glsl
index 1403f8e..bf4c719 100644
--- a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void floor_84658c() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void floor_84658c() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void floor_84658c() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.msl b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.msl
index 41e3d05..022db86 100644
--- a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_84658c() {
+void floor_84658c(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.5h);
   half2 res = floor(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_84658c();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  floor_84658c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_84658c();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  floor_84658c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_84658c();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  floor_84658c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.spvasm
index 0a4395d..9048fb0 100644
--- a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_84658c "floor_84658c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v2half %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v2half %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_84658c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Floor %22
-               OpStore %res %20
+%floor_84658c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Floor %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %floor_84658c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %floor_84658c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %floor_84658c
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %floor_84658c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %floor_84658c
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %floor_84658c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.wgsl
index d823b5a..baa7ad2 100644
--- a/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/floor/84658c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn floor_84658c() {
   var arg_0 = vec2<f16>(1.5h);
   var res : vec2<f16> = floor(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_84658c();
diff --git a/test/tint/builtins/gen/var/floor/953774.wgsl b/test/tint/builtins/gen/var/floor/953774.wgsl
index f5fa915..7e3c991 100644
--- a/test/tint/builtins/gen/var/floor/953774.wgsl
+++ b/test/tint/builtins/gen/var/floor/953774.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.5);
   var res = floor(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_953774();
diff --git a/test/tint/builtins/gen/var/floor/a2d31b.wgsl b/test/tint/builtins/gen/var/floor/a2d31b.wgsl
index 3bdccebd..fee78b2 100644
--- a/test/tint/builtins/gen/var/floor/a2d31b.wgsl
+++ b/test/tint/builtins/gen/var/floor/a2d31b.wgsl
@@ -27,7 +27,9 @@
 fn floor_a2d31b() {
   var arg_0 = vec4<f16>(1.5h);
   var res: vec4<f16> = floor(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.dxc.hlsl
index d32492c..15b62e4 100644
--- a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_a2d31b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.5h)).xxxx;
   vector<float16_t, 4> res = floor(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.fxc.hlsl
index ff59a5f..47973da 100644
--- a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_a2d31b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.5h)).xxxx;
   vector<float16_t, 4> res = floor(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.glsl b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.glsl
index dc60c85..57e720a 100644
--- a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void floor_a2d31b() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void floor_a2d31b() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void floor_a2d31b() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.msl b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.msl
index c261f68..6b69838 100644
--- a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_a2d31b() {
+void floor_a2d31b(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.5h);
   half4 res = floor(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_a2d31b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  floor_a2d31b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_a2d31b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  floor_a2d31b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_a2d31b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  floor_a2d31b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.spvasm
index 763f2fc..340a2d1 100644
--- a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_a2d31b "floor_a2d31b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v4half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v4half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_a2d31b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Floor %22
-               OpStore %res %20
+%floor_a2d31b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Floor %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %floor_a2d31b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %floor_a2d31b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %floor_a2d31b
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %floor_a2d31b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %floor_a2d31b
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %floor_a2d31b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.wgsl
index ec9a507..3d27339 100644
--- a/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/floor/a2d31b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn floor_a2d31b() {
   var arg_0 = vec4<f16>(1.5h);
   var res : vec4<f16> = floor(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_a2d31b();
diff --git a/test/tint/builtins/gen/var/floor/b6e09c.wgsl b/test/tint/builtins/gen/var/floor/b6e09c.wgsl
index a73b789..deb36b4 100644
--- a/test/tint/builtins/gen/var/floor/b6e09c.wgsl
+++ b/test/tint/builtins/gen/var/floor/b6e09c.wgsl
@@ -27,7 +27,9 @@
 fn floor_b6e09c() {
   var arg_0 = 1.5h;
   var res: f16 = floor(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.dxc.hlsl
index 6094c41..085e182 100644
--- a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_b6e09c() {
   float16_t arg_0 = float16_t(1.5h);
   float16_t res = floor(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.fxc.hlsl
index 016c2d6..ef23db8 100644
--- a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void floor_b6e09c() {
   float16_t arg_0 = float16_t(1.5h);
   float16_t res = floor(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.glsl b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.glsl
index 530debd..e4c1a50 100644
--- a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void floor_b6e09c() {
   float16_t arg_0 = 1.5hf;
   float16_t res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void floor_b6e09c() {
   float16_t arg_0 = 1.5hf;
   float16_t res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void floor_b6e09c() {
   float16_t arg_0 = 1.5hf;
   float16_t res = floor(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.msl b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.msl
index 4907c87..9ccf165 100644
--- a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void floor_b6e09c() {
+void floor_b6e09c(device half* const tint_symbol_1) {
   half arg_0 = 1.5h;
   half res = floor(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  floor_b6e09c();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  floor_b6e09c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  floor_b6e09c();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  floor_b6e09c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  floor_b6e09c();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  floor_b6e09c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.spvasm
index 7db04db..c342135 100644
--- a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %floor_b6e09c "floor_b6e09c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%floor_b6e09c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%floor_b6e09c = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1_8p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Floor %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Floor %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %floor_b6e09c
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %floor_b6e09c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %floor_b6e09c
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %floor_b6e09c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %floor_b6e09c
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %floor_b6e09c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.wgsl
index 62567c5..1990e4b 100644
--- a/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/floor/b6e09c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn floor_b6e09c() {
   var arg_0 = 1.5h;
   var res : f16 = floor(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_b6e09c();
diff --git a/test/tint/builtins/gen/var/floor/dcd5a2.wgsl b/test/tint/builtins/gen/var/floor/dcd5a2.wgsl
index 51ae5bc..c693b8c 100644
--- a/test/tint/builtins/gen/var/floor/dcd5a2.wgsl
+++ b/test/tint/builtins/gen/var/floor/dcd5a2.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.5;
   var res = floor(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_dcd5a2();
diff --git a/test/tint/builtins/gen/var/floor/e585ef.wgsl b/test/tint/builtins/gen/var/floor/e585ef.wgsl
index 80b301e..fdd8aa9 100644
--- a/test/tint/builtins/gen/var/floor/e585ef.wgsl
+++ b/test/tint/builtins/gen/var/floor/e585ef.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.5);
   var res = floor(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   floor_e585ef();
diff --git a/test/tint/builtins/gen/var/fma/143d5d.wgsl b/test/tint/builtins/gen/var/fma/143d5d.wgsl
index 124c6a7..a0cfee5 100644
--- a/test/tint/builtins/gen/var/fma/143d5d.wgsl
+++ b/test/tint/builtins/gen/var/fma/143d5d.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec4(1.);
   var res = fma(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_143d5d();
diff --git a/test/tint/builtins/gen/var/fma/1f5084.wgsl b/test/tint/builtins/gen/var/fma/1f5084.wgsl
index 20fb093..41bad76 100644
--- a/test/tint/builtins/gen/var/fma/1f5084.wgsl
+++ b/test/tint/builtins/gen/var/fma/1f5084.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec2(1.);
   var res = fma(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_1f5084();
diff --git a/test/tint/builtins/gen/var/fma/26a7a9.wgsl b/test/tint/builtins/gen/var/fma/26a7a9.wgsl
index e47de32..65646e2 100644
--- a/test/tint/builtins/gen/var/fma/26a7a9.wgsl
+++ b/test/tint/builtins/gen/var/fma/26a7a9.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(1.f);
   var arg_2 = vec2<f32>(1.f);
   var res: vec2<f32> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.dxc.hlsl
index 8f2ec1e..30a4cfd 100644
--- a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_26a7a9() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 arg_2 = (1.0f).xx;
   float2 res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.fxc.hlsl
index 8f2ec1e..30a4cfd 100644
--- a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_26a7a9() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 arg_2 = (1.0f).xx;
   float2 res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.glsl b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.glsl
index f2f2970..d7cf037 100644
--- a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fma_26a7a9() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fma_26a7a9() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fma_26a7a9() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.msl b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.msl
index c863f64..54408c4 100644
--- a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_26a7a9() {
+void fma_26a7a9(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 arg_2 = float2(1.0f);
   float2 res = fma(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_26a7a9();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  fma_26a7a9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_26a7a9();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  fma_26a7a9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_26a7a9();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  fma_26a7a9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.spvasm
index 46a54af..687452a 100644
--- a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_26a7a9 "fma_26a7a9"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,49 +39,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %27 = OpTypeFunction %v4float
- %fma_26a7a9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %15
-         %23 = OpLoad %v2float %arg_0
-         %24 = OpLoad %v2float %arg_1
-         %25 = OpLoad %v2float %arg_2
-         %21 = OpExtInst %v2float %22 Fma %23 %24 %25
-               OpStore %res %21
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %35 = OpTypeFunction %v4float
+ %fma_26a7a9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %18
+         %26 = OpLoad %v2float %arg_0
+         %27 = OpLoad %v2float %arg_1
+         %28 = OpLoad %v2float %arg_2
+         %24 = OpExtInst %v2float %25 Fma %26 %27 %28
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %34 = OpLoad %v2float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fma_26a7a9
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fma_26a7a9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %fma_26a7a9
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %fma_26a7a9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %fma_26a7a9
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %fma_26a7a9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.wgsl
index 213d680..a4ee354 100644
--- a/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fma/26a7a9.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(1.0f);
   var arg_2 = vec2<f32>(1.0f);
   var res : vec2<f32> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_26a7a9();
diff --git a/test/tint/builtins/gen/var/fma/466442.wgsl b/test/tint/builtins/gen/var/fma/466442.wgsl
index ef43d65..5b94b59 100644
--- a/test/tint/builtins/gen/var/fma/466442.wgsl
+++ b/test/tint/builtins/gen/var/fma/466442.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = fma(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_466442();
diff --git a/test/tint/builtins/gen/var/fma/6a3283.wgsl b/test/tint/builtins/gen/var/fma/6a3283.wgsl
index 94a268c..fda54fd 100644
--- a/test/tint/builtins/gen/var/fma/6a3283.wgsl
+++ b/test/tint/builtins/gen/var/fma/6a3283.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(1.f);
   var arg_2 = vec4<f32>(1.f);
   var res: vec4<f32> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.dxc.hlsl
index 5237032..ea5fb29 100644
--- a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_6a3283() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 arg_2 = (1.0f).xxxx;
   float4 res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.fxc.hlsl
index 5237032..ea5fb29 100644
--- a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_6a3283() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 arg_2 = (1.0f).xxxx;
   float4 res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.glsl b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.glsl
index 381001c..8782910 100644
--- a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fma_6a3283() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fma_6a3283() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fma_6a3283() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.msl b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.msl
index 0e48f02..3c377fa 100644
--- a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_6a3283() {
+void fma_6a3283(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 arg_2 = float4(1.0f);
   float4 res = fma(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_6a3283();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  fma_6a3283(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_6a3283();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  fma_6a3283(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_6a3283();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  fma_6a3283(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.spvasm
index a333789..bc8281b 100644
--- a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_6a3283 "fma_6a3283"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,47 +39,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %25 = OpTypeFunction %v4float
- %fma_6a3283 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
+ %fma_6a3283 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
       %arg_2 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-               OpStore %arg_2 %14
-         %21 = OpLoad %v4float %arg_0
-         %22 = OpLoad %v4float %arg_1
-         %23 = OpLoad %v4float %arg_2
-         %19 = OpExtInst %v4float %20 Fma %21 %22 %23
-               OpStore %res %19
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+               OpStore %arg_2 %17
+         %24 = OpLoad %v4float %arg_0
+         %25 = OpLoad %v4float %arg_1
+         %26 = OpLoad %v4float %arg_2
+         %22 = OpExtInst %v4float %23 Fma %24 %25 %26
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %fma_6a3283
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %fma_6a3283
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %fma_6a3283
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %fma_6a3283
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %fma_6a3283
+%compute_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %fma_6a3283
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.wgsl
index a514d9d..d8355d2 100644
--- a/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fma/6a3283.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(1.0f);
   var arg_2 = vec4<f32>(1.0f);
   var res : vec4<f32> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_6a3283();
diff --git a/test/tint/builtins/gen/var/fma/ab7818.wgsl b/test/tint/builtins/gen/var/fma/ab7818.wgsl
index 2d0cacc..aa60616 100644
--- a/test/tint/builtins/gen/var/fma/ab7818.wgsl
+++ b/test/tint/builtins/gen/var/fma/ab7818.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(1.h);
   var arg_2 = vec4<f16>(1.h);
   var res: vec4<f16> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.dxc.hlsl
index 2577424..b2f6c58 100644
--- a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_ab7818() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.fxc.hlsl
index 15fe3b9..744fbf8 100644
--- a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_ab7818() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.glsl b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.glsl
index 968b92e..669c461 100644
--- a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fma_ab7818() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fma_ab7818() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fma_ab7818() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.msl b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.msl
index ac5cd84..708fec4 100644
--- a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_ab7818() {
+void fma_ab7818(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 arg_2 = half4(1.0h);
   half4 res = fma(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_ab7818();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  fma_ab7818(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_ab7818();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  fma_ab7818(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_ab7818();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  fma_ab7818(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.spvasm
index 39bd7ab..0f3b277 100644
--- a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_ab7818 "fma_ab7818"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_ab7818 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v4half %arg_0
-         %25 = OpLoad %v4half %arg_1
-         %26 = OpLoad %v4half %arg_2
-         %22 = OpExtInst %v4half %23 Fma %24 %25 %26
-               OpStore %res %22
+ %fma_ab7818 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v4half %arg_0
+         %28 = OpLoad %v4half %arg_1
+         %29 = OpLoad %v4half %arg_2
+         %25 = OpExtInst %v4half %26 Fma %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %35 = OpLoad %v4half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %fma_ab7818
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %fma_ab7818
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %fma_ab7818
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %fma_ab7818
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %fma_ab7818
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %fma_ab7818
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.wgsl
index a858af1..0232a1a 100644
--- a/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fma/ab7818.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(1.0h);
   var arg_2 = vec4<f16>(1.0h);
   var res : vec4<f16> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_ab7818();
diff --git a/test/tint/builtins/gen/var/fma/bf21b6.wgsl b/test/tint/builtins/gen/var/fma/bf21b6.wgsl
index 93baf09..43db4cc 100644
--- a/test/tint/builtins/gen/var/fma/bf21b6.wgsl
+++ b/test/tint/builtins/gen/var/fma/bf21b6.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(1.h);
   var arg_2 = vec2<f16>(1.h);
   var res: vec2<f16> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.dxc.hlsl
index b9a8d05..9a6a310 100644
--- a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_bf21b6() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.fxc.hlsl
index 3d73b2d..55e386e 100644
--- a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_bf21b6() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.glsl b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.glsl
index 68d2e46..9cf1519 100644
--- a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fma_bf21b6() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fma_bf21b6() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fma_bf21b6() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.msl b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.msl
index beef6a7..ef1dc5f 100644
--- a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_bf21b6() {
+void fma_bf21b6(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 arg_2 = half2(1.0h);
   half2 res = fma(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_bf21b6();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  fma_bf21b6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_bf21b6();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  fma_bf21b6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_bf21b6();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  fma_bf21b6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.spvasm
index 5e403bd..05a0b77 100644
--- a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_bf21b6 "fma_bf21b6"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_bf21b6 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v2half %arg_0
-         %25 = OpLoad %v2half %arg_1
-         %26 = OpLoad %v2half %arg_2
-         %22 = OpExtInst %v2half %23 Fma %24 %25 %26
-               OpStore %res %22
+ %fma_bf21b6 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v2half %arg_0
+         %28 = OpLoad %v2half %arg_1
+         %29 = OpLoad %v2half %arg_2
+         %25 = OpExtInst %v2half %26 Fma %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %35 = OpLoad %v2half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %fma_bf21b6
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %fma_bf21b6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %fma_bf21b6
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %fma_bf21b6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %fma_bf21b6
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %fma_bf21b6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.wgsl
index d2f54c3..f400b6a 100644
--- a/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fma/bf21b6.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(1.0h);
   var arg_2 = vec2<f16>(1.0h);
   var res : vec2<f16> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_bf21b6();
diff --git a/test/tint/builtins/gen/var/fma/c10ba3.wgsl b/test/tint/builtins/gen/var/fma/c10ba3.wgsl
index 5dac834..f7a6f11 100644
--- a/test/tint/builtins/gen/var/fma/c10ba3.wgsl
+++ b/test/tint/builtins/gen/var/fma/c10ba3.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1.f;
   var arg_2 = 1.f;
   var res: f32 = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.dxc.hlsl
index 0c4b6a2..e2bd115 100644
--- a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_c10ba3() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.fxc.hlsl
index 0c4b6a2..e2bd115 100644
--- a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_c10ba3() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.glsl b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.glsl
index 895f1bc..50cec00 100644
--- a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fma_c10ba3() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fma_c10ba3() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fma_c10ba3() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.msl b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.msl
index a58b323..c3103cc 100644
--- a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_c10ba3() {
+void fma_c10ba3(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = fma(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_c10ba3();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  fma_c10ba3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_c10ba3();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  fma_c10ba3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_c10ba3();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  fma_c10ba3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.spvasm
index 5c99fc8..3acb08d 100644
--- a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_c10ba3 "fma_c10ba3"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,13 +39,19 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %24 = OpTypeFunction %v4float
- %fma_c10ba3 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %32 = OpTypeFunction %v4float
+ %fma_c10ba3 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
       %arg_2 = OpVariable %_ptr_Function_float Function %8
@@ -46,32 +59,35 @@
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
                OpStore %arg_2 %float_1
-         %20 = OpLoad %float %arg_0
-         %21 = OpLoad %float %arg_1
-         %22 = OpLoad %float %arg_2
-         %18 = OpExtInst %float %19 Fma %20 %21 %22
-               OpStore %res %18
+         %23 = OpLoad %float %arg_0
+         %24 = OpLoad %float %arg_1
+         %25 = OpLoad %float %arg_2
+         %21 = OpExtInst %float %22 Fma %23 %24 %25
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %31 = OpLoad %float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %fma_c10ba3
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %fma_c10ba3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fma_c10ba3
+%fragment_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fma_c10ba3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %fma_c10ba3
+%compute_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %fma_c10ba3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.wgsl
index 1ccb70f..c16131f 100644
--- a/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fma/c10ba3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1.0f;
   var arg_2 = 1.0f;
   var res : f32 = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_c10ba3();
diff --git a/test/tint/builtins/gen/var/fma/c8abb3.wgsl b/test/tint/builtins/gen/var/fma/c8abb3.wgsl
index cd25769..1d88e8b 100644
--- a/test/tint/builtins/gen/var/fma/c8abb3.wgsl
+++ b/test/tint/builtins/gen/var/fma/c8abb3.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = 1.h;
   var arg_2 = 1.h;
   var res: f16 = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.dxc.hlsl
index 8c0c958..60509b7 100644
--- a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_c8abb3() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t arg_2 = float16_t(1.0h);
   float16_t res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.fxc.hlsl
index f5bb357..f3cd439 100644
--- a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_c8abb3() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t arg_2 = float16_t(1.0h);
   float16_t res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.glsl b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.glsl
index 286d7c3..8299c29 100644
--- a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fma_c8abb3() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fma_c8abb3() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fma_c8abb3() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.msl b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.msl
index 9b513e7..d55ecab 100644
--- a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_c8abb3() {
+void fma_c8abb3(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half arg_2 = 1.0h;
   half res = fma(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_c8abb3();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  fma_c8abb3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_c8abb3();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  fma_c8abb3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_c8abb3();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  fma_c8abb3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.spvasm
index fe35e5d..5b9b5a3 100644
--- a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_c8abb3 "fma_c8abb3"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,49 +43,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %26 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_c8abb3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-      %arg_2 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %fma_c8abb3 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+      %arg_2 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
                OpStore %arg_2 %half_0x1p_0
-         %22 = OpLoad %half %arg_0
-         %23 = OpLoad %half %arg_1
-         %24 = OpLoad %half %arg_2
-         %20 = OpExtInst %half %21 Fma %22 %23 %24
-               OpStore %res %20
+         %25 = OpLoad %half %arg_0
+         %26 = OpLoad %half %arg_1
+         %27 = OpLoad %half %arg_2
+         %23 = OpExtInst %half %24 Fma %25 %26 %27
+               OpStore %res %23
+         %32 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %33 = OpLoad %half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %fma_c8abb3
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %fma_c8abb3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %fma_c8abb3
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %fma_c8abb3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %fma_c8abb3
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %fma_c8abb3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.wgsl
index 6d3be88..8be2650 100644
--- a/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fma/c8abb3.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = 1.0h;
   var arg_2 = 1.0h;
   var res : f16 = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_c8abb3();
diff --git a/test/tint/builtins/gen/var/fma/e17c5c.wgsl b/test/tint/builtins/gen/var/fma/e17c5c.wgsl
index 3babd02..99b9914 100644
--- a/test/tint/builtins/gen/var/fma/e17c5c.wgsl
+++ b/test/tint/builtins/gen/var/fma/e17c5c.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(1.f);
   var arg_2 = vec3<f32>(1.f);
   var res: vec3<f32> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.dxc.hlsl
index a2f5cba..09dedbe 100644
--- a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_e17c5c() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 arg_2 = (1.0f).xxx;
   float3 res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.fxc.hlsl
index a2f5cba..09dedbe 100644
--- a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_e17c5c() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 arg_2 = (1.0f).xxx;
   float3 res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.glsl b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.glsl
index aabb648..ab54dd2 100644
--- a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fma_e17c5c() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fma_e17c5c() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fma_e17c5c() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.msl b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.msl
index 3931c86..1fc1eac 100644
--- a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_e17c5c() {
+void fma_e17c5c(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 arg_2 = float3(1.0f);
   float3 res = fma(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_e17c5c();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  fma_e17c5c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_e17c5c();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  fma_e17c5c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_e17c5c();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  fma_e17c5c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.spvasm
index 15197e2..3338c68 100644
--- a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_e17c5c "fma_e17c5c"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,49 +39,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %27 = OpTypeFunction %v4float
- %fma_e17c5c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %15
-         %23 = OpLoad %v3float %arg_0
-         %24 = OpLoad %v3float %arg_1
-         %25 = OpLoad %v3float %arg_2
-         %21 = OpExtInst %v3float %22 Fma %23 %24 %25
-               OpStore %res %21
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %35 = OpTypeFunction %v4float
+ %fma_e17c5c = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %18
+         %26 = OpLoad %v3float %arg_0
+         %27 = OpLoad %v3float %arg_1
+         %28 = OpLoad %v3float %arg_2
+         %24 = OpExtInst %v3float %25 Fma %26 %27 %28
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %34 = OpLoad %v3float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fma_e17c5c
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fma_e17c5c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %fma_e17c5c
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %fma_e17c5c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %fma_e17c5c
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %fma_e17c5c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.wgsl
index 83a46ea..4ed699a 100644
--- a/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fma/e17c5c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(1.0f);
   var arg_2 = vec3<f32>(1.0f);
   var res : vec3<f32> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_e17c5c();
diff --git a/test/tint/builtins/gen/var/fma/e7abdc.wgsl b/test/tint/builtins/gen/var/fma/e7abdc.wgsl
index c8ffdad..361aa3b 100644
--- a/test/tint/builtins/gen/var/fma/e7abdc.wgsl
+++ b/test/tint/builtins/gen/var/fma/e7abdc.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(1.h);
   var arg_2 = vec3<f16>(1.h);
   var res: vec3<f16> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.dxc.hlsl
index d9701f8..3000f03 100644
--- a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_e7abdc() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.fxc.hlsl
index fd5db2b..7ad75b6 100644
--- a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fma_e7abdc() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = mad(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.glsl b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.glsl
index 58b28ba..d344af9 100644
--- a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fma_e7abdc() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fma_e7abdc() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fma_e7abdc() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = ((arg_0) * (arg_1) + (arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.msl b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.msl
index 4014cfc..4ca6521 100644
--- a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fma_e7abdc() {
+void fma_e7abdc(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 arg_2 = half3(1.0h);
   half3 res = fma(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fma_e7abdc();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  fma_e7abdc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fma_e7abdc();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  fma_e7abdc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fma_e7abdc();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  fma_e7abdc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.spvasm
index c5c6a7a..34c711a 100644
--- a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fma_e7abdc "fma_e7abdc"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %fma_e7abdc = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v3half %arg_0
-         %25 = OpLoad %v3half %arg_1
-         %26 = OpLoad %v3half %arg_2
-         %22 = OpExtInst %v3half %23 Fma %24 %25 %26
-               OpStore %res %22
+ %fma_e7abdc = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v3half %arg_0
+         %28 = OpLoad %v3half %arg_1
+         %29 = OpLoad %v3half %arg_2
+         %25 = OpExtInst %v3half %26 Fma %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %35 = OpLoad %v3half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %fma_e7abdc
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %fma_e7abdc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %fma_e7abdc
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %fma_e7abdc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %fma_e7abdc
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %fma_e7abdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.wgsl
index fd8ecb1..c13670b 100644
--- a/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fma/e7abdc.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(1.0h);
   var arg_2 = vec3<f16>(1.0h);
   var res : vec3<f16> = fma(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_e7abdc();
diff --git a/test/tint/builtins/gen/var/fma/eb25d7.wgsl b/test/tint/builtins/gen/var/fma/eb25d7.wgsl
index 4f56414..3bd2b53 100644
--- a/test/tint/builtins/gen/var/fma/eb25d7.wgsl
+++ b/test/tint/builtins/gen/var/fma/eb25d7.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec3(1.);
   var res = fma(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fma_eb25d7();
diff --git a/test/tint/builtins/gen/var/fract/181aa9.wgsl b/test/tint/builtins/gen/var/fract/181aa9.wgsl
index 218c38f..a73e1a3 100644
--- a/test/tint/builtins/gen/var/fract/181aa9.wgsl
+++ b/test/tint/builtins/gen/var/fract/181aa9.wgsl
@@ -27,7 +27,9 @@
 fn fract_181aa9() {
   var arg_0 = vec2<f16>(1.25h);
   var res: vec2<f16> = fract(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.dxc.hlsl
index 240fbb9..2340f2b 100644
--- a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_181aa9() {
   vector<float16_t, 2> arg_0 = (float16_t(1.25h)).xx;
   vector<float16_t, 2> res = frac(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.fxc.hlsl
index 05151f2..dcaebbf 100644
--- a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_181aa9() {
   vector<float16_t, 2> arg_0 = (float16_t(1.25h)).xx;
   vector<float16_t, 2> res = frac(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.glsl b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.glsl
index 06329c5..0d8c38a 100644
--- a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fract_181aa9() {
   f16vec2 arg_0 = f16vec2(1.25hf);
   f16vec2 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fract_181aa9() {
   f16vec2 arg_0 = f16vec2(1.25hf);
   f16vec2 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void fract_181aa9() {
   f16vec2 arg_0 = f16vec2(1.25hf);
   f16vec2 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.msl b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.msl
index 751c7b5..883733f 100644
--- a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_181aa9() {
+void fract_181aa9(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.25h);
   half2 res = fract(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_181aa9();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  fract_181aa9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_181aa9();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  fract_181aa9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_181aa9();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  fract_181aa9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.spvasm
index b50b553..94dad27f 100644
--- a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_181aa9 "fract_181aa9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_4p_0 = OpConstant %half 0x1.4p+0
-         %16 = OpConstantComposite %v2half %half_0x1_4p_0 %half_0x1_4p_0
+         %19 = OpConstantComposite %v2half %half_0x1_4p_0 %half_0x1_4p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_181aa9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Fract %22
-               OpStore %res %20
+%fract_181aa9 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Fract %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %fract_181aa9
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %fract_181aa9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %fract_181aa9
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %fract_181aa9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %fract_181aa9
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %fract_181aa9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.wgsl
index d47bd7f..72bedd0 100644
--- a/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fract/181aa9.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn fract_181aa9() {
   var arg_0 = vec2<f16>(1.25h);
   var res : vec2<f16> = fract(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_181aa9();
diff --git a/test/tint/builtins/gen/var/fract/2eddfe.wgsl b/test/tint/builtins/gen/var/fract/2eddfe.wgsl
index 44eb00b..af6c587 100644
--- a/test/tint/builtins/gen/var/fract/2eddfe.wgsl
+++ b/test/tint/builtins/gen/var/fract/2eddfe.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.25;
   var res = fract(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_2eddfe();
diff --git a/test/tint/builtins/gen/var/fract/498c77.wgsl b/test/tint/builtins/gen/var/fract/498c77.wgsl
index 9b550e8..ac98ebc 100644
--- a/test/tint/builtins/gen/var/fract/498c77.wgsl
+++ b/test/tint/builtins/gen/var/fract/498c77.wgsl
@@ -27,7 +27,9 @@
 fn fract_498c77() {
   var arg_0 = vec4<f16>(1.25h);
   var res: vec4<f16> = fract(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.dxc.hlsl
index d114662..d66469b 100644
--- a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_498c77() {
   vector<float16_t, 4> arg_0 = (float16_t(1.25h)).xxxx;
   vector<float16_t, 4> res = frac(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.fxc.hlsl
index 8a803ae..35bbed7f 100644
--- a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_498c77() {
   vector<float16_t, 4> arg_0 = (float16_t(1.25h)).xxxx;
   vector<float16_t, 4> res = frac(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.glsl b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.glsl
index 6c1a9c1..1dfd9fe 100644
--- a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fract_498c77() {
   f16vec4 arg_0 = f16vec4(1.25hf);
   f16vec4 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fract_498c77() {
   f16vec4 arg_0 = f16vec4(1.25hf);
   f16vec4 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void fract_498c77() {
   f16vec4 arg_0 = f16vec4(1.25hf);
   f16vec4 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.msl b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.msl
index 928481b..9320088 100644
--- a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_498c77() {
+void fract_498c77(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.25h);
   half4 res = fract(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_498c77();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  fract_498c77(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_498c77();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  fract_498c77(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_498c77();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  fract_498c77(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.spvasm
index dd24ec1..baa3fb4 100644
--- a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_498c77 "fract_498c77"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_4p_0 = OpConstant %half 0x1.4p+0
-         %16 = OpConstantComposite %v4half %half_0x1_4p_0 %half_0x1_4p_0 %half_0x1_4p_0 %half_0x1_4p_0
+         %19 = OpConstantComposite %v4half %half_0x1_4p_0 %half_0x1_4p_0 %half_0x1_4p_0 %half_0x1_4p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_498c77 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Fract %22
-               OpStore %res %20
+%fract_498c77 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Fract %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %fract_498c77
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %fract_498c77
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %fract_498c77
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %fract_498c77
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %fract_498c77
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %fract_498c77
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.wgsl
index 9255273..8bff92c 100644
--- a/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fract/498c77.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn fract_498c77() {
   var arg_0 = vec4<f16>(1.25h);
   var res : vec4<f16> = fract(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_498c77();
diff --git a/test/tint/builtins/gen/var/fract/7e3f2d.wgsl b/test/tint/builtins/gen/var/fract/7e3f2d.wgsl
index 80ad812..934bbbc 100644
--- a/test/tint/builtins/gen/var/fract/7e3f2d.wgsl
+++ b/test/tint/builtins/gen/var/fract/7e3f2d.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.25);
   var res = fract(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_7e3f2d();
diff --git a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl
index 671bed0..22ba150 100644
--- a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl
+++ b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl
@@ -25,7 +25,9 @@
 fn fract_8bc1e9() {
   var arg_0 = vec4<f32>(1.25f);
   var res: vec4<f32> = fract(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.dxc.hlsl
index 60cd54a..3a2e938 100644
--- a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_8bc1e9() {
   float4 arg_0 = (1.25f).xxxx;
   float4 res = frac(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.fxc.hlsl
index 60cd54a..3a2e938 100644
--- a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_8bc1e9() {
   float4 arg_0 = (1.25f).xxxx;
   float4 res = frac(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.glsl b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.glsl
index 268b77c..51740c2 100644
--- a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fract_8bc1e9() {
   vec4 arg_0 = vec4(1.25f);
   vec4 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fract_8bc1e9() {
   vec4 arg_0 = vec4(1.25f);
   vec4 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fract_8bc1e9() {
   vec4 arg_0 = vec4(1.25f);
   vec4 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.msl b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.msl
index dbedba1..e15f0fd 100644
--- a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_8bc1e9() {
+void fract_8bc1e9(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.25f);
   float4 res = fract(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_8bc1e9();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  fract_8bc1e9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_8bc1e9();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  fract_8bc1e9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_8bc1e9();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  fract_8bc1e9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.spvasm
index 1c8b35b..01bf616 100644
--- a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_8bc1e9 "fract_8bc1e9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
  %float_1_25 = OpConstant %float 1.25
-         %14 = OpConstantComposite %v4float %float_1_25 %float_1_25 %float_1_25 %float_1_25
+         %17 = OpConstantComposite %v4float %float_1_25 %float_1_25 %float_1_25 %float_1_25
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_8bc1e9 = OpFunction %void None %9
-         %12 = OpLabel
+%fract_8bc1e9 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Fract %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Fract %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %fract_8bc1e9
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %fract_8bc1e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %fract_8bc1e9
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %fract_8bc1e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %fract_8bc1e9
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %fract_8bc1e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.wgsl
index a1db1d3..47f8f27 100644
--- a/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fract/8bc1e9.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fract_8bc1e9() {
   var arg_0 = vec4<f32>(1.25f);
   var res : vec4<f32> = fract(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_8bc1e9();
diff --git a/test/tint/builtins/gen/var/fract/943cb1.wgsl b/test/tint/builtins/gen/var/fract/943cb1.wgsl
index 4db50d4..dedb067 100644
--- a/test/tint/builtins/gen/var/fract/943cb1.wgsl
+++ b/test/tint/builtins/gen/var/fract/943cb1.wgsl
@@ -25,7 +25,9 @@
 fn fract_943cb1() {
   var arg_0 = vec2<f32>(1.25f);
   var res: vec2<f32> = fract(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.dxc.hlsl
index 32341a2..3830162 100644
--- a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_943cb1() {
   float2 arg_0 = (1.25f).xx;
   float2 res = frac(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.fxc.hlsl
index 32341a2..3830162 100644
--- a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_943cb1() {
   float2 arg_0 = (1.25f).xx;
   float2 res = frac(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.glsl b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.glsl
index a5ced40..a67af0a 100644
--- a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fract_943cb1() {
   vec2 arg_0 = vec2(1.25f);
   vec2 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fract_943cb1() {
   vec2 arg_0 = vec2(1.25f);
   vec2 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fract_943cb1() {
   vec2 arg_0 = vec2(1.25f);
   vec2 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.msl b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.msl
index e2c7c6a..78c0aac 100644
--- a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_943cb1() {
+void fract_943cb1(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.25f);
   float2 res = fract(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_943cb1();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  fract_943cb1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_943cb1();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  fract_943cb1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_943cb1();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  fract_943cb1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.spvasm
index bfc7d49..1fb0596 100644
--- a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_943cb1 "fract_943cb1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
  %float_1_25 = OpConstant %float 1.25
-         %15 = OpConstantComposite %v2float %float_1_25 %float_1_25
+         %18 = OpConstantComposite %v2float %float_1_25 %float_1_25
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_943cb1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Fract %21
-               OpStore %res %19
+%fract_943cb1 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Fract %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %fract_943cb1
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %fract_943cb1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fract_943cb1
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fract_943cb1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %fract_943cb1
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %fract_943cb1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.wgsl
index b0fd64f..7c07902 100644
--- a/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fract/943cb1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fract_943cb1() {
   var arg_0 = vec2<f32>(1.25f);
   var res : vec2<f32> = fract(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_943cb1();
diff --git a/test/tint/builtins/gen/var/fract/958a1d.wgsl b/test/tint/builtins/gen/var/fract/958a1d.wgsl
index bec9395..acc436f 100644
--- a/test/tint/builtins/gen/var/fract/958a1d.wgsl
+++ b/test/tint/builtins/gen/var/fract/958a1d.wgsl
@@ -27,7 +27,9 @@
 fn fract_958a1d() {
   var arg_0 = vec3<f16>(1.25h);
   var res: vec3<f16> = fract(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.dxc.hlsl
index a63f1dc..2545146 100644
--- a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_958a1d() {
   vector<float16_t, 3> arg_0 = (float16_t(1.25h)).xxx;
   vector<float16_t, 3> res = frac(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.fxc.hlsl
index d7a3f2f..18ada47 100644
--- a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_958a1d() {
   vector<float16_t, 3> arg_0 = (float16_t(1.25h)).xxx;
   vector<float16_t, 3> res = frac(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.glsl b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.glsl
index 2cbca6f..7d88f3c 100644
--- a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fract_958a1d() {
   f16vec3 arg_0 = f16vec3(1.25hf);
   f16vec3 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fract_958a1d() {
   f16vec3 arg_0 = f16vec3(1.25hf);
   f16vec3 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void fract_958a1d() {
   f16vec3 arg_0 = f16vec3(1.25hf);
   f16vec3 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.msl b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.msl
index 9eb9bf4..5a5a6f8 100644
--- a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_958a1d() {
+void fract_958a1d(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.25h);
   half3 res = fract(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_958a1d();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  fract_958a1d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_958a1d();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  fract_958a1d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_958a1d();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  fract_958a1d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.spvasm
index c7617e2..a57dcd5 100644
--- a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_958a1d "fract_958a1d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_4p_0 = OpConstant %half 0x1.4p+0
-         %16 = OpConstantComposite %v3half %half_0x1_4p_0 %half_0x1_4p_0 %half_0x1_4p_0
+         %19 = OpConstantComposite %v3half %half_0x1_4p_0 %half_0x1_4p_0 %half_0x1_4p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_958a1d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Fract %22
-               OpStore %res %20
+%fract_958a1d = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Fract %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %fract_958a1d
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %fract_958a1d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %fract_958a1d
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %fract_958a1d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %fract_958a1d
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %fract_958a1d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.wgsl
index 9a710e3..508b73c 100644
--- a/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fract/958a1d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn fract_958a1d() {
   var arg_0 = vec3<f16>(1.25h);
   var res : vec3<f16> = fract(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_958a1d();
diff --git a/test/tint/builtins/gen/var/fract/a49758.wgsl b/test/tint/builtins/gen/var/fract/a49758.wgsl
index 5be115e..05440f9 100644
--- a/test/tint/builtins/gen/var/fract/a49758.wgsl
+++ b/test/tint/builtins/gen/var/fract/a49758.wgsl
@@ -25,7 +25,9 @@
 fn fract_a49758() {
   var arg_0 = vec3<f32>(1.25f);
   var res: vec3<f32> = fract(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.dxc.hlsl
index 911008e..c02cdbc 100644
--- a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_a49758() {
   float3 arg_0 = (1.25f).xxx;
   float3 res = frac(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.fxc.hlsl
index 911008e..c02cdbc 100644
--- a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_a49758() {
   float3 arg_0 = (1.25f).xxx;
   float3 res = frac(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.glsl b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.glsl
index 9fcd774..be87d9d 100644
--- a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fract_a49758() {
   vec3 arg_0 = vec3(1.25f);
   vec3 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fract_a49758() {
   vec3 arg_0 = vec3(1.25f);
   vec3 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fract_a49758() {
   vec3 arg_0 = vec3(1.25f);
   vec3 res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.msl b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.msl
index e5b30f8..cb80016 100644
--- a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_a49758() {
+void fract_a49758(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.25f);
   float3 res = fract(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_a49758();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  fract_a49758(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_a49758();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  fract_a49758(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_a49758();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  fract_a49758(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.spvasm
index 517ce36..0672bb4 100644
--- a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_a49758 "fract_a49758"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
  %float_1_25 = OpConstant %float 1.25
-         %15 = OpConstantComposite %v3float %float_1_25 %float_1_25 %float_1_25
+         %18 = OpConstantComposite %v3float %float_1_25 %float_1_25 %float_1_25
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_a49758 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Fract %21
-               OpStore %res %19
+%fract_a49758 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Fract %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %fract_a49758
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %fract_a49758
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fract_a49758
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fract_a49758
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %fract_a49758
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %fract_a49758
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.wgsl
index 103c12a..caefb31 100644
--- a/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fract/a49758.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fract_a49758() {
   var arg_0 = vec3<f32>(1.25f);
   var res : vec3<f32> = fract(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_a49758();
diff --git a/test/tint/builtins/gen/var/fract/eb38ce.wgsl b/test/tint/builtins/gen/var/fract/eb38ce.wgsl
index 52ca757..9476b8b 100644
--- a/test/tint/builtins/gen/var/fract/eb38ce.wgsl
+++ b/test/tint/builtins/gen/var/fract/eb38ce.wgsl
@@ -27,7 +27,9 @@
 fn fract_eb38ce() {
   var arg_0 = 1.25h;
   var res: f16 = fract(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.dxc.hlsl
index 3129c7d..e0b75a1 100644
--- a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_eb38ce() {
   float16_t arg_0 = float16_t(1.25h);
   float16_t res = frac(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.fxc.hlsl
index 572ff88..7725359 100644
--- a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_eb38ce() {
   float16_t arg_0 = float16_t(1.25h);
   float16_t res = frac(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.glsl
index 9fdbf1f..186811f 100644
--- a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fract_eb38ce() {
   float16_t arg_0 = 1.25hf;
   float16_t res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fract_eb38ce() {
   float16_t arg_0 = 1.25hf;
   float16_t res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void fract_eb38ce() {
   float16_t arg_0 = 1.25hf;
   float16_t res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.msl b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.msl
index 5b3e3ba..4d5a896 100644
--- a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_eb38ce() {
+void fract_eb38ce(device half* const tint_symbol_1) {
   half arg_0 = 1.25h;
   half res = fract(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_eb38ce();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  fract_eb38ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_eb38ce();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  fract_eb38ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_eb38ce();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  fract_eb38ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.spvasm
index 447246a..16e4e16 100644
--- a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_eb38ce "fract_eb38ce"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_4p_0 = OpConstant %half 0x1.4p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_eb38ce = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%fract_eb38ce = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1_4p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Fract %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Fract %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %fract_eb38ce
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %fract_eb38ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %fract_eb38ce
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %fract_eb38ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %fract_eb38ce
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %fract_eb38ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.wgsl
index ae970ef..3dea9e3 100644
--- a/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fract/eb38ce.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn fract_eb38ce() {
   var arg_0 = 1.25h;
   var res : f16 = fract(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_eb38ce();
diff --git a/test/tint/builtins/gen/var/fract/ed00ca.wgsl b/test/tint/builtins/gen/var/fract/ed00ca.wgsl
index beaa8e8..f7f9749 100644
--- a/test/tint/builtins/gen/var/fract/ed00ca.wgsl
+++ b/test/tint/builtins/gen/var/fract/ed00ca.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.25);
   var res = fract(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_ed00ca();
diff --git a/test/tint/builtins/gen/var/fract/ed2f79.wgsl b/test/tint/builtins/gen/var/fract/ed2f79.wgsl
index c2a1083..aa9e17c 100644
--- a/test/tint/builtins/gen/var/fract/ed2f79.wgsl
+++ b/test/tint/builtins/gen/var/fract/ed2f79.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.25);
   var res = fract(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_ed2f79();
diff --git a/test/tint/builtins/gen/var/fract/fa5c71.wgsl b/test/tint/builtins/gen/var/fract/fa5c71.wgsl
index 479ff32..8311cc9 100644
--- a/test/tint/builtins/gen/var/fract/fa5c71.wgsl
+++ b/test/tint/builtins/gen/var/fract/fa5c71.wgsl
@@ -25,7 +25,9 @@
 fn fract_fa5c71() {
   var arg_0 = 1.25f;
   var res: f32 = fract(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.dxc.hlsl
index 0547a42..1f1195b 100644
--- a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_fa5c71() {
   float arg_0 = 1.25f;
   float res = frac(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.fxc.hlsl
index 0547a42..1f1195b 100644
--- a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fract_fa5c71() {
   float arg_0 = 1.25f;
   float res = frac(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.glsl b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.glsl
index ffe50f0..34f3e43 100644
--- a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fract_fa5c71() {
   float arg_0 = 1.25f;
   float res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fract_fa5c71() {
   float arg_0 = 1.25f;
   float res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fract_fa5c71() {
   float arg_0 = 1.25f;
   float res = fract(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.msl b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.msl
index 4a98d21..b0e847d 100644
--- a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fract_fa5c71() {
+void fract_fa5c71(device float* const tint_symbol_1) {
   float arg_0 = 1.25f;
   float res = fract(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  fract_fa5c71();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  fract_fa5c71(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  fract_fa5c71();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  fract_fa5c71(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  fract_fa5c71();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  fract_fa5c71(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.spvasm
index 32de0e0..3ea1f65 100644
--- a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fract_fa5c71 "fract_fa5c71"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
  %float_1_25 = OpConstant %float 1.25
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%fract_fa5c71 = OpFunction %void None %9
-         %12 = OpLabel
+%fract_fa5c71 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1_25
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Fract %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Fract %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %fract_fa5c71
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %fract_fa5c71
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %fract_fa5c71
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %fract_fa5c71
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %fract_fa5c71
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %fract_fa5c71
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.wgsl
index 0ca4890..f809dad 100644
--- a/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fract/fa5c71.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fract_fa5c71() {
   var arg_0 = 1.25f;
   var res : f32 = fract(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   fract_fa5c71();
diff --git a/test/tint/builtins/gen/var/frexp/34bbfb.wgsl b/test/tint/builtins/gen/var/frexp/34bbfb.wgsl
index 5a57803..c746bed 100644
--- a/test/tint/builtins/gen/var/frexp/34bbfb.wgsl
+++ b/test/tint/builtins/gen/var/frexp/34bbfb.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_34bbfb();
diff --git a/test/tint/builtins/gen/var/frexp/3dd21e.wgsl b/test/tint/builtins/gen/var/frexp/3dd21e.wgsl
index e04da8c..18dd81d 100644
--- a/test/tint/builtins/gen/var/frexp/3dd21e.wgsl
+++ b/test/tint/builtins/gen/var/frexp/3dd21e.wgsl
@@ -28,7 +28,6 @@
   var arg_0 = vec4<f16>(1.h);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_3dd21e();
diff --git a/test/tint/builtins/gen/var/frexp/4b2200.wgsl b/test/tint/builtins/gen/var/frexp/4b2200.wgsl
index 2802b5f..d4f59ab 100644
--- a/test/tint/builtins/gen/var/frexp/4b2200.wgsl
+++ b/test/tint/builtins/gen/var/frexp/4b2200.wgsl
@@ -26,7 +26,6 @@
   var arg_0 = 1.f;
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_4b2200();
diff --git a/test/tint/builtins/gen/var/frexp/5257dd.wgsl b/test/tint/builtins/gen/var/frexp/5257dd.wgsl
index f917f1f..f46c8b5 100644
--- a/test/tint/builtins/gen/var/frexp/5257dd.wgsl
+++ b/test/tint/builtins/gen/var/frexp/5257dd.wgsl
@@ -28,7 +28,6 @@
   var arg_0 = 1.h;
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_5257dd();
diff --git a/test/tint/builtins/gen/var/frexp/5f47bf.wgsl b/test/tint/builtins/gen/var/frexp/5f47bf.wgsl
index b2b6534..00b4607 100644
--- a/test/tint/builtins/gen/var/frexp/5f47bf.wgsl
+++ b/test/tint/builtins/gen/var/frexp/5f47bf.wgsl
@@ -28,7 +28,6 @@
   var arg_0 = vec2<f16>(1.h);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_5f47bf();
diff --git a/test/tint/builtins/gen/var/frexp/6fb3ad.wgsl b/test/tint/builtins/gen/var/frexp/6fb3ad.wgsl
index a780569..c31e27f 100644
--- a/test/tint/builtins/gen/var/frexp/6fb3ad.wgsl
+++ b/test/tint/builtins/gen/var/frexp/6fb3ad.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_6fb3ad();
diff --git a/test/tint/builtins/gen/var/frexp/77af93.wgsl b/test/tint/builtins/gen/var/frexp/77af93.wgsl
index 4aab6cd..9e21678 100644
--- a/test/tint/builtins/gen/var/frexp/77af93.wgsl
+++ b/test/tint/builtins/gen/var/frexp/77af93.wgsl
@@ -26,7 +26,6 @@
   var arg_0 = vec4<f32>(1.f);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_77af93();
diff --git a/test/tint/builtins/gen/var/frexp/979800.wgsl b/test/tint/builtins/gen/var/frexp/979800.wgsl
index 500cf91..a08afdc 100644
--- a/test/tint/builtins/gen/var/frexp/979800.wgsl
+++ b/test/tint/builtins/gen/var/frexp/979800.wgsl
@@ -26,7 +26,6 @@
   var arg_0 = vec3<f32>(1.f);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_979800();
diff --git a/test/tint/builtins/gen/var/frexp/ae4a66.wgsl b/test/tint/builtins/gen/var/frexp/ae4a66.wgsl
index f31850a..73acfa7 100644
--- a/test/tint/builtins/gen/var/frexp/ae4a66.wgsl
+++ b/test/tint/builtins/gen/var/frexp/ae4a66.wgsl
@@ -28,7 +28,6 @@
   var arg_0 = vec3<f16>(1.h);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_ae4a66();
diff --git a/test/tint/builtins/gen/var/frexp/bee870.wgsl b/test/tint/builtins/gen/var/frexp/bee870.wgsl
index 9d01b83..ea1ea73d 100644
--- a/test/tint/builtins/gen/var/frexp/bee870.wgsl
+++ b/test/tint/builtins/gen/var/frexp/bee870.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_bee870();
diff --git a/test/tint/builtins/gen/var/frexp/bf45ae.wgsl b/test/tint/builtins/gen/var/frexp/bf45ae.wgsl
index c7477ac..9c1fd8c 100644
--- a/test/tint/builtins/gen/var/frexp/bf45ae.wgsl
+++ b/test/tint/builtins/gen/var/frexp/bf45ae.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_bf45ae();
diff --git a/test/tint/builtins/gen/var/frexp/eb2421.wgsl b/test/tint/builtins/gen/var/frexp/eb2421.wgsl
index 760e5f9..7942696 100644
--- a/test/tint/builtins/gen/var/frexp/eb2421.wgsl
+++ b/test/tint/builtins/gen/var/frexp/eb2421.wgsl
@@ -26,7 +26,6 @@
   var arg_0 = vec2<f32>(1.f);
   var res = frexp(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   frexp_eb2421();
diff --git a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl
index 580effa..9a16939 100644
--- a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl
+++ b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl
@@ -25,7 +25,9 @@
 fn fwidth_5d1b39() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = fwidth(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.dxc.hlsl
index 53c95e2..c5b2f51 100644
--- a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_5d1b39() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = fwidth(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.fxc.hlsl
index 53c95e2..c5b2f51 100644
--- a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_5d1b39() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = fwidth(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.glsl
index d0789a8..8e53275 100644
--- a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fwidth_5d1b39() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.msl
index 3611773..9fca09e 100644
--- a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidth_5d1b39() {
+void fwidth_5d1b39(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = fwidth(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  fwidth_5d1b39();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  fwidth_5d1b39(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.spvasm
index 1683a43..c7ee733 100644
--- a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidth_5d1b39 "fwidth_5d1b39"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%fwidth_5d1b39 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpFwidth %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%fwidth_5d1b39 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpFwidth %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidth_5d1b39
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidth_5d1b39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.wgsl
index b402cb2..cd60d44 100644
--- a/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidth/5d1b39.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidth_5d1b39() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = fwidth(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   fwidth_5d1b39();
diff --git a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl
index 8ebc5f1..19e421f 100644
--- a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl
+++ b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl
@@ -25,7 +25,9 @@
 fn fwidth_b83ebb() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = fwidth(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.dxc.hlsl
index b865572..7b6dcd1 100644
--- a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_b83ebb() {
   float2 arg_0 = (1.0f).xx;
   float2 res = fwidth(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.fxc.hlsl
index b865572..7b6dcd1 100644
--- a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_b83ebb() {
   float2 arg_0 = (1.0f).xx;
   float2 res = fwidth(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.glsl
index ced1f29..d539297 100644
--- a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fwidth_b83ebb() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.msl
index b5ecf5d..74d4751 100644
--- a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidth_b83ebb() {
+void fwidth_b83ebb(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidth_b83ebb();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  fwidth_b83ebb(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.spvasm
index cc85924..311d5b1 100644
--- a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidth_b83ebb "fwidth_b83ebb"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%fwidth_b83ebb = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpFwidth %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%fwidth_b83ebb = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpFwidth %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidth_b83ebb
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidth_b83ebb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.wgsl
index d3b1b6e..dfbc1b4 100644
--- a/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidth/b83ebb.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidth_b83ebb() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = fwidth(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   fwidth_b83ebb();
diff --git a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl
index 5bc9177..a076dd2 100644
--- a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl
+++ b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl
@@ -25,7 +25,9 @@
 fn fwidth_d2ab9a() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = fwidth(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.dxc.hlsl
index 535124d..0823b14 100644
--- a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_d2ab9a() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = fwidth(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.fxc.hlsl
index 535124d..0823b14 100644
--- a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_d2ab9a() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = fwidth(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.glsl
index 5fa1560..ca19bf0 100644
--- a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fwidth_d2ab9a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.msl
index 2290a21a..18ffd56 100644
--- a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidth_d2ab9a() {
+void fwidth_d2ab9a(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidth_d2ab9a();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  fwidth_d2ab9a(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.spvasm
index fadc0f6..3abe828 100644
--- a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.spvasm
@@ -1,36 +1,52 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidth_d2ab9a "fwidth_d2ab9a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%fwidth_d2ab9a = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpFwidth %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%fwidth_d2ab9a = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpFwidth %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidth_d2ab9a
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidth_d2ab9a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.wgsl
index 82baa9f..05eed64 100644
--- a/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidth/d2ab9a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidth_d2ab9a() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = fwidth(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   fwidth_d2ab9a();
diff --git a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl
index 57b96d5..ad86a76 100644
--- a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl
+++ b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl
@@ -25,7 +25,9 @@
 fn fwidth_df38ef() {
   var arg_0 = 1.f;
   var res: f32 = fwidth(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.dxc.hlsl
index 8c0b254..d31c327 100644
--- a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_df38ef() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.fxc.hlsl
index 8c0b254..d31c327 100644
--- a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidth_df38ef() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.glsl
index fd90c67..c0984da 100644
--- a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fwidth_df38ef() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.msl
index 45cdac6..460a7e2 100644
--- a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidth_df38ef() {
+void fwidth_df38ef(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidth_df38ef();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  fwidth_df38ef(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.spvasm
index 1b89aaa..2788a7d 100644
--- a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.spvasm
@@ -1,34 +1,50 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidth_df38ef "fwidth_df38ef"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%fwidth_df38ef = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%fwidth_df38ef = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpFwidth %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpFwidth %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidth_df38ef
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidth_df38ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.wgsl
index b168e0c..fd7f210 100644
--- a/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidth/df38ef.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidth_df38ef() {
   var arg_0 = 1.0f;
   var res : f32 = fwidth(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   fwidth_df38ef();
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl
index 4452233..3c6dc04 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl
@@ -25,7 +25,9 @@
 fn fwidthCoarse_159c8a() {
   var arg_0 = 1.f;
   var res: f32 = fwidthCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.dxc.hlsl
index 37bbb25..99efcec 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_159c8a() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.fxc.hlsl
index 37bbb25..99efcec 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_159c8a() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.glsl
index 7d57bbf..9734df8 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fwidthCoarse_159c8a() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.msl
index eb66e08..d8df43f 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthCoarse_159c8a() {
+void fwidthCoarse_159c8a(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthCoarse_159c8a();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  fwidthCoarse_159c8a(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.spvasm
index 324f1af..f16adea 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.spvasm
@@ -1,35 +1,51 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthCoarse_159c8a "fwidthCoarse_159c8a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%fwidthCoarse_159c8a = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%fwidthCoarse_159c8a = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpFwidthCoarse %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpFwidthCoarse %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidthCoarse_159c8a
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidthCoarse_159c8a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.wgsl
index ee9e1cb..e6bf2c8 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/159c8a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidthCoarse_159c8a() {
   var arg_0 = 1.0f;
   var res : f32 = fwidthCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   fwidthCoarse_159c8a();
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl
index a460748..95f7051 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl
@@ -25,7 +25,9 @@
 fn fwidthCoarse_1e59d9() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = fwidthCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.dxc.hlsl
index b35c76c..2cc7ade 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_1e59d9() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = fwidth(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.fxc.hlsl
index b35c76c..2cc7ade 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_1e59d9() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = fwidth(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.glsl
index 2e0b470..73f4087 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fwidthCoarse_1e59d9() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.msl
index 2b69739..6d48b31 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthCoarse_1e59d9() {
+void fwidthCoarse_1e59d9(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = fwidth(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  fwidthCoarse_1e59d9();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  fwidthCoarse_1e59d9(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.spvasm
index 2afcab0..a4f4807 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthCoarse_1e59d9 "fwidthCoarse_1e59d9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%fwidthCoarse_1e59d9 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpFwidthCoarse %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%fwidthCoarse_1e59d9 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpFwidthCoarse %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidthCoarse_1e59d9
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidthCoarse_1e59d9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.wgsl
index 7ba840c..b8983e1 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/1e59d9.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidthCoarse_1e59d9() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = fwidthCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthCoarse_1e59d9();
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl
index c0f2e1f..160e8e2 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl
@@ -25,7 +25,9 @@
 fn fwidthCoarse_4e4fc4() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = fwidthCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.dxc.hlsl
index 2ed8dd6..e98bb95 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_4e4fc4() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = fwidth(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.fxc.hlsl
index 2ed8dd6..e98bb95 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_4e4fc4() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = fwidth(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.glsl
index 5415252..9b6d068 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fwidthCoarse_4e4fc4() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.msl
index 714e8b9..d9d8b18 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthCoarse_4e4fc4() {
+void fwidthCoarse_4e4fc4(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthCoarse_4e4fc4();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  fwidthCoarse_4e4fc4(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.spvasm
index c26ac67..cea8f76 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthCoarse_4e4fc4 "fwidthCoarse_4e4fc4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%fwidthCoarse_4e4fc4 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpFwidthCoarse %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%fwidthCoarse_4e4fc4 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpFwidthCoarse %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidthCoarse_4e4fc4
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidthCoarse_4e4fc4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
index 9468c41..4abcd4b 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidthCoarse_4e4fc4() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = fwidthCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthCoarse_4e4fc4();
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl
index f3386b2..9c8f7b8 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl
@@ -25,7 +25,9 @@
 fn fwidthCoarse_e653f7() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = fwidthCoarse(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.dxc.hlsl
index be7258d..182f037 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_e653f7() {
   float2 arg_0 = (1.0f).xx;
   float2 res = fwidth(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.fxc.hlsl
index be7258d..182f037 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthCoarse_e653f7() {
   float2 arg_0 = (1.0f).xx;
   float2 res = fwidth(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.glsl
index d480dba..00f4009 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fwidthCoarse_e653f7() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.msl
index dc07843..f9962ec 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthCoarse_e653f7() {
+void fwidthCoarse_e653f7(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthCoarse_e653f7();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  fwidthCoarse_e653f7(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.spvasm
index 64daf80..ee20077 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthCoarse_e653f7 "fwidthCoarse_e653f7"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%fwidthCoarse_e653f7 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpFwidthCoarse %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%fwidthCoarse_e653f7 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpFwidthCoarse %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidthCoarse_e653f7
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidthCoarse_e653f7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.wgsl
index daeca58..0c6a165 100644
--- a/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidthCoarse/e653f7.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidthCoarse_e653f7() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = fwidthCoarse(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthCoarse_e653f7();
diff --git a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl
index a7f576d..5128fbc 100644
--- a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl
+++ b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl
@@ -25,7 +25,9 @@
 fn fwidthFine_523fdc() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = fwidthFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.dxc.hlsl
index bb1e86b..af999bd 100644
--- a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_523fdc() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = fwidth(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.fxc.hlsl
index bb1e86b..af999bd 100644
--- a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_523fdc() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = fwidth(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.glsl
index 67dca6c..4464c7c 100644
--- a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void fwidthFine_523fdc() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.msl
index d64921d..da1fd5b 100644
--- a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthFine_523fdc() {
+void fwidthFine_523fdc(device packed_float3* const tint_symbol) {
   float3 arg_0 = float3(1.0f);
   float3 res = fwidth(arg_0);
+  *(tint_symbol) = packed_float3(res);
 }
 
-fragment void fragment_main() {
-  fwidthFine_523fdc();
+fragment void fragment_main(device packed_float3* tint_symbol_1 [[buffer(0)]]) {
+  fwidthFine_523fdc(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.spvasm
index 47cb385..d280f1f 100644
--- a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthFine_523fdc "fwidthFine_523fdc"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %11 = OpConstantNull %v3float
-%fwidthFine_523fdc = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %11
-        %res = OpVariable %_ptr_Function_v3float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v3float %arg_0
-         %12 = OpFwidthFine %v3float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+%fwidthFine_523fdc = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+        %res = OpVariable %_ptr_Function_v3float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v3float %arg_0
+         %15 = OpFwidthFine %v3float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %22 = OpLoad %v3float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidthFine_523fdc
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidthFine_523fdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.wgsl
index a82a250..8af242a 100644
--- a/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidthFine/523fdc.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidthFine_523fdc() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = fwidthFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthFine_523fdc();
diff --git a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl
index bc0bb73..84965c6 100644
--- a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl
+++ b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl
@@ -25,7 +25,9 @@
 fn fwidthFine_68f4ef() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = fwidthFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.dxc.hlsl
index a9ede95..d9c92a8 100644
--- a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_68f4ef() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = fwidth(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.fxc.hlsl
index a9ede95..d9c92a8 100644
--- a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_68f4ef() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = fwidth(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.glsl
index ff47798..82334fb 100644
--- a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void fwidthFine_68f4ef() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.msl
index d6c8c43..4cd3e43 100644
--- a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthFine_68f4ef() {
+void fwidthFine_68f4ef(device float4* const tint_symbol) {
   float4 arg_0 = float4(1.0f);
   float4 res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthFine_68f4ef();
+fragment void fragment_main(device float4* tint_symbol_1 [[buffer(0)]]) {
+  fwidthFine_68f4ef(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.spvasm
index 635d2b0..acf733b 100644
--- a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthFine_68f4ef "fwidthFine_68f4ef"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %11 = OpConstantNull %v4float
-%fwidthFine_68f4ef = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4float Function %11
-        %res = OpVariable %_ptr_Function_v4float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v4float %arg_0
-         %12 = OpFwidthFine %v4float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%fwidthFine_68f4ef = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4float Function %14
+        %res = OpVariable %_ptr_Function_v4float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v4float %arg_0
+         %15 = OpFwidthFine %v4float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %22 = OpLoad %v4float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidthFine_68f4ef
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidthFine_68f4ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.wgsl
index 23978b3..b1f3ab0 100644
--- a/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidthFine/68f4ef.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidthFine_68f4ef() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = fwidthFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthFine_68f4ef();
diff --git a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl
index 8962ffe..8d1cace 100644
--- a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl
+++ b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl
@@ -25,7 +25,9 @@
 fn fwidthFine_f1742d() {
   var arg_0 = 1.f;
   var res: f32 = fwidthFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.dxc.hlsl
index 8e2b50b..fe437f7 100644
--- a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_f1742d() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.fxc.hlsl
index 8e2b50b..fe437f7 100644
--- a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_f1742d() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.glsl
index 8baea1c..fb304f9 100644
--- a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void fwidthFine_f1742d() {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.msl
index badc5cb..46d61583 100644
--- a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthFine_f1742d() {
+void fwidthFine_f1742d(device float* const tint_symbol) {
   float arg_0 = 1.0f;
   float res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthFine_f1742d();
+fragment void fragment_main(device float* tint_symbol_1 [[buffer(0)]]) {
+  fwidthFine_f1742d(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.spvasm
index a2d3e96..4e1077f 100644
--- a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.spvasm
@@ -1,35 +1,51 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 16
+; Bound: 24
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthFine_f1742d "fwidthFine_f1742d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %5 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-          %9 = OpConstantNull %float
-%fwidthFine_f1742d = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_float Function %9
-        %res = OpVariable %_ptr_Function_float Function %9
+         %12 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%fwidthFine_f1742d = OpFunction %void None %5
+          %8 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_float Function %12
+        %res = OpVariable %_ptr_Function_float Function %12
                OpStore %arg_0 %float_1
-         %11 = OpLoad %float %arg_0
-         %10 = OpFwidthFine %float %11
-               OpStore %res %10
+         %14 = OpLoad %float %arg_0
+         %13 = OpFwidthFine %float %14
+               OpStore %res %13
+         %19 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %20 = OpLoad %float %res
+               OpStore %19 %20
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %14 = OpLabel
-         %15 = OpFunctionCall %void %fwidthFine_f1742d
+%fragment_main = OpFunction %void None %5
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %fwidthFine_f1742d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.wgsl
index 78a6eb9..cb9facf 100644
--- a/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidthFine/f1742d.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidthFine_f1742d() {
   var arg_0 = 1.0f;
   var res : f32 = fwidthFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   fwidthFine_f1742d();
diff --git a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl
index fbaa7ec..a671d75 100644
--- a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl
+++ b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl
@@ -25,7 +25,9 @@
 fn fwidthFine_ff6aa0() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = fwidthFine(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.dxc.hlsl
index 7c2303f..03677c7 100644
--- a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_ff6aa0() {
   float2 arg_0 = (1.0f).xx;
   float2 res = fwidth(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.fxc.hlsl
index 7c2303f..03677c7 100644
--- a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void fwidthFine_ff6aa0() {
   float2 arg_0 = (1.0f).xx;
   float2 res = fwidth(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.glsl b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.glsl
index 18a0c6f..f7101ca 100644
--- a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void fwidthFine_ff6aa0() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = fwidth(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.msl b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.msl
index 4397415..63958b3 100644
--- a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void fwidthFine_ff6aa0() {
+void fwidthFine_ff6aa0(device float2* const tint_symbol) {
   float2 arg_0 = float2(1.0f);
   float2 res = fwidth(arg_0);
+  *(tint_symbol) = res;
 }
 
-fragment void fragment_main() {
-  fwidthFine_ff6aa0();
+fragment void fragment_main(device float2* tint_symbol_1 [[buffer(0)]]) {
+  fwidthFine_ff6aa0(tint_symbol_1);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.spvasm
index fad56e4..d211213 100644
--- a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.spvasm
@@ -1,37 +1,53 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 18
+; Bound: 26
 ; Schema: 0
                OpCapability Shader
                OpCapability DerivativeControl
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpExecutionMode %fragment_main OriginUpperLeft
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %fwidthFine_ff6aa0 "fwidthFine_ff6aa0"
                OpName %arg_0 "arg_0"
                OpName %res "res"
                OpName %fragment_main "fragment_main"
-       %void = OpTypeVoid
-          %1 = OpTypeFunction %void
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+          %6 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-          %8 = OpConstantComposite %v2float %float_1 %float_1
+         %11 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %11 = OpConstantNull %v2float
-%fwidthFine_ff6aa0 = OpFunction %void None %1
-          %4 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %11
-        %res = OpVariable %_ptr_Function_v2float Function %11
-               OpStore %arg_0 %8
-         %13 = OpLoad %v2float %arg_0
-         %12 = OpFwidthFine %v2float %13
-               OpStore %res %12
+         %14 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+%fwidthFine_ff6aa0 = OpFunction %void None %6
+          %9 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+        %res = OpVariable %_ptr_Function_v2float Function %14
+               OpStore %arg_0 %11
+         %16 = OpLoad %v2float %arg_0
+         %15 = OpFwidthFine %v2float %16
+               OpStore %res %15
+         %21 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %22 = OpLoad %v2float %res
+               OpStore %21 %22
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %1
-         %16 = OpLabel
-         %17 = OpFunctionCall %void %fwidthFine_ff6aa0
+%fragment_main = OpFunction %void None %6
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %fwidthFine_ff6aa0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.wgsl
index 9175e3e..8842520 100644
--- a/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/fwidthFine/ff6aa0.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn fwidthFine_ff6aa0() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = fwidthFine(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @fragment
 fn fragment_main() {
   fwidthFine_ff6aa0();
diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl
index 0606cf7..03366f3 100644
--- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec2<u32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.dxc.hlsl
index 1e92e80..ca30ecf 100644
--- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.dxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint2((offset).xx)) : (0u).xx) & uint2((mask).xx)) | (v & uint2((~(mask)).xx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_3c7ba5() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.fxc.hlsl
index 1e92e80..ca30ecf 100644
--- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.fxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint2((offset).xx)) : (0u).xx) & uint2((mask).xx)) | (v & uint2((~(mask)).xx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_3c7ba5() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.glsl b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.glsl
index ae7fd8a..92b6a3d 100644
--- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.glsl
@@ -6,12 +6,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void insertBits_3c7ba5() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -36,12 +41,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void insertBits_3c7ba5() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -60,12 +70,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void insertBits_3c7ba5() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.msl b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.msl
index 8cee554..7fb1fee 100644
--- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.msl
@@ -7,37 +7,38 @@
   return insert_bits(v, n, s, (e - s));
 }
 
-void insertBits_3c7ba5() {
+void insertBits_3c7ba5(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_3c7ba5();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  insertBits_3c7ba5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_3c7ba5();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_3c7ba5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_3c7ba5();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_3c7ba5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.spvasm
index 98fd575..bdf12a0 100644
--- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_insert_bits "tint_insert_bits"
                OpName %v "v"
                OpName %n "n"
@@ -30,6 +33,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,69 +47,77 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
-          %9 = OpTypeFunction %v2uint %v2uint %v2uint %uint %uint
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2uint %v2uint %v2uint %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %25 = OpTypeFunction %void
+         %28 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %30 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %33 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %33 = OpConstantNull %v2uint
+         %36 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %37 = OpConstantNull %uint
-         %45 = OpTypeFunction %v4float
+         %40 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %52 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_insert_bits = OpFunction %v2uint None %9
+%tint_insert_bits = OpFunction %v2uint None %14
           %v = OpFunctionParameter %v2uint
           %n = OpFunctionParameter %v2uint
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %17 = OpLabel
-         %18 = OpExtInst %uint %19 UMin %offset %uint_32
-         %22 = OpIAdd %uint %18 %count
-         %21 = OpExtInst %uint %19 UMin %uint_32 %22
-         %24 = OpISub %uint %21 %18
-         %23 = OpBitFieldInsert %v2uint %v %n %18 %24
-               OpReturnValue %23
+         %20 = OpLabel
+         %21 = OpExtInst %uint %22 UMin %offset %uint_32
+         %25 = OpIAdd %uint %21 %count
+         %24 = OpExtInst %uint %22 UMin %uint_32 %25
+         %27 = OpISub %uint %24 %21
+         %26 = OpBitFieldInsert %v2uint %v %n %21 %27
+               OpReturnValue %26
                OpFunctionEnd
-%insertBits_3c7ba5 = OpFunction %void None %25
-         %28 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %33
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %33
-      %arg_2 = OpVariable %_ptr_Function_uint Function %37
-      %arg_3 = OpVariable %_ptr_Function_uint Function %37
-        %res = OpVariable %_ptr_Function_v2uint Function %33
-               OpStore %arg_0 %30
-               OpStore %arg_1 %30
+%insertBits_3c7ba5 = OpFunction %void None %28
+         %31 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %36
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %36
+      %arg_2 = OpVariable %_ptr_Function_uint Function %40
+      %arg_3 = OpVariable %_ptr_Function_uint Function %40
+        %res = OpVariable %_ptr_Function_v2uint Function %36
+               OpStore %arg_0 %33
+               OpStore %arg_1 %33
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %40 = OpLoad %v2uint %arg_0
-         %41 = OpLoad %v2uint %arg_1
-         %42 = OpLoad %uint %arg_2
-         %43 = OpLoad %uint %arg_3
-         %39 = OpFunctionCall %v2uint %tint_insert_bits %40 %41 %42 %43
-               OpStore %res %39
+         %43 = OpLoad %v2uint %arg_0
+         %44 = OpLoad %v2uint %arg_1
+         %45 = OpLoad %uint %arg_2
+         %46 = OpLoad %uint %arg_3
+         %42 = OpFunctionCall %v2uint %tint_insert_bits %43 %44 %45 %46
+               OpStore %res %42
+         %50 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %51 = OpLoad %v2uint %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %insertBits_3c7ba5
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %insertBits_3c7ba5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %25
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %28
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %25
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %insertBits_3c7ba5
+%fragment_main = OpFunction %void None %28
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %insertBits_3c7ba5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %25
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %insertBits_3c7ba5
+%compute_main = OpFunction %void None %28
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %insertBits_3c7ba5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.wgsl
index 78175d6..d16e1b2 100644
--- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec2<u32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_3c7ba5();
diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl
index 14c5606..443307b 100644
--- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec3<i32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.dxc.hlsl
index f863d24..b61e200 100644
--- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.dxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint3((offset).xxx)) : (0).xxx) & int3((int(mask)).xxx)) | (v & int3((int(~(mask))).xxx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_428b0b() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.fxc.hlsl
index f863d24..b61e200 100644
--- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.fxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint3((offset).xxx)) : (0).xxx) & int3((int(mask)).xxx)) | (v & int3((int(~(mask))).xxx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_428b0b() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.glsl b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.glsl
index f4ed94f..a1d5e1c 100644
--- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.glsl
@@ -6,12 +6,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void insertBits_428b0b() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -36,12 +41,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void insertBits_428b0b() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -60,12 +70,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void insertBits_428b0b() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.msl b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.msl
index 3034164..8b37add 100644
--- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.msl
@@ -7,37 +7,38 @@
   return insert_bits(v, n, s, (e - s));
 }
 
-void insertBits_428b0b() {
+void insertBits_428b0b(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 arg_1 = int3(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_428b0b();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  insertBits_428b0b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_428b0b();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_428b0b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_428b0b();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_428b0b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.spvasm
index 7f7625b..88a5a98 100644
--- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_insert_bits "tint_insert_bits"
                OpName %v "v"
                OpName %n "n"
@@ -30,6 +33,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,71 +47,79 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %v3int %v3int %v3int %uint %uint
+         %14 = OpTypeFunction %v3int %v3int %v3int %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %26 = OpTypeFunction %void
+         %29 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %31 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %34 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %34 = OpConstantNull %v3int
+         %37 = OpConstantNull %v3int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %39 = OpConstantNull %uint
-         %47 = OpTypeFunction %v4float
+         %42 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %54 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_insert_bits = OpFunction %v3int None %9
+%tint_insert_bits = OpFunction %v3int None %14
           %v = OpFunctionParameter %v3int
           %n = OpFunctionParameter %v3int
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %18 = OpLabel
-         %19 = OpExtInst %uint %20 UMin %offset %uint_32
-         %23 = OpIAdd %uint %19 %count
-         %22 = OpExtInst %uint %20 UMin %uint_32 %23
-         %25 = OpISub %uint %22 %19
-         %24 = OpBitFieldInsert %v3int %v %n %19 %25
-               OpReturnValue %24
+         %21 = OpLabel
+         %22 = OpExtInst %uint %23 UMin %offset %uint_32
+         %26 = OpIAdd %uint %22 %count
+         %25 = OpExtInst %uint %23 UMin %uint_32 %26
+         %28 = OpISub %uint %25 %22
+         %27 = OpBitFieldInsert %v3int %v %n %22 %28
+               OpReturnValue %27
                OpFunctionEnd
-%insertBits_428b0b = OpFunction %void None %26
-         %29 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %34
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %34
-      %arg_2 = OpVariable %_ptr_Function_uint Function %39
-      %arg_3 = OpVariable %_ptr_Function_uint Function %39
-        %res = OpVariable %_ptr_Function_v3int Function %34
-               OpStore %arg_0 %31
-               OpStore %arg_1 %31
+%insertBits_428b0b = OpFunction %void None %29
+         %32 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %37
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %37
+      %arg_2 = OpVariable %_ptr_Function_uint Function %42
+      %arg_3 = OpVariable %_ptr_Function_uint Function %42
+        %res = OpVariable %_ptr_Function_v3int Function %37
+               OpStore %arg_0 %34
+               OpStore %arg_1 %34
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %42 = OpLoad %v3int %arg_0
-         %43 = OpLoad %v3int %arg_1
-         %44 = OpLoad %uint %arg_2
-         %45 = OpLoad %uint %arg_3
-         %41 = OpFunctionCall %v3int %tint_insert_bits %42 %43 %44 %45
-               OpStore %res %41
+         %45 = OpLoad %v3int %arg_0
+         %46 = OpLoad %v3int %arg_1
+         %47 = OpLoad %uint %arg_2
+         %48 = OpLoad %uint %arg_3
+         %44 = OpFunctionCall %v3int %tint_insert_bits %45 %46 %47 %48
+               OpStore %res %44
+         %52 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %53 = OpLoad %v3int %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %insertBits_428b0b
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %insertBits_428b0b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %26
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %29
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %26
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %insertBits_428b0b
+%fragment_main = OpFunction %void None %29
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %insertBits_428b0b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %26
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %insertBits_428b0b
+%compute_main = OpFunction %void None %29
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %insertBits_428b0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.wgsl
index d9a37dc..347f19e 100644
--- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec3<i32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_428b0b();
diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl
index 98af954..03cc84d 100644
--- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec4<u32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.dxc.hlsl
index e0f4cf3..2c49fe0 100644
--- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.dxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint4((offset).xxxx)) : (0u).xxxx) & uint4((mask).xxxx)) | (v & uint4((~(mask)).xxxx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_51ede1() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.fxc.hlsl
index e0f4cf3..2c49fe0 100644
--- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.fxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint4((offset).xxxx)) : (0u).xxxx) & uint4((mask).xxxx)) | (v & uint4((~(mask)).xxxx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_51ede1() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.glsl b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.glsl
index 2832d7b..d1eb280 100644
--- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.glsl
@@ -6,12 +6,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void insertBits_51ede1() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -36,12 +41,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void insertBits_51ede1() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -60,12 +70,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void insertBits_51ede1() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.msl b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.msl
index 2dbc14f..df25867 100644
--- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.msl
@@ -7,37 +7,38 @@
   return insert_bits(v, n, s, (e - s));
 }
 
-void insertBits_51ede1() {
+void insertBits_51ede1(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 arg_1 = uint4(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_51ede1();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  insertBits_51ede1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_51ede1();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_51ede1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_51ede1();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_51ede1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.spvasm
index cbbcd39..360700f 100644
--- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_insert_bits "tint_insert_bits"
                OpName %v "v"
                OpName %n "n"
@@ -30,6 +33,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,69 +47,77 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
-          %9 = OpTypeFunction %v4uint %v4uint %v4uint %uint %uint
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4uint %v4uint %v4uint %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %25 = OpTypeFunction %void
+         %28 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %30 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %33 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %33 = OpConstantNull %v4uint
+         %36 = OpConstantNull %v4uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %37 = OpConstantNull %uint
-         %45 = OpTypeFunction %v4float
+         %40 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %52 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_insert_bits = OpFunction %v4uint None %9
+%tint_insert_bits = OpFunction %v4uint None %14
           %v = OpFunctionParameter %v4uint
           %n = OpFunctionParameter %v4uint
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %17 = OpLabel
-         %18 = OpExtInst %uint %19 UMin %offset %uint_32
-         %22 = OpIAdd %uint %18 %count
-         %21 = OpExtInst %uint %19 UMin %uint_32 %22
-         %24 = OpISub %uint %21 %18
-         %23 = OpBitFieldInsert %v4uint %v %n %18 %24
-               OpReturnValue %23
+         %20 = OpLabel
+         %21 = OpExtInst %uint %22 UMin %offset %uint_32
+         %25 = OpIAdd %uint %21 %count
+         %24 = OpExtInst %uint %22 UMin %uint_32 %25
+         %27 = OpISub %uint %24 %21
+         %26 = OpBitFieldInsert %v4uint %v %n %21 %27
+               OpReturnValue %26
                OpFunctionEnd
-%insertBits_51ede1 = OpFunction %void None %25
-         %28 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %33
-      %arg_1 = OpVariable %_ptr_Function_v4uint Function %33
-      %arg_2 = OpVariable %_ptr_Function_uint Function %37
-      %arg_3 = OpVariable %_ptr_Function_uint Function %37
-        %res = OpVariable %_ptr_Function_v4uint Function %33
-               OpStore %arg_0 %30
-               OpStore %arg_1 %30
+%insertBits_51ede1 = OpFunction %void None %28
+         %31 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %36
+      %arg_1 = OpVariable %_ptr_Function_v4uint Function %36
+      %arg_2 = OpVariable %_ptr_Function_uint Function %40
+      %arg_3 = OpVariable %_ptr_Function_uint Function %40
+        %res = OpVariable %_ptr_Function_v4uint Function %36
+               OpStore %arg_0 %33
+               OpStore %arg_1 %33
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %40 = OpLoad %v4uint %arg_0
-         %41 = OpLoad %v4uint %arg_1
-         %42 = OpLoad %uint %arg_2
-         %43 = OpLoad %uint %arg_3
-         %39 = OpFunctionCall %v4uint %tint_insert_bits %40 %41 %42 %43
-               OpStore %res %39
+         %43 = OpLoad %v4uint %arg_0
+         %44 = OpLoad %v4uint %arg_1
+         %45 = OpLoad %uint %arg_2
+         %46 = OpLoad %uint %arg_3
+         %42 = OpFunctionCall %v4uint %tint_insert_bits %43 %44 %45 %46
+               OpStore %res %42
+         %50 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %51 = OpLoad %v4uint %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %insertBits_51ede1
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %insertBits_51ede1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %25
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %28
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %25
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %insertBits_51ede1
+%fragment_main = OpFunction %void None %28
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %insertBits_51ede1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %25
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %insertBits_51ede1
+%compute_main = OpFunction %void None %28
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %insertBits_51ede1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.wgsl
index 76a46b8..2f25cb7 100644
--- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec4<u32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_51ede1();
diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl b/test/tint/builtins/gen/var/insertBits/65468b.wgsl
index f23865d..f33502c 100644
--- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: i32 = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.dxc.hlsl
index 49ac66a..c6d3478 100644
--- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.dxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << offset) : 0) & int(mask)) | (v & int(~(mask))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_65468b() {
   int arg_0 = 1;
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.fxc.hlsl
index 49ac66a..c6d3478 100644
--- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.fxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << offset) : 0) & int(mask)) | (v & int(~(mask))));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_65468b() {
   int arg_0 = 1;
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.glsl b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.glsl
index 8d9614e..247e14c 100644
--- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.glsl
@@ -6,12 +6,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void insertBits_65468b() {
   int arg_0 = 1;
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -36,12 +41,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void insertBits_65468b() {
   int arg_0 = 1;
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -60,12 +70,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void insertBits_65468b() {
   int arg_0 = 1;
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.msl b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.msl
index 21411f7..466ea2c 100644
--- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.msl
@@ -7,37 +7,38 @@
   return insert_bits(v, n, s, (e - s));
 }
 
-void insertBits_65468b() {
+void insertBits_65468b(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_65468b();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  insertBits_65468b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_65468b();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_65468b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_65468b();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_65468b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.spvasm
index 3d4e69f..5968b7e 100644
--- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_insert_bits "tint_insert_bits"
                OpName %v "v"
                OpName %n "n"
@@ -30,6 +33,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -39,70 +46,78 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %int %int %int %uint %uint
+         %13 = OpTypeFunction %int %int %int %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %25 = OpTypeFunction %void
+         %28 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %32 = OpConstantNull %int
+         %35 = OpConstantNull %int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %37 = OpConstantNull %uint
-         %45 = OpTypeFunction %v4float
+         %40 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %52 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_insert_bits = OpFunction %int None %9
+%tint_insert_bits = OpFunction %int None %13
           %v = OpFunctionParameter %int
           %n = OpFunctionParameter %int
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %17 = OpLabel
-         %18 = OpExtInst %uint %19 UMin %offset %uint_32
-         %22 = OpIAdd %uint %18 %count
-         %21 = OpExtInst %uint %19 UMin %uint_32 %22
-         %24 = OpISub %uint %21 %18
-         %23 = OpBitFieldInsert %int %v %n %18 %24
-               OpReturnValue %23
+         %20 = OpLabel
+         %21 = OpExtInst %uint %22 UMin %offset %uint_32
+         %25 = OpIAdd %uint %21 %count
+         %24 = OpExtInst %uint %22 UMin %uint_32 %25
+         %27 = OpISub %uint %24 %21
+         %26 = OpBitFieldInsert %int %v %n %21 %27
+               OpReturnValue %26
                OpFunctionEnd
-%insertBits_65468b = OpFunction %void None %25
-         %28 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %32
-      %arg_1 = OpVariable %_ptr_Function_int Function %32
-      %arg_2 = OpVariable %_ptr_Function_uint Function %37
-      %arg_3 = OpVariable %_ptr_Function_uint Function %37
-        %res = OpVariable %_ptr_Function_int Function %32
+%insertBits_65468b = OpFunction %void None %28
+         %31 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %35
+      %arg_1 = OpVariable %_ptr_Function_int Function %35
+      %arg_2 = OpVariable %_ptr_Function_uint Function %40
+      %arg_3 = OpVariable %_ptr_Function_uint Function %40
+        %res = OpVariable %_ptr_Function_int Function %35
                OpStore %arg_0 %int_1
                OpStore %arg_1 %int_1
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %40 = OpLoad %int %arg_0
-         %41 = OpLoad %int %arg_1
-         %42 = OpLoad %uint %arg_2
-         %43 = OpLoad %uint %arg_3
-         %39 = OpFunctionCall %int %tint_insert_bits %40 %41 %42 %43
-               OpStore %res %39
+         %43 = OpLoad %int %arg_0
+         %44 = OpLoad %int %arg_1
+         %45 = OpLoad %uint %arg_2
+         %46 = OpLoad %uint %arg_3
+         %42 = OpFunctionCall %int %tint_insert_bits %43 %44 %45 %46
+               OpStore %res %42
+         %50 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %51 = OpLoad %int %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %insertBits_65468b
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %insertBits_65468b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %25
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %28
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %25
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %insertBits_65468b
+%fragment_main = OpFunction %void None %28
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %insertBits_65468b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %25
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %insertBits_65468b
+%compute_main = OpFunction %void None %28
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %insertBits_65468b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.wgsl
index 77dce81..a975ac5 100644
--- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : i32 = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_65468b();
diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl b/test/tint/builtins/gen/var/insertBits/87826b.wgsl
index 12ea9ba..0a00a5b 100644
--- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec3<u32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.dxc.hlsl
index 9b1ac83..3c09859 100644
--- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.dxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint3((offset).xxx)) : (0u).xxx) & uint3((mask).xxx)) | (v & uint3((~(mask)).xxx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_87826b() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.fxc.hlsl
index 9b1ac83..3c09859 100644
--- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.fxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint3((offset).xxx)) : (0u).xxx) & uint3((mask).xxx)) | (v & uint3((~(mask)).xxx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_87826b() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.glsl b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.glsl
index cebc13a..3545ad3 100644
--- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.glsl
@@ -6,12 +6,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void insertBits_87826b() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -36,12 +41,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void insertBits_87826b() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -60,12 +70,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void insertBits_87826b() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.msl b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.msl
index e4901f9..7c7283e 100644
--- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.msl
@@ -7,37 +7,38 @@
   return insert_bits(v, n, s, (e - s));
 }
 
-void insertBits_87826b() {
+void insertBits_87826b(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 arg_1 = uint3(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint3 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_87826b();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  insertBits_87826b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_87826b();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_87826b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_87826b();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_87826b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.spvasm
index 23c2e7a..2e88dfa 100644
--- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_insert_bits "tint_insert_bits"
                OpName %v "v"
                OpName %n "n"
@@ -30,6 +33,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,69 +47,77 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
-          %9 = OpTypeFunction %v3uint %v3uint %v3uint %uint %uint
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3uint %v3uint %v3uint %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %25 = OpTypeFunction %void
+         %28 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %30 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %33 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %33 = OpConstantNull %v3uint
+         %36 = OpConstantNull %v3uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %37 = OpConstantNull %uint
-         %45 = OpTypeFunction %v4float
+         %40 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %52 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_insert_bits = OpFunction %v3uint None %9
+%tint_insert_bits = OpFunction %v3uint None %14
           %v = OpFunctionParameter %v3uint
           %n = OpFunctionParameter %v3uint
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %17 = OpLabel
-         %18 = OpExtInst %uint %19 UMin %offset %uint_32
-         %22 = OpIAdd %uint %18 %count
-         %21 = OpExtInst %uint %19 UMin %uint_32 %22
-         %24 = OpISub %uint %21 %18
-         %23 = OpBitFieldInsert %v3uint %v %n %18 %24
-               OpReturnValue %23
+         %20 = OpLabel
+         %21 = OpExtInst %uint %22 UMin %offset %uint_32
+         %25 = OpIAdd %uint %21 %count
+         %24 = OpExtInst %uint %22 UMin %uint_32 %25
+         %27 = OpISub %uint %24 %21
+         %26 = OpBitFieldInsert %v3uint %v %n %21 %27
+               OpReturnValue %26
                OpFunctionEnd
-%insertBits_87826b = OpFunction %void None %25
-         %28 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %33
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %33
-      %arg_2 = OpVariable %_ptr_Function_uint Function %37
-      %arg_3 = OpVariable %_ptr_Function_uint Function %37
-        %res = OpVariable %_ptr_Function_v3uint Function %33
-               OpStore %arg_0 %30
-               OpStore %arg_1 %30
+%insertBits_87826b = OpFunction %void None %28
+         %31 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %36
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %36
+      %arg_2 = OpVariable %_ptr_Function_uint Function %40
+      %arg_3 = OpVariable %_ptr_Function_uint Function %40
+        %res = OpVariable %_ptr_Function_v3uint Function %36
+               OpStore %arg_0 %33
+               OpStore %arg_1 %33
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %40 = OpLoad %v3uint %arg_0
-         %41 = OpLoad %v3uint %arg_1
-         %42 = OpLoad %uint %arg_2
-         %43 = OpLoad %uint %arg_3
-         %39 = OpFunctionCall %v3uint %tint_insert_bits %40 %41 %42 %43
-               OpStore %res %39
+         %43 = OpLoad %v3uint %arg_0
+         %44 = OpLoad %v3uint %arg_1
+         %45 = OpLoad %uint %arg_2
+         %46 = OpLoad %uint %arg_3
+         %42 = OpFunctionCall %v3uint %tint_insert_bits %43 %44 %45 %46
+               OpStore %res %42
+         %50 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %51 = OpLoad %v3uint %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %insertBits_87826b
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %insertBits_87826b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %25
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %28
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %25
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %insertBits_87826b
+%fragment_main = OpFunction %void None %28
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %insertBits_87826b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %25
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %insertBits_87826b
+%compute_main = OpFunction %void None %28
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %insertBits_87826b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.wgsl
index cfbc74e..c8c9b8e 100644
--- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec3<u32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_87826b();
diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl b/test/tint/builtins/gen/var/insertBits/d86978.wgsl
index a59ce0b..3b30119 100644
--- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec4<i32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.dxc.hlsl
index da39ac7..db0d3f3 100644
--- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.dxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint4((offset).xxxx)) : (0).xxxx) & int4((int(mask)).xxxx)) | (v & int4((int(~(mask))).xxxx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_d86978() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.fxc.hlsl
index da39ac7..db0d3f3 100644
--- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.fxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint4((offset).xxxx)) : (0).xxxx) & int4((int(mask)).xxxx)) | (v & int4((int(~(mask))).xxxx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_d86978() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.glsl b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.glsl
index ff4206a..792a9e9 100644
--- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.glsl
@@ -6,12 +6,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void insertBits_d86978() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -36,12 +41,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void insertBits_d86978() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -60,12 +70,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void insertBits_d86978() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.msl b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.msl
index da3e5a1..fa663d0 100644
--- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.msl
@@ -7,37 +7,38 @@
   return insert_bits(v, n, s, (e - s));
 }
 
-void insertBits_d86978() {
+void insertBits_d86978(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 arg_1 = int4(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_d86978();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  insertBits_d86978(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_d86978();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_d86978(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_d86978();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_d86978(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.spvasm b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.spvasm
index b9ea59e..8ac0491 100644
--- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_insert_bits "tint_insert_bits"
                OpName %v "v"
                OpName %n "n"
@@ -30,6 +33,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,71 +47,79 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %v4int %v4int %v4int %uint %uint
+         %14 = OpTypeFunction %v4int %v4int %v4int %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %26 = OpTypeFunction %void
+         %29 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %31 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %34 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %34 = OpConstantNull %v4int
+         %37 = OpConstantNull %v4int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %39 = OpConstantNull %uint
-         %47 = OpTypeFunction %v4float
+         %42 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %54 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_insert_bits = OpFunction %v4int None %9
+%tint_insert_bits = OpFunction %v4int None %14
           %v = OpFunctionParameter %v4int
           %n = OpFunctionParameter %v4int
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %18 = OpLabel
-         %19 = OpExtInst %uint %20 UMin %offset %uint_32
-         %23 = OpIAdd %uint %19 %count
-         %22 = OpExtInst %uint %20 UMin %uint_32 %23
-         %25 = OpISub %uint %22 %19
-         %24 = OpBitFieldInsert %v4int %v %n %19 %25
-               OpReturnValue %24
+         %21 = OpLabel
+         %22 = OpExtInst %uint %23 UMin %offset %uint_32
+         %26 = OpIAdd %uint %22 %count
+         %25 = OpExtInst %uint %23 UMin %uint_32 %26
+         %28 = OpISub %uint %25 %22
+         %27 = OpBitFieldInsert %v4int %v %n %22 %28
+               OpReturnValue %27
                OpFunctionEnd
-%insertBits_d86978 = OpFunction %void None %26
-         %29 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %34
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %34
-      %arg_2 = OpVariable %_ptr_Function_uint Function %39
-      %arg_3 = OpVariable %_ptr_Function_uint Function %39
-        %res = OpVariable %_ptr_Function_v4int Function %34
-               OpStore %arg_0 %31
-               OpStore %arg_1 %31
+%insertBits_d86978 = OpFunction %void None %29
+         %32 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %37
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %37
+      %arg_2 = OpVariable %_ptr_Function_uint Function %42
+      %arg_3 = OpVariable %_ptr_Function_uint Function %42
+        %res = OpVariable %_ptr_Function_v4int Function %37
+               OpStore %arg_0 %34
+               OpStore %arg_1 %34
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %42 = OpLoad %v4int %arg_0
-         %43 = OpLoad %v4int %arg_1
-         %44 = OpLoad %uint %arg_2
-         %45 = OpLoad %uint %arg_3
-         %41 = OpFunctionCall %v4int %tint_insert_bits %42 %43 %44 %45
-               OpStore %res %41
+         %45 = OpLoad %v4int %arg_0
+         %46 = OpLoad %v4int %arg_1
+         %47 = OpLoad %uint %arg_2
+         %48 = OpLoad %uint %arg_3
+         %44 = OpFunctionCall %v4int %tint_insert_bits %45 %46 %47 %48
+               OpStore %res %44
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %53 = OpLoad %v4int %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %insertBits_d86978
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %insertBits_d86978
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %26
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %29
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %26
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %insertBits_d86978
+%fragment_main = OpFunction %void None %29
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %insertBits_d86978
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %26
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %insertBits_d86978
+%compute_main = OpFunction %void None %29
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %insertBits_d86978
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.wgsl b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.wgsl
index 97ff1e5..651b5fa 100644
--- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec4<i32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_d86978();
diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl
index 515a8d9..bf17e57 100644
--- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: u32 = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.dxc.hlsl
index ea68815..9e4ed94 100644
--- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.dxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << offset) : 0u) & mask) | (v & ~(mask)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_e3e3a2() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.fxc.hlsl
index ea68815..9e4ed94 100644
--- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.fxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << offset) : 0u) & mask) | (v & ~(mask)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_e3e3a2() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.glsl b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.glsl
index 07f56be..569766b 100644
--- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.glsl
@@ -6,12 +6,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void insertBits_e3e3a2() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -36,12 +41,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void insertBits_e3e3a2() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -60,12 +70,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void insertBits_e3e3a2() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.msl b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.msl
index 20a4950..710ccc2 100644
--- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.msl
@@ -7,37 +7,38 @@
   return insert_bits(v, n, s, (e - s));
 }
 
-void insertBits_e3e3a2() {
+void insertBits_e3e3a2(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_e3e3a2();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  insertBits_e3e3a2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_e3e3a2();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_e3e3a2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_e3e3a2();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_e3e3a2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.spvasm
index 17e63b9..cbce078 100644
--- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_insert_bits "tint_insert_bits"
                OpName %v "v"
                OpName %n "n"
@@ -30,6 +33,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -39,66 +46,74 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %uint %uint %uint %uint %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %uint %uint %uint %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %24 = OpTypeFunction %void
+         %27 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %31 = OpConstantNull %uint
-         %41 = OpTypeFunction %v4float
+         %34 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %48 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_insert_bits = OpFunction %uint None %9
+%tint_insert_bits = OpFunction %uint None %13
           %v = OpFunctionParameter %uint
           %n = OpFunctionParameter %uint
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %16 = OpLabel
-         %17 = OpExtInst %uint %18 UMin %offset %uint_32
-         %21 = OpIAdd %uint %17 %count
-         %20 = OpExtInst %uint %18 UMin %uint_32 %21
-         %23 = OpISub %uint %20 %17
-         %22 = OpBitFieldInsert %uint %v %n %17 %23
-               OpReturnValue %22
+         %19 = OpLabel
+         %20 = OpExtInst %uint %21 UMin %offset %uint_32
+         %24 = OpIAdd %uint %20 %count
+         %23 = OpExtInst %uint %21 UMin %uint_32 %24
+         %26 = OpISub %uint %23 %20
+         %25 = OpBitFieldInsert %uint %v %n %20 %26
+               OpReturnValue %25
                OpFunctionEnd
-%insertBits_e3e3a2 = OpFunction %void None %24
-         %27 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %31
-      %arg_1 = OpVariable %_ptr_Function_uint Function %31
-      %arg_2 = OpVariable %_ptr_Function_uint Function %31
-      %arg_3 = OpVariable %_ptr_Function_uint Function %31
-        %res = OpVariable %_ptr_Function_uint Function %31
+%insertBits_e3e3a2 = OpFunction %void None %27
+         %30 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %34
+      %arg_1 = OpVariable %_ptr_Function_uint Function %34
+      %arg_2 = OpVariable %_ptr_Function_uint Function %34
+      %arg_3 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_uint Function %34
                OpStore %arg_0 %uint_1
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %36 = OpLoad %uint %arg_0
-         %37 = OpLoad %uint %arg_1
-         %38 = OpLoad %uint %arg_2
-         %39 = OpLoad %uint %arg_3
-         %35 = OpFunctionCall %uint %tint_insert_bits %36 %37 %38 %39
-               OpStore %res %35
+         %39 = OpLoad %uint %arg_0
+         %40 = OpLoad %uint %arg_1
+         %41 = OpLoad %uint %arg_2
+         %42 = OpLoad %uint %arg_3
+         %38 = OpFunctionCall %uint %tint_insert_bits %39 %40 %41 %42
+               OpStore %res %38
+         %46 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %47 = OpLoad %uint %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %insertBits_e3e3a2
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %insertBits_e3e3a2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %24
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %27
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %24
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %insertBits_e3e3a2
+%fragment_main = OpFunction %void None %27
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %insertBits_e3e3a2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %24
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %insertBits_e3e3a2
+%compute_main = OpFunction %void None %27
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %insertBits_e3e3a2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.wgsl
index 4541379..0dcff24 100644
--- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : u32 = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_e3e3a2();
diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl
index 953dd24..6a878c2 100644
--- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec2<i32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.dxc.hlsl
index e94b11d..a3e8ed7 100644
--- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.dxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint2((offset).xx)) : (0).xx) & int2((int(mask)).xx)) | (v & int2((int(~(mask))).xx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_fe6ba6() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.fxc.hlsl
index e94b11d..a3e8ed7 100644
--- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.fxc.hlsl
@@ -4,12 +4,15 @@
   return ((((offset < 32u) ? (n << uint2((offset).xx)) : (0).xx) & int2((int(mask)).xx)) | (v & int2((int(~(mask))).xx)));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void insertBits_fe6ba6() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.glsl b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.glsl
index 775c87c..3ef6ca5 100644
--- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.glsl
@@ -6,12 +6,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void insertBits_fe6ba6() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -36,12 +41,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void insertBits_fe6ba6() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -60,12 +70,17 @@
   return bitfieldInsert(v, n, int(s), int((e - s)));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void insertBits_fe6ba6() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.msl b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.msl
index 9720049..d642557 100644
--- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.msl
@@ -7,37 +7,38 @@
   return insert_bits(v, n, s, (e - s));
 }
 
-void insertBits_fe6ba6() {
+void insertBits_fe6ba6(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int2 res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  insertBits_fe6ba6();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  insertBits_fe6ba6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  insertBits_fe6ba6();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  insertBits_fe6ba6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  insertBits_fe6ba6();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  insertBits_fe6ba6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.spvasm
index 9d41b6e..d363694 100644
--- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_insert_bits "tint_insert_bits"
                OpName %v "v"
                OpName %n "n"
@@ -30,6 +33,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,71 +47,79 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %uint = OpTypeInt 32 0
-          %9 = OpTypeFunction %v2int %v2int %v2int %uint %uint
+         %14 = OpTypeFunction %v2int %v2int %v2int %uint %uint
     %uint_32 = OpConstant %uint 32
        %void = OpTypeVoid
-         %26 = OpTypeFunction %void
+         %29 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %31 = OpConstantComposite %v2int %int_1 %int_1
+         %34 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %34 = OpConstantNull %v2int
+         %37 = OpConstantNull %v2int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %39 = OpConstantNull %uint
-         %47 = OpTypeFunction %v4float
+         %42 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %54 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_insert_bits = OpFunction %v2int None %9
+%tint_insert_bits = OpFunction %v2int None %14
           %v = OpFunctionParameter %v2int
           %n = OpFunctionParameter %v2int
      %offset = OpFunctionParameter %uint
       %count = OpFunctionParameter %uint
-         %18 = OpLabel
-         %19 = OpExtInst %uint %20 UMin %offset %uint_32
-         %23 = OpIAdd %uint %19 %count
-         %22 = OpExtInst %uint %20 UMin %uint_32 %23
-         %25 = OpISub %uint %22 %19
-         %24 = OpBitFieldInsert %v2int %v %n %19 %25
-               OpReturnValue %24
+         %21 = OpLabel
+         %22 = OpExtInst %uint %23 UMin %offset %uint_32
+         %26 = OpIAdd %uint %22 %count
+         %25 = OpExtInst %uint %23 UMin %uint_32 %26
+         %28 = OpISub %uint %25 %22
+         %27 = OpBitFieldInsert %v2int %v %n %22 %28
+               OpReturnValue %27
                OpFunctionEnd
-%insertBits_fe6ba6 = OpFunction %void None %26
-         %29 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %34
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %34
-      %arg_2 = OpVariable %_ptr_Function_uint Function %39
-      %arg_3 = OpVariable %_ptr_Function_uint Function %39
-        %res = OpVariable %_ptr_Function_v2int Function %34
-               OpStore %arg_0 %31
-               OpStore %arg_1 %31
+%insertBits_fe6ba6 = OpFunction %void None %29
+         %32 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %37
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %37
+      %arg_2 = OpVariable %_ptr_Function_uint Function %42
+      %arg_3 = OpVariable %_ptr_Function_uint Function %42
+        %res = OpVariable %_ptr_Function_v2int Function %37
+               OpStore %arg_0 %34
+               OpStore %arg_1 %34
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %42 = OpLoad %v2int %arg_0
-         %43 = OpLoad %v2int %arg_1
-         %44 = OpLoad %uint %arg_2
-         %45 = OpLoad %uint %arg_3
-         %41 = OpFunctionCall %v2int %tint_insert_bits %42 %43 %44 %45
-               OpStore %res %41
+         %45 = OpLoad %v2int %arg_0
+         %46 = OpLoad %v2int %arg_1
+         %47 = OpLoad %uint %arg_2
+         %48 = OpLoad %uint %arg_3
+         %44 = OpFunctionCall %v2int %tint_insert_bits %45 %46 %47 %48
+               OpStore %res %44
+         %52 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %53 = OpLoad %v2int %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %insertBits_fe6ba6
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %insertBits_fe6ba6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %26
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %29
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %26
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %insertBits_fe6ba6
+%fragment_main = OpFunction %void None %29
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %insertBits_fe6ba6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %26
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %insertBits_fe6ba6
+%compute_main = OpFunction %void None %29
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %insertBits_fe6ba6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.wgsl
index cdd0ab4..ff3882b 100644
--- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec2<i32> = insertBits(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   insertBits_fe6ba6();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl
index a63b143..8358fd3 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = inverseSqrt(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_07a6fe();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl
index 7263f4e..d81f957 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl
@@ -27,7 +27,9 @@
 fn inverseSqrt_440300() {
   var arg_0 = 1.h;
   var res: f16 = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.dxc.hlsl
index 806ebb4..d447ee1 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_440300() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = rsqrt(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.fxc.hlsl
index 4f961b9..0f95134 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_440300() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = rsqrt(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.glsl
index 432932b..25ce045 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void inverseSqrt_440300() {
   float16_t arg_0 = 1.0hf;
   float16_t res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void inverseSqrt_440300() {
   float16_t arg_0 = 1.0hf;
   float16_t res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void inverseSqrt_440300() {
   float16_t arg_0 = 1.0hf;
   float16_t res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.msl
index a0a16e0..1b7f0458 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_440300() {
+void inverseSqrt_440300(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = rsqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_440300();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  inverseSqrt_440300(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_440300();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_440300(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_440300();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_440300(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.spvasm
index 15e331c..869f853 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_440300 "inverseSqrt_440300"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%inverseSqrt_440300 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%inverseSqrt_440300 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 InverseSqrt %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 InverseSqrt %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %inverseSqrt_440300
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %inverseSqrt_440300
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %inverseSqrt_440300
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %inverseSqrt_440300
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %inverseSqrt_440300
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %inverseSqrt_440300
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.wgsl
index 7619128..86f631f 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/440300.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn inverseSqrt_440300() {
   var arg_0 = 1.0h;
   var res : f16 = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_440300();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl
index ca09f89..9f63447 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = inverseSqrt(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_4ca6d6();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl
index e098e5a..55471d7 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl
@@ -27,7 +27,9 @@
 fn inverseSqrt_5f51f8() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
index d8dc6a8..8ce03b7 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_5f51f8() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = rsqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.fxc.hlsl
index 3a01bfd..2d532f0 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_5f51f8() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = rsqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.glsl
index 727f37d..8049c79 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_5f51f8() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_5f51f8() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_5f51f8() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.msl
index 7b5a0fb..4bccdef 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_5f51f8() {
+void inverseSqrt_5f51f8(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = rsqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_5f51f8();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  inverseSqrt_5f51f8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_5f51f8();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_5f51f8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_5f51f8();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_5f51f8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.spvasm
index 363b7d5..43029c7 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_5f51f8 "inverseSqrt_5f51f8"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%inverseSqrt_5f51f8 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 InverseSqrt %22
-               OpStore %res %20
+%inverseSqrt_5f51f8 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 InverseSqrt %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %inverseSqrt_5f51f8
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %inverseSqrt_5f51f8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %inverseSqrt_5f51f8
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %inverseSqrt_5f51f8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %inverseSqrt_5f51f8
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %inverseSqrt_5f51f8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.wgsl
index a2c5b72..6073e2e 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/5f51f8.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn inverseSqrt_5f51f8() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_5f51f8();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl
index bc3f3ee..1b6b1be 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = inverseSqrt(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_6d0783();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl
index 286a18d..2591ab3 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl
@@ -25,7 +25,9 @@
 fn inverseSqrt_84407e() {
   var arg_0 = 1.f;
   var res: f32 = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
index 97c63e5..e2c915f 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_84407e() {
   float arg_0 = 1.0f;
   float res = rsqrt(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
index 97c63e5..e2c915f 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_84407e() {
   float arg_0 = 1.0f;
   float res = rsqrt(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.glsl
index 9ddc694..da3cd3c 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void inverseSqrt_84407e() {
   float arg_0 = 1.0f;
   float res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void inverseSqrt_84407e() {
   float arg_0 = 1.0f;
   float res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void inverseSqrt_84407e() {
   float arg_0 = 1.0f;
   float res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.msl
index 61e9b67..2aa30b7 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_84407e() {
+void inverseSqrt_84407e(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = rsqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_84407e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  inverseSqrt_84407e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_84407e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_84407e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_84407e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_84407e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.spvasm
index c350373..1262cd6 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_84407e "inverseSqrt_84407e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%inverseSqrt_84407e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%inverseSqrt_84407e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 InverseSqrt %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 InverseSqrt %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %inverseSqrt_84407e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_84407e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %inverseSqrt_84407e
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %inverseSqrt_84407e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %inverseSqrt_84407e
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %inverseSqrt_84407e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.wgsl
index 6ab5da9..4e87c18 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/84407e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn inverseSqrt_84407e() {
   var arg_0 = 1.0f;
   var res : f32 = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_84407e();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl
index 0074c41..b9b6693 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl
@@ -25,7 +25,9 @@
 fn inverseSqrt_8f2bd2() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
index 6956b0b..d7619e8 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_8f2bd2() {
   float2 arg_0 = (1.0f).xx;
   float2 res = rsqrt(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
index 6956b0b..d7619e8 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_8f2bd2() {
   float2 arg_0 = (1.0f).xx;
   float2 res = rsqrt(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.glsl
index 5cd5fdb..76594c3 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_8f2bd2() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_8f2bd2() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void inverseSqrt_8f2bd2() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.msl
index 3c9cc54..7130972 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_8f2bd2() {
+void inverseSqrt_8f2bd2(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = rsqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_8f2bd2();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  inverseSqrt_8f2bd2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_8f2bd2();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_8f2bd2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_8f2bd2();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_8f2bd2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.spvasm
index db0bc7f..65e840f 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_8f2bd2 "inverseSqrt_8f2bd2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%inverseSqrt_8f2bd2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 InverseSqrt %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%inverseSqrt_8f2bd2 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 InverseSqrt %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %inverseSqrt_8f2bd2
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %inverseSqrt_8f2bd2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %inverseSqrt_8f2bd2
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %inverseSqrt_8f2bd2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %inverseSqrt_8f2bd2
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %inverseSqrt_8f2bd2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.wgsl
index 6d49dff..a8fc980 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/8f2bd2.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn inverseSqrt_8f2bd2() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_8f2bd2();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl
index fa7fb19b..4b12c10 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl
@@ -25,7 +25,9 @@
 fn inverseSqrt_b197b1() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
index 77b75e2..5206933 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_b197b1() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = rsqrt(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
index 77b75e2..5206933 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_b197b1() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = rsqrt(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.glsl
index 07deb2d..50442ee 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b197b1() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b197b1() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b197b1() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.msl
index 686c30f..47b658f 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_b197b1() {
+void inverseSqrt_b197b1(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = rsqrt(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_b197b1();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  inverseSqrt_b197b1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_b197b1();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_b197b1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_b197b1();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_b197b1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.spvasm
index 1811031..74df661 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_b197b1 "inverseSqrt_b197b1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%inverseSqrt_b197b1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 InverseSqrt %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%inverseSqrt_b197b1 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 InverseSqrt %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %inverseSqrt_b197b1
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %inverseSqrt_b197b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %inverseSqrt_b197b1
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %inverseSqrt_b197b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %inverseSqrt_b197b1
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %inverseSqrt_b197b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.wgsl
index 4b7c5f6..8457768 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b197b1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn inverseSqrt_b197b1() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_b197b1();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl
index 36a3110..8a5c0e1 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl
@@ -27,7 +27,9 @@
 fn inverseSqrt_b85ebd() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
index 1b3025f..0476b5d 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_b85ebd() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = rsqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.fxc.hlsl
index eb77afa..f309d38 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_b85ebd() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = rsqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.glsl
index 89c20ff..2ae0669 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b85ebd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b85ebd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void inverseSqrt_b85ebd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.msl
index 533aa98..b2a8038 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_b85ebd() {
+void inverseSqrt_b85ebd(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = rsqrt(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_b85ebd();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  inverseSqrt_b85ebd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_b85ebd();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_b85ebd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_b85ebd();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_b85ebd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.spvasm
index f5e3311..47a8a5c 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_b85ebd "inverseSqrt_b85ebd"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%inverseSqrt_b85ebd = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 InverseSqrt %22
-               OpStore %res %20
+%inverseSqrt_b85ebd = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 InverseSqrt %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %inverseSqrt_b85ebd
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %inverseSqrt_b85ebd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %inverseSqrt_b85ebd
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %inverseSqrt_b85ebd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %inverseSqrt_b85ebd
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %inverseSqrt_b85ebd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.wgsl
index c338e18..39732ba 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/b85ebd.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn inverseSqrt_b85ebd() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_b85ebd();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl
index 5fc9084..9ebb962 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl
@@ -25,7 +25,9 @@
 fn inverseSqrt_c22347() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
index bbc1a79..8c53a97 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_c22347() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = rsqrt(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
index bbc1a79..8c53a97 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_c22347() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = rsqrt(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.glsl
index ca6a413..f620b65 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_c22347() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_c22347() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_c22347() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.msl
index a0933d1..0267910 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_c22347() {
+void inverseSqrt_c22347(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = rsqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_c22347();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  inverseSqrt_c22347(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_c22347();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_c22347(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_c22347();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_c22347(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.spvasm
index 4c1b062..4050917 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_c22347 "inverseSqrt_c22347"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%inverseSqrt_c22347 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%inverseSqrt_c22347 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 InverseSqrt %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 InverseSqrt %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %inverseSqrt_c22347
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %inverseSqrt_c22347
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %inverseSqrt_c22347
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %inverseSqrt_c22347
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %inverseSqrt_c22347
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %inverseSqrt_c22347
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.wgsl
index d5aeee3..fb35931 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/c22347.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn inverseSqrt_c22347() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_c22347();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl
index f22ebe8..1c00bbc 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl
@@ -27,7 +27,9 @@
 fn inverseSqrt_cbdc70() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
index 1cb9c9f..e18e6c7 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_cbdc70() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = rsqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.fxc.hlsl
index 1aef13c..4f153a3 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void inverseSqrt_cbdc70() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = rsqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.glsl
index e78264c..b1e350d 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_cbdc70() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_cbdc70() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void inverseSqrt_cbdc70() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = inversesqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.msl
index 4563666..9f96694 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void inverseSqrt_cbdc70() {
+void inverseSqrt_cbdc70(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = rsqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  inverseSqrt_cbdc70();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  inverseSqrt_cbdc70(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  inverseSqrt_cbdc70();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  inverseSqrt_cbdc70(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  inverseSqrt_cbdc70();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  inverseSqrt_cbdc70(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.spvasm
index a3948a0..cf3f683 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %inverseSqrt_cbdc70 "inverseSqrt_cbdc70"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%inverseSqrt_cbdc70 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 InverseSqrt %22
-               OpStore %res %20
+%inverseSqrt_cbdc70 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 InverseSqrt %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %inverseSqrt_cbdc70
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %inverseSqrt_cbdc70
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %inverseSqrt_cbdc70
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %inverseSqrt_cbdc70
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %inverseSqrt_cbdc70
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %inverseSqrt_cbdc70
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.wgsl
index 66a78b7..ea8c7d5 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/cbdc70.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn inverseSqrt_cbdc70() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = inverseSqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_cbdc70();
diff --git a/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl
index 4196cc8..7535ab2 100644
--- a/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl
+++ b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = inverseSqrt(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   inverseSqrt_f60c1c();
diff --git a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl
index 57aee57..b2c9784 100644
--- a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1.h;
   const arg_1 = 1;
   var res: f16 = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.dxc.hlsl
index 5719218..80eb5c9 100644
--- a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_082c1f() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = ldexp(arg_0, 1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.fxc.hlsl
index 2d93cd8..67b41b8 100644
--- a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_082c1f() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = ldexp(arg_0, 1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.glsl
index 2cf1b33..9f8f319 100644
--- a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_082c1f() {
   float16_t arg_0 = 1.0hf;
   float16_t res = ldexp(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_082c1f() {
   float16_t arg_0 = 1.0hf;
   float16_t res = ldexp(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_082c1f() {
   float16_t arg_0 = 1.0hf;
   float16_t res = ldexp(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.msl
index 4a4c644..3502a04 100644
--- a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_082c1f() {
+void ldexp_082c1f(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = ldexp(arg_0, 1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_082c1f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  ldexp_082c1f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_082c1f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_082c1f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_082c1f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_082c1f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.spvasm
index aa563fc..4822a09 100644
--- a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_082c1f "ldexp_082c1f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
+         %20 = OpConstantNull %half
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
-         %24 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_082c1f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%ldexp_082c1f = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Ldexp %20 %int_1
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Ldexp %23 %int_1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %ldexp_082c1f
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %ldexp_082c1f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ldexp_082c1f
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ldexp_082c1f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %ldexp_082c1f
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %ldexp_082c1f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.wgsl
index b9e963e..c5cd396 100644
--- a/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/082c1f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1.0h;
   const arg_1 = 1;
   var res : f16 = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_082c1f();
diff --git a/test/tint/builtins/gen/var/ldexp/217a31.wgsl b/test/tint/builtins/gen/var/ldexp/217a31.wgsl
index e764f38..e87e132 100644
--- a/test/tint/builtins/gen/var/ldexp/217a31.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/217a31.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   const arg_1 = vec2(1);
   var res: vec2<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.dxc.hlsl
index 245ac05..2d0571f 100644
--- a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_217a31() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = ldexp(arg_0, (1).xx);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.fxc.hlsl
index af8ff2b..13162eb 100644
--- a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_217a31() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = ldexp(arg_0, (1).xx);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.glsl
index 28dac2d..87b352b 100644
--- a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_217a31() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = ldexp(arg_0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_217a31() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = ldexp(arg_0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_217a31() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = ldexp(arg_0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.msl
index 2eed306..b041863 100644
--- a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_217a31() {
+void ldexp_217a31(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = ldexp(arg_0, int2(1));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_217a31();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  ldexp_217a31(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_217a31();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_217a31(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_217a31();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_217a31(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.spvasm
index 056ec42..73e7d51 100644
--- a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_217a31 "ldexp_217a31"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %26 = OpConstantComposite %v2int %int_1 %int_1
-         %28 = OpTypeFunction %v4float
+         %29 = OpConstantComposite %v2int %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_217a31 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Ldexp %22 %26
-               OpStore %res %20
+%ldexp_217a31 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Ldexp %25 %29
+               OpStore %res %23
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %35 = OpLoad %v2half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ldexp_217a31
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ldexp_217a31
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %ldexp_217a31
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %ldexp_217a31
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %ldexp_217a31
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %ldexp_217a31
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.wgsl
index 4ecfc9c..bb6467e 100644
--- a/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/217a31.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   const arg_1 = vec2(1);
   var res : vec2<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_217a31();
diff --git a/test/tint/builtins/gen/var/ldexp/2bfc68.wgsl b/test/tint/builtins/gen/var/ldexp/2bfc68.wgsl
index 1edfb79..f243d93 100644
--- a/test/tint/builtins/gen/var/ldexp/2bfc68.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/2bfc68.wgsl
@@ -27,7 +27,6 @@
   var arg_1 = vec2<i32>(1i);
   var res = ldexp(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_2bfc68();
diff --git a/test/tint/builtins/gen/var/ldexp/2c6370.wgsl b/test/tint/builtins/gen/var/ldexp/2c6370.wgsl
index b539c2a..23028b6 100644
--- a/test/tint/builtins/gen/var/ldexp/2c6370.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/2c6370.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1);
   var res = ldexp(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_2c6370();
diff --git a/test/tint/builtins/gen/var/ldexp/376938.wgsl b/test/tint/builtins/gen/var/ldexp/376938.wgsl
index 6514ae7..1a41f15 100644
--- a/test/tint/builtins/gen/var/ldexp/376938.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/376938.wgsl
@@ -27,7 +27,6 @@
   var arg_1 = vec4<i32>(1i);
   var res = ldexp(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_376938();
diff --git a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl
index 080f54e..f6ae69b 100644
--- a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<i32>(1i);
   var res: vec2<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.dxc.hlsl
index 5cd3e0d..ac05591 100644
--- a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_3d90b4() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   int2 arg_1 = (1).xx;
   vector<float16_t, 2> res = ldexp(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.fxc.hlsl
index 87d9984..7dc2f2a 100644
--- a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_3d90b4() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   int2 arg_1 = (1).xx;
   vector<float16_t, 2> res = ldexp(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.glsl
index a9ee48b..246ebfb 100644
--- a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_3d90b4() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   ivec2 arg_1 = ivec2(1);
   f16vec2 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_3d90b4() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   ivec2 arg_1 = ivec2(1);
   f16vec2 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void ldexp_3d90b4() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   ivec2 arg_1 = ivec2(1);
   f16vec2 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.msl
index 460fbd8..723ca6b 100644
--- a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_3d90b4() {
+void ldexp_3d90b4(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   int2 arg_1 = int2(1);
   half2 res = ldexp(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_3d90b4();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  ldexp_3d90b4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_3d90b4();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_3d90b4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_3d90b4();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_3d90b4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.spvasm
index bddcfa6..e9de5d7 100644
--- a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %28 = OpExtInstImport "GLSL.std.450"
+         %31 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_3d90b4 "ldexp_3d90b4"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,54 +42,63 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v2int %int_1 %int_1
+         %26 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %26 = OpConstantNull %v2int
-         %32 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_3d90b4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %23
-         %29 = OpLoad %v2half %arg_0
-         %30 = OpLoad %v2int %arg_1
-         %27 = OpExtInst %v2half %28 Ldexp %29 %30
-               OpStore %res %27
+%ldexp_3d90b4 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %29
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %26
+         %32 = OpLoad %v2half %arg_0
+         %33 = OpLoad %v2int %arg_1
+         %30 = OpExtInst %v2half %31 Ldexp %32 %33
+               OpStore %res %30
+         %38 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %39 = OpLoad %v2half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %ldexp_3d90b4
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %ldexp_3d90b4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %ldexp_3d90b4
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %ldexp_3d90b4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %ldexp_3d90b4
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %ldexp_3d90b4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.wgsl
index 6c02f17..b771423 100644
--- a/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/3d90b4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<i32>(1i);
   var res : vec2<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_3d90b4();
diff --git a/test/tint/builtins/gen/var/ldexp/4a3ad9.wgsl b/test/tint/builtins/gen/var/ldexp/4a3ad9.wgsl
index bfa0ed4..dcc5790 100644
--- a/test/tint/builtins/gen/var/ldexp/4a3ad9.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/4a3ad9.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1);
   var res = ldexp(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_4a3ad9();
diff --git a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl
index ea9448e..dd0ce9c 100644
--- a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   const arg_1 = vec3(1);
   var res: vec3<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.dxc.hlsl
index 57d8a99..3bdbb51 100644
--- a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_593ff3() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ldexp(arg_0, (1).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.fxc.hlsl
index 57d8a99..3bdbb51 100644
--- a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_593ff3() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = ldexp(arg_0, (1).xxx);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.glsl
index 81202b8..651a12d 100644
--- a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_593ff3() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = ldexp(arg_0, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_593ff3() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = ldexp(arg_0, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_593ff3() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = ldexp(arg_0, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.msl
index c4b025f..8f202e3 100644
--- a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_593ff3() {
+void ldexp_593ff3(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = ldexp(arg_0, int3(1));
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_593ff3();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  ldexp_593ff3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_593ff3();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_593ff3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_593ff3();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_593ff3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.spvasm
index 1a1a14f..2f2672f 100644
--- a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_593ff3 "ldexp_593ff3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,47 +37,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %25 = OpConstantComposite %v3int %int_1 %int_1 %int_1
-         %27 = OpTypeFunction %v4float
-%ldexp_593ff3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Ldexp %21 %25
-               OpStore %res %19
+         %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %35 = OpTypeFunction %v4float
+%ldexp_593ff3 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Ldexp %24 %28
+               OpStore %res %22
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %34 = OpLoad %v3float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_593ff3
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_593ff3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %ldexp_593ff3
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %ldexp_593ff3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %ldexp_593ff3
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %ldexp_593ff3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.wgsl
index 47ed92b..b33dc4d 100644
--- a/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/593ff3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   const arg_1 = vec3(1);
   var res : vec3<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_593ff3();
diff --git a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl
index e1fb3be..be7fda7 100644
--- a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1.h;
   var arg_1 = 1i;
   var res: f16 = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.dxc.hlsl
index c5fc864..299896e 100644
--- a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_624e0c() {
   float16_t arg_0 = float16_t(1.0h);
   int arg_1 = 1;
   float16_t res = ldexp(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.fxc.hlsl
index 339d9e8..b6e61c9 100644
--- a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_624e0c() {
   float16_t arg_0 = float16_t(1.0h);
   int arg_1 = 1;
   float16_t res = ldexp(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.glsl
index 6ab61d2..2aaddf2 100644
--- a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_624e0c() {
   float16_t arg_0 = 1.0hf;
   int arg_1 = 1;
   float16_t res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_624e0c() {
   float16_t arg_0 = 1.0hf;
   int arg_1 = 1;
   float16_t res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void ldexp_624e0c() {
   float16_t arg_0 = 1.0hf;
   int arg_1 = 1;
   float16_t res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.msl
index 2fd7f64..693590e1c 100644
--- a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_624e0c() {
+void ldexp_624e0c(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   int arg_1 = 1;
   half res = ldexp(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_624e0c();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  ldexp_624e0c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_624e0c();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_624e0c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_624e0c();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_624e0c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.spvasm
index d63c6af..ebfcb34 100644
--- a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %24 = OpExtInstImport "GLSL.std.450"
+         %27 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_624e0c "ldexp_624e0c"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,50 +42,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
+         %20 = OpConstantNull %half
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
-         %28 = OpTypeFunction %v4float
+         %25 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_624e0c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_int Function %22
-        %res = OpVariable %_ptr_Function_half Function %17
+%ldexp_624e0c = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %int_1
-         %25 = OpLoad %half %arg_0
-         %26 = OpLoad %int %arg_1
-         %23 = OpExtInst %half %24 Ldexp %25 %26
-               OpStore %res %23
+         %28 = OpLoad %half %arg_0
+         %29 = OpLoad %int %arg_1
+         %26 = OpExtInst %half %27 Ldexp %28 %29
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ldexp_624e0c
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ldexp_624e0c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %ldexp_624e0c
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %ldexp_624e0c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %ldexp_624e0c
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %ldexp_624e0c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.wgsl
index d9430d8..60f0679 100644
--- a/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/624e0c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1.0h;
   var arg_1 = 1i;
   var res : f16 = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_624e0c();
diff --git a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl
index acc7e71..a3cc25f 100644
--- a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   const arg_1 = vec4(1);
   var res: vec4<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.dxc.hlsl
index 5f15d6ec..55f78a5 100644
--- a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_65a7bd() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ldexp(arg_0, (1).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.fxc.hlsl
index 5f15d6ec..55f78a5 100644
--- a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_65a7bd() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = ldexp(arg_0, (1).xxxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.glsl
index 5fdaafe..cfd2f6e 100644
--- a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_65a7bd() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = ldexp(arg_0, ivec4(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_65a7bd() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = ldexp(arg_0, ivec4(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_65a7bd() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = ldexp(arg_0, ivec4(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.msl
index cea4917..227506f 100644
--- a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_65a7bd() {
+void ldexp_65a7bd(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = ldexp(arg_0, int4(1));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_65a7bd();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  ldexp_65a7bd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_65a7bd();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_65a7bd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_65a7bd();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_65a7bd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.spvasm
index b616b7e..62fda400 100644
--- a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_65a7bd "ldexp_65a7bd"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
-         %25 = OpTypeFunction %v4float
-%ldexp_65a7bd = OpFunction %void None %9
-         %12 = OpLabel
+         %26 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
+%ldexp_65a7bd = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Ldexp %19 %23
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Ldexp %22 %26
+               OpStore %res %20
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %ldexp_65a7bd
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %ldexp_65a7bd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ldexp_65a7bd
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ldexp_65a7bd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %ldexp_65a7bd
+%compute_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %ldexp_65a7bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.wgsl
index 22a5b83..123f2b4 100644
--- a/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/65a7bd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   const arg_1 = vec4(1);
   var res : vec4<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_65a7bd();
diff --git a/test/tint/builtins/gen/var/ldexp/71ebe3.wgsl b/test/tint/builtins/gen/var/ldexp/71ebe3.wgsl
index 815f173..5ecdb7a 100644
--- a/test/tint/builtins/gen/var/ldexp/71ebe3.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/71ebe3.wgsl
@@ -27,7 +27,6 @@
   var arg_1 = 1i;
   var res = ldexp(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_71ebe3();
diff --git a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl
index 977dba8..5bce95a 100644
--- a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<i32>(1i);
   var res: vec3<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.dxc.hlsl
index 86c7207..8f0ed9e 100644
--- a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_7485ce() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   int3 arg_1 = (1).xxx;
   vector<float16_t, 3> res = ldexp(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.fxc.hlsl
index 1779269..45fd297 100644
--- a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_7485ce() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   int3 arg_1 = (1).xxx;
   vector<float16_t, 3> res = ldexp(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.glsl
index e28e17c..7b58af9 100644
--- a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_7485ce() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   ivec3 arg_1 = ivec3(1);
   f16vec3 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_7485ce() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   ivec3 arg_1 = ivec3(1);
   f16vec3 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_7485ce() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   ivec3 arg_1 = ivec3(1);
   f16vec3 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.msl
index 8802d29..a203f00 100644
--- a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_7485ce() {
+void ldexp_7485ce(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   int3 arg_1 = int3(1);
   half3 res = ldexp(arg_0, arg_1);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_7485ce();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  ldexp_7485ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_7485ce();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_7485ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_7485ce();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_7485ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.spvasm
index 7dc0f66..e5bbcfb 100644
--- a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %28 = OpExtInstImport "GLSL.std.450"
+         %31 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_7485ce "ldexp_7485ce"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,54 +42,63 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %26 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %26 = OpConstantNull %v3int
-         %32 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_7485ce = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %26
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %23
-         %29 = OpLoad %v3half %arg_0
-         %30 = OpLoad %v3int %arg_1
-         %27 = OpExtInst %v3half %28 Ldexp %29 %30
-               OpStore %res %27
+%ldexp_7485ce = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %29
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %26
+         %32 = OpLoad %v3half %arg_0
+         %33 = OpLoad %v3int %arg_1
+         %30 = OpExtInst %v3half %31 Ldexp %32 %33
+               OpStore %res %30
+         %38 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %39 = OpLoad %v3half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %ldexp_7485ce
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %ldexp_7485ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %ldexp_7485ce
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %ldexp_7485ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %ldexp_7485ce
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %ldexp_7485ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.wgsl
index 7b824e2..5310efd 100644
--- a/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/7485ce.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<i32>(1i);
   var res : vec3<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_7485ce();
diff --git a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl
index 7d2dafb..1ad0d97 100644
--- a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<i32>(1i);
   var res: vec4<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.dxc.hlsl
index 461a1aa..b87ff57 100644
--- a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_7fa13c() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   int4 arg_1 = (1).xxxx;
   vector<float16_t, 4> res = ldexp(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.fxc.hlsl
index 5b49144..c97cb21 100644
--- a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_7fa13c() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   int4 arg_1 = (1).xxxx;
   vector<float16_t, 4> res = ldexp(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.glsl
index 8259b61..c930500 100644
--- a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_7fa13c() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   ivec4 arg_1 = ivec4(1);
   f16vec4 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_7fa13c() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   ivec4 arg_1 = ivec4(1);
   f16vec4 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_7fa13c() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   ivec4 arg_1 = ivec4(1);
   f16vec4 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.msl
index 4df9a39..d790af3 100644
--- a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_7fa13c() {
+void ldexp_7fa13c(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   int4 arg_1 = int4(1);
   half4 res = ldexp(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_7fa13c();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  ldexp_7fa13c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_7fa13c();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_7fa13c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_7fa13c();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_7fa13c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.spvasm
index ce3a3d9..a49d503 100644
--- a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %28 = OpExtInstImport "GLSL.std.450"
+         %31 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_7fa13c "ldexp_7fa13c"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,54 +42,63 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
       %int_1 = OpConstant %int 1
-         %23 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %26 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %26 = OpConstantNull %v4int
-         %32 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_7fa13c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %26
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %23
-         %29 = OpLoad %v4half %arg_0
-         %30 = OpLoad %v4int %arg_1
-         %27 = OpExtInst %v4half %28 Ldexp %29 %30
-               OpStore %res %27
+%ldexp_7fa13c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %29
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %26
+         %32 = OpLoad %v4half %arg_0
+         %33 = OpLoad %v4int %arg_1
+         %30 = OpExtInst %v4half %31 Ldexp %32 %33
+               OpStore %res %30
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %39 = OpLoad %v4half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %ldexp_7fa13c
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %ldexp_7fa13c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %ldexp_7fa13c
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %ldexp_7fa13c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %ldexp_7fa13c
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %ldexp_7fa13c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.wgsl
index 527ff3f..c998a6b 100644
--- a/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/7fa13c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<i32>(1i);
   var res : vec4<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_7fa13c();
diff --git a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl
index 54a98d0..5e8569f 100644
--- a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   const arg_1 = vec4(1);
   var res: vec4<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.dxc.hlsl
index 0be3a6b..437fda6 100644
--- a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_8a0c2f() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = ldexp(arg_0, (1).xxxx);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.fxc.hlsl
index a71f03e..8f8caa8 100644
--- a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_8a0c2f() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = ldexp(arg_0, (1).xxxx);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.glsl
index eac5e78..ecbf749 100644
--- a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_8a0c2f() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = ldexp(arg_0, ivec4(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_8a0c2f() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = ldexp(arg_0, ivec4(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void ldexp_8a0c2f() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = ldexp(arg_0, ivec4(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.msl
index c5f1b8e..b838a54 100644
--- a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_8a0c2f() {
+void ldexp_8a0c2f(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = ldexp(arg_0, int4(1));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_8a0c2f();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  ldexp_8a0c2f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_8a0c2f();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_8a0c2f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_8a0c2f();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_8a0c2f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.spvasm
index fc841e5..8b0113d 100644
--- a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_8a0c2f "ldexp_8a0c2f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
       %int_1 = OpConstant %int 1
-         %26 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
-         %28 = OpTypeFunction %v4float
+         %29 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_8a0c2f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Ldexp %22 %26
-               OpStore %res %20
+%ldexp_8a0c2f = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Ldexp %25 %29
+               OpStore %res %23
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %35 = OpLoad %v4half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ldexp_8a0c2f
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ldexp_8a0c2f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %ldexp_8a0c2f
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %ldexp_8a0c2f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %ldexp_8a0c2f
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %ldexp_8a0c2f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.wgsl
index 48ea3f4..72de3c2 100644
--- a/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/8a0c2f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   const arg_1 = vec4(1);
   var res : vec4<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_8a0c2f();
diff --git a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl
index 76183ef..62e089d 100644
--- a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   const arg_1 = vec3(1);
   var res: vec3<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.dxc.hlsl
index 3c8b9bd..3823707 100644
--- a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_8e43e9() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = ldexp(arg_0, (1).xxx);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.fxc.hlsl
index 583d17c..03c657d 100644
--- a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_8e43e9() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = ldexp(arg_0, (1).xxx);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.glsl
index 0f177aa..bda25d4 100644
--- a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_8e43e9() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = ldexp(arg_0, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_8e43e9() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = ldexp(arg_0, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void ldexp_8e43e9() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = ldexp(arg_0, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.msl
index 57f08ea..bfe07c1 100644
--- a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_8e43e9() {
+void ldexp_8e43e9(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = ldexp(arg_0, int3(1));
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_8e43e9();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  ldexp_8e43e9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_8e43e9();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_8e43e9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_8e43e9();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_8e43e9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.spvasm
index 7892e77..83fa8c8 100644
--- a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_8e43e9 "ldexp_8e43e9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,49 +41,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %26 = OpConstantComposite %v3int %int_1 %int_1 %int_1
-         %28 = OpTypeFunction %v4float
+         %29 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%ldexp_8e43e9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Ldexp %22 %26
-               OpStore %res %20
+%ldexp_8e43e9 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Ldexp %25 %29
+               OpStore %res %23
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %35 = OpLoad %v3half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ldexp_8e43e9
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ldexp_8e43e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %ldexp_8e43e9
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %ldexp_8e43e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %ldexp_8e43e9
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %ldexp_8e43e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.wgsl
index f282db3..627d182 100644
--- a/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/8e43e9.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   const arg_1 = vec3(1);
   var res : vec3<f16> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_8e43e9();
diff --git a/test/tint/builtins/gen/var/ldexp/a22679.wgsl b/test/tint/builtins/gen/var/ldexp/a22679.wgsl
index 7aa4ea9..6a7ce6d 100644
--- a/test/tint/builtins/gen/var/ldexp/a22679.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/a22679.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   const arg_1 = vec2(1);
   var res: vec2<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.dxc.hlsl
index d488868..df34590 100644
--- a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_a22679() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ldexp(arg_0, (1).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.fxc.hlsl
index d488868..df34590 100644
--- a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_a22679() {
   float2 arg_0 = (1.0f).xx;
   float2 res = ldexp(arg_0, (1).xx);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.glsl
index 6f0630c..aa1c655 100644
--- a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_a22679() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = ldexp(arg_0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_a22679() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = ldexp(arg_0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_a22679() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = ldexp(arg_0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.msl
index 428e958..22cdfe0 100644
--- a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_a22679() {
+void ldexp_a22679(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = ldexp(arg_0, int2(1));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_a22679();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  ldexp_a22679(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_a22679();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_a22679(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_a22679();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_a22679(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.spvasm
index 67946b1..b8013d7 100644
--- a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_a22679 "ldexp_a22679"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,47 +37,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %25 = OpConstantComposite %v2int %int_1 %int_1
-         %27 = OpTypeFunction %v4float
-%ldexp_a22679 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Ldexp %21 %25
-               OpStore %res %19
+         %28 = OpConstantComposite %v2int %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %35 = OpTypeFunction %v4float
+%ldexp_a22679 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Ldexp %24 %28
+               OpStore %res %22
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %34 = OpLoad %v2float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %ldexp_a22679
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %ldexp_a22679
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %ldexp_a22679
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %ldexp_a22679
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %ldexp_a22679
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %ldexp_a22679
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.wgsl
index e01bfb4..8448262 100644
--- a/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/a22679.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   const arg_1 = vec2(1);
   var res : vec2<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_a22679();
diff --git a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl
index 82f799f..3fcffee 100644
--- a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<i32>(1i);
   var res: vec3<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.dxc.hlsl
index feac445..7480b98 100644
--- a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_a31cdc() {
   float3 arg_0 = (1.0f).xxx;
   int3 arg_1 = (1).xxx;
   float3 res = ldexp(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.fxc.hlsl
index feac445..7480b98 100644
--- a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_a31cdc() {
   float3 arg_0 = (1.0f).xxx;
   int3 arg_1 = (1).xxx;
   float3 res = ldexp(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.glsl
index c9bc461..4c5bb90 100644
--- a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_a31cdc() {
   vec3 arg_0 = vec3(1.0f);
   ivec3 arg_1 = ivec3(1);
   vec3 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_a31cdc() {
   vec3 arg_0 = vec3(1.0f);
   ivec3 arg_1 = ivec3(1);
   vec3 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void ldexp_a31cdc() {
   vec3 arg_0 = vec3(1.0f);
   ivec3 arg_1 = ivec3(1);
   vec3 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.msl
index f8215af..3a39706 100644
--- a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_a31cdc() {
+void ldexp_a31cdc(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   int3 arg_1 = int3(1);
   float3 res = ldexp(arg_0, arg_1);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_a31cdc();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  ldexp_a31cdc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_a31cdc();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_a31cdc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_a31cdc();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_a31cdc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.spvasm
index 560f0ab..496771c 100644
--- a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
-         %27 = OpExtInstImport "GLSL.std.450"
+         %30 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_a31cdc "ldexp_a31cdc"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,52 +38,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %25 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %25 = OpConstantNull %v3int
-         %31 = OpTypeFunction %v4float
-%ldexp_a31cdc = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %25
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %22
-         %28 = OpLoad %v3float %arg_0
-         %29 = OpLoad %v3int %arg_1
-         %26 = OpExtInst %v3float %27 Ldexp %28 %29
-               OpStore %res %26
+         %28 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %39 = OpTypeFunction %v4float
+%ldexp_a31cdc = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %28
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %25
+         %31 = OpLoad %v3float %arg_0
+         %32 = OpLoad %v3int %arg_1
+         %29 = OpExtInst %v3float %30 Ldexp %31 %32
+               OpStore %res %29
+         %37 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %38 = OpLoad %v3float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ldexp_a31cdc
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ldexp_a31cdc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %ldexp_a31cdc
+%fragment_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %ldexp_a31cdc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %ldexp_a31cdc
+%compute_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %ldexp_a31cdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.wgsl
index 218a630..7360a22 100644
--- a/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/a31cdc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<i32>(1i);
   var res : vec3<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_a31cdc();
diff --git a/test/tint/builtins/gen/var/ldexp/a6126e.wgsl b/test/tint/builtins/gen/var/ldexp/a6126e.wgsl
index 3b7ca61..046abe8 100644
--- a/test/tint/builtins/gen/var/ldexp/a6126e.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/a6126e.wgsl
@@ -27,7 +27,6 @@
   var arg_1 = vec3<i32>(1i);
   var res = ldexp(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_a6126e();
diff --git a/test/tint/builtins/gen/var/ldexp/abd718.wgsl b/test/tint/builtins/gen/var/ldexp/abd718.wgsl
index d95072b..68a8c49 100644
--- a/test/tint/builtins/gen/var/ldexp/abd718.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/abd718.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<i32>(1i);
   var res: vec2<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.dxc.hlsl
index 47cfc47..757e41d 100644
--- a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_abd718() {
   float2 arg_0 = (1.0f).xx;
   int2 arg_1 = (1).xx;
   float2 res = ldexp(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.fxc.hlsl
index 47cfc47..757e41d 100644
--- a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_abd718() {
   float2 arg_0 = (1.0f).xx;
   int2 arg_1 = (1).xx;
   float2 res = ldexp(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.glsl
index d024dda..db9e4c0 100644
--- a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_abd718() {
   vec2 arg_0 = vec2(1.0f);
   ivec2 arg_1 = ivec2(1);
   vec2 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_abd718() {
   vec2 arg_0 = vec2(1.0f);
   ivec2 arg_1 = ivec2(1);
   vec2 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void ldexp_abd718() {
   vec2 arg_0 = vec2(1.0f);
   ivec2 arg_1 = ivec2(1);
   vec2 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.msl
index 7cfe631..609824c 100644
--- a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_abd718() {
+void ldexp_abd718(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   int2 arg_1 = int2(1);
   float2 res = ldexp(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_abd718();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  ldexp_abd718(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_abd718();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_abd718(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_abd718();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_abd718(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.spvasm
index 1bd5281..d32fb59 100644
--- a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
-         %27 = OpExtInstImport "GLSL.std.450"
+         %30 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_abd718 "ldexp_abd718"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,52 +38,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %22 = OpConstantComposite %v2int %int_1 %int_1
+         %25 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %25 = OpConstantNull %v2int
-         %31 = OpTypeFunction %v4float
-%ldexp_abd718 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %22
-         %28 = OpLoad %v2float %arg_0
-         %29 = OpLoad %v2int %arg_1
-         %26 = OpExtInst %v2float %27 Ldexp %28 %29
-               OpStore %res %26
+         %28 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %39 = OpTypeFunction %v4float
+%ldexp_abd718 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %28
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %25
+         %31 = OpLoad %v2float %arg_0
+         %32 = OpLoad %v2int %arg_1
+         %29 = OpExtInst %v2float %30 Ldexp %31 %32
+               OpStore %res %29
+         %37 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %38 = OpLoad %v2float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ldexp_abd718
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ldexp_abd718
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %ldexp_abd718
+%fragment_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %ldexp_abd718
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %ldexp_abd718
+%compute_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %ldexp_abd718
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.wgsl
index a80333e..5f48e0b 100644
--- a/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/abd718.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<i32>(1i);
   var res : vec2<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_abd718();
diff --git a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl
index 48fac9f..f0721b4 100644
--- a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1.f;
   const arg_1 = 1;
   var res: f32 = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.dxc.hlsl
index 0c3a885..bc0bb13 100644
--- a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_c9d0b7() {
   float arg_0 = 1.0f;
   float res = ldexp(arg_0, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.fxc.hlsl
index 0c3a885..bc0bb13 100644
--- a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_c9d0b7() {
   float arg_0 = 1.0f;
   float res = ldexp(arg_0, 1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.glsl
index 9849927..0a508bb 100644
--- a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_c9d0b7() {
   float arg_0 = 1.0f;
   float res = ldexp(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_c9d0b7() {
   float arg_0 = 1.0f;
   float res = ldexp(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_c9d0b7() {
   float arg_0 = 1.0f;
   float res = ldexp(arg_0, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.msl
index b6ac8c7..db1ae17 100644
--- a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_c9d0b7() {
+void ldexp_c9d0b7(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = ldexp(arg_0, 1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_c9d0b7();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  ldexp_c9d0b7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_c9d0b7();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_c9d0b7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_c9d0b7();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_c9d0b7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.spvasm
index 2759d06..d8a1e6a 100644
--- a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_c9d0b7 "ldexp_c9d0b7"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
-         %22 = OpTypeFunction %v4float
-%ldexp_c9d0b7 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
+%ldexp_c9d0b7 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Ldexp %18 %int_1
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Ldexp %21 %int_1
+               OpStore %res %19
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %ldexp_c9d0b7
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %ldexp_c9d0b7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %ldexp_c9d0b7
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %ldexp_c9d0b7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %ldexp_c9d0b7
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %ldexp_c9d0b7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.wgsl
index 60556e7..9a95c13 100644
--- a/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/c9d0b7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1.0f;
   const arg_1 = 1;
   var res : f32 = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_c9d0b7();
diff --git a/test/tint/builtins/gen/var/ldexp/cb0faf.wgsl b/test/tint/builtins/gen/var/ldexp/cb0faf.wgsl
index 521b1ba..ed2c9da 100644
--- a/test/tint/builtins/gen/var/ldexp/cb0faf.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/cb0faf.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1);
   var res = ldexp(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_cb0faf();
diff --git a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl
index 3148f30..1bf7bf4 100644
--- a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<i32>(1i);
   var res: vec4<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.dxc.hlsl
index d1ee9bf..fee9edf 100644
--- a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_cc9cde() {
   float4 arg_0 = (1.0f).xxxx;
   int4 arg_1 = (1).xxxx;
   float4 res = ldexp(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.fxc.hlsl
index d1ee9bf..fee9edf 100644
--- a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_cc9cde() {
   float4 arg_0 = (1.0f).xxxx;
   int4 arg_1 = (1).xxxx;
   float4 res = ldexp(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.glsl
index fdb98cd..491dda1 100644
--- a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_cc9cde() {
   vec4 arg_0 = vec4(1.0f);
   ivec4 arg_1 = ivec4(1);
   vec4 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_cc9cde() {
   vec4 arg_0 = vec4(1.0f);
   ivec4 arg_1 = ivec4(1);
   vec4 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void ldexp_cc9cde() {
   vec4 arg_0 = vec4(1.0f);
   ivec4 arg_1 = ivec4(1);
   vec4 res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.msl
index 2b70f29..3cc3cc2 100644
--- a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_cc9cde() {
+void ldexp_cc9cde(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   int4 arg_1 = int4(1);
   float4 res = ldexp(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_cc9cde();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  ldexp_cc9cde(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_cc9cde();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_cc9cde(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_cc9cde();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_cc9cde(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.spvasm
index 7dfbd0e..44b0e40 100644
--- a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
-         %25 = OpExtInstImport "GLSL.std.450"
+         %28 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_cc9cde "ldexp_cc9cde"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,50 +38,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %23 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %23 = OpConstantNull %v4int
-         %29 = OpTypeFunction %v4float
-%ldexp_cc9cde = OpFunction %void None %9
-         %12 = OpLabel
+         %26 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
+%ldexp_cc9cde = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %23
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %26
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %20
-         %26 = OpLoad %v4float %arg_0
-         %27 = OpLoad %v4int %arg_1
-         %24 = OpExtInst %v4float %25 Ldexp %26 %27
-               OpStore %res %24
+               OpStore %arg_0 %17
+               OpStore %arg_1 %23
+         %29 = OpLoad %v4float %arg_0
+         %30 = OpLoad %v4int %arg_1
+         %27 = OpExtInst %v4float %28 Ldexp %29 %30
+               OpStore %res %27
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %ldexp_cc9cde
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %ldexp_cc9cde
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %ldexp_cc9cde
+%fragment_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %ldexp_cc9cde
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %ldexp_cc9cde
+%compute_main = OpFunction %void None %12
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %ldexp_cc9cde
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.wgsl
index f59650a..d798ea9 100644
--- a/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/cc9cde.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<i32>(1i);
   var res : vec4<f32> = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_cc9cde();
diff --git a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl
index 886317f..13cc740 100644
--- a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1.f;
   var arg_1 = 1i;
   var res: f32 = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.dxc.hlsl
index 9f62531..f46029c 100644
--- a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_db8b49() {
   float arg_0 = 1.0f;
   int arg_1 = 1;
   float res = ldexp(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.fxc.hlsl
index 9f62531..f46029c 100644
--- a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void ldexp_db8b49() {
   float arg_0 = 1.0f;
   int arg_1 = 1;
   float res = ldexp(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.glsl b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.glsl
index 72e0972..1dab912 100644
--- a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_db8b49() {
   float arg_0 = 1.0f;
   int arg_1 = 1;
   float res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_db8b49() {
   float arg_0 = 1.0f;
   int arg_1 = 1;
   float res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void ldexp_db8b49() {
   float arg_0 = 1.0f;
   int arg_1 = 1;
   float res = ldexp(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.msl b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.msl
index e980316..d1e8933 100644
--- a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void ldexp_db8b49() {
+void ldexp_db8b49(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   int arg_1 = 1;
   float res = ldexp(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  ldexp_db8b49();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  ldexp_db8b49(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  ldexp_db8b49();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  ldexp_db8b49(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  ldexp_db8b49();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  ldexp_db8b49(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.spvasm b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.spvasm
index 0a22486..24d4362 100644
--- a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %ldexp_db8b49 "ldexp_db8b49"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,47 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-         %26 = OpTypeFunction %v4float
-%ldexp_db8b49 = OpFunction %void None %9
-         %12 = OpLabel
+         %23 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
+%ldexp_db8b49 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
+      %arg_1 = OpVariable %_ptr_Function_int Function %23
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
                OpStore %arg_1 %int_1
-         %23 = OpLoad %float %arg_0
-         %24 = OpLoad %int %arg_1
-         %21 = OpExtInst %float %22 Ldexp %23 %24
-               OpStore %res %21
+         %26 = OpLoad %float %arg_0
+         %27 = OpLoad %int %arg_1
+         %24 = OpExtInst %float %25 Ldexp %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %ldexp_db8b49
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %ldexp_db8b49
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %ldexp_db8b49
+%fragment_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %ldexp_db8b49
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %ldexp_db8b49
+%compute_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %ldexp_db8b49
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.wgsl b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.wgsl
index 94edda7..ea46023 100644
--- a/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/db8b49.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1.0f;
   var arg_1 = 1i;
   var res : f32 = ldexp(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_db8b49();
diff --git a/test/tint/builtins/gen/var/ldexp/fdbc7b.wgsl b/test/tint/builtins/gen/var/ldexp/fdbc7b.wgsl
index 9775c0e..8f87698 100644
--- a/test/tint/builtins/gen/var/ldexp/fdbc7b.wgsl
+++ b/test/tint/builtins/gen/var/ldexp/fdbc7b.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1;
   var res = ldexp(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   ldexp_fdbc7b();
diff --git a/test/tint/builtins/gen/var/length/056071.wgsl b/test/tint/builtins/gen/var/length/056071.wgsl
index f353299..311b430 100644
--- a/test/tint/builtins/gen/var/length/056071.wgsl
+++ b/test/tint/builtins/gen/var/length/056071.wgsl
@@ -25,7 +25,9 @@
 fn length_056071() {
   var arg_0 = vec3<f32>(0.f);
   var res: f32 = length(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/length/056071.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/length/056071.wgsl.expected.dxc.hlsl
index bd540fb..4369c36 100644
--- a/test/tint/builtins/gen/var/length/056071.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/length/056071.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_056071() {
   float3 arg_0 = (0.0f).xxx;
   float res = length(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/056071.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/length/056071.wgsl.expected.fxc.hlsl
index bd540fb..4369c36 100644
--- a/test/tint/builtins/gen/var/length/056071.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/length/056071.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_056071() {
   float3 arg_0 = (0.0f).xxx;
   float res = length(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/056071.wgsl.expected.glsl b/test/tint/builtins/gen/var/length/056071.wgsl.expected.glsl
index f4f3920..bfac97a 100644
--- a/test/tint/builtins/gen/var/length/056071.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/length/056071.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_056071() {
   vec3 arg_0 = vec3(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_056071() {
   vec3 arg_0 = vec3(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_056071() {
   vec3 arg_0 = vec3(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/length/056071.wgsl.expected.msl b/test/tint/builtins/gen/var/length/056071.wgsl.expected.msl
index 1727b62..c4d905c 100644
--- a/test/tint/builtins/gen/var/length/056071.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/length/056071.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_056071() {
+void length_056071(device float* const tint_symbol_1) {
   float3 arg_0 = float3(0.0f);
   float res = length(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_056071();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  length_056071(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_056071();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  length_056071(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_056071();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  length_056071(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/length/056071.wgsl.expected.spvasm b/test/tint/builtins/gen/var/length/056071.wgsl.expected.spvasm
index fb485c7..3936a81 100644
--- a/test/tint/builtins/gen/var/length/056071.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/length/056071.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_056071 "length_056071"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
-         %14 = OpConstantNull %v3float
+         %17 = OpConstantNull %v3float
 %_ptr_Function_v3float = OpTypePointer Function %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_056071 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %14
+%length_056071 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %17
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %14
-         %19 = OpLoad %v3float %arg_0
-         %17 = OpExtInst %float %18 Length %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v3float %arg_0
+         %20 = OpExtInst %float %21 Length %22
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %length_056071
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %length_056071
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %length_056071
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %length_056071
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %length_056071
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %length_056071
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/length/056071.wgsl.expected.wgsl b/test/tint/builtins/gen/var/length/056071.wgsl.expected.wgsl
index ff5c0f2..72260c8 100644
--- a/test/tint/builtins/gen/var/length/056071.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/length/056071.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn length_056071() {
   var arg_0 = vec3<f32>(0.0f);
   var res : f32 = length(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_056071();
diff --git a/test/tint/builtins/gen/var/length/3f0e13.wgsl b/test/tint/builtins/gen/var/length/3f0e13.wgsl
index 053f8b7..eb4def9 100644
--- a/test/tint/builtins/gen/var/length/3f0e13.wgsl
+++ b/test/tint/builtins/gen/var/length/3f0e13.wgsl
@@ -27,7 +27,9 @@
 fn length_3f0e13() {
   var arg_0 = vec2<f16>(0.h);
   var res: f16 = length(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.dxc.hlsl
index ef03b06..13277cf 100644
--- a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_3f0e13() {
   vector<float16_t, 2> arg_0 = (float16_t(0.0h)).xx;
   float16_t res = length(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.fxc.hlsl
index 3c23526..2bb7483 100644
--- a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_3f0e13() {
   vector<float16_t, 2> arg_0 = (float16_t(0.0h)).xx;
   float16_t res = length(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.glsl b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.glsl
index a5f2471..f5b5c86 100644
--- a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_3f0e13() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_3f0e13() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_3f0e13() {
   f16vec2 arg_0 = f16vec2(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.msl b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.msl
index 797b6fb..a2d83ee 100644
--- a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_3f0e13() {
+void length_3f0e13(device half* const tint_symbol_1) {
   half2 arg_0 = half2(0.0h);
   half res = length(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_3f0e13();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  length_3f0e13(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_3f0e13();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  length_3f0e13(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_3f0e13();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  length_3f0e13(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.spvasm b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.spvasm
index a92c3f1..fa23694 100644
--- a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_3f0e13 "length_3f0e13"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v2half = OpTypeVector %half 2
-         %15 = OpConstantNull %v2half
+         %18 = OpConstantNull %v2half
 %_ptr_Function_v2half = OpTypePointer Function %v2half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_3f0e13 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %15
-        %res = OpVariable %_ptr_Function_half Function %23
-               OpStore %arg_0 %15
-         %20 = OpLoad %v2half %arg_0
-         %18 = OpExtInst %half %19 Length %20
-               OpStore %res %18
+%length_3f0e13 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %18
+        %res = OpVariable %_ptr_Function_half Function %26
+               OpStore %arg_0 %18
+         %23 = OpLoad %v2half %arg_0
+         %21 = OpExtInst %half %22 Length %23
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %length_3f0e13
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %length_3f0e13
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %length_3f0e13
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %length_3f0e13
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %length_3f0e13
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %length_3f0e13
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.wgsl b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.wgsl
index 1f69181..5a5fa71 100644
--- a/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/length/3f0e13.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn length_3f0e13() {
   var arg_0 = vec2<f16>(0.0h);
   var res : f16 = length(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_3f0e13();
diff --git a/test/tint/builtins/gen/var/length/555aba.wgsl b/test/tint/builtins/gen/var/length/555aba.wgsl
index c16c099..54f086f 100644
--- a/test/tint/builtins/gen/var/length/555aba.wgsl
+++ b/test/tint/builtins/gen/var/length/555aba.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(0.);
   var res = length(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_555aba();
diff --git a/test/tint/builtins/gen/var/length/5b1a9b.wgsl b/test/tint/builtins/gen/var/length/5b1a9b.wgsl
index cef2978..fabcb9c 100644
--- a/test/tint/builtins/gen/var/length/5b1a9b.wgsl
+++ b/test/tint/builtins/gen/var/length/5b1a9b.wgsl
@@ -27,7 +27,9 @@
 fn length_5b1a9b() {
   var arg_0 = vec4<f16>(0.h);
   var res: f16 = length(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.dxc.hlsl
index 4865222..fe7962a 100644
--- a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_5b1a9b() {
   vector<float16_t, 4> arg_0 = (float16_t(0.0h)).xxxx;
   float16_t res = length(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.fxc.hlsl
index b5542b5..cd6ab60 100644
--- a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_5b1a9b() {
   vector<float16_t, 4> arg_0 = (float16_t(0.0h)).xxxx;
   float16_t res = length(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.glsl b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.glsl
index 75b0701..1825b2a 100644
--- a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_5b1a9b() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_5b1a9b() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_5b1a9b() {
   f16vec4 arg_0 = f16vec4(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.msl b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.msl
index 885dd66..b549eaa 100644
--- a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_5b1a9b() {
+void length_5b1a9b(device half* const tint_symbol_1) {
   half4 arg_0 = half4(0.0h);
   half res = length(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_5b1a9b();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  length_5b1a9b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_5b1a9b();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  length_5b1a9b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_5b1a9b();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  length_5b1a9b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.spvasm
index 0d97afe..c114d13 100644
--- a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_5b1a9b "length_5b1a9b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v4half = OpTypeVector %half 4
-         %15 = OpConstantNull %v4half
+         %18 = OpConstantNull %v4half
 %_ptr_Function_v4half = OpTypePointer Function %v4half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_5b1a9b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %15
-        %res = OpVariable %_ptr_Function_half Function %23
-               OpStore %arg_0 %15
-         %20 = OpLoad %v4half %arg_0
-         %18 = OpExtInst %half %19 Length %20
-               OpStore %res %18
+%length_5b1a9b = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %18
+        %res = OpVariable %_ptr_Function_half Function %26
+               OpStore %arg_0 %18
+         %23 = OpLoad %v4half %arg_0
+         %21 = OpExtInst %half %22 Length %23
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %length_5b1a9b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %length_5b1a9b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %length_5b1a9b
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %length_5b1a9b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %length_5b1a9b
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %length_5b1a9b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.wgsl
index 5a4657d..976d3a4 100644
--- a/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/length/5b1a9b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn length_5b1a9b() {
   var arg_0 = vec4<f16>(0.0h);
   var res : f16 = length(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_5b1a9b();
diff --git a/test/tint/builtins/gen/var/length/602a17.wgsl b/test/tint/builtins/gen/var/length/602a17.wgsl
index e96d9d3..e9d1bbd 100644
--- a/test/tint/builtins/gen/var/length/602a17.wgsl
+++ b/test/tint/builtins/gen/var/length/602a17.wgsl
@@ -25,7 +25,9 @@
 fn length_602a17() {
   var arg_0 = 0.f;
   var res: f32 = length(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.dxc.hlsl
index a887d00..54c4729 100644
--- a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_602a17() {
   float arg_0 = 0.0f;
   float res = length(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.fxc.hlsl
index a887d00..54c4729 100644
--- a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_602a17() {
   float arg_0 = 0.0f;
   float res = length(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.glsl b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.glsl
index 2fb5467..1dcf099 100644
--- a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_602a17() {
   float arg_0 = 0.0f;
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_602a17() {
   float arg_0 = 0.0f;
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_602a17() {
   float arg_0 = 0.0f;
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.msl b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.msl
index b7bbcd9..48c6e6a 100644
--- a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_602a17() {
+void length_602a17(device float* const tint_symbol_1) {
   float arg_0 = 0.0f;
   float res = fabs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_602a17();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  length_602a17(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_602a17();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  length_602a17(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_602a17();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  length_602a17(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.spvasm b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.spvasm
index 087b034..ce055fb 100644
--- a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_602a17 "length_602a17"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %19 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %27 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_602a17 = OpFunction %void None %9
-         %12 = OpLabel
+%length_602a17 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %8
-         %17 = OpLoad %float %arg_0
-         %15 = OpExtInst %float %16 Length %17
-               OpStore %res %15
+         %20 = OpLoad %float %arg_0
+         %18 = OpExtInst %float %19 Length %20
+               OpStore %res %18
+         %25 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %26 = OpLoad %float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %length_602a17
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %length_602a17
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %length_602a17
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %length_602a17
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %length_602a17
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %length_602a17
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.wgsl b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.wgsl
index aaeb9ed..6b32f18 100644
--- a/test/tint/builtins/gen/var/length/602a17.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/length/602a17.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn length_602a17() {
   var arg_0 = 0.0f;
   var res : f32 = length(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_602a17();
diff --git a/test/tint/builtins/gen/var/length/7b4741.wgsl b/test/tint/builtins/gen/var/length/7b4741.wgsl
index ef76630..713773c 100644
--- a/test/tint/builtins/gen/var/length/7b4741.wgsl
+++ b/test/tint/builtins/gen/var/length/7b4741.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(0.);
   var res = length(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_7b4741();
diff --git a/test/tint/builtins/gen/var/length/936ad5.wgsl b/test/tint/builtins/gen/var/length/936ad5.wgsl
index ffaf899..fca2ef4 100644
--- a/test/tint/builtins/gen/var/length/936ad5.wgsl
+++ b/test/tint/builtins/gen/var/length/936ad5.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 0.;
   var res = length(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_936ad5();
diff --git a/test/tint/builtins/gen/var/length/afde8b.wgsl b/test/tint/builtins/gen/var/length/afde8b.wgsl
index 20d6230..5e2bd02 100644
--- a/test/tint/builtins/gen/var/length/afde8b.wgsl
+++ b/test/tint/builtins/gen/var/length/afde8b.wgsl
@@ -25,7 +25,9 @@
 fn length_afde8b() {
   var arg_0 = vec2<f32>(0.f);
   var res: f32 = length(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.dxc.hlsl
index f1ca92a..cb9031b 100644
--- a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_afde8b() {
   float2 arg_0 = (0.0f).xx;
   float res = length(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.fxc.hlsl
index f1ca92a..cb9031b 100644
--- a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_afde8b() {
   float2 arg_0 = (0.0f).xx;
   float res = length(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.glsl b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.glsl
index bee8807..4ed4ce7 100644
--- a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_afde8b() {
   vec2 arg_0 = vec2(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_afde8b() {
   vec2 arg_0 = vec2(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_afde8b() {
   vec2 arg_0 = vec2(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.msl b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.msl
index ebda0cb..bfc73fe 100644
--- a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_afde8b() {
+void length_afde8b(device float* const tint_symbol_1) {
   float2 arg_0 = float2(0.0f);
   float res = length(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_afde8b();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  length_afde8b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_afde8b();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  length_afde8b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_afde8b();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  length_afde8b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.spvasm
index 975439c..318a900 100644
--- a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_afde8b "length_afde8b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
-         %14 = OpConstantNull %v2float
+         %17 = OpConstantNull %v2float
 %_ptr_Function_v2float = OpTypePointer Function %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_afde8b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %14
+%length_afde8b = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %17
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %14
-         %19 = OpLoad %v2float %arg_0
-         %17 = OpExtInst %float %18 Length %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v2float %arg_0
+         %20 = OpExtInst %float %21 Length %22
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %length_afde8b
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %length_afde8b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %length_afde8b
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %length_afde8b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %length_afde8b
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %length_afde8b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.wgsl
index 8fad0c3..92d306a 100644
--- a/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/length/afde8b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn length_afde8b() {
   var arg_0 = vec2<f32>(0.0f);
   var res : f32 = length(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_afde8b();
diff --git a/test/tint/builtins/gen/var/length/ba16d6.wgsl b/test/tint/builtins/gen/var/length/ba16d6.wgsl
index c838fd5..185b425 100644
--- a/test/tint/builtins/gen/var/length/ba16d6.wgsl
+++ b/test/tint/builtins/gen/var/length/ba16d6.wgsl
@@ -27,7 +27,9 @@
 fn length_ba16d6() {
   var arg_0 = vec3<f16>(0.h);
   var res: f16 = length(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.dxc.hlsl
index 7480de0..5ff8c69 100644
--- a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_ba16d6() {
   vector<float16_t, 3> arg_0 = (float16_t(0.0h)).xxx;
   float16_t res = length(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.fxc.hlsl
index 422bf1d..fb04093 100644
--- a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_ba16d6() {
   vector<float16_t, 3> arg_0 = (float16_t(0.0h)).xxx;
   float16_t res = length(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.glsl b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.glsl
index ea04f30..e621887 100644
--- a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_ba16d6() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_ba16d6() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_ba16d6() {
   f16vec3 arg_0 = f16vec3(0.0hf);
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.msl b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.msl
index 54123fc..8be33a7 100644
--- a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_ba16d6() {
+void length_ba16d6(device half* const tint_symbol_1) {
   half3 arg_0 = half3(0.0h);
   half res = length(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_ba16d6();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  length_ba16d6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_ba16d6();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  length_ba16d6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_ba16d6();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  length_ba16d6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.spvasm
index 4ec76a0..9237063 100644
--- a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_ba16d6 "length_ba16d6"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %v3half = OpTypeVector %half 3
-         %15 = OpConstantNull %v3half
+         %18 = OpConstantNull %v3half
 %_ptr_Function_v3half = OpTypePointer Function %v3half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_ba16d6 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %15
-        %res = OpVariable %_ptr_Function_half Function %23
-               OpStore %arg_0 %15
-         %20 = OpLoad %v3half %arg_0
-         %18 = OpExtInst %half %19 Length %20
-               OpStore %res %18
+%length_ba16d6 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %18
+        %res = OpVariable %_ptr_Function_half Function %26
+               OpStore %arg_0 %18
+         %23 = OpLoad %v3half %arg_0
+         %21 = OpExtInst %half %22 Length %23
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %length_ba16d6
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %length_ba16d6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %length_ba16d6
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %length_ba16d6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %length_ba16d6
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %length_ba16d6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.wgsl
index 2319558..1e73e65 100644
--- a/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/length/ba16d6.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn length_ba16d6() {
   var arg_0 = vec3<f16>(0.0h);
   var res : f16 = length(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_ba16d6();
diff --git a/test/tint/builtins/gen/var/length/becebf.wgsl b/test/tint/builtins/gen/var/length/becebf.wgsl
index 32cdab7..45fdbe4 100644
--- a/test/tint/builtins/gen/var/length/becebf.wgsl
+++ b/test/tint/builtins/gen/var/length/becebf.wgsl
@@ -25,7 +25,9 @@
 fn length_becebf() {
   var arg_0 = vec4<f32>(0.f);
   var res: f32 = length(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.dxc.hlsl
index e7760dd8..ecb2e31 100644
--- a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_becebf() {
   float4 arg_0 = (0.0f).xxxx;
   float res = length(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.fxc.hlsl
index e7760dd8..ecb2e31 100644
--- a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_becebf() {
   float4 arg_0 = (0.0f).xxxx;
   float res = length(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.glsl b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.glsl
index a87cbf7..de1885e 100644
--- a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_becebf() {
   vec4 arg_0 = vec4(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_becebf() {
   vec4 arg_0 = vec4(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void length_becebf() {
   vec4 arg_0 = vec4(0.0f);
   float res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.msl b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.msl
index 6909b06..edaca11 100644
--- a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_becebf() {
+void length_becebf(device float* const tint_symbol_1) {
   float4 arg_0 = float4(0.0f);
   float res = length(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_becebf();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  length_becebf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_becebf();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  length_becebf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_becebf();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  length_becebf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.spvasm
index 4162c69..8476b0b 100644
--- a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_becebf "length_becebf"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_becebf = OpFunction %void None %9
-         %12 = OpLabel
+%length_becebf = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %5
-         %17 = OpLoad %v4float %arg_0
-         %15 = OpExtInst %float %16 Length %17
-               OpStore %res %15
+         %20 = OpLoad %v4float %arg_0
+         %18 = OpExtInst %float %19 Length %20
+               OpStore %res %18
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %length_becebf
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %length_becebf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %length_becebf
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %length_becebf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %length_becebf
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %length_becebf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.wgsl
index 2d1b76d..7153543 100644
--- a/test/tint/builtins/gen/var/length/becebf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/length/becebf.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn length_becebf() {
   var arg_0 = vec4<f32>(0.0f);
   var res : f32 = length(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_becebf();
diff --git a/test/tint/builtins/gen/var/length/c158da.wgsl b/test/tint/builtins/gen/var/length/c158da.wgsl
index 8205577..d0f0f5a 100644
--- a/test/tint/builtins/gen/var/length/c158da.wgsl
+++ b/test/tint/builtins/gen/var/length/c158da.wgsl
@@ -27,7 +27,9 @@
 fn length_c158da() {
   var arg_0 = 0.h;
   var res: f16 = length(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.dxc.hlsl
index e8ad9f7..ee2ece1 100644
--- a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_c158da() {
   float16_t arg_0 = float16_t(0.0h);
   float16_t res = length(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.fxc.hlsl
index 51ff282..290d96e 100644
--- a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void length_c158da() {
   float16_t arg_0 = float16_t(0.0h);
   float16_t res = length(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.glsl b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.glsl
index 023690c..70ab3e1 100644
--- a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_c158da() {
   float16_t arg_0 = 0.0hf;
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_c158da() {
   float16_t arg_0 = 0.0hf;
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void length_c158da() {
   float16_t arg_0 = 0.0hf;
   float16_t res = length(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.msl b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.msl
index ea75d99..78a44fe 100644
--- a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void length_c158da() {
+void length_c158da(device half* const tint_symbol_1) {
   half arg_0 = 0.0h;
   half res = fabs(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  length_c158da();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  length_c158da(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  length_c158da();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  length_c158da(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  length_c158da();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  length_c158da(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.spvasm b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.spvasm
index 5b14574..e7d6a09 100644
--- a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %length_c158da "length_c158da"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,42 +41,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-         %14 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+         %17 = OpConstantNull %half
 %_ptr_Function_half = OpTypePointer Function %half
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%length_c158da = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %14
-        %res = OpVariable %_ptr_Function_half Function %14
-               OpStore %arg_0 %14
-         %19 = OpLoad %half %arg_0
-         %17 = OpExtInst %half %18 Length %19
-               OpStore %res %17
+%length_c158da = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %17
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %half %arg_0
+         %20 = OpExtInst %half %21 Length %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %28 = OpLoad %half %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %length_c158da
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %length_c158da
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %length_c158da
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %length_c158da
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %length_c158da
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %length_c158da
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.wgsl b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.wgsl
index dc07d4b..fa6ca05 100644
--- a/test/tint/builtins/gen/var/length/c158da.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/length/c158da.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn length_c158da() {
   var arg_0 = 0.0h;
   var res : f16 = length(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_c158da();
diff --git a/test/tint/builtins/gen/var/length/c2c544.wgsl b/test/tint/builtins/gen/var/length/c2c544.wgsl
index 5e145ff..be23c5e 100644
--- a/test/tint/builtins/gen/var/length/c2c544.wgsl
+++ b/test/tint/builtins/gen/var/length/c2c544.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(0.);
   var res = length(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   length_c2c544();
diff --git a/test/tint/builtins/gen/var/log/3da25a.wgsl b/test/tint/builtins/gen/var/log/3da25a.wgsl
index 3c41757..bea6df5 100644
--- a/test/tint/builtins/gen/var/log/3da25a.wgsl
+++ b/test/tint/builtins/gen/var/log/3da25a.wgsl
@@ -25,7 +25,9 @@
 fn log_3da25a() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = log(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.dxc.hlsl
index 48ea81d..fc60411 100644
--- a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_3da25a() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = log(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.fxc.hlsl
index 48ea81d..fc60411 100644
--- a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_3da25a() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = log(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.glsl b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.glsl
index a4e53d1..6c4d818 100644
--- a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log_3da25a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log_3da25a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log_3da25a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.msl b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.msl
index 6524679..5a8dd0a 100644
--- a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_3da25a() {
+void log_3da25a(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = log(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_3da25a();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  log_3da25a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_3da25a();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  log_3da25a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_3da25a();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  log_3da25a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.spvasm
index 196896f..0174a10 100644
--- a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_3da25a "log_3da25a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
- %log_3da25a = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+ %log_3da25a = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Log %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Log %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %log_3da25a
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %log_3da25a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %log_3da25a
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %log_3da25a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %log_3da25a
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %log_3da25a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.wgsl
index f66d4f5..ce99d2d 100644
--- a/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log/3da25a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn log_3da25a() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = log(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_3da25a();
diff --git a/test/tint/builtins/gen/var/log/655989.wgsl b/test/tint/builtins/gen/var/log/655989.wgsl
index 062a3e9..aee9c5a 100644
--- a/test/tint/builtins/gen/var/log/655989.wgsl
+++ b/test/tint/builtins/gen/var/log/655989.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = log(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_655989();
diff --git a/test/tint/builtins/gen/var/log/697e1d.wgsl b/test/tint/builtins/gen/var/log/697e1d.wgsl
index 7f7822f..9b28c331 100644
--- a/test/tint/builtins/gen/var/log/697e1d.wgsl
+++ b/test/tint/builtins/gen/var/log/697e1d.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = log(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_697e1d();
diff --git a/test/tint/builtins/gen/var/log/6ff86f.wgsl b/test/tint/builtins/gen/var/log/6ff86f.wgsl
index c4eb176..f3ed05d 100644
--- a/test/tint/builtins/gen/var/log/6ff86f.wgsl
+++ b/test/tint/builtins/gen/var/log/6ff86f.wgsl
@@ -27,7 +27,9 @@
 fn log_6ff86f() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = log(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.dxc.hlsl
index 2ced859..ac34759 100644
--- a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_6ff86f() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = log(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.fxc.hlsl
index e38b06e..eb147f2 100644
--- a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_6ff86f() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = log(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.glsl b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.glsl
index 0431e5b..37f6ae6 100644
--- a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log_6ff86f() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log_6ff86f() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log_6ff86f() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.msl b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.msl
index 3fa752c..e5d73fe 100644
--- a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_6ff86f() {
+void log_6ff86f(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = log(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_6ff86f();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  log_6ff86f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_6ff86f();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  log_6ff86f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_6ff86f();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  log_6ff86f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.spvasm
index 8acde47..aaa184b 100644
--- a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_6ff86f "log_6ff86f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_6ff86f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Log %22
-               OpStore %res %20
+ %log_6ff86f = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Log %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log_6ff86f
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log_6ff86f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %log_6ff86f
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %log_6ff86f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %log_6ff86f
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %log_6ff86f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.wgsl
index 7a24128..03d4a8a 100644
--- a/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log/6ff86f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn log_6ff86f() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = log(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_6ff86f();
diff --git a/test/tint/builtins/gen/var/log/7114a6.wgsl b/test/tint/builtins/gen/var/log/7114a6.wgsl
index 172fc2e..ec8e4c9 100644
--- a/test/tint/builtins/gen/var/log/7114a6.wgsl
+++ b/test/tint/builtins/gen/var/log/7114a6.wgsl
@@ -25,7 +25,9 @@
 fn log_7114a6() {
   var arg_0 = 1.f;
   var res: f32 = log(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.dxc.hlsl
index c908d84..6793ce7 100644
--- a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_7114a6() {
   float arg_0 = 1.0f;
   float res = log(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.fxc.hlsl
index c908d84..6793ce7 100644
--- a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_7114a6() {
   float arg_0 = 1.0f;
   float res = log(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.glsl b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.glsl
index cac97bf..d177759 100644
--- a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log_7114a6() {
   float arg_0 = 1.0f;
   float res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log_7114a6() {
   float arg_0 = 1.0f;
   float res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log_7114a6() {
   float arg_0 = 1.0f;
   float res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.msl b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.msl
index 65aab32..d2d1831 100644
--- a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_7114a6() {
+void log_7114a6(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = log(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_7114a6();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  log_7114a6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_7114a6();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  log_7114a6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_7114a6();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  log_7114a6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.spvasm
index 0fab51b..338b943 100644
--- a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_7114a6 "log_7114a6"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
- %log_7114a6 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+ %log_7114a6 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Log %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Log %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %log_7114a6
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %log_7114a6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %log_7114a6
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %log_7114a6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %log_7114a6
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %log_7114a6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.wgsl
index 952ac3c..9216965 100644
--- a/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log/7114a6.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn log_7114a6() {
   var arg_0 = 1.0f;
   var res : f32 = log(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_7114a6();
diff --git a/test/tint/builtins/gen/var/log/8f0e32.wgsl b/test/tint/builtins/gen/var/log/8f0e32.wgsl
index b7aa49d..abc9c33 100644
--- a/test/tint/builtins/gen/var/log/8f0e32.wgsl
+++ b/test/tint/builtins/gen/var/log/8f0e32.wgsl
@@ -27,7 +27,9 @@
 fn log_8f0e32() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = log(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.dxc.hlsl
index f04a6f5..600e4e6 100644
--- a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_8f0e32() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = log(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.fxc.hlsl
index f2bc419..e5900ba 100644
--- a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_8f0e32() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = log(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.glsl b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.glsl
index 6f6b1aa..9d50ecc 100644
--- a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log_8f0e32() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log_8f0e32() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log_8f0e32() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.msl b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.msl
index 0e25caa..8ae942d 100644
--- a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_8f0e32() {
+void log_8f0e32(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = log(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_8f0e32();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  log_8f0e32(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_8f0e32();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  log_8f0e32(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_8f0e32();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  log_8f0e32(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.spvasm
index ac6fe38..cf88369 100644
--- a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_8f0e32 "log_8f0e32"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_8f0e32 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Log %22
-               OpStore %res %20
+ %log_8f0e32 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Log %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log_8f0e32
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log_8f0e32
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %log_8f0e32
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %log_8f0e32
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %log_8f0e32
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %log_8f0e32
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.wgsl
index fe96b0e..f43aecf 100644
--- a/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log/8f0e32.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn log_8f0e32() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = log(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_8f0e32();
diff --git a/test/tint/builtins/gen/var/log/b2ce28.wgsl b/test/tint/builtins/gen/var/log/b2ce28.wgsl
index f467a86..597afac 100644
--- a/test/tint/builtins/gen/var/log/b2ce28.wgsl
+++ b/test/tint/builtins/gen/var/log/b2ce28.wgsl
@@ -25,7 +25,9 @@
 fn log_b2ce28() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = log(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.dxc.hlsl
index 60c82a6..780b38c 100644
--- a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_b2ce28() {
   float2 arg_0 = (1.0f).xx;
   float2 res = log(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.fxc.hlsl
index 60c82a6..780b38c 100644
--- a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_b2ce28() {
   float2 arg_0 = (1.0f).xx;
   float2 res = log(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.glsl b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.glsl
index ce6c62b..6800239 100644
--- a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log_b2ce28() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log_b2ce28() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log_b2ce28() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.msl b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.msl
index fe0c6d6..f767dbb 100644
--- a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_b2ce28() {
+void log_b2ce28(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = log(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_b2ce28();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  log_b2ce28(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_b2ce28();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  log_b2ce28(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_b2ce28();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  log_b2ce28(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.spvasm
index 5fc25bf..cf2f3af 100644
--- a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_b2ce28 "log_b2ce28"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
- %log_b2ce28 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Log %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+ %log_b2ce28 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Log %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %log_b2ce28
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %log_b2ce28
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %log_b2ce28
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %log_b2ce28
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %log_b2ce28
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %log_b2ce28
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.wgsl
index 3b5a952..fbc1145 100644
--- a/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log/b2ce28.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn log_b2ce28() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = log(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_b2ce28();
diff --git a/test/tint/builtins/gen/var/log/b8088d.wgsl b/test/tint/builtins/gen/var/log/b8088d.wgsl
index 2bcdc0f..3b2d69a 100644
--- a/test/tint/builtins/gen/var/log/b8088d.wgsl
+++ b/test/tint/builtins/gen/var/log/b8088d.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = log(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_b8088d();
diff --git a/test/tint/builtins/gen/var/log/c9f489.wgsl b/test/tint/builtins/gen/var/log/c9f489.wgsl
index ed3404b..5bfcd02 100644
--- a/test/tint/builtins/gen/var/log/c9f489.wgsl
+++ b/test/tint/builtins/gen/var/log/c9f489.wgsl
@@ -27,7 +27,9 @@
 fn log_c9f489() {
   var arg_0 = 1.h;
   var res: f16 = log(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.dxc.hlsl
index b65744f..8daecc5 100644
--- a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_c9f489() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = log(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.fxc.hlsl
index 98aae52..1d5447c 100644
--- a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_c9f489() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = log(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.glsl b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.glsl
index 94e8d4b..70b0e34 100644
--- a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log_c9f489() {
   float16_t arg_0 = 1.0hf;
   float16_t res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log_c9f489() {
   float16_t arg_0 = 1.0hf;
   float16_t res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log_c9f489() {
   float16_t arg_0 = 1.0hf;
   float16_t res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.msl b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.msl
index b2588e4..c7d9435 100644
--- a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_c9f489() {
+void log_c9f489(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = log(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_c9f489();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  log_c9f489(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_c9f489();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  log_c9f489(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_c9f489();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  log_c9f489(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.spvasm
index 76e0a15..b946a06 100644
--- a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_c9f489 "log_c9f489"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_c9f489 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %log_c9f489 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Log %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Log %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %log_c9f489
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %log_c9f489
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %log_c9f489
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %log_c9f489
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %log_c9f489
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %log_c9f489
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.wgsl
index 4f9373c..260c5b2 100644
--- a/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log/c9f489.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn log_c9f489() {
   var arg_0 = 1.0h;
   var res : f16 = log(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_c9f489();
diff --git a/test/tint/builtins/gen/var/log/cdbdc1.wgsl b/test/tint/builtins/gen/var/log/cdbdc1.wgsl
index 55be483..d90301d 100644
--- a/test/tint/builtins/gen/var/log/cdbdc1.wgsl
+++ b/test/tint/builtins/gen/var/log/cdbdc1.wgsl
@@ -27,7 +27,9 @@
 fn log_cdbdc1() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = log(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.dxc.hlsl
index 07574a6..a31efa5 100644
--- a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_cdbdc1() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = log(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.fxc.hlsl
index 6bd39bf..34ea086 100644
--- a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_cdbdc1() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = log(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.glsl b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.glsl
index d278e67..bb463c3 100644
--- a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log_cdbdc1() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log_cdbdc1() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log_cdbdc1() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.msl b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.msl
index 3463548..301cde0 100644
--- a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_cdbdc1() {
+void log_cdbdc1(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = log(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_cdbdc1();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  log_cdbdc1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_cdbdc1();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  log_cdbdc1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_cdbdc1();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  log_cdbdc1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.spvasm
index 017227c..bd89bad 100644
--- a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_cdbdc1 "log_cdbdc1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %log_cdbdc1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Log %22
-               OpStore %res %20
+ %log_cdbdc1 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Log %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log_cdbdc1
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log_cdbdc1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %log_cdbdc1
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %log_cdbdc1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %log_cdbdc1
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %log_cdbdc1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.wgsl
index c9f7a70..b80455c 100644
--- a/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log/cdbdc1.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn log_cdbdc1() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = log(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_cdbdc1();
diff --git a/test/tint/builtins/gen/var/log/f4c570.wgsl b/test/tint/builtins/gen/var/log/f4c570.wgsl
index b509b5d..8285319 100644
--- a/test/tint/builtins/gen/var/log/f4c570.wgsl
+++ b/test/tint/builtins/gen/var/log/f4c570.wgsl
@@ -25,7 +25,9 @@
 fn log_f4c570() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = log(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.dxc.hlsl
index b1ba5c3..8cac031 100644
--- a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_f4c570() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = log(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.fxc.hlsl
index b1ba5c3..8cac031 100644
--- a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log_f4c570() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = log(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.glsl b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.glsl
index 945a3d9..7cbdb2e 100644
--- a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log_f4c570() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log_f4c570() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log_f4c570() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = log(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.msl b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.msl
index 7cf7fb2..577a92b 100644
--- a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log_f4c570() {
+void log_f4c570(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = log(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log_f4c570();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  log_f4c570(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log_f4c570();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  log_f4c570(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log_f4c570();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  log_f4c570(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.spvasm
index 7dbf8f9..4391328 100644
--- a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log_f4c570 "log_f4c570"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
- %log_f4c570 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Log %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+ %log_f4c570 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Log %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %log_f4c570
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %log_f4c570
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %log_f4c570
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %log_f4c570
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %log_f4c570
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %log_f4c570
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.wgsl
index 4fa5970..c0a044d 100644
--- a/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log/f4c570.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn log_f4c570() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = log(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_f4c570();
diff --git a/test/tint/builtins/gen/var/log/f60cc7.wgsl b/test/tint/builtins/gen/var/log/f60cc7.wgsl
index ea4f452..485af58 100644
--- a/test/tint/builtins/gen/var/log/f60cc7.wgsl
+++ b/test/tint/builtins/gen/var/log/f60cc7.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = log(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log_f60cc7();
diff --git a/test/tint/builtins/gen/var/log2/0fbd39.wgsl b/test/tint/builtins/gen/var/log2/0fbd39.wgsl
index c61df79..d0abfe5 100644
--- a/test/tint/builtins/gen/var/log2/0fbd39.wgsl
+++ b/test/tint/builtins/gen/var/log2/0fbd39.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = log2(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_0fbd39();
diff --git a/test/tint/builtins/gen/var/log2/38b478.wgsl b/test/tint/builtins/gen/var/log2/38b478.wgsl
index f07d42f..346f4ef 100644
--- a/test/tint/builtins/gen/var/log2/38b478.wgsl
+++ b/test/tint/builtins/gen/var/log2/38b478.wgsl
@@ -27,7 +27,9 @@
 fn log2_38b478() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = log2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.dxc.hlsl
index 798fd2f..6190e3b 100644
--- a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_38b478() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = log2(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.fxc.hlsl
index 1972795..859353b 100644
--- a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_38b478() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = log2(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.glsl b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.glsl
index fbf3bbf..c94898b 100644
--- a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log2_38b478() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log2_38b478() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void log2_38b478() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.msl b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.msl
index 71d7c90..0a83013 100644
--- a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_38b478() {
+void log2_38b478(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = log2(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_38b478();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  log2_38b478(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_38b478();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  log2_38b478(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_38b478();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  log2_38b478(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.spvasm
index 1de3931..1a1436a 100644
--- a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_38b478 "log2_38b478"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_38b478 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Log2 %22
-               OpStore %res %20
+%log2_38b478 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Log2 %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log2_38b478
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log2_38b478
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %log2_38b478
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %log2_38b478
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %log2_38b478
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %log2_38b478
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.wgsl
index 875fe4d..0b78656 100644
--- a/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log2/38b478.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn log2_38b478() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = log2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_38b478();
diff --git a/test/tint/builtins/gen/var/log2/4036ed.wgsl b/test/tint/builtins/gen/var/log2/4036ed.wgsl
index b611265..9af03e8 100644
--- a/test/tint/builtins/gen/var/log2/4036ed.wgsl
+++ b/test/tint/builtins/gen/var/log2/4036ed.wgsl
@@ -25,7 +25,9 @@
 fn log2_4036ed() {
   var arg_0 = 1.f;
   var res: f32 = log2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.dxc.hlsl
index bc9a7c4..abcd7da 100644
--- a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_4036ed() {
   float arg_0 = 1.0f;
   float res = log2(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.fxc.hlsl
index bc9a7c4..abcd7da 100644
--- a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_4036ed() {
   float arg_0 = 1.0f;
   float res = log2(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.glsl b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.glsl
index dbd9a48..36966de 100644
--- a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log2_4036ed() {
   float arg_0 = 1.0f;
   float res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log2_4036ed() {
   float arg_0 = 1.0f;
   float res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void log2_4036ed() {
   float arg_0 = 1.0f;
   float res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.msl b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.msl
index d21766d..15a7e79 100644
--- a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_4036ed() {
+void log2_4036ed(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = log2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_4036ed();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  log2_4036ed(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_4036ed();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  log2_4036ed(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_4036ed();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  log2_4036ed(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.spvasm
index 14887a7..54c03be 100644
--- a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_4036ed "log2_4036ed"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%log2_4036ed = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%log2_4036ed = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Log2 %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Log2 %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %log2_4036ed
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %log2_4036ed
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %log2_4036ed
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %log2_4036ed
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %log2_4036ed
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %log2_4036ed
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.wgsl
index ec4ffa1..59a515d 100644
--- a/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log2/4036ed.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn log2_4036ed() {
   var arg_0 = 1.0f;
   var res : f32 = log2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_4036ed();
diff --git a/test/tint/builtins/gen/var/log2/5b464b.wgsl b/test/tint/builtins/gen/var/log2/5b464b.wgsl
index ec03520..8932003 100644
--- a/test/tint/builtins/gen/var/log2/5b464b.wgsl
+++ b/test/tint/builtins/gen/var/log2/5b464b.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = log2(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_5b464b();
diff --git a/test/tint/builtins/gen/var/log2/6b8954.wgsl b/test/tint/builtins/gen/var/log2/6b8954.wgsl
index adc9400..7db3749 100644
--- a/test/tint/builtins/gen/var/log2/6b8954.wgsl
+++ b/test/tint/builtins/gen/var/log2/6b8954.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = log2(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_6b8954();
diff --git a/test/tint/builtins/gen/var/log2/776088.wgsl b/test/tint/builtins/gen/var/log2/776088.wgsl
index 03d3efc..5f3345a 100644
--- a/test/tint/builtins/gen/var/log2/776088.wgsl
+++ b/test/tint/builtins/gen/var/log2/776088.wgsl
@@ -27,7 +27,9 @@
 fn log2_776088() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = log2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.dxc.hlsl
index 82cdfb4..32afff1 100644
--- a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_776088() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = log2(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.fxc.hlsl
index 2830287..684c13b 100644
--- a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_776088() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = log2(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.glsl b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.glsl
index c431053..fe3e94c 100644
--- a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log2_776088() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log2_776088() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void log2_776088() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.msl b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.msl
index 748be70..e5414f8 100644
--- a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_776088() {
+void log2_776088(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = log2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_776088();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  log2_776088(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_776088();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  log2_776088(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_776088();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  log2_776088(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.spvasm
index 01c8096..ada82fe 100644
--- a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_776088 "log2_776088"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_776088 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Log2 %22
-               OpStore %res %20
+%log2_776088 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Log2 %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log2_776088
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log2_776088
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %log2_776088
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %log2_776088
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %log2_776088
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %log2_776088
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.wgsl
index 616e82a..ef5f23d 100644
--- a/test/tint/builtins/gen/var/log2/776088.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log2/776088.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn log2_776088() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = log2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_776088();
diff --git a/test/tint/builtins/gen/var/log2/8c10b3.wgsl b/test/tint/builtins/gen/var/log2/8c10b3.wgsl
index 1ce9f7c..857f04f 100644
--- a/test/tint/builtins/gen/var/log2/8c10b3.wgsl
+++ b/test/tint/builtins/gen/var/log2/8c10b3.wgsl
@@ -27,7 +27,9 @@
 fn log2_8c10b3() {
   var arg_0 = 1.h;
   var res: f16 = log2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.dxc.hlsl
index 43eb1d1..72a3f11 100644
--- a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_8c10b3() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = log2(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.fxc.hlsl
index bc650ec..d637943 100644
--- a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_8c10b3() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = log2(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.glsl b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.glsl
index f05214f..15e1afe 100644
--- a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log2_8c10b3() {
   float16_t arg_0 = 1.0hf;
   float16_t res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log2_8c10b3() {
   float16_t arg_0 = 1.0hf;
   float16_t res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void log2_8c10b3() {
   float16_t arg_0 = 1.0hf;
   float16_t res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.msl b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.msl
index 9637f0f..09c44c9 100644
--- a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_8c10b3() {
+void log2_8c10b3(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = log2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_8c10b3();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  log2_8c10b3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_8c10b3();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  log2_8c10b3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_8c10b3();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  log2_8c10b3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.spvasm
index ca79600..c081068 100644
--- a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_8c10b3 "log2_8c10b3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_8c10b3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%log2_8c10b3 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Log2 %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Log2 %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %log2_8c10b3
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %log2_8c10b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %log2_8c10b3
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %log2_8c10b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %log2_8c10b3
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %log2_8c10b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.wgsl
index fab4228..e3e4ab9 100644
--- a/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log2/8c10b3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn log2_8c10b3() {
   var arg_0 = 1.0h;
   var res : f16 = log2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_8c10b3();
diff --git a/test/tint/builtins/gen/var/log2/902988.wgsl b/test/tint/builtins/gen/var/log2/902988.wgsl
index 78ec4cd..e5083f2 100644
--- a/test/tint/builtins/gen/var/log2/902988.wgsl
+++ b/test/tint/builtins/gen/var/log2/902988.wgsl
@@ -25,7 +25,9 @@
 fn log2_902988() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = log2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.dxc.hlsl
index d2a41fd..5845c44 100644
--- a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_902988() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = log2(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.fxc.hlsl
index d2a41fd..5845c44 100644
--- a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_902988() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = log2(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.glsl b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.glsl
index 1ab598e..75c4f07 100644
--- a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log2_902988() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log2_902988() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void log2_902988() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.msl b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.msl
index b1afdbd..d289e1a 100644
--- a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_902988() {
+void log2_902988(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = log2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_902988();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  log2_902988(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_902988();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  log2_902988(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_902988();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  log2_902988(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.spvasm
index 3ea274a..ed45e8e 100644
--- a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_902988 "log2_902988"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%log2_902988 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%log2_902988 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Log2 %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Log2 %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %log2_902988
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %log2_902988
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %log2_902988
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %log2_902988
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %log2_902988
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %log2_902988
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.wgsl
index 9bfd632..14a1059 100644
--- a/test/tint/builtins/gen/var/log2/902988.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log2/902988.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn log2_902988() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = log2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_902988();
diff --git a/test/tint/builtins/gen/var/log2/a52bbb.wgsl b/test/tint/builtins/gen/var/log2/a52bbb.wgsl
index 4d4cf71..5565ff3 100644
--- a/test/tint/builtins/gen/var/log2/a52bbb.wgsl
+++ b/test/tint/builtins/gen/var/log2/a52bbb.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = log2(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_a52bbb();
diff --git a/test/tint/builtins/gen/var/log2/adb233.wgsl b/test/tint/builtins/gen/var/log2/adb233.wgsl
index 9db6186..6eea0c8 100644
--- a/test/tint/builtins/gen/var/log2/adb233.wgsl
+++ b/test/tint/builtins/gen/var/log2/adb233.wgsl
@@ -25,7 +25,9 @@
 fn log2_adb233() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = log2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.dxc.hlsl
index edd19e1..33211ef 100644
--- a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_adb233() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = log2(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.fxc.hlsl
index edd19e1..33211ef 100644
--- a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_adb233() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = log2(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.glsl b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.glsl
index 08551f4..47a9764 100644
--- a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log2_adb233() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log2_adb233() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void log2_adb233() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.msl b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.msl
index 1143645..164e57c 100644
--- a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_adb233() {
+void log2_adb233(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = log2(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_adb233();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  log2_adb233(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_adb233();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  log2_adb233(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_adb233();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  log2_adb233(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.spvasm
index fd25695..197f910 100644
--- a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_adb233 "log2_adb233"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%log2_adb233 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Log2 %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%log2_adb233 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Log2 %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %log2_adb233
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %log2_adb233
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %log2_adb233
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %log2_adb233
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %log2_adb233
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %log2_adb233
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.wgsl
index 252dd99..7b6a88f 100644
--- a/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log2/adb233.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn log2_adb233() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = log2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_adb233();
diff --git a/test/tint/builtins/gen/var/log2/aea659.wgsl b/test/tint/builtins/gen/var/log2/aea659.wgsl
index 32b5b41..78a1bf2 100644
--- a/test/tint/builtins/gen/var/log2/aea659.wgsl
+++ b/test/tint/builtins/gen/var/log2/aea659.wgsl
@@ -25,7 +25,9 @@
 fn log2_aea659() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = log2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.dxc.hlsl
index 0a7192d..f226711 100644
--- a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_aea659() {
   float2 arg_0 = (1.0f).xx;
   float2 res = log2(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.fxc.hlsl
index 0a7192d..f226711 100644
--- a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_aea659() {
   float2 arg_0 = (1.0f).xx;
   float2 res = log2(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.glsl b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.glsl
index c2b459e..cfc072d 100644
--- a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log2_aea659() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log2_aea659() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void log2_aea659() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.msl b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.msl
index f7095c8..c44e436 100644
--- a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_aea659() {
+void log2_aea659(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = log2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_aea659();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  log2_aea659(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_aea659();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  log2_aea659(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_aea659();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  log2_aea659(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.spvasm
index 2b53916..7d32955 100644
--- a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_aea659 "log2_aea659"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%log2_aea659 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Log2 %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%log2_aea659 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Log2 %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %log2_aea659
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %log2_aea659
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %log2_aea659
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %log2_aea659
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %log2_aea659
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %log2_aea659
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.wgsl
index 86accf1..2219ab9 100644
--- a/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log2/aea659.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn log2_aea659() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = log2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_aea659();
diff --git a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl
index 27b6ac1..5c65ef1 100644
--- a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl
+++ b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl
@@ -27,7 +27,9 @@
 fn log2_fb9f0b() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = log2(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.dxc.hlsl
index 1499535..7a28de3 100644
--- a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_fb9f0b() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = log2(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.fxc.hlsl
index 86baba4..6809742 100644
--- a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void log2_fb9f0b() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = log2(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.glsl b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.glsl
index aac760b..35c5c8e 100644
--- a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log2_fb9f0b() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log2_fb9f0b() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void log2_fb9f0b() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = log2(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.msl b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.msl
index 4fdf2a3..89520e2 100644
--- a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void log2_fb9f0b() {
+void log2_fb9f0b(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = log2(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  log2_fb9f0b();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  log2_fb9f0b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  log2_fb9f0b();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  log2_fb9f0b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  log2_fb9f0b();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  log2_fb9f0b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.spvasm
index e1d6d91..549ad4d 100644
--- a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %log2_fb9f0b "log2_fb9f0b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%log2_fb9f0b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Log2 %22
-               OpStore %res %20
+%log2_fb9f0b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Log2 %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %log2_fb9f0b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %log2_fb9f0b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %log2_fb9f0b
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %log2_fb9f0b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %log2_fb9f0b
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %log2_fb9f0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.wgsl
index 1a44c5c..e930649 100644
--- a/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/log2/fb9f0b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn log2_fb9f0b() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = log2(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   log2_fb9f0b();
diff --git a/test/tint/builtins/gen/var/max/067f3a.wgsl b/test/tint/builtins/gen/var/max/067f3a.wgsl
index bc8fe72..d4a1fe8 100644
--- a/test/tint/builtins/gen/var/max/067f3a.wgsl
+++ b/test/tint/builtins/gen/var/max/067f3a.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1);
   var res = max(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_067f3a();
diff --git a/test/tint/builtins/gen/var/max/0c0aae.wgsl b/test/tint/builtins/gen/var/max/0c0aae.wgsl
index d40ba00..d3d2da2 100644
--- a/test/tint/builtins/gen/var/max/0c0aae.wgsl
+++ b/test/tint/builtins/gen/var/max/0c0aae.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1u;
   var arg_1 = 1u;
   var res: u32 = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.dxc.hlsl
index e7e8dce..4f688b1 100644
--- a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_0c0aae() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = max(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.fxc.hlsl
index e7e8dce..4f688b1 100644
--- a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_0c0aae() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = max(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.glsl
index de68a14..a902a2a 100644
--- a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void max_0c0aae() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void max_0c0aae() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void max_0c0aae() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.msl b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.msl
index 6a31914..cbda05a 100644
--- a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_0c0aae() {
+void max_0c0aae(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = max(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_0c0aae();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  max_0c0aae(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_0c0aae();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  max_0c0aae(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_0c0aae();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  max_0c0aae(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.spvasm
index 4f9f3b9..f44ff05 100644
--- a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_0c0aae "max_0c0aae"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_0c0aae = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-      %arg_1 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %max_0c0aae = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+      %arg_1 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
                OpStore %arg_1 %uint_1
-         %21 = OpLoad %uint %arg_0
-         %22 = OpLoad %uint %arg_1
-         %19 = OpExtInst %uint %20 UMax %21 %22
-               OpStore %res %19
+         %24 = OpLoad %uint %arg_0
+         %25 = OpLoad %uint %arg_1
+         %22 = OpExtInst %uint %23 UMax %24 %25
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %max_0c0aae
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %max_0c0aae
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %max_0c0aae
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %max_0c0aae
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %max_0c0aae
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %max_0c0aae
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.wgsl
index 2f1e9c2..1840cc4 100644
--- a/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/0c0aae.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1u;
   var arg_1 = 1u;
   var res : u32 = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_0c0aae();
diff --git a/test/tint/builtins/gen/var/max/111ac0.wgsl b/test/tint/builtins/gen/var/max/111ac0.wgsl
index 58ecced..ffb582d 100644
--- a/test/tint/builtins/gen/var/max/111ac0.wgsl
+++ b/test/tint/builtins/gen/var/max/111ac0.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1.h;
   var arg_1 = 1.h;
   var res: f16 = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.dxc.hlsl
index 9307bc9..a8d57ad 100644
--- a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_111ac0() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = max(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.fxc.hlsl
index 9dbfddd..560bcd5 100644
--- a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_111ac0() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = max(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.glsl
index 826f121..1dda017 100644
--- a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void max_111ac0() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void max_111ac0() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void max_111ac0() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.msl b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.msl
index 8e3b8c3..aabf512 100644
--- a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_111ac0() {
+void max_111ac0(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half res = fmax(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_111ac0();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  max_111ac0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_111ac0();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  max_111ac0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_111ac0();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  max_111ac0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.spvasm
index 234a5e0..bda708f 100644
--- a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_111ac0 "max_111ac0"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,46 +42,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_111ac0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %max_111ac0 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
-         %21 = OpLoad %half %arg_0
-         %22 = OpLoad %half %arg_1
-         %19 = OpExtInst %half %20 NMax %21 %22
-               OpStore %res %19
+         %24 = OpLoad %half %arg_0
+         %25 = OpLoad %half %arg_1
+         %22 = OpExtInst %half %23 NMax %24 %25
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %max_111ac0
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %max_111ac0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %max_111ac0
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %max_111ac0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %max_111ac0
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %max_111ac0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.wgsl
index db1a126..f89a7d6 100644
--- a/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/111ac0.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1.0h;
   var arg_1 = 1.0h;
   var res : f16 = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_111ac0();
diff --git a/test/tint/builtins/gen/var/max/19070a.wgsl b/test/tint/builtins/gen/var/max/19070a.wgsl
index 9d97502..2dd6afb 100644
--- a/test/tint/builtins/gen/var/max/19070a.wgsl
+++ b/test/tint/builtins/gen/var/max/19070a.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1);
   var res = max(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_19070a();
diff --git a/test/tint/builtins/gen/var/max/25eafe.wgsl b/test/tint/builtins/gen/var/max/25eafe.wgsl
index 656bf37..236ae64 100644
--- a/test/tint/builtins/gen/var/max/25eafe.wgsl
+++ b/test/tint/builtins/gen/var/max/25eafe.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<i32>(1i);
   var arg_1 = vec3<i32>(1i);
   var res: vec3<i32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.dxc.hlsl
index 1e23c54..9aaf09b 100644
--- a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_25eafe() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   int3 res = max(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.fxc.hlsl
index 1e23c54..9aaf09b 100644
--- a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_25eafe() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   int3 res = max(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.glsl
index 1f8e21d..7a377b6 100644
--- a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void max_25eafe() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void max_25eafe() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void max_25eafe() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.msl b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.msl
index 1b4a2f2..4f3dfc5 100644
--- a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_25eafe() {
+void max_25eafe(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 arg_1 = int3(1);
   int3 res = max(arg_0, arg_1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_25eafe();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  max_25eafe(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_25eafe();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  max_25eafe(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_25eafe();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  max_25eafe(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.spvasm
index 7d84e7c..048339e 100644
--- a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_25eafe "max_25eafe"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_25eafe = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %19
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3int %arg_0
-         %24 = OpLoad %v3int %arg_1
-         %21 = OpExtInst %v3int %22 SMax %23 %24
-               OpStore %res %21
+ %max_25eafe = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3int %arg_0
+         %27 = OpLoad %v3int %arg_1
+         %24 = OpExtInst %v3int %25 SMax %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %33 = OpLoad %v3int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_25eafe
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_25eafe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_25eafe
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %max_25eafe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_25eafe
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %max_25eafe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.wgsl
index 61a61eb..a985c5e 100644
--- a/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/25eafe.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<i32>(1i);
   var arg_1 = vec3<i32>(1i);
   var res : vec3<i32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_25eafe();
diff --git a/test/tint/builtins/gen/var/max/320815.wgsl b/test/tint/builtins/gen/var/max/320815.wgsl
index 4a973ee..2053259 100644
--- a/test/tint/builtins/gen/var/max/320815.wgsl
+++ b/test/tint/builtins/gen/var/max/320815.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<u32>(1u);
   var arg_1 = vec2<u32>(1u);
   var res: vec2<u32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/320815.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/320815.wgsl.expected.dxc.hlsl
index db6bae6..45943ee 100644
--- a/test/tint/builtins/gen/var/max/320815.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/320815.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_320815() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint2 res = max(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/320815.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/320815.wgsl.expected.fxc.hlsl
index db6bae6..45943ee 100644
--- a/test/tint/builtins/gen/var/max/320815.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/320815.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_320815() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint2 res = max(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/320815.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/320815.wgsl.expected.glsl
index 7eb797c..8efff62 100644
--- a/test/tint/builtins/gen/var/max/320815.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/320815.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void max_320815() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void max_320815() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void max_320815() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/320815.wgsl.expected.msl b/test/tint/builtins/gen/var/max/320815.wgsl.expected.msl
index afba782..7dc8b9c 100644
--- a/test/tint/builtins/gen/var/max/320815.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/320815.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_320815() {
+void max_320815(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 arg_1 = uint2(1u);
   uint2 res = max(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_320815();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  max_320815(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_320815();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  max_320815(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_320815();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  max_320815(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/320815.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/320815.wgsl.expected.spvasm
index fcac466..79651fd 100644
--- a/test/tint/builtins/gen/var/max/320815.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/320815.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_320815 "max_320815"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_320815 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %19
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2uint %arg_0
-         %24 = OpLoad %v2uint %arg_1
-         %21 = OpExtInst %v2uint %22 UMax %23 %24
-               OpStore %res %21
+ %max_320815 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2uint %arg_0
+         %27 = OpLoad %v2uint %arg_1
+         %24 = OpExtInst %v2uint %25 UMax %26 %27
+               OpStore %res %24
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_320815
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_320815
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_320815
+%fragment_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %max_320815
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_320815
+%compute_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %max_320815
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/320815.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/320815.wgsl.expected.wgsl
index cb862a6..fff3925 100644
--- a/test/tint/builtins/gen/var/max/320815.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/320815.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<u32>(1u);
   var arg_1 = vec2<u32>(1u);
   var res : vec2<u32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_320815();
diff --git a/test/tint/builtins/gen/var/max/34956e.wgsl b/test/tint/builtins/gen/var/max/34956e.wgsl
index ce58c35..45e40bc 100644
--- a/test/tint/builtins/gen/var/max/34956e.wgsl
+++ b/test/tint/builtins/gen/var/max/34956e.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<f16>(1.h);
   var res: vec2<f16> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.dxc.hlsl
index b634c66..d51d61b 100644
--- a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_34956e() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = max(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.fxc.hlsl
index ecc7eec..6b2d850 100644
--- a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_34956e() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = max(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.glsl
index dfad11c..0becf92 100644
--- a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void max_34956e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void max_34956e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void max_34956e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.msl b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.msl
index 506f094..5febc66 100644
--- a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_34956e() {
+void max_34956e(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 res = fmax(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_34956e();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  max_34956e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_34956e();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  max_34956e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_34956e();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  max_34956e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.spvasm
index 3702f75..cb10b5f 100644
--- a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_34956e "max_34956e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_34956e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2half %arg_0
-         %24 = OpLoad %v2half %arg_1
-         %21 = OpExtInst %v2half %22 NMax %23 %24
-               OpStore %res %21
+ %max_34956e = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2half %arg_0
+         %27 = OpLoad %v2half %arg_1
+         %24 = OpExtInst %v2half %25 NMax %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %33 = OpLoad %v2half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_34956e
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_34956e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_34956e
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %max_34956e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_34956e
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %max_34956e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.wgsl
index 3499673..35df4cc 100644
--- a/test/tint/builtins/gen/var/max/34956e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/34956e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<f16>(1.0h);
   var res : vec2<f16> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_34956e();
diff --git a/test/tint/builtins/gen/var/max/445169.wgsl b/test/tint/builtins/gen/var/max/445169.wgsl
index 34b6472..d89e94a 100644
--- a/test/tint/builtins/gen/var/max/445169.wgsl
+++ b/test/tint/builtins/gen/var/max/445169.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: vec3<f16> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/445169.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/445169.wgsl.expected.dxc.hlsl
index ca512f4..688a2b9 100644
--- a/test/tint/builtins/gen/var/max/445169.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/445169.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_445169() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = max(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/445169.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/445169.wgsl.expected.fxc.hlsl
index 6ff78e8..fda1a4d 100644
--- a/test/tint/builtins/gen/var/max/445169.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/445169.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_445169() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = max(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/445169.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/445169.wgsl.expected.glsl
index 58502c4..00544cc 100644
--- a/test/tint/builtins/gen/var/max/445169.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/445169.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void max_445169() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void max_445169() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void max_445169() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/445169.wgsl.expected.msl b/test/tint/builtins/gen/var/max/445169.wgsl.expected.msl
index 2f8144d..18eca55 100644
--- a/test/tint/builtins/gen/var/max/445169.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/445169.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_445169() {
+void max_445169(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 res = fmax(arg_0, arg_1);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_445169();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  max_445169(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_445169();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  max_445169(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_445169();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  max_445169(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/445169.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/445169.wgsl.expected.spvasm
index 6c31171..483df9a 100644
--- a/test/tint/builtins/gen/var/max/445169.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/445169.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_445169 "max_445169"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_445169 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3half %arg_0
-         %24 = OpLoad %v3half %arg_1
-         %21 = OpExtInst %v3half %22 NMax %23 %24
-               OpStore %res %21
+ %max_445169 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3half %arg_0
+         %27 = OpLoad %v3half %arg_1
+         %24 = OpExtInst %v3half %25 NMax %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %33 = OpLoad %v3half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_445169
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_445169
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_445169
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %max_445169
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_445169
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %max_445169
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/445169.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/445169.wgsl.expected.wgsl
index 56f7d93..7107787 100644
--- a/test/tint/builtins/gen/var/max/445169.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/445169.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : vec3<f16> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_445169();
diff --git a/test/tint/builtins/gen/var/max/44a39d.wgsl b/test/tint/builtins/gen/var/max/44a39d.wgsl
index 6b09e76..b5bd60e 100644
--- a/test/tint/builtins/gen/var/max/44a39d.wgsl
+++ b/test/tint/builtins/gen/var/max/44a39d.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1.f;
   var arg_1 = 1.f;
   var res: f32 = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.dxc.hlsl
index 4435435..cd9dbc7 100644
--- a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_44a39d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = max(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.fxc.hlsl
index 4435435..cd9dbc7 100644
--- a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_44a39d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = max(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.glsl
index aff772a..dcb979b 100644
--- a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void max_44a39d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void max_44a39d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void max_44a39d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.msl b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.msl
index da0146b..9b8c205 100644
--- a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_44a39d() {
+void max_44a39d(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = fmax(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_44a39d();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  max_44a39d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_44a39d();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  max_44a39d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_44a39d();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  max_44a39d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.spvasm
index d075c28..f19579c 100644
--- a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_44a39d "max_44a39d"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,43 +38,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpTypeFunction %v4float
- %max_44a39d = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
+ %max_44a39d = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
-         %19 = OpLoad %float %arg_0
-         %20 = OpLoad %float %arg_1
-         %17 = OpExtInst %float %18 NMax %19 %20
-               OpStore %res %17
+         %22 = OpLoad %float %arg_0
+         %23 = OpLoad %float %arg_1
+         %20 = OpExtInst %float %21 NMax %22 %23
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %max_44a39d
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %max_44a39d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %max_44a39d
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %max_44a39d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %max_44a39d
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %max_44a39d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.wgsl
index f0ff168..d753b15 100644
--- a/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/44a39d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1.0f;
   var arg_1 = 1.0f;
   var res : f32 = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_44a39d();
diff --git a/test/tint/builtins/gen/var/max/453e04.wgsl b/test/tint/builtins/gen/var/max/453e04.wgsl
index f25c9e3..cbb5407 100644
--- a/test/tint/builtins/gen/var/max/453e04.wgsl
+++ b/test/tint/builtins/gen/var/max/453e04.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<u32>(1u);
   var arg_1 = vec4<u32>(1u);
   var res: vec4<u32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.dxc.hlsl
index 70b7cb4..a6c6558 100644
--- a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_453e04() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint4 res = max(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.fxc.hlsl
index 70b7cb4..a6c6558 100644
--- a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_453e04() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint4 res = max(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.glsl
index 8345f5c..ed88cac 100644
--- a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void max_453e04() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void max_453e04() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void max_453e04() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.msl b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.msl
index bd9f1ce..c82a341 100644
--- a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_453e04() {
+void max_453e04(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 arg_1 = uint4(1u);
   uint4 res = max(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_453e04();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  max_453e04(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_453e04();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  max_453e04(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_453e04();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  max_453e04(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.spvasm
index 6a27d30..4f84945 100644
--- a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_453e04 "max_453e04"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_453e04 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4uint Function %19
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4uint %arg_0
-         %24 = OpLoad %v4uint %arg_1
-         %21 = OpExtInst %v4uint %22 UMax %23 %24
-               OpStore %res %21
+ %max_453e04 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4uint Function %22
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4uint %arg_0
+         %27 = OpLoad %v4uint %arg_1
+         %24 = OpExtInst %v4uint %25 UMax %26 %27
+               OpStore %res %24
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %32 = OpLoad %v4uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_453e04
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_453e04
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_453e04
+%fragment_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %max_453e04
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_453e04
+%compute_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %max_453e04
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.wgsl
index ce4a47c..f7d03ee 100644
--- a/test/tint/builtins/gen/var/max/453e04.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/453e04.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<u32>(1u);
   var arg_1 = vec4<u32>(1u);
   var res : vec4<u32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_453e04();
diff --git a/test/tint/builtins/gen/var/max/462050.wgsl b/test/tint/builtins/gen/var/max/462050.wgsl
index 9345d44..a800d5d 100644
--- a/test/tint/builtins/gen/var/max/462050.wgsl
+++ b/test/tint/builtins/gen/var/max/462050.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<f32>(1.f);
   var res: vec2<f32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/462050.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/462050.wgsl.expected.dxc.hlsl
index 74aa9e8..5b582da 100644
--- a/test/tint/builtins/gen/var/max/462050.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/462050.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_462050() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = max(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/462050.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/462050.wgsl.expected.fxc.hlsl
index 74aa9e8..5b582da 100644
--- a/test/tint/builtins/gen/var/max/462050.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/462050.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_462050() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = max(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/462050.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/462050.wgsl.expected.glsl
index 627f0c9..241d0fd 100644
--- a/test/tint/builtins/gen/var/max/462050.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/462050.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void max_462050() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void max_462050() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void max_462050() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/462050.wgsl.expected.msl b/test/tint/builtins/gen/var/max/462050.wgsl.expected.msl
index 77fd1ac..ec06a11 100644
--- a/test/tint/builtins/gen/var/max/462050.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/462050.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_462050() {
+void max_462050(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 res = fmax(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_462050();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  max_462050(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_462050();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  max_462050(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_462050();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  max_462050(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/462050.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/462050.wgsl.expected.spvasm
index 7a9ff56..5ef6cd2 100644
--- a/test/tint/builtins/gen/var/max/462050.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/462050.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_462050 "max_462050"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
- %max_462050 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v2float %arg_0
-         %23 = OpLoad %v2float %arg_1
-         %20 = OpExtInst %v2float %21 NMax %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %33 = OpTypeFunction %v4float
+ %max_462050 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v2float %arg_0
+         %26 = OpLoad %v2float %arg_1
+         %23 = OpExtInst %v2float %24 NMax %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %32 = OpLoad %v2float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %max_462050
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_462050
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %max_462050
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %max_462050
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %max_462050
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %max_462050
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/462050.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/462050.wgsl.expected.wgsl
index 28b3e0d..ec8f544 100644
--- a/test/tint/builtins/gen/var/max/462050.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/462050.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<f32>(1.0f);
   var res : vec2<f32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_462050();
diff --git a/test/tint/builtins/gen/var/max/482d23.wgsl b/test/tint/builtins/gen/var/max/482d23.wgsl
index e5506ea..2d56f40 100644
--- a/test/tint/builtins/gen/var/max/482d23.wgsl
+++ b/test/tint/builtins/gen/var/max/482d23.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1);
   var res = max(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_482d23();
diff --git a/test/tint/builtins/gen/var/max/4883ac.wgsl b/test/tint/builtins/gen/var/max/4883ac.wgsl
index b83adc0..4e7af8b 100644
--- a/test/tint/builtins/gen/var/max/4883ac.wgsl
+++ b/test/tint/builtins/gen/var/max/4883ac.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: vec3<f32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.dxc.hlsl
index ee0df6b..066b03f 100644
--- a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_4883ac() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = max(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.fxc.hlsl
index ee0df6b..066b03f 100644
--- a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_4883ac() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = max(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.glsl
index 0821605..48c0e84 100644
--- a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void max_4883ac() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void max_4883ac() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void max_4883ac() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.msl b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.msl
index 28df7d6..df6481f 100644
--- a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_4883ac() {
+void max_4883ac(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 res = fmax(arg_0, arg_1);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_4883ac();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  max_4883ac(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_4883ac();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  max_4883ac(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_4883ac();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  max_4883ac(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.spvasm
index 3c32bd9..d3117cd 100644
--- a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_4883ac "max_4883ac"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %25 = OpTypeFunction %v4float
- %max_4883ac = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v3float %arg_0
-         %23 = OpLoad %v3float %arg_1
-         %20 = OpExtInst %v3float %21 NMax %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %33 = OpTypeFunction %v4float
+ %max_4883ac = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v3float %arg_0
+         %26 = OpLoad %v3float %arg_1
+         %23 = OpExtInst %v3float %24 NMax %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %32 = OpLoad %v3float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %max_4883ac
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_4883ac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %max_4883ac
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %max_4883ac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %max_4883ac
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %max_4883ac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.wgsl
index 4da24d3..3e4e172 100644
--- a/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/4883ac.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : vec3<f32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_4883ac();
diff --git a/test/tint/builtins/gen/var/max/4bbff2.wgsl b/test/tint/builtins/gen/var/max/4bbff2.wgsl
index e5f8e1b..ba08cdb 100644
--- a/test/tint/builtins/gen/var/max/4bbff2.wgsl
+++ b/test/tint/builtins/gen/var/max/4bbff2.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1.);
   var res = max(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_4bbff2();
diff --git a/test/tint/builtins/gen/var/max/85e6bc.wgsl b/test/tint/builtins/gen/var/max/85e6bc.wgsl
index 46cee3e..4e57e93 100644
--- a/test/tint/builtins/gen/var/max/85e6bc.wgsl
+++ b/test/tint/builtins/gen/var/max/85e6bc.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<i32>(1i);
   var arg_1 = vec4<i32>(1i);
   var res: vec4<i32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.dxc.hlsl
index 51e9ac4..482c3a3 100644
--- a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_85e6bc() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   int4 res = max(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.fxc.hlsl
index 51e9ac4..482c3a3 100644
--- a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_85e6bc() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   int4 res = max(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.glsl
index cf4d0af..1a10d09 100644
--- a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void max_85e6bc() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void max_85e6bc() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void max_85e6bc() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.msl b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.msl
index 77d28f2..96ac82d 100644
--- a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_85e6bc() {
+void max_85e6bc(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 arg_1 = int4(1);
   int4 res = max(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_85e6bc();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  max_85e6bc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_85e6bc();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  max_85e6bc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_85e6bc();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  max_85e6bc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.spvasm
index 09be5c6..4e53c74 100644
--- a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_85e6bc "max_85e6bc"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_85e6bc = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %19
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4int %arg_0
-         %24 = OpLoad %v4int %arg_1
-         %21 = OpExtInst %v4int %22 SMax %23 %24
-               OpStore %res %21
+ %max_85e6bc = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %22
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4int %arg_0
+         %27 = OpLoad %v4int %arg_1
+         %24 = OpExtInst %v4int %25 SMax %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %33 = OpLoad %v4int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_85e6bc
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_85e6bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_85e6bc
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %max_85e6bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_85e6bc
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %max_85e6bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.wgsl
index b7948b5..0616245 100644
--- a/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/85e6bc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<i32>(1i);
   var arg_1 = vec4<i32>(1i);
   var res : vec4<i32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_85e6bc();
diff --git a/test/tint/builtins/gen/var/max/a1b196.wgsl b/test/tint/builtins/gen/var/max/a1b196.wgsl
index 05996a9..3d40fec 100644
--- a/test/tint/builtins/gen/var/max/a1b196.wgsl
+++ b/test/tint/builtins/gen/var/max/a1b196.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = max(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_a1b196();
diff --git a/test/tint/builtins/gen/var/max/a93419.wgsl b/test/tint/builtins/gen/var/max/a93419.wgsl
index 2f72d7a..925c8d8 100644
--- a/test/tint/builtins/gen/var/max/a93419.wgsl
+++ b/test/tint/builtins/gen/var/max/a93419.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<f32>(1.f);
   var res: vec4<f32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.dxc.hlsl
index 69e83f6..00160ad 100644
--- a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_a93419() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = max(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.fxc.hlsl
index 69e83f6..00160ad 100644
--- a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_a93419() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = max(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.glsl
index 3f2450c..6202bde 100644
--- a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void max_a93419() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void max_a93419() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void max_a93419() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.msl b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.msl
index 6a04eaf..35c8578 100644
--- a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_a93419() {
+void max_a93419(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 res = fmax(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_a93419();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  max_a93419(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_a93419();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  max_a93419(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_a93419();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  max_a93419(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.spvasm
index f70b7bd..cd0f85a 100644
--- a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_a93419 "max_a93419"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,44 +38,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpTypeFunction %v4float
- %max_a93419 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
+ %max_a93419 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-         %20 = OpLoad %v4float %arg_0
-         %21 = OpLoad %v4float %arg_1
-         %18 = OpExtInst %v4float %19 NMax %20 %21
-               OpStore %res %18
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+         %23 = OpLoad %v4float %arg_0
+         %24 = OpLoad %v4float %arg_1
+         %21 = OpExtInst %v4float %22 NMax %23 %24
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %max_a93419
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %max_a93419
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %max_a93419
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %max_a93419
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %max_a93419
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %max_a93419
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.wgsl
index 7ae8a6d..9a2b6df 100644
--- a/test/tint/builtins/gen/var/max/a93419.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/a93419.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<f32>(1.0f);
   var res : vec4<f32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_a93419();
diff --git a/test/tint/builtins/gen/var/max/b1b73a.wgsl b/test/tint/builtins/gen/var/max/b1b73a.wgsl
index e806a90..c5026cd 100644
--- a/test/tint/builtins/gen/var/max/b1b73a.wgsl
+++ b/test/tint/builtins/gen/var/max/b1b73a.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<u32>(1u);
   var arg_1 = vec3<u32>(1u);
   var res: vec3<u32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.dxc.hlsl
index 1469748..9bb48d8 100644
--- a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_b1b73a() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint3 res = max(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.fxc.hlsl
index 1469748..9bb48d8 100644
--- a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_b1b73a() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint3 res = max(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.glsl
index 2e42313..2516a41 100644
--- a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void max_b1b73a() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void max_b1b73a() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void max_b1b73a() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.msl b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.msl
index d26d86e..6075943 100644
--- a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_b1b73a() {
+void max_b1b73a(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 arg_1 = uint3(1u);
   uint3 res = max(arg_0, arg_1);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_b1b73a();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  max_b1b73a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_b1b73a();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  max_b1b73a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_b1b73a();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  max_b1b73a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.spvasm
index 9c16755..df47397 100644
--- a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_b1b73a "max_b1b73a"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_b1b73a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %19
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3uint %arg_0
-         %24 = OpLoad %v3uint %arg_1
-         %21 = OpExtInst %v3uint %22 UMax %23 %24
-               OpStore %res %21
+ %max_b1b73a = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3uint %arg_0
+         %27 = OpLoad %v3uint %arg_1
+         %24 = OpExtInst %v3uint %25 UMax %26 %27
+               OpStore %res %24
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %32 = OpLoad %v3uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_b1b73a
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %max_b1b73a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_b1b73a
+%fragment_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %max_b1b73a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_b1b73a
+%compute_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %max_b1b73a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.wgsl
index 8585dbe..42ec5a9 100644
--- a/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/b1b73a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<u32>(1u);
   var arg_1 = vec3<u32>(1u);
   var res : vec3<u32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_b1b73a();
diff --git a/test/tint/builtins/gen/var/max/c023dd.wgsl b/test/tint/builtins/gen/var/max/c023dd.wgsl
index bc2a6ae..12c9454 100644
--- a/test/tint/builtins/gen/var/max/c023dd.wgsl
+++ b/test/tint/builtins/gen/var/max/c023dd.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1.;
   var res = max(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_c023dd();
diff --git a/test/tint/builtins/gen/var/max/caa3d7.wgsl b/test/tint/builtins/gen/var/max/caa3d7.wgsl
index 64c69a6..fd56f57 100644
--- a/test/tint/builtins/gen/var/max/caa3d7.wgsl
+++ b/test/tint/builtins/gen/var/max/caa3d7.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1;
   var res = max(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_caa3d7();
diff --git a/test/tint/builtins/gen/var/max/ce7c30.wgsl b/test/tint/builtins/gen/var/max/ce7c30.wgsl
index 3590105..81dde62 100644
--- a/test/tint/builtins/gen/var/max/ce7c30.wgsl
+++ b/test/tint/builtins/gen/var/max/ce7c30.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1i;
   var arg_1 = 1i;
   var res: i32 = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.dxc.hlsl
index 532d8ac..f5ae04a 100644
--- a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_ce7c30() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = max(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.fxc.hlsl
index 532d8ac..f5ae04a 100644
--- a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_ce7c30() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = max(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.glsl
index fde5bcf..88df4d5 100644
--- a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void max_ce7c30() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void max_ce7c30() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void max_ce7c30() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.msl b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.msl
index 1f01f8a0..7797245 100644
--- a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_ce7c30() {
+void max_ce7c30(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = max(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_ce7c30();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  max_ce7c30(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_ce7c30();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  max_ce7c30(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_ce7c30();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  max_ce7c30(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.spvasm
index faeb02c..5ee0af9 100644
--- a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_ce7c30 "max_ce7c30"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_ce7c30 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %17
-      %arg_1 = OpVariable %_ptr_Function_int Function %17
-        %res = OpVariable %_ptr_Function_int Function %17
+ %max_ce7c30 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %20
+      %arg_1 = OpVariable %_ptr_Function_int Function %20
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %arg_0 %int_1
                OpStore %arg_1 %int_1
-         %21 = OpLoad %int %arg_0
-         %22 = OpLoad %int %arg_1
-         %19 = OpExtInst %int %20 SMax %21 %22
-               OpStore %res %19
+         %24 = OpLoad %int %arg_0
+         %25 = OpLoad %int %arg_1
+         %22 = OpExtInst %int %23 SMax %24 %25
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %31 = OpLoad %int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %max_ce7c30
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %max_ce7c30
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %max_ce7c30
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %max_ce7c30
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %max_ce7c30
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %max_ce7c30
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.wgsl
index 900c6ea..37e09c2 100644
--- a/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/ce7c30.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1i;
   var arg_1 = 1i;
   var res : i32 = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_ce7c30();
diff --git a/test/tint/builtins/gen/var/max/de6b87.wgsl b/test/tint/builtins/gen/var/max/de6b87.wgsl
index cd6ef7a..8875729 100644
--- a/test/tint/builtins/gen/var/max/de6b87.wgsl
+++ b/test/tint/builtins/gen/var/max/de6b87.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1.);
   var res = max(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_de6b87();
diff --git a/test/tint/builtins/gen/var/max/e14f2b.wgsl b/test/tint/builtins/gen/var/max/e14f2b.wgsl
index c714541..b551445 100644
--- a/test/tint/builtins/gen/var/max/e14f2b.wgsl
+++ b/test/tint/builtins/gen/var/max/e14f2b.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<f16>(1.h);
   var res: vec4<f16> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.dxc.hlsl
index f2e6da2..0e41ff8 100644
--- a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_e14f2b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = max(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.fxc.hlsl
index 7922c1c..0a90709 100644
--- a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_e14f2b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = max(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.glsl
index 36d4e06..af6ad58 100644
--- a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void max_e14f2b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void max_e14f2b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void max_e14f2b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.msl b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.msl
index 919b3f9..5a9d243 100644
--- a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_e14f2b() {
+void max_e14f2b(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 res = fmax(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_e14f2b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  max_e14f2b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_e14f2b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  max_e14f2b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_e14f2b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  max_e14f2b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.spvasm
index 11eb171..4f07534 100644
--- a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_e14f2b "max_e14f2b"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_e14f2b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4half %arg_0
-         %24 = OpLoad %v4half %arg_1
-         %21 = OpExtInst %v4half %22 NMax %23 %24
-               OpStore %res %21
+ %max_e14f2b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4half %arg_0
+         %27 = OpLoad %v4half %arg_1
+         %24 = OpExtInst %v4half %25 NMax %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %33 = OpLoad %v4half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_e14f2b
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_e14f2b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_e14f2b
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %max_e14f2b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_e14f2b
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %max_e14f2b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.wgsl
index 7473f10..16b8d1b 100644
--- a/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/e14f2b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<f16>(1.0h);
   var res : vec4<f16> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_e14f2b();
diff --git a/test/tint/builtins/gen/var/max/e8192f.wgsl b/test/tint/builtins/gen/var/max/e8192f.wgsl
index 68ea3b3..6173b34 100644
--- a/test/tint/builtins/gen/var/max/e8192f.wgsl
+++ b/test/tint/builtins/gen/var/max/e8192f.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<i32>(1i);
   var arg_1 = vec2<i32>(1i);
   var res: vec2<i32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.dxc.hlsl
index e773f17..58742a4 100644
--- a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_e8192f() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   int2 res = max(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.fxc.hlsl
index e773f17..58742a4 100644
--- a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void max_e8192f() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   int2 res = max(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.glsl b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.glsl
index a25ec00..c9b4a23 100644
--- a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void max_e8192f() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void max_e8192f() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void max_e8192f() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 res = max(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.msl b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.msl
index 91e431b..d9d319a 100644
--- a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void max_e8192f() {
+void max_e8192f(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 arg_1 = int2(1);
   int2 res = max(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  max_e8192f();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  max_e8192f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  max_e8192f();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  max_e8192f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  max_e8192f();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  max_e8192f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.spvasm
index de054b1..c563e20 100644
--- a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %max_e8192f "max_e8192f"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %max_e8192f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %19
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2int %arg_0
-         %24 = OpLoad %v2int %arg_1
-         %21 = OpExtInst %v2int %22 SMax %23 %24
-               OpStore %res %21
+ %max_e8192f = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2int %arg_0
+         %27 = OpLoad %v2int %arg_1
+         %24 = OpExtInst %v2int %25 SMax %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %33 = OpLoad %v2int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %max_e8192f
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %max_e8192f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %max_e8192f
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %max_e8192f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %max_e8192f
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %max_e8192f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.wgsl
index 9798a03..34f2568 100644
--- a/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/max/e8192f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<i32>(1i);
   var arg_1 = vec2<i32>(1i);
   var res : vec2<i32> = max(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   max_e8192f();
diff --git a/test/tint/builtins/gen/var/min/03c7e3.wgsl b/test/tint/builtins/gen/var/min/03c7e3.wgsl
index 778a837..5c66813 100644
--- a/test/tint/builtins/gen/var/min/03c7e3.wgsl
+++ b/test/tint/builtins/gen/var/min/03c7e3.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<i32>(1i);
   var arg_1 = vec2<i32>(1i);
   var res: vec2<i32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.dxc.hlsl
index 3e1a788..07eccc3 100644
--- a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_03c7e3() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   int2 res = min(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.fxc.hlsl
index 3e1a788..07eccc3 100644
--- a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_03c7e3() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   int2 res = min(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.glsl
index 89c4419..6767d44 100644
--- a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void min_03c7e3() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void min_03c7e3() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void min_03c7e3() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   ivec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.msl b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.msl
index f5fd9d7..0b4cb9a 100644
--- a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_03c7e3() {
+void min_03c7e3(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 arg_1 = int2(1);
   int2 res = min(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_03c7e3();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  min_03c7e3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_03c7e3();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  min_03c7e3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_03c7e3();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  min_03c7e3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.spvasm
index c78e2ba..19bbb23 100644
--- a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_03c7e3 "min_03c7e3"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_03c7e3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %19
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2int %arg_0
-         %24 = OpLoad %v2int %arg_1
-         %21 = OpExtInst %v2int %22 SMin %23 %24
-               OpStore %res %21
+ %min_03c7e3 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2int %arg_0
+         %27 = OpLoad %v2int %arg_1
+         %24 = OpExtInst %v2int %25 SMin %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %33 = OpLoad %v2int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_03c7e3
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_03c7e3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_03c7e3
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %min_03c7e3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_03c7e3
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %min_03c7e3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.wgsl
index 166ff30..9d0c94a 100644
--- a/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/03c7e3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<i32>(1i);
   var arg_1 = vec2<i32>(1i);
   var res : vec2<i32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_03c7e3();
diff --git a/test/tint/builtins/gen/var/min/0dc614.wgsl b/test/tint/builtins/gen/var/min/0dc614.wgsl
index 2b190eb..59eb911 100644
--- a/test/tint/builtins/gen/var/min/0dc614.wgsl
+++ b/test/tint/builtins/gen/var/min/0dc614.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<u32>(1u);
   var arg_1 = vec4<u32>(1u);
   var res: vec4<u32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.dxc.hlsl
index 4c2b0bc..5905271 100644
--- a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_0dc614() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint4 res = min(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.fxc.hlsl
index 4c2b0bc..5905271 100644
--- a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_0dc614() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   uint4 res = min(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.glsl
index d866fed..12f2b1b 100644
--- a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void min_0dc614() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void min_0dc614() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void min_0dc614() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   uvec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.msl b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.msl
index 9bd62b1..4de334d 100644
--- a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_0dc614() {
+void min_0dc614(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 arg_1 = uint4(1u);
   uint4 res = min(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_0dc614();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  min_0dc614(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_0dc614();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  min_0dc614(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_0dc614();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  min_0dc614(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.spvasm
index 1d33b5d..218712a 100644
--- a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_0dc614 "min_0dc614"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_0dc614 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4uint Function %19
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4uint %arg_0
-         %24 = OpLoad %v4uint %arg_1
-         %21 = OpExtInst %v4uint %22 UMin %23 %24
-               OpStore %res %21
+ %min_0dc614 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4uint Function %22
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4uint %arg_0
+         %27 = OpLoad %v4uint %arg_1
+         %24 = OpExtInst %v4uint %25 UMin %26 %27
+               OpStore %res %24
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %32 = OpLoad %v4uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_0dc614
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_0dc614
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_0dc614
+%fragment_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %min_0dc614
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_0dc614
+%compute_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %min_0dc614
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.wgsl
index 7709177..a9a5c75c 100644
--- a/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/0dc614.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<u32>(1u);
   var arg_1 = vec4<u32>(1u);
   var res : vec4<u32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_0dc614();
diff --git a/test/tint/builtins/gen/var/min/364910.wgsl b/test/tint/builtins/gen/var/min/364910.wgsl
index caf7f17..f9fe75c 100644
--- a/test/tint/builtins/gen/var/min/364910.wgsl
+++ b/test/tint/builtins/gen/var/min/364910.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = min(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_364910();
diff --git a/test/tint/builtins/gen/var/min/371bd6.wgsl b/test/tint/builtins/gen/var/min/371bd6.wgsl
index 8868084..8220d6e 100644
--- a/test/tint/builtins/gen/var/min/371bd6.wgsl
+++ b/test/tint/builtins/gen/var/min/371bd6.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1);
   var res = min(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_371bd6();
diff --git a/test/tint/builtins/gen/var/min/3941e1.wgsl b/test/tint/builtins/gen/var/min/3941e1.wgsl
index 7958101..9390fae 100644
--- a/test/tint/builtins/gen/var/min/3941e1.wgsl
+++ b/test/tint/builtins/gen/var/min/3941e1.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<i32>(1i);
   var arg_1 = vec4<i32>(1i);
   var res: vec4<i32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.dxc.hlsl
index 3b6cb18..624055e 100644
--- a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_3941e1() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   int4 res = min(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.fxc.hlsl
index 3b6cb18..624055e 100644
--- a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_3941e1() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   int4 res = min(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.glsl
index 0e2fa7b..c41c255 100644
--- a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void min_3941e1() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void min_3941e1() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void min_3941e1() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   ivec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.msl b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.msl
index 3bf044d..258ae98 100644
--- a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_3941e1() {
+void min_3941e1(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 arg_1 = int4(1);
   int4 res = min(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_3941e1();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  min_3941e1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_3941e1();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  min_3941e1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_3941e1();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  min_3941e1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.spvasm
index 3cea99c..848ae7e 100644
--- a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_3941e1 "min_3941e1"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_3941e1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %19
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4int %arg_0
-         %24 = OpLoad %v4int %arg_1
-         %21 = OpExtInst %v4int %22 SMin %23 %24
-               OpStore %res %21
+ %min_3941e1 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %22
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4int %arg_0
+         %27 = OpLoad %v4int %arg_1
+         %24 = OpExtInst %v4int %25 SMin %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %33 = OpLoad %v4int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_3941e1
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_3941e1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_3941e1
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %min_3941e1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_3941e1
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %min_3941e1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.wgsl
index 112a2b7..89d2baf 100644
--- a/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/3941e1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<i32>(1i);
   var arg_1 = vec4<i32>(1i);
   var res : vec4<i32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_3941e1();
diff --git a/test/tint/builtins/gen/var/min/46c5d3.wgsl b/test/tint/builtins/gen/var/min/46c5d3.wgsl
index 820ce72..aec6ff2 100644
--- a/test/tint/builtins/gen/var/min/46c5d3.wgsl
+++ b/test/tint/builtins/gen/var/min/46c5d3.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1u;
   var arg_1 = 1u;
   var res: u32 = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.dxc.hlsl
index 68dfb8e..29fa25a 100644
--- a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_46c5d3() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = min(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.fxc.hlsl
index 68dfb8e..29fa25a 100644
--- a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_46c5d3() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = min(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.glsl
index d2cce51..d9f166c 100644
--- a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void min_46c5d3() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void min_46c5d3() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void min_46c5d3() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.msl b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.msl
index a66228b..ab1ce56 100644
--- a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_46c5d3() {
+void min_46c5d3(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   uint res = min(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_46c5d3();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  min_46c5d3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_46c5d3();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  min_46c5d3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_46c5d3();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  min_46c5d3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.spvasm
index f68a728..d45dfdd 100644
--- a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_46c5d3 "min_46c5d3"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_46c5d3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-      %arg_1 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+ %min_46c5d3 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+      %arg_1 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
                OpStore %arg_1 %uint_1
-         %21 = OpLoad %uint %arg_0
-         %22 = OpLoad %uint %arg_1
-         %19 = OpExtInst %uint %20 UMin %21 %22
-               OpStore %res %19
+         %24 = OpLoad %uint %arg_0
+         %25 = OpLoad %uint %arg_1
+         %22 = OpExtInst %uint %23 UMin %24 %25
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %min_46c5d3
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %min_46c5d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %min_46c5d3
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %min_46c5d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %min_46c5d3
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %min_46c5d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.wgsl
index 8c3630f..4654331 100644
--- a/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/46c5d3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1u;
   var arg_1 = 1u;
   var res : u32 = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_46c5d3();
diff --git a/test/tint/builtins/gen/var/min/527b79.wgsl b/test/tint/builtins/gen/var/min/527b79.wgsl
index 8fe5e13..bbd4741 100644
--- a/test/tint/builtins/gen/var/min/527b79.wgsl
+++ b/test/tint/builtins/gen/var/min/527b79.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1);
   var res = min(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_527b79();
diff --git a/test/tint/builtins/gen/var/min/717257.wgsl b/test/tint/builtins/gen/var/min/717257.wgsl
index 957807b..8518d6f 100644
--- a/test/tint/builtins/gen/var/min/717257.wgsl
+++ b/test/tint/builtins/gen/var/min/717257.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1.);
   var res = min(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_717257();
diff --git a/test/tint/builtins/gen/var/min/794711.wgsl b/test/tint/builtins/gen/var/min/794711.wgsl
index 1ae2f1c..29fad63 100644
--- a/test/tint/builtins/gen/var/min/794711.wgsl
+++ b/test/tint/builtins/gen/var/min/794711.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1.;
   var res = min(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_794711();
diff --git a/test/tint/builtins/gen/var/min/7c710a.wgsl b/test/tint/builtins/gen/var/min/7c710a.wgsl
index b99bb84..7952718 100644
--- a/test/tint/builtins/gen/var/min/7c710a.wgsl
+++ b/test/tint/builtins/gen/var/min/7c710a.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<f16>(1.h);
   var res: vec4<f16> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.dxc.hlsl
index e47cb43..403db2b 100644
--- a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_7c710a() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = min(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.fxc.hlsl
index e473753..cb3b27b 100644
--- a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_7c710a() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = min(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.glsl
index 16d0a50..baf94ae 100644
--- a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void min_7c710a() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void min_7c710a() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void min_7c710a() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.msl b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.msl
index ccf9f90..406139d 100644
--- a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_7c710a() {
+void min_7c710a(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 res = fmin(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_7c710a();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  min_7c710a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_7c710a();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  min_7c710a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_7c710a();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  min_7c710a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.spvasm
index e17e61a..a565f95 100644
--- a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_7c710a "min_7c710a"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_7c710a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4half %arg_0
-         %24 = OpLoad %v4half %arg_1
-         %21 = OpExtInst %v4half %22 NMin %23 %24
-               OpStore %res %21
+ %min_7c710a = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4half %arg_0
+         %27 = OpLoad %v4half %arg_1
+         %24 = OpExtInst %v4half %25 NMin %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %33 = OpLoad %v4half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_7c710a
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_7c710a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_7c710a
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %min_7c710a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_7c710a
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %min_7c710a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.wgsl
index 4250314..19203ad 100644
--- a/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/7c710a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<f16>(1.0h);
   var res : vec4<f16> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_7c710a();
diff --git a/test/tint/builtins/gen/var/min/82b28f.wgsl b/test/tint/builtins/gen/var/min/82b28f.wgsl
index 57ea797..1d75ac0 100644
--- a/test/tint/builtins/gen/var/min/82b28f.wgsl
+++ b/test/tint/builtins/gen/var/min/82b28f.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<u32>(1u);
   var arg_1 = vec2<u32>(1u);
   var res: vec2<u32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.dxc.hlsl
index 8d028e3..1424d4b 100644
--- a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_82b28f() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint2 res = min(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.fxc.hlsl
index 8d028e3..1424d4b 100644
--- a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_82b28f() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   uint2 res = min(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.glsl
index 49661cf..8f58a03 100644
--- a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void min_82b28f() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void min_82b28f() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void min_82b28f() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   uvec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.msl b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.msl
index 840a24e..b0b6939 100644
--- a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_82b28f() {
+void min_82b28f(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 arg_1 = uint2(1u);
   uint2 res = min(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_82b28f();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  min_82b28f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_82b28f();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  min_82b28f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_82b28f();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  min_82b28f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.spvasm
index 1515f3a..8fe64cb 100644
--- a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_82b28f "min_82b28f"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_82b28f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %19
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2uint %arg_0
-         %24 = OpLoad %v2uint %arg_1
-         %21 = OpExtInst %v2uint %22 UMin %23 %24
-               OpStore %res %21
+ %min_82b28f = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2uint %arg_0
+         %27 = OpLoad %v2uint %arg_1
+         %24 = OpExtInst %v2uint %25 UMin %26 %27
+               OpStore %res %24
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_82b28f
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_82b28f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_82b28f
+%fragment_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %min_82b28f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_82b28f
+%compute_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %min_82b28f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.wgsl
index f97e16b..eeb1eb4 100644
--- a/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/82b28f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<u32>(1u);
   var arg_1 = vec2<u32>(1u);
   var res : vec2<u32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_82b28f();
diff --git a/test/tint/builtins/gen/var/min/84c9fe.wgsl b/test/tint/builtins/gen/var/min/84c9fe.wgsl
index ad42d16..cdf9e4b 100644
--- a/test/tint/builtins/gen/var/min/84c9fe.wgsl
+++ b/test/tint/builtins/gen/var/min/84c9fe.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1;
   var res = min(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_84c9fe();
diff --git a/test/tint/builtins/gen/var/min/93cfc4.wgsl b/test/tint/builtins/gen/var/min/93cfc4.wgsl
index 9d485a6..b548c35 100644
--- a/test/tint/builtins/gen/var/min/93cfc4.wgsl
+++ b/test/tint/builtins/gen/var/min/93cfc4.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: vec3<f32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.dxc.hlsl
index a4c9d49..01e8d0f 100644
--- a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_93cfc4() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = min(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.fxc.hlsl
index a4c9d49..01e8d0f 100644
--- a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_93cfc4() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = min(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.glsl
index 93215e8..4dc79df 100644
--- a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void min_93cfc4() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void min_93cfc4() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void min_93cfc4() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.msl b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.msl
index 2504c4b..54ac475 100644
--- a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_93cfc4() {
+void min_93cfc4(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 res = fmin(arg_0, arg_1);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_93cfc4();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  min_93cfc4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_93cfc4();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  min_93cfc4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_93cfc4();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  min_93cfc4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.spvasm
index da67bad..fba26c5 100644
--- a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_93cfc4 "min_93cfc4"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %25 = OpTypeFunction %v4float
- %min_93cfc4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v3float %arg_0
-         %23 = OpLoad %v3float %arg_1
-         %20 = OpExtInst %v3float %21 NMin %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %33 = OpTypeFunction %v4float
+ %min_93cfc4 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v3float %arg_0
+         %26 = OpLoad %v3float %arg_1
+         %23 = OpExtInst %v3float %24 NMin %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %32 = OpLoad %v3float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %min_93cfc4
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_93cfc4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %min_93cfc4
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %min_93cfc4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %min_93cfc4
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %min_93cfc4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.wgsl
index b71c538..6601a48 100644
--- a/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/93cfc4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : vec3<f32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_93cfc4();
diff --git a/test/tint/builtins/gen/var/min/98e797.wgsl b/test/tint/builtins/gen/var/min/98e797.wgsl
index a1898ed..ca5a848 100644
--- a/test/tint/builtins/gen/var/min/98e797.wgsl
+++ b/test/tint/builtins/gen/var/min/98e797.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1.);
   var res = min(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_98e797();
diff --git a/test/tint/builtins/gen/var/min/a45171.wgsl b/test/tint/builtins/gen/var/min/a45171.wgsl
index 3d982c8..26f2951 100644
--- a/test/tint/builtins/gen/var/min/a45171.wgsl
+++ b/test/tint/builtins/gen/var/min/a45171.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<i32>(1i);
   var arg_1 = vec3<i32>(1i);
   var res: vec3<i32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.dxc.hlsl
index ceca011..bc82bda 100644
--- a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_a45171() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   int3 res = min(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.fxc.hlsl
index ceca011..bc82bda 100644
--- a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_a45171() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   int3 res = min(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.glsl
index 341b229..9fa2ece 100644
--- a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void min_a45171() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void min_a45171() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void min_a45171() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   ivec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.msl b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.msl
index 4a44fab..5085780 100644
--- a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_a45171() {
+void min_a45171(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 arg_1 = int3(1);
   int3 res = min(arg_0, arg_1);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_a45171();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  min_a45171(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_a45171();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  min_a45171(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_a45171();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  min_a45171(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.spvasm
index c21caef..aafa3fe 100644
--- a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_a45171 "min_a45171"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_a45171 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %19
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3int %arg_0
-         %24 = OpLoad %v3int %arg_1
-         %21 = OpExtInst %v3int %22 SMin %23 %24
-               OpStore %res %21
+ %min_a45171 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3int %arg_0
+         %27 = OpLoad %v3int %arg_1
+         %24 = OpExtInst %v3int %25 SMin %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %33 = OpLoad %v3int %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_a45171
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_a45171
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_a45171
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %min_a45171
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_a45171
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %min_a45171
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.wgsl
index a757288..65aa453 100644
--- a/test/tint/builtins/gen/var/min/a45171.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/a45171.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<i32>(1i);
   var arg_1 = vec3<i32>(1i);
   var res : vec3<i32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_a45171();
diff --git a/test/tint/builtins/gen/var/min/aa28ad.wgsl b/test/tint/builtins/gen/var/min/aa28ad.wgsl
index caabe4f..39d85b3 100644
--- a/test/tint/builtins/gen/var/min/aa28ad.wgsl
+++ b/test/tint/builtins/gen/var/min/aa28ad.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<f32>(1.f);
   var res: vec2<f32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.dxc.hlsl
index 44fe479..4749b06 100644
--- a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_aa28ad() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = min(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.fxc.hlsl
index 44fe479..4749b06 100644
--- a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_aa28ad() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = min(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.glsl
index 03446d0..5665232 100644
--- a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void min_aa28ad() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void min_aa28ad() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void min_aa28ad() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.msl b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.msl
index aed687e..17e2f91 100644
--- a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_aa28ad() {
+void min_aa28ad(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 res = fmin(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_aa28ad();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  min_aa28ad(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_aa28ad();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  min_aa28ad(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_aa28ad();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  min_aa28ad(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.spvasm
index 7fc4843..c2caf12 100644
--- a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_aa28ad "min_aa28ad"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
- %min_aa28ad = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v2float %arg_0
-         %23 = OpLoad %v2float %arg_1
-         %20 = OpExtInst %v2float %21 NMin %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %33 = OpTypeFunction %v4float
+ %min_aa28ad = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v2float %arg_0
+         %26 = OpLoad %v2float %arg_1
+         %23 = OpExtInst %v2float %24 NMin %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %32 = OpLoad %v2float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %min_aa28ad
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_aa28ad
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %min_aa28ad
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %min_aa28ad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %min_aa28ad
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %min_aa28ad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.wgsl
index 92baedc..86c7d98 100644
--- a/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/aa28ad.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<f32>(1.0f);
   var res : vec2<f32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_aa28ad();
diff --git a/test/tint/builtins/gen/var/min/ab0acd.wgsl b/test/tint/builtins/gen/var/min/ab0acd.wgsl
index 9c0c694..7d838dc 100644
--- a/test/tint/builtins/gen/var/min/ab0acd.wgsl
+++ b/test/tint/builtins/gen/var/min/ab0acd.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: vec3<f16> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.dxc.hlsl
index 75b3365..6f6ecea 100644
--- a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_ab0acd() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = min(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.fxc.hlsl
index 4e9158f..7cf0e2d 100644
--- a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_ab0acd() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = min(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.glsl
index 98f7650..d5481f9 100644
--- a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void min_ab0acd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void min_ab0acd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void min_ab0acd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.msl b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.msl
index 970eb0f..53dc3dd 100644
--- a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_ab0acd() {
+void min_ab0acd(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 res = fmin(arg_0, arg_1);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_ab0acd();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  min_ab0acd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_ab0acd();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  min_ab0acd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_ab0acd();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  min_ab0acd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.spvasm
index 497f917..ecee865 100644
--- a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_ab0acd "min_ab0acd"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_ab0acd = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3half %arg_0
-         %24 = OpLoad %v3half %arg_1
-         %21 = OpExtInst %v3half %22 NMin %23 %24
-               OpStore %res %21
+ %min_ab0acd = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3half %arg_0
+         %27 = OpLoad %v3half %arg_1
+         %24 = OpExtInst %v3half %25 NMin %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %33 = OpLoad %v3half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_ab0acd
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_ab0acd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_ab0acd
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %min_ab0acd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_ab0acd
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %min_ab0acd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.wgsl
index b0fb3b2..985fa97 100644
--- a/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/ab0acd.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : vec3<f16> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_ab0acd();
diff --git a/test/tint/builtins/gen/var/min/ac84d6.wgsl b/test/tint/builtins/gen/var/min/ac84d6.wgsl
index a81afe6..2b6fe6f 100644
--- a/test/tint/builtins/gen/var/min/ac84d6.wgsl
+++ b/test/tint/builtins/gen/var/min/ac84d6.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1.h;
   var arg_1 = 1.h;
   var res: f16 = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.dxc.hlsl
index 6d00fc3..4354c1d 100644
--- a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_ac84d6() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = min(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.fxc.hlsl
index ca86379..11ea9d7 100644
--- a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_ac84d6() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = min(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.glsl
index 4b92b8c..8c1b3df 100644
--- a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void min_ac84d6() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void min_ac84d6() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void min_ac84d6() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.msl b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.msl
index 264a507..1322af1 100644
--- a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_ac84d6() {
+void min_ac84d6(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half res = fmin(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_ac84d6();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  min_ac84d6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_ac84d6();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  min_ac84d6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_ac84d6();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  min_ac84d6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.spvasm
index 6d286e3..4121301 100644
--- a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_ac84d6 "min_ac84d6"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,46 +42,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_ac84d6 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %min_ac84d6 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
-         %21 = OpLoad %half %arg_0
-         %22 = OpLoad %half %arg_1
-         %19 = OpExtInst %half %20 NMin %21 %22
-               OpStore %res %19
+         %24 = OpLoad %half %arg_0
+         %25 = OpLoad %half %arg_1
+         %22 = OpExtInst %half %23 NMin %24 %25
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %min_ac84d6
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %min_ac84d6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %min_ac84d6
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %min_ac84d6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %min_ac84d6
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %min_ac84d6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.wgsl
index 9654ad3..a3ee76d 100644
--- a/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/ac84d6.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1.0h;
   var arg_1 = 1.0h;
   var res : f16 = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_ac84d6();
diff --git a/test/tint/builtins/gen/var/min/af326d.wgsl b/test/tint/builtins/gen/var/min/af326d.wgsl
index 0bff055..67ea9a0 100644
--- a/test/tint/builtins/gen/var/min/af326d.wgsl
+++ b/test/tint/builtins/gen/var/min/af326d.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1.f;
   var arg_1 = 1.f;
   var res: f32 = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.dxc.hlsl
index ea481e5..f74e379 100644
--- a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_af326d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = min(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.fxc.hlsl
index ea481e5..f74e379 100644
--- a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_af326d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = min(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.glsl
index 070d859..65edf9e 100644
--- a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void min_af326d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void min_af326d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void min_af326d() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.msl b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.msl
index f7b47f6..16deecc 100644
--- a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_af326d() {
+void min_af326d(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = fmin(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_af326d();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  min_af326d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_af326d();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  min_af326d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_af326d();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  min_af326d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.spvasm
index 70b60fe..fa7674a 100644
--- a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_af326d "min_af326d"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,43 +38,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpTypeFunction %v4float
- %min_af326d = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
+ %min_af326d = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
-         %19 = OpLoad %float %arg_0
-         %20 = OpLoad %float %arg_1
-         %17 = OpExtInst %float %18 NMin %19 %20
-               OpStore %res %17
+         %22 = OpLoad %float %arg_0
+         %23 = OpLoad %float %arg_1
+         %20 = OpExtInst %float %21 NMin %22 %23
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %min_af326d
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %min_af326d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %min_af326d
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %min_af326d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %min_af326d
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %min_af326d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.wgsl
index 02bc142..0079aa5 100644
--- a/test/tint/builtins/gen/var/min/af326d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/af326d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1.0f;
   var arg_1 = 1.0f;
   var res : f32 = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_af326d();
diff --git a/test/tint/builtins/gen/var/min/af364e.wgsl b/test/tint/builtins/gen/var/min/af364e.wgsl
index b29dea2..ba62038 100644
--- a/test/tint/builtins/gen/var/min/af364e.wgsl
+++ b/test/tint/builtins/gen/var/min/af364e.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1);
   var res = min(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_af364e();
diff --git a/test/tint/builtins/gen/var/min/c70bb7.wgsl b/test/tint/builtins/gen/var/min/c70bb7.wgsl
index aa2a34f..b11e301 100644
--- a/test/tint/builtins/gen/var/min/c70bb7.wgsl
+++ b/test/tint/builtins/gen/var/min/c70bb7.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<u32>(1u);
   var arg_1 = vec3<u32>(1u);
   var res: vec3<u32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.dxc.hlsl
index d0518f5..6d01cd1 100644
--- a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c70bb7() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint3 res = min(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.fxc.hlsl
index d0518f5..6d01cd1 100644
--- a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c70bb7() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   uint3 res = min(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.glsl
index 356455e..f4af17e 100644
--- a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void min_c70bb7() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void min_c70bb7() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void min_c70bb7() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   uvec3 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.msl b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.msl
index 174463a..6165cd2 100644
--- a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_c70bb7() {
+void min_c70bb7(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 arg_1 = uint3(1u);
   uint3 res = min(arg_0, arg_1);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_c70bb7();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  min_c70bb7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_c70bb7();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  min_c70bb7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_c70bb7();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  min_c70bb7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.spvasm
index f0e6690..a5a171c 100644
--- a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_c70bb7 "min_c70bb7"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,48 +38,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_c70bb7 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %19
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3uint %arg_0
-         %24 = OpLoad %v3uint %arg_1
-         %21 = OpExtInst %v3uint %22 UMin %23 %24
-               OpStore %res %21
+ %min_c70bb7 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3uint %arg_0
+         %27 = OpLoad %v3uint %arg_1
+         %24 = OpExtInst %v3uint %25 UMin %26 %27
+               OpStore %res %24
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %32 = OpLoad %v3uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_c70bb7
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %min_c70bb7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_c70bb7
+%fragment_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %min_c70bb7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_c70bb7
+%compute_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %min_c70bb7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.wgsl
index 86e9d1f..88d9638 100644
--- a/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/c70bb7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<u32>(1u);
   var arg_1 = vec3<u32>(1u);
   var res : vec3<u32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_c70bb7();
diff --git a/test/tint/builtins/gen/var/min/c73147.wgsl b/test/tint/builtins/gen/var/min/c73147.wgsl
index c361893..49f199e 100644
--- a/test/tint/builtins/gen/var/min/c73147.wgsl
+++ b/test/tint/builtins/gen/var/min/c73147.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1i;
   var arg_1 = 1i;
   var res: i32 = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.dxc.hlsl
index a50a55d..76c40e8 100644
--- a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c73147() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = min(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.fxc.hlsl
index a50a55d..76c40e8 100644
--- a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c73147() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = min(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.glsl
index 0cf036e..bf0ed35 100644
--- a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void min_c73147() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void min_c73147() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void min_c73147() {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.msl b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.msl
index 22a72c9..f28173c 100644
--- a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_c73147() {
+void min_c73147(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int arg_1 = 1;
   int res = min(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_c73147();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  min_c73147(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_c73147();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  min_c73147(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_c73147();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  min_c73147(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.spvasm
index 51ce104..4d23b7b 100644
--- a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_c73147 "min_c73147"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_c73147 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %17
-      %arg_1 = OpVariable %_ptr_Function_int Function %17
-        %res = OpVariable %_ptr_Function_int Function %17
+ %min_c73147 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %20
+      %arg_1 = OpVariable %_ptr_Function_int Function %20
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %arg_0 %int_1
                OpStore %arg_1 %int_1
-         %21 = OpLoad %int %arg_0
-         %22 = OpLoad %int %arg_1
-         %19 = OpExtInst %int %20 SMin %21 %22
-               OpStore %res %19
+         %24 = OpLoad %int %arg_0
+         %25 = OpLoad %int %arg_1
+         %22 = OpExtInst %int %23 SMin %24 %25
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %31 = OpLoad %int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %min_c73147
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %min_c73147
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %min_c73147
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %min_c73147
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %min_c73147
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %min_c73147
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.wgsl
index d174fe5..dc04f85 100644
--- a/test/tint/builtins/gen/var/min/c73147.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/c73147.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1i;
   var arg_1 = 1i;
   var res : i32 = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_c73147();
diff --git a/test/tint/builtins/gen/var/min/c76fa6.wgsl b/test/tint/builtins/gen/var/min/c76fa6.wgsl
index b1b4f0e..c2aa001 100644
--- a/test/tint/builtins/gen/var/min/c76fa6.wgsl
+++ b/test/tint/builtins/gen/var/min/c76fa6.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<f32>(1.f);
   var res: vec4<f32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.dxc.hlsl
index bd0c327..d2f6889 100644
--- a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c76fa6() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = min(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.fxc.hlsl
index bd0c327..d2f6889 100644
--- a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_c76fa6() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = min(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.glsl
index 88ac3d3..01e7ea2 100644
--- a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void min_c76fa6() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void min_c76fa6() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void min_c76fa6() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.msl b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.msl
index 313f56c..d99de4e 100644
--- a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_c76fa6() {
+void min_c76fa6(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 res = fmin(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_c76fa6();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  min_c76fa6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_c76fa6();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  min_c76fa6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_c76fa6();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  min_c76fa6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.spvasm
index 1512cf1..ff6d89f 100644
--- a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_c76fa6 "min_c76fa6"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,44 +38,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpTypeFunction %v4float
- %min_c76fa6 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
+ %min_c76fa6 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-         %20 = OpLoad %v4float %arg_0
-         %21 = OpLoad %v4float %arg_1
-         %18 = OpExtInst %v4float %19 NMin %20 %21
-               OpStore %res %18
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+         %23 = OpLoad %v4float %arg_0
+         %24 = OpLoad %v4float %arg_1
+         %21 = OpExtInst %v4float %22 NMin %23 %24
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %min_c76fa6
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %min_c76fa6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %min_c76fa6
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %min_c76fa6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %min_c76fa6
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %min_c76fa6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.wgsl
index c624b7e..5cb60ba 100644
--- a/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/c76fa6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<f32>(1.0f);
   var res : vec4<f32> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_c76fa6();
diff --git a/test/tint/builtins/gen/var/min/e780f9.wgsl b/test/tint/builtins/gen/var/min/e780f9.wgsl
index 9e11b5a..c20e1d2 100644
--- a/test/tint/builtins/gen/var/min/e780f9.wgsl
+++ b/test/tint/builtins/gen/var/min/e780f9.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<f16>(1.h);
   var res: vec2<f16> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.dxc.hlsl
index b072226..eb7d46d 100644
--- a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_e780f9() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = min(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.fxc.hlsl
index 64947bb..8921e06 100644
--- a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void min_e780f9() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = min(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.glsl b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.glsl
index 9ffa9fe..b021554 100644
--- a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void min_e780f9() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void min_e780f9() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void min_e780f9() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = min(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.msl b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.msl
index 11a0d62..608312e 100644
--- a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void min_e780f9() {
+void min_e780f9(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 res = fmin(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  min_e780f9();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  min_e780f9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  min_e780f9();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  min_e780f9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  min_e780f9();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  min_e780f9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.spvasm
index 6119fe1..9932349 100644
--- a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %min_e780f9 "min_e780f9"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %min_e780f9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2half %arg_0
-         %24 = OpLoad %v2half %arg_1
-         %21 = OpExtInst %v2half %22 NMin %23 %24
-               OpStore %res %21
+ %min_e780f9 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2half %arg_0
+         %27 = OpLoad %v2half %arg_1
+         %24 = OpExtInst %v2half %25 NMin %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %33 = OpLoad %v2half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %min_e780f9
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %min_e780f9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %min_e780f9
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %min_e780f9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %min_e780f9
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %min_e780f9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.wgsl
index 7d43618..8673745 100644
--- a/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/min/e780f9.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<f16>(1.0h);
   var res : vec2<f16> = min(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   min_e780f9();
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl
index 0801276..0de7113 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(1.f);
   var arg_2 = vec3<f32>(1.f);
   var res: vec3<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.dxc.hlsl
index 575d95d..2e68260 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_0c8c33() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 arg_2 = (1.0f).xxx;
   float3 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.fxc.hlsl
index 575d95d..2e68260 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_0c8c33() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 arg_2 = (1.0f).xxx;
   float3 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.glsl
index b6a83cf..6eff575 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_0c8c33() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_0c8c33() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_0c8c33() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 arg_2 = vec3(1.0f);
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.msl
index fb8ce73..eea7a53 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_0c8c33() {
+void mix_0c8c33(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 arg_2 = float3(1.0f);
   float3 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_0c8c33();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  mix_0c8c33(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_0c8c33();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  mix_0c8c33(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_0c8c33();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  mix_0c8c33(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.spvasm
index 945a11f..d814674 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_0c8c33 "mix_0c8c33"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,49 +39,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %27 = OpTypeFunction %v4float
- %mix_0c8c33 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %15
-         %23 = OpLoad %v3float %arg_0
-         %24 = OpLoad %v3float %arg_1
-         %25 = OpLoad %v3float %arg_2
-         %21 = OpExtInst %v3float %22 FMix %23 %24 %25
-               OpStore %res %21
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %35 = OpTypeFunction %v4float
+ %mix_0c8c33 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %18
+         %26 = OpLoad %v3float %arg_0
+         %27 = OpLoad %v3float %arg_1
+         %28 = OpLoad %v3float %arg_2
+         %24 = OpExtInst %v3float %25 FMix %26 %27 %28
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %34 = OpLoad %v3float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %mix_0c8c33
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %mix_0c8c33
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %mix_0c8c33
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %mix_0c8c33
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %mix_0c8c33
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %mix_0c8c33
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.wgsl
index 5cac533..74d8216 100644
--- a/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/0c8c33.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(1.0f);
   var arg_2 = vec3<f32>(1.0f);
   var res : vec3<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_0c8c33();
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl
index 74c1677..5196514 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(1.f);
   var arg_2 = 1.f;
   var res: vec4<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.dxc.hlsl
index 849c498..475ba54 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_1faeb1() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float arg_2 = 1.0f;
   float4 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.fxc.hlsl
index 849c498..475ba54 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_1faeb1() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float arg_2 = 1.0f;
   float4 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.glsl
index 7fbecbb..e3e167d 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_1faeb1() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float arg_2 = 1.0f;
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_1faeb1() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float arg_2 = 1.0f;
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_1faeb1() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float arg_2 = 1.0f;
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.msl
index 1707059..c452949 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_1faeb1() {
+void mix_1faeb1(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float arg_2 = 1.0f;
   float4 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_1faeb1();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  mix_1faeb1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_1faeb1();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  mix_1faeb1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_1faeb1();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  mix_1faeb1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.spvasm
index 787c9a8..0d2388c 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_1faeb1 "mix_1faeb1"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,50 +39,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Function_float = OpTypePointer Function %float
-         %28 = OpTypeFunction %v4float
- %mix_1faeb1 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %36 = OpTypeFunction %v4float
+ %mix_1faeb1 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
       %arg_2 = OpVariable %_ptr_Function_float Function %8
-         %25 = OpVariable %_ptr_Function_v4float Function %5
+         %28 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
                OpStore %arg_2 %float_1
-         %22 = OpLoad %v4float %arg_0
-         %23 = OpLoad %v4float %arg_1
-         %24 = OpLoad %float %arg_2
-         %26 = OpCompositeConstruct %v4float %24 %24 %24 %24
-         %20 = OpExtInst %v4float %21 FMix %22 %23 %26
-               OpStore %res %20
+         %25 = OpLoad %v4float %arg_0
+         %26 = OpLoad %v4float %arg_1
+         %27 = OpLoad %float %arg_2
+         %29 = OpCompositeConstruct %v4float %27 %27 %27 %27
+         %23 = OpExtInst %v4float %24 FMix %25 %26 %29
+               OpStore %res %23
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_1faeb1
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_1faeb1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %mix_1faeb1
+%fragment_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %mix_1faeb1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %mix_1faeb1
+%compute_main = OpFunction %void None %12
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %mix_1faeb1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.wgsl
index 0bd8c68..476bbb7 100644
--- a/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/1faeb1.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(1.0f);
   var arg_2 = 1.0f;
   var res : vec4<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_1faeb1();
diff --git a/test/tint/builtins/gen/var/mix/275cac.wgsl b/test/tint/builtins/gen/var/mix/275cac.wgsl
index d9b8191..d2679e4 100644
--- a/test/tint/builtins/gen/var/mix/275cac.wgsl
+++ b/test/tint/builtins/gen/var/mix/275cac.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = mix(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_275cac();
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl
index c5719fd..f1cb60d 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(1.f);
   var arg_2 = 1.f;
   var res: vec2<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.dxc.hlsl
index f46a543..f2f059e 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_2fadab() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float arg_2 = 1.0f;
   float2 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.fxc.hlsl
index f46a543..f2f059e 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_2fadab() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float arg_2 = 1.0f;
   float2 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.glsl
index cb94e51..974d4a1 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_2fadab() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float arg_2 = 1.0f;
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_2fadab() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float arg_2 = 1.0f;
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_2fadab() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float arg_2 = 1.0f;
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.msl
index ad998d7..efc6fcb 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_2fadab() {
+void mix_2fadab(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float arg_2 = 1.0f;
   float2 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_2fadab();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  mix_2fadab(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_2fadab();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  mix_2fadab(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_2fadab();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  mix_2fadab(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.spvasm
index 4e77aa1..1edea3a 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_2fadab "mix_2fadab"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,52 +39,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeFunction %v4float
- %mix_2fadab = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %38 = OpTypeFunction %v4float
+ %mix_2fadab = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
       %arg_2 = OpVariable %_ptr_Function_float Function %8
-         %27 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
+         %30 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
                OpStore %arg_2 %float_1
-         %24 = OpLoad %v2float %arg_0
-         %25 = OpLoad %v2float %arg_1
-         %26 = OpLoad %float %arg_2
-         %28 = OpCompositeConstruct %v2float %26 %26
-         %22 = OpExtInst %v2float %23 FMix %24 %25 %28
-               OpStore %res %22
+         %27 = OpLoad %v2float %arg_0
+         %28 = OpLoad %v2float %arg_1
+         %29 = OpLoad %float %arg_2
+         %31 = OpCompositeConstruct %v2float %29 %29
+         %25 = OpExtInst %v2float %26 FMix %27 %28 %31
+               OpStore %res %25
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %37 = OpLoad %v2float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_2fadab
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_2fadab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %mix_2fadab
+%fragment_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %mix_2fadab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %mix_2fadab
+%compute_main = OpFunction %void None %13
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %mix_2fadab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.wgsl
index 82845ab..de76d1c 100644
--- a/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/2fadab.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(1.0f);
   var arg_2 = 1.0f;
   var res : vec2<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_2fadab();
diff --git a/test/tint/builtins/gen/var/mix/30de36.wgsl b/test/tint/builtins/gen/var/mix/30de36.wgsl
index 4a2789f..25dc2de 100644
--- a/test/tint/builtins/gen/var/mix/30de36.wgsl
+++ b/test/tint/builtins/gen/var/mix/30de36.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = mix(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_30de36();
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl b/test/tint/builtins/gen/var/mix/315264.wgsl
index 3d8f9ac..601162f 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(1.f);
   var arg_2 = 1.f;
   var res: vec3<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.dxc.hlsl
index 64aa63f..24f5c85 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_315264() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float arg_2 = 1.0f;
   float3 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.fxc.hlsl
index 64aa63f..24f5c85 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_315264() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float arg_2 = 1.0f;
   float3 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.glsl
index ee1b5a7..a37e48c 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_315264() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float arg_2 = 1.0f;
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_315264() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float arg_2 = 1.0f;
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void mix_315264() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float arg_2 = 1.0f;
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.msl
index 0b75b92..96b8574 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_315264() {
+void mix_315264(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float arg_2 = 1.0f;
   float3 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_315264();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  mix_315264(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_315264();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  mix_315264(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_315264();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  mix_315264(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.spvasm
index c3dcf62..9a22772 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_315264 "mix_315264"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,52 +39,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeFunction %v4float
- %mix_315264 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %38 = OpTypeFunction %v4float
+ %mix_315264 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
       %arg_2 = OpVariable %_ptr_Function_float Function %8
-         %27 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
+         %30 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
                OpStore %arg_2 %float_1
-         %24 = OpLoad %v3float %arg_0
-         %25 = OpLoad %v3float %arg_1
-         %26 = OpLoad %float %arg_2
-         %28 = OpCompositeConstruct %v3float %26 %26 %26
-         %22 = OpExtInst %v3float %23 FMix %24 %25 %28
-               OpStore %res %22
+         %27 = OpLoad %v3float %arg_0
+         %28 = OpLoad %v3float %arg_1
+         %29 = OpLoad %float %arg_2
+         %31 = OpCompositeConstruct %v3float %29 %29 %29
+         %25 = OpExtInst %v3float %26 FMix %27 %28 %31
+               OpStore %res %25
+         %36 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %37 = OpLoad %v3float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_315264
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_315264
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %mix_315264
+%fragment_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %mix_315264
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %mix_315264
+%compute_main = OpFunction %void None %13
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %mix_315264
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.wgsl
index 209ecad..0ae84ca 100644
--- a/test/tint/builtins/gen/var/mix/315264.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/315264.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(1.0f);
   var arg_2 = 1.0f;
   var res : vec3<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_315264();
diff --git a/test/tint/builtins/gen/var/mix/343c49.wgsl b/test/tint/builtins/gen/var/mix/343c49.wgsl
index 009932e..ff976da 100644
--- a/test/tint/builtins/gen/var/mix/343c49.wgsl
+++ b/test/tint/builtins/gen/var/mix/343c49.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec3(1.);
   var res = mix(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_343c49();
diff --git a/test/tint/builtins/gen/var/mix/38cbbb.wgsl b/test/tint/builtins/gen/var/mix/38cbbb.wgsl
index 0a36f24..a48bce2 100644
--- a/test/tint/builtins/gen/var/mix/38cbbb.wgsl
+++ b/test/tint/builtins/gen/var/mix/38cbbb.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = 1.h;
   var arg_2 = 1.h;
   var res: f16 = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.dxc.hlsl
index 167fb88..67c8056 100644
--- a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_38cbbb() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t arg_2 = float16_t(1.0h);
   float16_t res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.fxc.hlsl
index 77f7ac1..679886b 100644
--- a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_38cbbb() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t arg_2 = float16_t(1.0h);
   float16_t res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.glsl
index a4b6259..75544df 100644
--- a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void mix_38cbbb() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void mix_38cbbb() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void mix_38cbbb() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t arg_2 = 1.0hf;
   float16_t res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.msl
index 98dc09d..8361a71 100644
--- a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_38cbbb() {
+void mix_38cbbb(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half arg_2 = 1.0h;
   half res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_38cbbb();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  mix_38cbbb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_38cbbb();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  mix_38cbbb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_38cbbb();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  mix_38cbbb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.spvasm
index eac22c3..511c951 100644
--- a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_38cbbb "mix_38cbbb"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,49 +43,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %26 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_38cbbb = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-      %arg_2 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %mix_38cbbb = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+      %arg_2 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
                OpStore %arg_2 %half_0x1p_0
-         %22 = OpLoad %half %arg_0
-         %23 = OpLoad %half %arg_1
-         %24 = OpLoad %half %arg_2
-         %20 = OpExtInst %half %21 FMix %22 %23 %24
-               OpStore %res %20
+         %25 = OpLoad %half %arg_0
+         %26 = OpLoad %half %arg_1
+         %27 = OpLoad %half %arg_2
+         %23 = OpExtInst %half %24 FMix %25 %26 %27
+               OpStore %res %23
+         %32 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %33 = OpLoad %half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %mix_38cbbb
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %mix_38cbbb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %mix_38cbbb
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %mix_38cbbb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %mix_38cbbb
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %mix_38cbbb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.wgsl
index 1da8d88..ef8cc73 100644
--- a/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/38cbbb.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = 1.0h;
   var arg_2 = 1.0h;
   var res : f16 = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_38cbbb();
diff --git a/test/tint/builtins/gen/var/mix/42d11d.wgsl b/test/tint/builtins/gen/var/mix/42d11d.wgsl
index 6451054..88e4163 100644
--- a/test/tint/builtins/gen/var/mix/42d11d.wgsl
+++ b/test/tint/builtins/gen/var/mix/42d11d.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = mix(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_42d11d();
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl
index 88173de..f0f7363 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1.f;
   var arg_2 = 1.f;
   var res: f32 = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.dxc.hlsl
index 3ddc02b..f65ef19 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_4f0b5e() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.fxc.hlsl
index 3ddc02b..f65ef19 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_4f0b5e() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.glsl
index 4c40bad..f48f87e 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void mix_4f0b5e() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void mix_4f0b5e() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void mix_4f0b5e() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.msl
index 55238da..452815f 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_4f0b5e() {
+void mix_4f0b5e(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float arg_2 = 1.0f;
   float res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_4f0b5e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  mix_4f0b5e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_4f0b5e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  mix_4f0b5e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_4f0b5e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  mix_4f0b5e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.spvasm
index a307df3..2d2ce84 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_4f0b5e "mix_4f0b5e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,13 +39,19 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %24 = OpTypeFunction %v4float
- %mix_4f0b5e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %32 = OpTypeFunction %v4float
+ %mix_4f0b5e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
       %arg_2 = OpVariable %_ptr_Function_float Function %8
@@ -46,32 +59,35 @@
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
                OpStore %arg_2 %float_1
-         %20 = OpLoad %float %arg_0
-         %21 = OpLoad %float %arg_1
-         %22 = OpLoad %float %arg_2
-         %18 = OpExtInst %float %19 FMix %20 %21 %22
-               OpStore %res %18
+         %23 = OpLoad %float %arg_0
+         %24 = OpLoad %float %arg_1
+         %25 = OpLoad %float %arg_2
+         %21 = OpExtInst %float %22 FMix %23 %24 %25
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %31 = OpLoad %float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %mix_4f0b5e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %mix_4f0b5e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %mix_4f0b5e
+%fragment_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %mix_4f0b5e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %mix_4f0b5e
+%compute_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %mix_4f0b5e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.wgsl
index 3543079..76d9a25 100644
--- a/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/4f0b5e.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1.0f;
   var arg_2 = 1.0f;
   var res : f32 = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_4f0b5e();
diff --git a/test/tint/builtins/gen/var/mix/63f2fd.wgsl b/test/tint/builtins/gen/var/mix/63f2fd.wgsl
index 5839216..682a3a4 100644
--- a/test/tint/builtins/gen/var/mix/63f2fd.wgsl
+++ b/test/tint/builtins/gen/var/mix/63f2fd.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(1.h);
   var arg_2 = vec3<f16>(1.h);
   var res: vec3<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.dxc.hlsl
index 8bbc511..0ec024f 100644
--- a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_63f2fd() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.fxc.hlsl
index 454ca55..24fb315 100644
--- a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_63f2fd() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.glsl
index 9651c99..173f59e 100644
--- a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_63f2fd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_63f2fd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_63f2fd() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 arg_2 = f16vec3(1.0hf);
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.msl
index e738ae5..d9e7309 100644
--- a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_63f2fd() {
+void mix_63f2fd(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 arg_2 = half3(1.0h);
   half3 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_63f2fd();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  mix_63f2fd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_63f2fd();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  mix_63f2fd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_63f2fd();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  mix_63f2fd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.spvasm
index e02acfa..d1cfbfe 100644
--- a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_63f2fd "mix_63f2fd"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_63f2fd = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v3half %arg_0
-         %25 = OpLoad %v3half %arg_1
-         %26 = OpLoad %v3half %arg_2
-         %22 = OpExtInst %v3half %23 FMix %24 %25 %26
-               OpStore %res %22
+ %mix_63f2fd = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v3half %arg_0
+         %28 = OpLoad %v3half %arg_1
+         %29 = OpLoad %v3half %arg_2
+         %25 = OpExtInst %v3half %26 FMix %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %35 = OpLoad %v3half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_63f2fd
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_63f2fd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %mix_63f2fd
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %mix_63f2fd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %mix_63f2fd
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %mix_63f2fd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.wgsl
index 9475f3d..60378f4 100644
--- a/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/63f2fd.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(1.0h);
   var arg_2 = vec3<f16>(1.0h);
   var res : vec3<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_63f2fd();
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl
index c42ccf9..441660d 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(1.f);
   var arg_2 = vec2<f32>(1.f);
   var res: vec2<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.dxc.hlsl
index 78b6a37..a361943 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_6f8adc() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 arg_2 = (1.0f).xx;
   float2 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.fxc.hlsl
index 78b6a37..a361943 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_6f8adc() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 arg_2 = (1.0f).xx;
   float2 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.glsl
index d1d9e5a..778bf25 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_6f8adc() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_6f8adc() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void mix_6f8adc() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 arg_2 = vec2(1.0f);
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.msl
index d81240b..0b8dd5f 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_6f8adc() {
+void mix_6f8adc(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 arg_2 = float2(1.0f);
   float2 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_6f8adc();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  mix_6f8adc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_6f8adc();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  mix_6f8adc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_6f8adc();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  mix_6f8adc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.spvasm
index d201897..d97a942 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_6f8adc "mix_6f8adc"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,49 +39,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %27 = OpTypeFunction %v4float
- %mix_6f8adc = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %15
-         %23 = OpLoad %v2float %arg_0
-         %24 = OpLoad %v2float %arg_1
-         %25 = OpLoad %v2float %arg_2
-         %21 = OpExtInst %v2float %22 FMix %23 %24 %25
-               OpStore %res %21
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %35 = OpTypeFunction %v4float
+ %mix_6f8adc = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %18
+         %26 = OpLoad %v2float %arg_0
+         %27 = OpLoad %v2float %arg_1
+         %28 = OpLoad %v2float %arg_2
+         %24 = OpExtInst %v2float %25 FMix %26 %27 %28
+               OpStore %res %24
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %34 = OpLoad %v2float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %mix_6f8adc
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %mix_6f8adc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %mix_6f8adc
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %mix_6f8adc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %mix_6f8adc
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %mix_6f8adc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.wgsl
index 5d5ab3c..d6d7397 100644
--- a/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/6f8adc.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(1.0f);
   var arg_2 = vec2<f32>(1.0f);
   var res : vec2<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_6f8adc();
diff --git a/test/tint/builtins/gen/var/mix/98007a.wgsl b/test/tint/builtins/gen/var/mix/98007a.wgsl
index 6b2d226..5b07373 100644
--- a/test/tint/builtins/gen/var/mix/98007a.wgsl
+++ b/test/tint/builtins/gen/var/mix/98007a.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec4(1.);
   var res = mix(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_98007a();
diff --git a/test/tint/builtins/gen/var/mix/98ee3e.wgsl b/test/tint/builtins/gen/var/mix/98ee3e.wgsl
index 969f696..a28e666 100644
--- a/test/tint/builtins/gen/var/mix/98ee3e.wgsl
+++ b/test/tint/builtins/gen/var/mix/98ee3e.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(1.h);
   var arg_2 = vec2<f16>(1.h);
   var res: vec2<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.dxc.hlsl
index 77c92aa..319c722 100644
--- a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_98ee3e() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.fxc.hlsl
index 12a5507..a91127a 100644
--- a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_98ee3e() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.glsl
index 19a996c..683b657 100644
--- a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_98ee3e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_98ee3e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_98ee3e() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 arg_2 = f16vec2(1.0hf);
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.msl
index 1a2c97a..c9bbf2f 100644
--- a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_98ee3e() {
+void mix_98ee3e(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 arg_2 = half2(1.0h);
   half2 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_98ee3e();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  mix_98ee3e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_98ee3e();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  mix_98ee3e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_98ee3e();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  mix_98ee3e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.spvasm
index 368245f..7ce66f5 100644
--- a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_98ee3e "mix_98ee3e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_98ee3e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v2half %arg_0
-         %25 = OpLoad %v2half %arg_1
-         %26 = OpLoad %v2half %arg_2
-         %22 = OpExtInst %v2half %23 FMix %24 %25 %26
-               OpStore %res %22
+ %mix_98ee3e = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v2half %arg_0
+         %28 = OpLoad %v2half %arg_1
+         %29 = OpLoad %v2half %arg_2
+         %25 = OpExtInst %v2half %26 FMix %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %35 = OpLoad %v2half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_98ee3e
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_98ee3e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %mix_98ee3e
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %mix_98ee3e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %mix_98ee3e
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %mix_98ee3e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.wgsl
index 3209439..15e492a 100644
--- a/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/98ee3e.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(1.0h);
   var arg_2 = vec2<f16>(1.0h);
   var res : vec2<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_98ee3e();
diff --git a/test/tint/builtins/gen/var/mix/9c2681.wgsl b/test/tint/builtins/gen/var/mix/9c2681.wgsl
index 495d85c..3b8486d 100644
--- a/test/tint/builtins/gen/var/mix/9c2681.wgsl
+++ b/test/tint/builtins/gen/var/mix/9c2681.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = mix(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_9c2681();
diff --git a/test/tint/builtins/gen/var/mix/c1aec6.wgsl b/test/tint/builtins/gen/var/mix/c1aec6.wgsl
index b90bd7a..75918a2 100644
--- a/test/tint/builtins/gen/var/mix/c1aec6.wgsl
+++ b/test/tint/builtins/gen/var/mix/c1aec6.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(1.h);
   var arg_2 = 1.h;
   var res: vec3<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.dxc.hlsl
index f0543f9..b10eaf9 100644
--- a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_c1aec6() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 3> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.fxc.hlsl
index b502d44..bc4db2f 100644
--- a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_c1aec6() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 3> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.glsl
index f8f3e7c..c268586 100644
--- a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_c1aec6() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_c1aec6() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void mix_c1aec6() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.msl
index 2086672..28921bf 100644
--- a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_c1aec6() {
+void mix_c1aec6(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half arg_2 = 1.0h;
   half3 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_c1aec6();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  mix_c1aec6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_c1aec6();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  mix_c1aec6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_c1aec6();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  mix_c1aec6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.spvasm
index 3498a35..b0cea40 100644
--- a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %25 = OpExtInstImport "GLSL.std.450"
+         %28 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_c1aec6 "mix_c1aec6"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %32 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_c1aec6 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_half Function %23
-         %29 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+ %mix_c1aec6 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_half Function %26
+         %32 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %half_0x1p_0
-         %26 = OpLoad %v3half %arg_0
-         %27 = OpLoad %v3half %arg_1
-         %28 = OpLoad %half %arg_2
-         %30 = OpCompositeConstruct %v3half %28 %28 %28
-         %24 = OpExtInst %v3half %25 FMix %26 %27 %30
-               OpStore %res %24
+         %29 = OpLoad %v3half %arg_0
+         %30 = OpLoad %v3half %arg_1
+         %31 = OpLoad %half %arg_2
+         %33 = OpCompositeConstruct %v3half %31 %31 %31
+         %27 = OpExtInst %v3half %28 FMix %29 %30 %33
+               OpStore %res %27
+         %38 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %39 = OpLoad %v3half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %mix_c1aec6
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %mix_c1aec6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %mix_c1aec6
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %mix_c1aec6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %mix_c1aec6
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %mix_c1aec6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.wgsl
index d6ceef5..aa40ab4 100644
--- a/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/c1aec6.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(1.0h);
   var arg_2 = 1.0h;
   var res : vec3<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_c1aec6();
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl
index 847edc8..4f52302 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(1.f);
   var arg_2 = vec4<f32>(1.f);
   var res: vec4<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.dxc.hlsl
index 202b6a5..10811c8 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_c37ede() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 arg_2 = (1.0f).xxxx;
   float4 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.fxc.hlsl
index 202b6a5..10811c8 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_c37ede() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 arg_2 = (1.0f).xxxx;
   float4 res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.glsl
index 2642b1c..dfbdc24 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_c37ede() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_c37ede() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void mix_c37ede() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 arg_2 = vec4(1.0f);
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.msl
index 58c02b5..234797e 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_c37ede() {
+void mix_c37ede(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 arg_2 = float4(1.0f);
   float4 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_c37ede();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  mix_c37ede(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_c37ede();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  mix_c37ede(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_c37ede();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  mix_c37ede(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.spvasm
index 548ba53..3ddb64e 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_c37ede "mix_c37ede"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,47 +39,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %25 = OpTypeFunction %v4float
- %mix_c37ede = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %33 = OpTypeFunction %v4float
+ %mix_c37ede = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
       %arg_2 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-               OpStore %arg_2 %14
-         %21 = OpLoad %v4float %arg_0
-         %22 = OpLoad %v4float %arg_1
-         %23 = OpLoad %v4float %arg_2
-         %19 = OpExtInst %v4float %20 FMix %21 %22 %23
-               OpStore %res %19
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+               OpStore %arg_2 %17
+         %24 = OpLoad %v4float %arg_0
+         %25 = OpLoad %v4float %arg_1
+         %26 = OpLoad %v4float %arg_2
+         %22 = OpExtInst %v4float %23 FMix %24 %25 %26
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %32 = OpLoad %v4float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %mix_c37ede
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %mix_c37ede
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %mix_c37ede
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %mix_c37ede
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %mix_c37ede
+%compute_main = OpFunction %void None %12
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %mix_c37ede
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.wgsl
index 6fb66e2..5b518d6 100644
--- a/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/c37ede.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(1.0f);
   var arg_2 = vec4<f32>(1.0f);
   var res : vec4<f32> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_c37ede();
diff --git a/test/tint/builtins/gen/var/mix/e46a83.wgsl b/test/tint/builtins/gen/var/mix/e46a83.wgsl
index 76a4327..bedece1 100644
--- a/test/tint/builtins/gen/var/mix/e46a83.wgsl
+++ b/test/tint/builtins/gen/var/mix/e46a83.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(1.h);
   var arg_2 = 1.h;
   var res: vec2<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.dxc.hlsl
index 8f93160..c23db8a 100644
--- a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_e46a83() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 2> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.fxc.hlsl
index 2e95ba5..58655ab 100644
--- a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_e46a83() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 2> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.glsl
index 5669373..5f78e57 100644
--- a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_e46a83() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_e46a83() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void mix_e46a83() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.msl
index 1909e9e..39599b0 100644
--- a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_e46a83() {
+void mix_e46a83(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half arg_2 = 1.0h;
   half2 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_e46a83();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  mix_e46a83(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_e46a83();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  mix_e46a83(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_e46a83();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  mix_e46a83(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.spvasm
index ef4c8f3..d1768d8 100644
--- a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %25 = OpExtInstImport "GLSL.std.450"
+         %28 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_e46a83 "mix_e46a83"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %32 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_e46a83 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_half Function %23
-         %29 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+ %mix_e46a83 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_half Function %26
+         %32 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %half_0x1p_0
-         %26 = OpLoad %v2half %arg_0
-         %27 = OpLoad %v2half %arg_1
-         %28 = OpLoad %half %arg_2
-         %30 = OpCompositeConstruct %v2half %28 %28
-         %24 = OpExtInst %v2half %25 FMix %26 %27 %30
-               OpStore %res %24
+         %29 = OpLoad %v2half %arg_0
+         %30 = OpLoad %v2half %arg_1
+         %31 = OpLoad %half %arg_2
+         %33 = OpCompositeConstruct %v2half %31 %31
+         %27 = OpExtInst %v2half %28 FMix %29 %30 %33
+               OpStore %res %27
+         %38 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %39 = OpLoad %v2half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %mix_e46a83
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %mix_e46a83
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %mix_e46a83
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %mix_e46a83
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %mix_e46a83
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %mix_e46a83
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.wgsl
index 19cdcbf..4d297c3 100644
--- a/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/e46a83.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(1.0h);
   var arg_2 = 1.0h;
   var res : vec2<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_e46a83();
diff --git a/test/tint/builtins/gen/var/mix/ee2468.wgsl b/test/tint/builtins/gen/var/mix/ee2468.wgsl
index deb9741..9a22732 100644
--- a/test/tint/builtins/gen/var/mix/ee2468.wgsl
+++ b/test/tint/builtins/gen/var/mix/ee2468.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(1.h);
   var arg_2 = vec4<f16>(1.h);
   var res: vec4<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.dxc.hlsl
index e557582..b17793b 100644
--- a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_ee2468() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.fxc.hlsl
index f2d3f27..57b1876 100644
--- a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_ee2468() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.glsl
index 8663a0b..ff7c08b 100644
--- a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_ee2468() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_ee2468() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_ee2468() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 arg_2 = f16vec4(1.0hf);
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.msl
index 5f8350d..a2f7f26 100644
--- a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_ee2468() {
+void mix_ee2468(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 arg_2 = half4(1.0h);
   half4 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_ee2468();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  mix_ee2468(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_ee2468();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  mix_ee2468(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_ee2468();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  mix_ee2468(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.spvasm
index ba10aef..b3ebe76 100644
--- a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_ee2468 "mix_ee2468"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %28 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_ee2468 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %24 = OpLoad %v4half %arg_0
-         %25 = OpLoad %v4half %arg_1
-         %26 = OpLoad %v4half %arg_2
-         %22 = OpExtInst %v4half %23 FMix %24 %25 %26
-               OpStore %res %22
+ %mix_ee2468 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %19
+         %27 = OpLoad %v4half %arg_0
+         %28 = OpLoad %v4half %arg_1
+         %29 = OpLoad %v4half %arg_2
+         %25 = OpExtInst %v4half %26 FMix %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %35 = OpLoad %v4half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %mix_ee2468
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %mix_ee2468
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %mix_ee2468
+%fragment_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %mix_ee2468
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %mix_ee2468
+%compute_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %mix_ee2468
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.wgsl
index dce3429..d5dfe59 100644
--- a/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/ee2468.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(1.0h);
   var arg_2 = vec4<f16>(1.0h);
   var res : vec4<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_ee2468();
diff --git a/test/tint/builtins/gen/var/mix/ef3575.wgsl b/test/tint/builtins/gen/var/mix/ef3575.wgsl
index 3d658f7..d79272b 100644
--- a/test/tint/builtins/gen/var/mix/ef3575.wgsl
+++ b/test/tint/builtins/gen/var/mix/ef3575.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec2(1.);
   var res = mix(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_ef3575();
diff --git a/test/tint/builtins/gen/var/mix/f1a543.wgsl b/test/tint/builtins/gen/var/mix/f1a543.wgsl
index bb1271b..33fab0a 100644
--- a/test/tint/builtins/gen/var/mix/f1a543.wgsl
+++ b/test/tint/builtins/gen/var/mix/f1a543.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(1.h);
   var arg_2 = 1.h;
   var res: vec4<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.dxc.hlsl
index 7eca853..a57ff67 100644
--- a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_f1a543() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 4> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.fxc.hlsl
index 0c528fc..a00412f 100644
--- a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void mix_f1a543() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 4> res = lerp(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.glsl b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.glsl
index 85904ca..ac5c3ea 100644
--- a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_f1a543() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_f1a543() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void mix_f1a543() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.msl b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.msl
index bc6f44d..8d2c653 100644
--- a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void mix_f1a543() {
+void mix_f1a543(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half arg_2 = 1.0h;
   half4 res = mix(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  mix_f1a543();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  mix_f1a543(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  mix_f1a543();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  mix_f1a543(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  mix_f1a543();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  mix_f1a543(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.spvasm b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.spvasm
index ea36681..526f579 100644
--- a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %25 = OpExtInstImport "GLSL.std.450"
+         %28 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %mix_f1a543 "mix_f1a543"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %32 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %mix_f1a543 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_half Function %23
-         %29 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+ %mix_f1a543 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_half Function %26
+         %32 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %half_0x1p_0
-         %26 = OpLoad %v4half %arg_0
-         %27 = OpLoad %v4half %arg_1
-         %28 = OpLoad %half %arg_2
-         %30 = OpCompositeConstruct %v4half %28 %28 %28 %28
-         %24 = OpExtInst %v4half %25 FMix %26 %27 %30
-               OpStore %res %24
+         %29 = OpLoad %v4half %arg_0
+         %30 = OpLoad %v4half %arg_1
+         %31 = OpLoad %half %arg_2
+         %33 = OpCompositeConstruct %v4half %31 %31 %31 %31
+         %27 = OpExtInst %v4half %28 FMix %29 %30 %33
+               OpStore %res %27
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %39 = OpLoad %v4half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %mix_f1a543
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %mix_f1a543
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %mix_f1a543
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %mix_f1a543
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %mix_f1a543
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %mix_f1a543
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.wgsl b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.wgsl
index 87c061d..7245a1b 100644
--- a/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/mix/f1a543.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(1.0h);
   var arg_2 = 1.0h;
   var res : vec4<f16> = mix(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   mix_f1a543();
diff --git a/test/tint/builtins/gen/var/modf/2d50da.wgsl b/test/tint/builtins/gen/var/modf/2d50da.wgsl
index 00be018..bc33bc7 100644
--- a/test/tint/builtins/gen/var/modf/2d50da.wgsl
+++ b/test/tint/builtins/gen/var/modf/2d50da.wgsl
@@ -26,7 +26,6 @@
   var arg_0 = vec2<f32>(-1.5f);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_2d50da();
diff --git a/test/tint/builtins/gen/var/modf/45005f.wgsl b/test/tint/builtins/gen/var/modf/45005f.wgsl
index 8955e23..e2f9d40 100644
--- a/test/tint/builtins/gen/var/modf/45005f.wgsl
+++ b/test/tint/builtins/gen/var/modf/45005f.wgsl
@@ -28,7 +28,6 @@
   var arg_0 = vec3<f16>(-1.5h);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_45005f();
diff --git a/test/tint/builtins/gen/var/modf/4bfced.wgsl b/test/tint/builtins/gen/var/modf/4bfced.wgsl
index 52581ce..0b2ff3d 100644
--- a/test/tint/builtins/gen/var/modf/4bfced.wgsl
+++ b/test/tint/builtins/gen/var/modf/4bfced.wgsl
@@ -26,7 +26,6 @@
   var arg_0 = vec4<f32>(-1.5f);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_4bfced();
diff --git a/test/tint/builtins/gen/var/modf/5ea256.wgsl b/test/tint/builtins/gen/var/modf/5ea256.wgsl
index f623263..dbc2393 100644
--- a/test/tint/builtins/gen/var/modf/5ea256.wgsl
+++ b/test/tint/builtins/gen/var/modf/5ea256.wgsl
@@ -26,7 +26,6 @@
   var arg_0 = vec3<f32>(-1.5f);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_5ea256();
diff --git a/test/tint/builtins/gen/var/modf/68d8ee.wgsl b/test/tint/builtins/gen/var/modf/68d8ee.wgsl
index f40c08f..aecbe9a 100644
--- a/test/tint/builtins/gen/var/modf/68d8ee.wgsl
+++ b/test/tint/builtins/gen/var/modf/68d8ee.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(-1.5);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_68d8ee();
diff --git a/test/tint/builtins/gen/var/modf/732aa6.wgsl b/test/tint/builtins/gen/var/modf/732aa6.wgsl
index dcea43c..ba22f8b 100644
--- a/test/tint/builtins/gen/var/modf/732aa6.wgsl
+++ b/test/tint/builtins/gen/var/modf/732aa6.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(-1.5);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_732aa6();
diff --git a/test/tint/builtins/gen/var/modf/8dbbbf.wgsl b/test/tint/builtins/gen/var/modf/8dbbbf.wgsl
index 3b65908..3d753a0 100644
--- a/test/tint/builtins/gen/var/modf/8dbbbf.wgsl
+++ b/test/tint/builtins/gen/var/modf/8dbbbf.wgsl
@@ -28,7 +28,6 @@
   var arg_0 = -1.5h;
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_8dbbbf();
diff --git a/test/tint/builtins/gen/var/modf/995934.wgsl b/test/tint/builtins/gen/var/modf/995934.wgsl
index fa33c70..f3128e1 100644
--- a/test/tint/builtins/gen/var/modf/995934.wgsl
+++ b/test/tint/builtins/gen/var/modf/995934.wgsl
@@ -28,7 +28,6 @@
   var arg_0 = vec4<f16>(-1.5h);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_995934();
diff --git a/test/tint/builtins/gen/var/modf/a545b9.wgsl b/test/tint/builtins/gen/var/modf/a545b9.wgsl
index c559912..3dd909f 100644
--- a/test/tint/builtins/gen/var/modf/a545b9.wgsl
+++ b/test/tint/builtins/gen/var/modf/a545b9.wgsl
@@ -28,7 +28,6 @@
   var arg_0 = vec2<f16>(-1.5h);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_a545b9();
diff --git a/test/tint/builtins/gen/var/modf/bbf7f7.wgsl b/test/tint/builtins/gen/var/modf/bbf7f7.wgsl
index 7fa9467..5eb5df3 100644
--- a/test/tint/builtins/gen/var/modf/bbf7f7.wgsl
+++ b/test/tint/builtins/gen/var/modf/bbf7f7.wgsl
@@ -26,7 +26,6 @@
   var arg_0 = -1.5f;
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_bbf7f7();
diff --git a/test/tint/builtins/gen/var/modf/c15f48.wgsl b/test/tint/builtins/gen/var/modf/c15f48.wgsl
index 7331b69..0272261 100644
--- a/test/tint/builtins/gen/var/modf/c15f48.wgsl
+++ b/test/tint/builtins/gen/var/modf/c15f48.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = -1.5;
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_c15f48();
diff --git a/test/tint/builtins/gen/var/modf/f3d1f9.wgsl b/test/tint/builtins/gen/var/modf/f3d1f9.wgsl
index 3cfffae..e28dea4 100644
--- a/test/tint/builtins/gen/var/modf/f3d1f9.wgsl
+++ b/test/tint/builtins/gen/var/modf/f3d1f9.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(-1.5);
   var res = modf(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   modf_f3d1f9();
diff --git a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl
index 35c06bf..478e928 100644
--- a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl
+++ b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl
@@ -27,7 +27,9 @@
 fn normalize_39d5ec() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = normalize(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.dxc.hlsl
index e671082..36bfc94 100644
--- a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_39d5ec() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = normalize(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.fxc.hlsl
index 644f646..b1ef930 100644
--- a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_39d5ec() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = normalize(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.glsl b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.glsl
index 0934cc3..66360b2 100644
--- a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void normalize_39d5ec() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void normalize_39d5ec() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void normalize_39d5ec() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.msl b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.msl
index 3c34456..3c2f460 100644
--- a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_39d5ec() {
+void normalize_39d5ec(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = normalize(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_39d5ec();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  normalize_39d5ec(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_39d5ec();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  normalize_39d5ec(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_39d5ec();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  normalize_39d5ec(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.spvasm b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.spvasm
index 0ad6acc..e79a3d5 100644
--- a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_39d5ec "normalize_39d5ec"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_39d5ec = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Normalize %22
-               OpStore %res %20
+%normalize_39d5ec = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Normalize %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %normalize_39d5ec
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %normalize_39d5ec
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %normalize_39d5ec
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %normalize_39d5ec
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %normalize_39d5ec
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %normalize_39d5ec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.wgsl b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.wgsl
index ef253e8..feded90 100644
--- a/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/normalize/39d5ec.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn normalize_39d5ec() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = normalize(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_39d5ec();
diff --git a/test/tint/builtins/gen/var/normalize/4eaf61.wgsl b/test/tint/builtins/gen/var/normalize/4eaf61.wgsl
index 08d23e2..b50c1da 100644
--- a/test/tint/builtins/gen/var/normalize/4eaf61.wgsl
+++ b/test/tint/builtins/gen/var/normalize/4eaf61.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = normalize(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_4eaf61();
diff --git a/test/tint/builtins/gen/var/normalize/584e47.wgsl b/test/tint/builtins/gen/var/normalize/584e47.wgsl
index bc1a01c..15286bf 100644
--- a/test/tint/builtins/gen/var/normalize/584e47.wgsl
+++ b/test/tint/builtins/gen/var/normalize/584e47.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = normalize(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_584e47();
diff --git a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl
index c289918..aac70ff 100644
--- a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl
+++ b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl
@@ -25,7 +25,9 @@
 fn normalize_64d8c0() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = normalize(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.dxc.hlsl
index 1d5044b..8b6a389 100644
--- a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_64d8c0() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = normalize(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.fxc.hlsl
index 1d5044b..8b6a389 100644
--- a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_64d8c0() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = normalize(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.glsl b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.glsl
index 2140545..42c9506 100644
--- a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void normalize_64d8c0() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void normalize_64d8c0() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void normalize_64d8c0() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.msl b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.msl
index a117703..801aac3 100644
--- a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_64d8c0() {
+void normalize_64d8c0(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = normalize(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_64d8c0();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  normalize_64d8c0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_64d8c0();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  normalize_64d8c0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_64d8c0();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  normalize_64d8c0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.spvasm
index d031f1e..c8082f9 100644
--- a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_64d8c0 "normalize_64d8c0"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%normalize_64d8c0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Normalize %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%normalize_64d8c0 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Normalize %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %normalize_64d8c0
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %normalize_64d8c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %normalize_64d8c0
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %normalize_64d8c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %normalize_64d8c0
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %normalize_64d8c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.wgsl
index a014236..93ec004 100644
--- a/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/normalize/64d8c0.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn normalize_64d8c0() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = normalize(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_64d8c0();
diff --git a/test/tint/builtins/gen/var/normalize/7990f3.wgsl b/test/tint/builtins/gen/var/normalize/7990f3.wgsl
index 907a64f..5ff1f25 100644
--- a/test/tint/builtins/gen/var/normalize/7990f3.wgsl
+++ b/test/tint/builtins/gen/var/normalize/7990f3.wgsl
@@ -27,7 +27,9 @@
 fn normalize_7990f3() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = normalize(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.dxc.hlsl
index 4d33c76..ed6ad74 100644
--- a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_7990f3() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = normalize(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.fxc.hlsl
index e073fb4..4e770e1 100644
--- a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_7990f3() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = normalize(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.glsl
index f5b5264..2e2b6b9 100644
--- a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void normalize_7990f3() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void normalize_7990f3() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void normalize_7990f3() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.msl b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.msl
index db2d01b..dcd9bb5 100644
--- a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_7990f3() {
+void normalize_7990f3(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = normalize(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_7990f3();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  normalize_7990f3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_7990f3();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  normalize_7990f3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_7990f3();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  normalize_7990f3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.spvasm
index 225a26e..7bae958 100644
--- a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_7990f3 "normalize_7990f3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_7990f3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Normalize %22
-               OpStore %res %20
+%normalize_7990f3 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Normalize %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %normalize_7990f3
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %normalize_7990f3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %normalize_7990f3
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %normalize_7990f3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %normalize_7990f3
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %normalize_7990f3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.wgsl
index 1d9e115..1456cf7 100644
--- a/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/normalize/7990f3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn normalize_7990f3() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = normalize(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_7990f3();
diff --git a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl
index f2c2f38..0e06793 100644
--- a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl
+++ b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl
@@ -25,7 +25,9 @@
 fn normalize_9a0aab() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = normalize(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.dxc.hlsl
index f5898ef..6f17124 100644
--- a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_9a0aab() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = normalize(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.fxc.hlsl
index f5898ef..6f17124 100644
--- a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_9a0aab() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = normalize(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.glsl b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.glsl
index 7ed5366..ee0e8f9 100644
--- a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void normalize_9a0aab() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void normalize_9a0aab() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void normalize_9a0aab() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.msl b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.msl
index e808882..60da83d 100644
--- a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_9a0aab() {
+void normalize_9a0aab(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = normalize(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_9a0aab();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  normalize_9a0aab(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_9a0aab();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  normalize_9a0aab(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_9a0aab();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  normalize_9a0aab(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.spvasm
index 1e8195c..36a517c 100644
--- a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_9a0aab "normalize_9a0aab"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%normalize_9a0aab = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%normalize_9a0aab = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Normalize %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Normalize %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %normalize_9a0aab
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %normalize_9a0aab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %normalize_9a0aab
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %normalize_9a0aab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %normalize_9a0aab
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %normalize_9a0aab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.wgsl
index 2ac1d49..f897dba 100644
--- a/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/normalize/9a0aab.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn normalize_9a0aab() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = normalize(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_9a0aab();
diff --git a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl
index 72b994f..a9f093e 100644
--- a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl
+++ b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl
@@ -27,7 +27,9 @@
 fn normalize_b8cb8d() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = normalize(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.dxc.hlsl
index 026a522..2ff97f2 100644
--- a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_b8cb8d() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = normalize(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.fxc.hlsl
index 2e49b0d..c8b9713 100644
--- a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_b8cb8d() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = normalize(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.glsl b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.glsl
index 03c0cd7..c4c6c6a 100644
--- a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void normalize_b8cb8d() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void normalize_b8cb8d() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void normalize_b8cb8d() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.msl b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.msl
index fdcce05..beb63fa 100644
--- a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_b8cb8d() {
+void normalize_b8cb8d(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = normalize(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_b8cb8d();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  normalize_b8cb8d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_b8cb8d();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  normalize_b8cb8d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_b8cb8d();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  normalize_b8cb8d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.spvasm
index c802491..94f43b7 100644
--- a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_b8cb8d "normalize_b8cb8d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%normalize_b8cb8d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Normalize %22
-               OpStore %res %20
+%normalize_b8cb8d = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Normalize %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %normalize_b8cb8d
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %normalize_b8cb8d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %normalize_b8cb8d
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %normalize_b8cb8d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %normalize_b8cb8d
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %normalize_b8cb8d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.wgsl
index a2e6bb9..d314f2b 100644
--- a/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/normalize/b8cb8d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn normalize_b8cb8d() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = normalize(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_b8cb8d();
diff --git a/test/tint/builtins/gen/var/normalize/e7def8.wgsl b/test/tint/builtins/gen/var/normalize/e7def8.wgsl
index a87e995..11b3da6 100644
--- a/test/tint/builtins/gen/var/normalize/e7def8.wgsl
+++ b/test/tint/builtins/gen/var/normalize/e7def8.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = normalize(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_e7def8();
diff --git a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl
index f98ac1b..6be59f8 100644
--- a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl
+++ b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl
@@ -25,7 +25,9 @@
 fn normalize_fc2ef1() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = normalize(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.dxc.hlsl
index 9d24fee..93224c9 100644
--- a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_fc2ef1() {
   float2 arg_0 = (1.0f).xx;
   float2 res = normalize(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.fxc.hlsl
index 9d24fee..93224c9 100644
--- a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void normalize_fc2ef1() {
   float2 arg_0 = (1.0f).xx;
   float2 res = normalize(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.glsl b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.glsl
index c9ff24a..f9a2e7f 100644
--- a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void normalize_fc2ef1() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void normalize_fc2ef1() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void normalize_fc2ef1() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = normalize(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.msl b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.msl
index 6350353..f465bba 100644
--- a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void normalize_fc2ef1() {
+void normalize_fc2ef1(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = normalize(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  normalize_fc2ef1();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  normalize_fc2ef1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  normalize_fc2ef1();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  normalize_fc2ef1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  normalize_fc2ef1();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  normalize_fc2ef1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.spvasm
index 3294d02..4b7b459 100644
--- a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %normalize_fc2ef1 "normalize_fc2ef1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%normalize_fc2ef1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Normalize %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%normalize_fc2ef1 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Normalize %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %normalize_fc2ef1
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %normalize_fc2ef1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %normalize_fc2ef1
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %normalize_fc2ef1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %normalize_fc2ef1
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %normalize_fc2ef1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.wgsl
index 9d670b7..0cdf1dd 100644
--- a/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/normalize/fc2ef1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn normalize_fc2ef1() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = normalize(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   normalize_fc2ef1();
diff --git a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl
index dbea6a0..ffcb103 100644
--- a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl
+++ b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl
@@ -25,7 +25,9 @@
 fn pack2x16float_0e97b3() {
   var arg_0 = vec2<f32>(1.f);
   var res: u32 = pack2x16float(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.dxc.hlsl
index 101f1f2..a1e86fe 100644
--- a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.dxc.hlsl
@@ -3,9 +3,12 @@
   return i.x | (i.y << 16);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16float_0e97b3() {
   float2 arg_0 = (1.0f).xx;
   uint res = tint_pack2x16float(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.fxc.hlsl
index 101f1f2..a1e86fe 100644
--- a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.fxc.hlsl
@@ -3,9 +3,12 @@
   return i.x | (i.y << 16);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16float_0e97b3() {
   float2 arg_0 = (1.0f).xx;
   uint res = tint_pack2x16float(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.glsl b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.glsl
index e41a07f..f884272 100644
--- a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16float_0e97b3() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packHalf2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16float_0e97b3() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packHalf2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16float_0e97b3() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packHalf2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.msl b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.msl
index 9d3f17d..eed6b06 100644
--- a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack2x16float_0e97b3() {
+void pack2x16float_0e97b3(device uint* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   uint res = as_type<uint>(half2(arg_0));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack2x16float_0e97b3();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack2x16float_0e97b3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack2x16float_0e97b3();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack2x16float_0e97b3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack2x16float_0e97b3();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack2x16float_0e97b3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.spvasm
index d384bb2..6c7c463 100644
--- a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack2x16float_0e97b3 "pack2x16float_0e97b3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,46 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %19 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-       %uint = OpTypeInt 32 0
+         %22 = OpConstantNull %v2float
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
-%pack2x16float_0e97b3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_uint Function %25
-               OpStore %arg_0 %15
-         %22 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %uint %21 PackHalf2x16 %22
-               OpStore %res %19
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
+%pack2x16float_0e97b3 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %22
+        %res = OpVariable %_ptr_Function_uint Function %28
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2float %arg_0
+         %23 = OpExtInst %uint %24 PackHalf2x16 %25
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %pack2x16float_0e97b3
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pack2x16float_0e97b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %pack2x16float_0e97b3
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %pack2x16float_0e97b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %pack2x16float_0e97b3
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %pack2x16float_0e97b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.wgsl
index a0049c0..d344203 100644
--- a/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pack2x16float/0e97b3.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn pack2x16float_0e97b3() {
   var arg_0 = vec2<f32>(1.0f);
   var res : u32 = pack2x16float(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack2x16float_0e97b3();
diff --git a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl
index e0ca978..40f50e7 100644
--- a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl
+++ b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl
@@ -25,7 +25,9 @@
 fn pack2x16snorm_6c169b() {
   var arg_0 = vec2<f32>(1.f);
   var res: u32 = pack2x16snorm(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.dxc.hlsl
index ef98643..fb7236d 100644
--- a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.dxc.hlsl
@@ -3,9 +3,12 @@
   return asuint(i.x | i.y << 16);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16snorm_6c169b() {
   float2 arg_0 = (1.0f).xx;
   uint res = tint_pack2x16snorm(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.fxc.hlsl
index ef98643..fb7236d 100644
--- a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.fxc.hlsl
@@ -3,9 +3,12 @@
   return asuint(i.x | i.y << 16);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16snorm_6c169b() {
   float2 arg_0 = (1.0f).xx;
   uint res = tint_pack2x16snorm(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.glsl b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.glsl
index 671e3e9..fb0ecd1 100644
--- a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16snorm_6c169b() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packSnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16snorm_6c169b() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packSnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16snorm_6c169b() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packSnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.msl b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.msl
index cca6392..bc5132d 100644
--- a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack2x16snorm_6c169b() {
+void pack2x16snorm_6c169b(device uint* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   uint res = pack_float_to_snorm2x16(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack2x16snorm_6c169b();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack2x16snorm_6c169b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack2x16snorm_6c169b();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack2x16snorm_6c169b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack2x16snorm_6c169b();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack2x16snorm_6c169b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.spvasm
index bf9981b..c97f0c9 100644
--- a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack2x16snorm_6c169b "pack2x16snorm_6c169b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,46 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %19 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-       %uint = OpTypeInt 32 0
+         %22 = OpConstantNull %v2float
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
-%pack2x16snorm_6c169b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_uint Function %25
-               OpStore %arg_0 %15
-         %22 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %uint %21 PackSnorm2x16 %22
-               OpStore %res %19
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
+%pack2x16snorm_6c169b = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %22
+        %res = OpVariable %_ptr_Function_uint Function %28
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2float %arg_0
+         %23 = OpExtInst %uint %24 PackSnorm2x16 %25
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %pack2x16snorm_6c169b
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pack2x16snorm_6c169b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %pack2x16snorm_6c169b
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %pack2x16snorm_6c169b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %pack2x16snorm_6c169b
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %pack2x16snorm_6c169b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.wgsl
index ad7697a..8688783 100644
--- a/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pack2x16snorm/6c169b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn pack2x16snorm_6c169b() {
   var arg_0 = vec2<f32>(1.0f);
   var res : u32 = pack2x16snorm(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack2x16snorm_6c169b();
diff --git a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl
index 6be7de7..5077bda 100644
--- a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl
+++ b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl
@@ -25,7 +25,9 @@
 fn pack2x16unorm_0f08e4() {
   var arg_0 = vec2<f32>(1.f);
   var res: u32 = pack2x16unorm(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.dxc.hlsl
index fcb4bea..f33f94c 100644
--- a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.dxc.hlsl
@@ -3,9 +3,12 @@
   return (i.x | i.y << 16);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16unorm_0f08e4() {
   float2 arg_0 = (1.0f).xx;
   uint res = tint_pack2x16unorm(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.fxc.hlsl
index fcb4bea..f33f94c 100644
--- a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.fxc.hlsl
@@ -3,9 +3,12 @@
   return (i.x | i.y << 16);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack2x16unorm_0f08e4() {
   float2 arg_0 = (1.0f).xx;
   uint res = tint_pack2x16unorm(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.glsl b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.glsl
index b888043..3eb954f 100644
--- a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16unorm_0f08e4() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packUnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16unorm_0f08e4() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packUnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack2x16unorm_0f08e4() {
   vec2 arg_0 = vec2(1.0f);
   uint res = packUnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.msl b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.msl
index 9e4aec4..50ff465 100644
--- a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack2x16unorm_0f08e4() {
+void pack2x16unorm_0f08e4(device uint* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   uint res = pack_float_to_unorm2x16(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack2x16unorm_0f08e4();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack2x16unorm_0f08e4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack2x16unorm_0f08e4();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack2x16unorm_0f08e4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack2x16unorm_0f08e4();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack2x16unorm_0f08e4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.spvasm
index 49aaa65..9e9be4b 100644
--- a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack2x16unorm_0f08e4 "pack2x16unorm_0f08e4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,46 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+       %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %19 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-       %uint = OpTypeInt 32 0
+         %22 = OpConstantNull %v2float
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
-%pack2x16unorm_0f08e4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_uint Function %25
-               OpStore %arg_0 %15
-         %22 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %uint %21 PackUnorm2x16 %22
-               OpStore %res %19
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
+%pack2x16unorm_0f08e4 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %22
+        %res = OpVariable %_ptr_Function_uint Function %28
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2float %arg_0
+         %23 = OpExtInst %uint %24 PackUnorm2x16 %25
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %pack2x16unorm_0f08e4
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pack2x16unorm_0f08e4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %pack2x16unorm_0f08e4
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %pack2x16unorm_0f08e4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %pack2x16unorm_0f08e4
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %pack2x16unorm_0f08e4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.wgsl
index 2b7ffb2..571e3ea 100644
--- a/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pack2x16unorm/0f08e4.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn pack2x16unorm_0f08e4() {
   var arg_0 = vec2<f32>(1.0f);
   var res : u32 = pack2x16unorm(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack2x16unorm_0f08e4();
diff --git a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl
index 846ce98..168938d 100644
--- a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl
+++ b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl
@@ -25,7 +25,9 @@
 fn pack4x8snorm_4d22e7() {
   var arg_0 = vec4<f32>(1.f);
   var res: u32 = pack4x8snorm(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.dxc.hlsl
index c972c3c..92981c7 100644
--- a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.dxc.hlsl
@@ -3,9 +3,12 @@
   return asuint(i.x | i.y << 8 | i.z << 16 | i.w << 24);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack4x8snorm_4d22e7() {
   float4 arg_0 = (1.0f).xxxx;
   uint res = tint_pack4x8snorm(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.fxc.hlsl
index c972c3c..92981c7 100644
--- a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.fxc.hlsl
@@ -3,9 +3,12 @@
   return asuint(i.x | i.y << 8 | i.z << 16 | i.w << 24);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack4x8snorm_4d22e7() {
   float4 arg_0 = (1.0f).xxxx;
   uint res = tint_pack4x8snorm(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.glsl b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.glsl
index 769ce4f..8142e81 100644
--- a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8snorm_4d22e7() {
   vec4 arg_0 = vec4(1.0f);
   uint res = packSnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8snorm_4d22e7() {
   vec4 arg_0 = vec4(1.0f);
   uint res = packSnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8snorm_4d22e7() {
   vec4 arg_0 = vec4(1.0f);
   uint res = packSnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.msl b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.msl
index 49f2d32..e8e8924 100644
--- a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack4x8snorm_4d22e7() {
+void pack4x8snorm_4d22e7(device uint* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   uint res = pack_float_to_snorm4x8(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack4x8snorm_4d22e7();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack4x8snorm_4d22e7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack4x8snorm_4d22e7();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack4x8snorm_4d22e7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack4x8snorm_4d22e7();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack4x8snorm_4d22e7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.spvasm
index 64f0b03..f468656 100644
--- a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack4x8snorm_4d22e7 "pack4x8snorm_4d22e7"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
-    %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-%_ptr_Function_v4float = OpTypePointer Function %v4float
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+    %float_1 = OpConstant %float 1
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
-%pack4x8snorm_4d22e7 = OpFunction %void None %9
-         %12 = OpLabel
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
+%pack4x8snorm_4d22e7 = OpFunction %void None %13
+         %16 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
-        %res = OpVariable %_ptr_Function_uint Function %23
-               OpStore %arg_0 %14
-         %20 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %uint %19 PackSnorm4x8 %20
-               OpStore %res %17
+        %res = OpVariable %_ptr_Function_uint Function %26
+               OpStore %arg_0 %18
+         %23 = OpLoad %v4float %arg_0
+         %21 = OpExtInst %uint %22 PackSnorm4x8 %23
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %pack4x8snorm_4d22e7
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %pack4x8snorm_4d22e7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %pack4x8snorm_4d22e7
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %pack4x8snorm_4d22e7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %pack4x8snorm_4d22e7
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %pack4x8snorm_4d22e7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.wgsl
index 965c4ba..5861b16 100644
--- a/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pack4x8snorm/4d22e7.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn pack4x8snorm_4d22e7() {
   var arg_0 = vec4<f32>(1.0f);
   var res : u32 = pack4x8snorm(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack4x8snorm_4d22e7();
diff --git a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl
index bef2623..77a0ece 100644
--- a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl
+++ b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl
@@ -25,7 +25,9 @@
 fn pack4x8unorm_95c456() {
   var arg_0 = vec4<f32>(1.f);
   var res: u32 = pack4x8unorm(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.dxc.hlsl
index 4577820..b4cf3df 100644
--- a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.dxc.hlsl
@@ -3,9 +3,12 @@
   return (i.x | i.y << 8 | i.z << 16 | i.w << 24);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack4x8unorm_95c456() {
   float4 arg_0 = (1.0f).xxxx;
   uint res = tint_pack4x8unorm(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.fxc.hlsl
index 4577820..b4cf3df 100644
--- a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.fxc.hlsl
@@ -3,9 +3,12 @@
   return (i.x | i.y << 8 | i.z << 16 | i.w << 24);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pack4x8unorm_95c456() {
   float4 arg_0 = (1.0f).xxxx;
   uint res = tint_pack4x8unorm(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.glsl b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.glsl
index 80a0b9b..7c21dd3 100644
--- a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8unorm_95c456() {
   vec4 arg_0 = vec4(1.0f);
   uint res = packUnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8unorm_95c456() {
   vec4 arg_0 = vec4(1.0f);
   uint res = packUnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void pack4x8unorm_95c456() {
   vec4 arg_0 = vec4(1.0f);
   uint res = packUnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.msl b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.msl
index acba42a..2d2e28f 100644
--- a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pack4x8unorm_95c456() {
+void pack4x8unorm_95c456(device uint* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   uint res = pack_float_to_unorm4x8(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pack4x8unorm_95c456();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  pack4x8unorm_95c456(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pack4x8unorm_95c456();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  pack4x8unorm_95c456(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pack4x8unorm_95c456();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  pack4x8unorm_95c456(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.spvasm
index f064de4..cf92231 100644
--- a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pack4x8unorm_95c456 "pack4x8unorm_95c456"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
-    %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-%_ptr_Function_v4float = OpTypePointer Function %v4float
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
+    %float_1 = OpConstant %float 1
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
-%pack4x8unorm_95c456 = OpFunction %void None %9
-         %12 = OpLabel
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
+%pack4x8unorm_95c456 = OpFunction %void None %13
+         %16 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
-        %res = OpVariable %_ptr_Function_uint Function %23
-               OpStore %arg_0 %14
-         %20 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %uint %19 PackUnorm4x8 %20
-               OpStore %res %17
+        %res = OpVariable %_ptr_Function_uint Function %26
+               OpStore %arg_0 %18
+         %23 = OpLoad %v4float %arg_0
+         %21 = OpExtInst %uint %22 PackUnorm4x8 %23
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %pack4x8unorm_95c456
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %pack4x8unorm_95c456
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %pack4x8unorm_95c456
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %pack4x8unorm_95c456
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %pack4x8unorm_95c456
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %pack4x8unorm_95c456
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.wgsl
index 653c338..1463f62 100644
--- a/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pack4x8unorm/95c456.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn pack4x8unorm_95c456() {
   var arg_0 = vec4<f32>(1.0f);
   var res : u32 = pack4x8unorm(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pack4x8unorm_95c456();
diff --git a/test/tint/builtins/gen/var/pow/04a908.wgsl b/test/tint/builtins/gen/var/pow/04a908.wgsl
index a5673c6..7f7288d 100644
--- a/test/tint/builtins/gen/var/pow/04a908.wgsl
+++ b/test/tint/builtins/gen/var/pow/04a908.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<f32>(1.f);
   var res: vec4<f32> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.dxc.hlsl
index 1627d18..ba6cd70 100644
--- a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_04a908() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = pow(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.fxc.hlsl
index 1627d18..ba6cd70 100644
--- a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_04a908() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = pow(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.glsl b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.glsl
index 73fb0f1..c5e903a 100644
--- a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void pow_04a908() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void pow_04a908() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void pow_04a908() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.msl b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.msl
index efc8eeb..e568b03 100644
--- a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_04a908() {
+void pow_04a908(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 res = pow(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_04a908();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  pow_04a908(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_04a908();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  pow_04a908(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_04a908();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  pow_04a908(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.spvasm
index 1f127be..4669089 100644
--- a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_04a908 "pow_04a908"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,44 +38,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpTypeFunction %v4float
- %pow_04a908 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
+ %pow_04a908 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-         %20 = OpLoad %v4float %arg_0
-         %21 = OpLoad %v4float %arg_1
-         %18 = OpExtInst %v4float %19 Pow %20 %21
-               OpStore %res %18
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+         %23 = OpLoad %v4float %arg_0
+         %24 = OpLoad %v4float %arg_1
+         %21 = OpExtInst %v4float %22 Pow %23 %24
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %pow_04a908
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %pow_04a908
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %pow_04a908
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %pow_04a908
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %pow_04a908
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %pow_04a908
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.wgsl
index 4140a31..697eae4 100644
--- a/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pow/04a908.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<f32>(1.0f);
   var res : vec4<f32> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_04a908();
diff --git a/test/tint/builtins/gen/var/pow/46e029.wgsl b/test/tint/builtins/gen/var/pow/46e029.wgsl
index ac2ab7f..d2a3572 100644
--- a/test/tint/builtins/gen/var/pow/46e029.wgsl
+++ b/test/tint/builtins/gen/var/pow/46e029.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1.f;
   var arg_1 = 1.f;
   var res: f32 = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.dxc.hlsl
index 82b73ac..890e5c9 100644
--- a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_46e029() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = pow(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.fxc.hlsl
index 82b73ac..890e5c9 100644
--- a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_46e029() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = pow(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.glsl b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.glsl
index ba9d17e..2dd4cd5 100644
--- a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void pow_46e029() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void pow_46e029() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void pow_46e029() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.msl b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.msl
index 2cac6c7..819d09d 100644
--- a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_46e029() {
+void pow_46e029(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = pow(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_46e029();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  pow_46e029(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_46e029();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  pow_46e029(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_46e029();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  pow_46e029(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.spvasm
index cbf125f..694f353 100644
--- a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_46e029 "pow_46e029"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,43 +38,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpTypeFunction %v4float
- %pow_46e029 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
+ %pow_46e029 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
-         %19 = OpLoad %float %arg_0
-         %20 = OpLoad %float %arg_1
-         %17 = OpExtInst %float %18 Pow %19 %20
-               OpStore %res %17
+         %22 = OpLoad %float %arg_0
+         %23 = OpLoad %float %arg_1
+         %20 = OpExtInst %float %21 Pow %22 %23
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %pow_46e029
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %pow_46e029
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %pow_46e029
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %pow_46e029
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %pow_46e029
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %pow_46e029
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.wgsl
index 78398b8..fcd9506 100644
--- a/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pow/46e029.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1.0f;
   var arg_1 = 1.0f;
   var res : f32 = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_46e029();
diff --git a/test/tint/builtins/gen/var/pow/4a46c9.wgsl b/test/tint/builtins/gen/var/pow/4a46c9.wgsl
index 35082e9..679706b 100644
--- a/test/tint/builtins/gen/var/pow/4a46c9.wgsl
+++ b/test/tint/builtins/gen/var/pow/4a46c9.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: vec3<f32> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.dxc.hlsl
index bcc8f22..455e409 100644
--- a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_4a46c9() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = pow(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.fxc.hlsl
index bcc8f22..455e409 100644
--- a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_4a46c9() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = pow(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.glsl b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.glsl
index b01d4b0..d5eada7 100644
--- a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void pow_4a46c9() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void pow_4a46c9() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void pow_4a46c9() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.msl b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.msl
index 91d2b2d..e971b35 100644
--- a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_4a46c9() {
+void pow_4a46c9(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 res = pow(arg_0, arg_1);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_4a46c9();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  pow_4a46c9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_4a46c9();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  pow_4a46c9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_4a46c9();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  pow_4a46c9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.spvasm
index d5f5ebf..514d97f 100644
--- a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_4a46c9 "pow_4a46c9"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %25 = OpTypeFunction %v4float
- %pow_4a46c9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v3float %arg_0
-         %23 = OpLoad %v3float %arg_1
-         %20 = OpExtInst %v3float %21 Pow %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %33 = OpTypeFunction %v4float
+ %pow_4a46c9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v3float %arg_0
+         %26 = OpLoad %v3float %arg_1
+         %23 = OpExtInst %v3float %24 Pow %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %32 = OpLoad %v3float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pow_4a46c9
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pow_4a46c9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %pow_4a46c9
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %pow_4a46c9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %pow_4a46c9
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %pow_4a46c9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.wgsl
index a4ec757..54f8e02 100644
--- a/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pow/4a46c9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : vec3<f32> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_4a46c9();
diff --git a/test/tint/builtins/gen/var/pow/4f33b2.wgsl b/test/tint/builtins/gen/var/pow/4f33b2.wgsl
index 208361a..d77e04d 100644
--- a/test/tint/builtins/gen/var/pow/4f33b2.wgsl
+++ b/test/tint/builtins/gen/var/pow/4f33b2.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<f16>(1.h);
   var res: vec4<f16> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.dxc.hlsl
index 6492891..0292929 100644
--- a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_4f33b2() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = pow(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.fxc.hlsl
index 313dc5d..93b34a6 100644
--- a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_4f33b2() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = pow(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.glsl b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.glsl
index 5bc4a15..aa0fe74 100644
--- a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void pow_4f33b2() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void pow_4f33b2() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void pow_4f33b2() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.msl b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.msl
index 18b7935..24d1e17 100644
--- a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_4f33b2() {
+void pow_4f33b2(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 res = pow(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_4f33b2();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  pow_4f33b2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_4f33b2();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  pow_4f33b2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_4f33b2();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  pow_4f33b2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.spvasm
index 33e18d8..2e61354 100644
--- a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_4f33b2 "pow_4f33b2"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %pow_4f33b2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4half %arg_0
-         %24 = OpLoad %v4half %arg_1
-         %21 = OpExtInst %v4half %22 Pow %23 %24
-               OpStore %res %21
+ %pow_4f33b2 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4half %arg_0
+         %27 = OpLoad %v4half %arg_1
+         %24 = OpExtInst %v4half %25 Pow %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %33 = OpLoad %v4half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %pow_4f33b2
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %pow_4f33b2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %pow_4f33b2
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %pow_4f33b2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %pow_4f33b2
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %pow_4f33b2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.wgsl
index 8b19afe..caacf16 100644
--- a/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pow/4f33b2.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<f16>(1.0h);
   var res : vec4<f16> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_4f33b2();
diff --git a/test/tint/builtins/gen/var/pow/749c42.wgsl b/test/tint/builtins/gen/var/pow/749c42.wgsl
index 28a6356..cabd12a 100644
--- a/test/tint/builtins/gen/var/pow/749c42.wgsl
+++ b/test/tint/builtins/gen/var/pow/749c42.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1.;
   var res = pow(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_749c42();
diff --git a/test/tint/builtins/gen/var/pow/a8f6b2.wgsl b/test/tint/builtins/gen/var/pow/a8f6b2.wgsl
index 97038ee..f054914 100644
--- a/test/tint/builtins/gen/var/pow/a8f6b2.wgsl
+++ b/test/tint/builtins/gen/var/pow/a8f6b2.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1.);
   var res = pow(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_a8f6b2();
diff --git a/test/tint/builtins/gen/var/pow/bc91ed.wgsl b/test/tint/builtins/gen/var/pow/bc91ed.wgsl
index e3891cf..01efd71 100644
--- a/test/tint/builtins/gen/var/pow/bc91ed.wgsl
+++ b/test/tint/builtins/gen/var/pow/bc91ed.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1.);
   var res = pow(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_bc91ed();
diff --git a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl
index 9cdae13..de00ba7 100644
--- a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl
+++ b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1.h;
   var arg_1 = 1.h;
   var res: f16 = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.dxc.hlsl
index 6cab791..321989c 100644
--- a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_ce9ef5() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = pow(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.fxc.hlsl
index 3884960..d5b83bc 100644
--- a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_ce9ef5() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = pow(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.glsl b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.glsl
index 7a314b4..985f6e8a 100644
--- a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void pow_ce9ef5() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void pow_ce9ef5() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void pow_ce9ef5() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.msl b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.msl
index 6554112..de94b0f 100644
--- a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_ce9ef5() {
+void pow_ce9ef5(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half res = pow(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_ce9ef5();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  pow_ce9ef5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_ce9ef5();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  pow_ce9ef5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_ce9ef5();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  pow_ce9ef5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.spvasm
index f2625b1..2fc9bb2 100644
--- a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_ce9ef5 "pow_ce9ef5"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,46 +42,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %pow_ce9ef5 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %pow_ce9ef5 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
-         %21 = OpLoad %half %arg_0
-         %22 = OpLoad %half %arg_1
-         %19 = OpExtInst %half %20 Pow %21 %22
-               OpStore %res %19
+         %24 = OpLoad %half %arg_0
+         %25 = OpLoad %half %arg_1
+         %22 = OpExtInst %half %23 Pow %24 %25
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %pow_ce9ef5
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %pow_ce9ef5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %pow_ce9ef5
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %pow_ce9ef5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %pow_ce9ef5
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %pow_ce9ef5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.wgsl
index 0030fde..b54c82c 100644
--- a/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pow/ce9ef5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1.0h;
   var arg_1 = 1.0h;
   var res : f16 = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_ce9ef5();
diff --git a/test/tint/builtins/gen/var/pow/e42f20.wgsl b/test/tint/builtins/gen/var/pow/e42f20.wgsl
index 48cbde9..8f8a86d 100644
--- a/test/tint/builtins/gen/var/pow/e42f20.wgsl
+++ b/test/tint/builtins/gen/var/pow/e42f20.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = pow(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_e42f20();
diff --git a/test/tint/builtins/gen/var/pow/e60ea5.wgsl b/test/tint/builtins/gen/var/pow/e60ea5.wgsl
index 8d8a8f0..36f4f12 100644
--- a/test/tint/builtins/gen/var/pow/e60ea5.wgsl
+++ b/test/tint/builtins/gen/var/pow/e60ea5.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<f32>(1.f);
   var res: vec2<f32> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.dxc.hlsl
index 3b7f18f..47e7669 100644
--- a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_e60ea5() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = pow(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.fxc.hlsl
index 3b7f18f..47e7669 100644
--- a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_e60ea5() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = pow(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.glsl b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.glsl
index 0ad8d4e..425718f 100644
--- a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void pow_e60ea5() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void pow_e60ea5() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void pow_e60ea5() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.msl b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.msl
index 24f95d3..0f5ae1b 100644
--- a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_e60ea5() {
+void pow_e60ea5(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 res = pow(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_e60ea5();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  pow_e60ea5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_e60ea5();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  pow_e60ea5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_e60ea5();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  pow_e60ea5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.spvasm
index a31e014..72c0add 100644
--- a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_e60ea5 "pow_e60ea5"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
- %pow_e60ea5 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v2float %arg_0
-         %23 = OpLoad %v2float %arg_1
-         %20 = OpExtInst %v2float %21 Pow %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %33 = OpTypeFunction %v4float
+ %pow_e60ea5 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v2float %arg_0
+         %26 = OpLoad %v2float %arg_1
+         %23 = OpExtInst %v2float %24 Pow %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %32 = OpLoad %v2float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %pow_e60ea5
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %pow_e60ea5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %pow_e60ea5
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %pow_e60ea5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %pow_e60ea5
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %pow_e60ea5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.wgsl
index 0c7df27..2ef83d4 100644
--- a/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pow/e60ea5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<f32>(1.0f);
   var res : vec2<f32> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_e60ea5();
diff --git a/test/tint/builtins/gen/var/pow/f37b25.wgsl b/test/tint/builtins/gen/var/pow/f37b25.wgsl
index 6658892..3b7b020 100644
--- a/test/tint/builtins/gen/var/pow/f37b25.wgsl
+++ b/test/tint/builtins/gen/var/pow/f37b25.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<f16>(1.h);
   var res: vec2<f16> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.dxc.hlsl
index 1b67444..5d7a8dd 100644
--- a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_f37b25() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = pow(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.fxc.hlsl
index acaaffb..934e25a 100644
--- a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_f37b25() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = pow(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.glsl b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.glsl
index bd5e74c..f4958ec 100644
--- a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void pow_f37b25() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void pow_f37b25() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void pow_f37b25() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.msl b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.msl
index 7fbe58a..c545280 100644
--- a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_f37b25() {
+void pow_f37b25(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 res = pow(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_f37b25();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  pow_f37b25(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_f37b25();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  pow_f37b25(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_f37b25();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  pow_f37b25(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.spvasm
index b83fd05..0afb454 100644
--- a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_f37b25 "pow_f37b25"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %pow_f37b25 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2half %arg_0
-         %24 = OpLoad %v2half %arg_1
-         %21 = OpExtInst %v2half %22 Pow %23 %24
-               OpStore %res %21
+ %pow_f37b25 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2half %arg_0
+         %27 = OpLoad %v2half %arg_1
+         %24 = OpExtInst %v2half %25 Pow %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %33 = OpLoad %v2half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %pow_f37b25
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %pow_f37b25
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %pow_f37b25
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %pow_f37b25
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %pow_f37b25
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %pow_f37b25
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.wgsl
index f8aa5e7..0b0f531 100644
--- a/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pow/f37b25.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<f16>(1.0h);
   var res : vec2<f16> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_f37b25();
diff --git a/test/tint/builtins/gen/var/pow/fa5429.wgsl b/test/tint/builtins/gen/var/pow/fa5429.wgsl
index 7258f43..2cc20a8 100644
--- a/test/tint/builtins/gen/var/pow/fa5429.wgsl
+++ b/test/tint/builtins/gen/var/pow/fa5429.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: vec3<f16> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.dxc.hlsl
index 884d1f5..46a0fcd 100644
--- a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_fa5429() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = pow(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.fxc.hlsl
index 09cd3e8..dc8d60f 100644
--- a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void pow_fa5429() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = pow(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.glsl b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.glsl
index c704188..f643a6f 100644
--- a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void pow_fa5429() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void pow_fa5429() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void pow_fa5429() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = pow(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.msl b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.msl
index 9b5c0fa..0c8f150 100644
--- a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void pow_fa5429() {
+void pow_fa5429(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 res = pow(arg_0, arg_1);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  pow_fa5429();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  pow_fa5429(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  pow_fa5429();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  pow_fa5429(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  pow_fa5429();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  pow_fa5429(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.spvasm b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.spvasm
index 7896da3..7bbe2a2 100644
--- a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %pow_fa5429 "pow_fa5429"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %pow_fa5429 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3half %arg_0
-         %24 = OpLoad %v3half %arg_1
-         %21 = OpExtInst %v3half %22 Pow %23 %24
-               OpStore %res %21
+ %pow_fa5429 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3half %arg_0
+         %27 = OpLoad %v3half %arg_1
+         %24 = OpExtInst %v3half %25 Pow %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %33 = OpLoad %v3half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %pow_fa5429
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %pow_fa5429
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %pow_fa5429
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %pow_fa5429
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %pow_fa5429
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %pow_fa5429
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.wgsl b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.wgsl
index 0b3b9de..347e5f7 100644
--- a/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/pow/fa5429.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : vec3<f16> = pow(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   pow_fa5429();
diff --git a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl
index 0db4d3d..258c132 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl
@@ -25,7 +25,9 @@
 fn quantizeToF16_12e50e() {
   var arg_0 = 1.f;
   var res: f32 = quantizeToF16(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.dxc.hlsl
index dc09097..6fef161 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_12e50e() {
   float arg_0 = 1.0f;
   float res = float(min16float(arg_0));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.fxc.hlsl
index dc09097..6fef161 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_12e50e() {
   float arg_0 = 1.0f;
   float res = float(min16float(arg_0));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.glsl b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.glsl
index bdf4066..6cfcd39 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void quantizeToF16_12e50e() {
   float arg_0 = 1.0f;
   float res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void quantizeToF16_12e50e() {
   float arg_0 = 1.0f;
   float res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void quantizeToF16_12e50e() {
   float arg_0 = 1.0f;
   float res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.msl b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.msl
index fe77da0..3b3e65f 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void quantizeToF16_12e50e() {
+void quantizeToF16_12e50e(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = float(half(arg_0));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  quantizeToF16_12e50e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  quantizeToF16_12e50e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  quantizeToF16_12e50e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  quantizeToF16_12e50e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  quantizeToF16_12e50e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  quantizeToF16_12e50e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.spvasm
index 364ed53..b01babb 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %quantizeToF16_12e50e "quantizeToF16_12e50e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,40 +36,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %19 = OpTypeFunction %v4float
-%quantizeToF16_12e50e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %27 = OpTypeFunction %v4float
+%quantizeToF16_12e50e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %17 = OpLoad %float %arg_0
-         %16 = OpQuantizeToF16 %float %17
-               OpStore %res %16
+         %20 = OpLoad %float %arg_0
+         %19 = OpQuantizeToF16 %float %20
+               OpStore %res %19
+         %25 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %26 = OpLoad %float %res
+               OpStore %25 %26
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %quantizeToF16_12e50e
+%vertex_main_inner = OpFunction %v4float None %27
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %quantizeToF16_12e50e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %24 = OpLabel
-         %25 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %25
+%vertex_main = OpFunction %void None %12
+         %32 = OpLabel
+         %33 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %33
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %quantizeToF16_12e50e
+%fragment_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %quantizeToF16_12e50e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %quantizeToF16_12e50e
+%compute_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %quantizeToF16_12e50e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.wgsl
index db42012..17f0aa7 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/12e50e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn quantizeToF16_12e50e() {
   var arg_0 = 1.0f;
   var res : f32 = quantizeToF16(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   quantizeToF16_12e50e();
diff --git a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl
index b206740..b9cd2a2 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl
@@ -25,7 +25,9 @@
 fn quantizeToF16_2cddf3() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = quantizeToF16(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.dxc.hlsl
index b8c9801..f417dc6 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_2cddf3() {
   float2 arg_0 = (1.0f).xx;
   float2 res = float2(min16float2(arg_0));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.fxc.hlsl
index b8c9801..f417dc6 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_2cddf3() {
   float2 arg_0 = (1.0f).xx;
   float2 res = float2(min16float2(arg_0));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.glsl b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.glsl
index a1cc981..085fd8b 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void quantizeToF16_2cddf3() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void quantizeToF16_2cddf3() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void quantizeToF16_2cddf3() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.msl b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.msl
index f1465f5..d5ea2d3 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void quantizeToF16_2cddf3() {
+void quantizeToF16_2cddf3(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = float2(half2(arg_0));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  quantizeToF16_2cddf3();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  quantizeToF16_2cddf3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  quantizeToF16_2cddf3();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  quantizeToF16_2cddf3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  quantizeToF16_2cddf3();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  quantizeToF16_2cddf3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.spvasm
index b1765a7..12890bc 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_quantizeToF16 "tint_quantizeToF16"
                OpName %v "v"
                OpName %quantizeToF16_2cddf3 "quantizeToF16_2cddf3"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,56 +39,64 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
     %v2float = OpTypeVector %float 2
-          %9 = OpTypeFunction %v2float %v2float
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %v2float %v2float
        %uint = OpTypeInt 32 0
-         %16 = OpConstantNull %uint
+         %19 = OpConstantNull %uint
      %uint_1 = OpConstant %uint 1
        %void = OpTypeVoid
-         %22 = OpTypeFunction %void
+         %25 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %27 = OpConstantComposite %v2float %float_1 %float_1
+         %30 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %30 = OpConstantNull %v2float
-         %34 = OpTypeFunction %v4float
-%tint_quantizeToF16 = OpFunction %v2float None %9
+         %33 = OpConstantNull %v2float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %41 = OpTypeFunction %v4float
+%tint_quantizeToF16 = OpFunction %v2float None %13
           %v = OpFunctionParameter %v2float
-         %13 = OpLabel
-         %17 = OpCompositeExtract %float %v 0
-         %14 = OpQuantizeToF16 %float %17
-         %20 = OpCompositeExtract %float %v 1
-         %18 = OpQuantizeToF16 %float %20
-         %21 = OpCompositeConstruct %v2float %14 %18
-               OpReturnValue %21
+         %16 = OpLabel
+         %20 = OpCompositeExtract %float %v 0
+         %17 = OpQuantizeToF16 %float %20
+         %23 = OpCompositeExtract %float %v 1
+         %21 = OpQuantizeToF16 %float %23
+         %24 = OpCompositeConstruct %v2float %17 %21
+               OpReturnValue %24
                OpFunctionEnd
-%quantizeToF16_2cddf3 = OpFunction %void None %22
-         %25 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %30
-        %res = OpVariable %_ptr_Function_v2float Function %30
-               OpStore %arg_0 %27
-         %32 = OpLoad %v2float %arg_0
-         %31 = OpFunctionCall %v2float %tint_quantizeToF16 %32
-               OpStore %res %31
+%quantizeToF16_2cddf3 = OpFunction %void None %25
+         %28 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %33
+        %res = OpVariable %_ptr_Function_v2float Function %33
+               OpStore %arg_0 %30
+         %35 = OpLoad %v2float %arg_0
+         %34 = OpFunctionCall %v2float %tint_quantizeToF16 %35
+               OpStore %res %34
+         %39 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %40 = OpLoad %v2float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %quantizeToF16_2cddf3
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %quantizeToF16_2cddf3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %22
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %25
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %22
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %quantizeToF16_2cddf3
+%fragment_main = OpFunction %void None %25
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %quantizeToF16_2cddf3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %22
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %quantizeToF16_2cddf3
+%compute_main = OpFunction %void None %25
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %quantizeToF16_2cddf3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.wgsl
index 9909116..704b69e 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/2cddf3.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn quantizeToF16_2cddf3() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = quantizeToF16(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   quantizeToF16_2cddf3();
diff --git a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl
index d647f17..aadb852 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl
@@ -25,7 +25,9 @@
 fn quantizeToF16_cba294() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = quantizeToF16(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.dxc.hlsl
index 2acea19..b1e0299 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_cba294() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = float4(min16float4(arg_0));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.fxc.hlsl
index 2acea19..b1e0299 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_cba294() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = float4(min16float4(arg_0));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.glsl b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.glsl
index 8fe738e..901fbf8 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.glsl
@@ -7,9 +7,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void quantizeToF16_cba294() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,9 +40,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void quantizeToF16_cba294() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -57,9 +67,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void quantizeToF16_cba294() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.msl b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.msl
index a1def76..cc0cc1c 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void quantizeToF16_cba294() {
+void quantizeToF16_cba294(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = float4(half4(arg_0));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  quantizeToF16_cba294();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  quantizeToF16_cba294(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  quantizeToF16_cba294();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  quantizeToF16_cba294(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  quantizeToF16_cba294();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  quantizeToF16_cba294(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.spvasm b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.spvasm
index 68eed38..78aa62f 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_quantizeToF16 "tint_quantizeToF16"
                OpName %v "v"
                OpName %quantizeToF16_cba294 "quantizeToF16_cba294"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,61 +38,69 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-          %9 = OpTypeFunction %v4float %v4float
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %12 = OpTypeFunction %v4float %v4float
        %uint = OpTypeInt 32 0
-         %15 = OpConstantNull %uint
+         %18 = OpConstantNull %uint
      %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
        %void = OpTypeVoid
-         %27 = OpTypeFunction %void
+         %30 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %32 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %35 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%tint_quantizeToF16 = OpFunction %v4float None %9
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%tint_quantizeToF16 = OpFunction %v4float None %12
           %v = OpFunctionParameter %v4float
-         %12 = OpLabel
-         %16 = OpCompositeExtract %float %v 0
-         %13 = OpQuantizeToF16 %float %16
-         %19 = OpCompositeExtract %float %v 1
-         %17 = OpQuantizeToF16 %float %19
-         %22 = OpCompositeExtract %float %v 2
+         %15 = OpLabel
+         %19 = OpCompositeExtract %float %v 0
+         %16 = OpQuantizeToF16 %float %19
+         %22 = OpCompositeExtract %float %v 1
          %20 = OpQuantizeToF16 %float %22
-         %25 = OpCompositeExtract %float %v 3
+         %25 = OpCompositeExtract %float %v 2
          %23 = OpQuantizeToF16 %float %25
-         %26 = OpCompositeConstruct %v4float %13 %17 %20 %23
-               OpReturnValue %26
+         %28 = OpCompositeExtract %float %v 3
+         %26 = OpQuantizeToF16 %float %28
+         %29 = OpCompositeConstruct %v4float %16 %20 %23 %26
+               OpReturnValue %29
                OpFunctionEnd
-%quantizeToF16_cba294 = OpFunction %void None %27
-         %30 = OpLabel
+%quantizeToF16_cba294 = OpFunction %void None %30
+         %33 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %32
-         %36 = OpLoad %v4float %arg_0
-         %35 = OpFunctionCall %v4float %tint_quantizeToF16 %36
-               OpStore %res %35
+               OpStore %arg_0 %35
+         %39 = OpLoad %v4float %arg_0
+         %38 = OpFunctionCall %v4float %tint_quantizeToF16 %39
+               OpStore %res %38
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %quantizeToF16_cba294
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %quantizeToF16_cba294
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %27
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %30
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %27
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %quantizeToF16_cba294
+%fragment_main = OpFunction %void None %30
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %quantizeToF16_cba294
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %27
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %quantizeToF16_cba294
+%compute_main = OpFunction %void None %30
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %quantizeToF16_cba294
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.wgsl b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.wgsl
index 445723c..8555c93 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/cba294.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn quantizeToF16_cba294() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = quantizeToF16(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   quantizeToF16_cba294();
diff --git a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl
index 38c6785..5f0560c 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl
@@ -25,7 +25,9 @@
 fn quantizeToF16_e8fd14() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = quantizeToF16(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.dxc.hlsl
index 445ea20..cc97bf3 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_e8fd14() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = float3(min16float3(arg_0));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.fxc.hlsl
index 445ea20..cc97bf3 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void quantizeToF16_e8fd14() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = float3(min16float3(arg_0));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.glsl b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.glsl
index 34fc911..e600e43 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.glsl
@@ -7,9 +7,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void quantizeToF16_e8fd14() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -35,9 +40,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void quantizeToF16_e8fd14() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -57,9 +67,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void quantizeToF16_e8fd14() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_quantizeToF16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.msl b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.msl
index 15e1d87..7a2fc2c 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void quantizeToF16_e8fd14() {
+void quantizeToF16_e8fd14(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = float3(half3(arg_0));
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  quantizeToF16_e8fd14();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  quantizeToF16_e8fd14(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  quantizeToF16_e8fd14();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  quantizeToF16_e8fd14(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  quantizeToF16_e8fd14();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  quantizeToF16_e8fd14(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.spvasm b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.spvasm
index b617ab1..95b6a1b 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_quantizeToF16 "tint_quantizeToF16"
                OpName %v "v"
                OpName %quantizeToF16_e8fd14 "quantizeToF16_e8fd14"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,59 +39,67 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
     %v3float = OpTypeVector %float 3
-          %9 = OpTypeFunction %v3float %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %v3float %v3float
        %uint = OpTypeInt 32 0
-         %16 = OpConstantNull %uint
+         %19 = OpConstantNull %uint
      %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
        %void = OpTypeVoid
-         %25 = OpTypeFunction %void
+         %28 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %30 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %33 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %33 = OpConstantNull %v3float
-         %37 = OpTypeFunction %v4float
-%tint_quantizeToF16 = OpFunction %v3float None %9
+         %36 = OpConstantNull %v3float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %44 = OpTypeFunction %v4float
+%tint_quantizeToF16 = OpFunction %v3float None %13
           %v = OpFunctionParameter %v3float
-         %13 = OpLabel
-         %17 = OpCompositeExtract %float %v 0
-         %14 = OpQuantizeToF16 %float %17
-         %20 = OpCompositeExtract %float %v 1
-         %18 = OpQuantizeToF16 %float %20
-         %23 = OpCompositeExtract %float %v 2
+         %16 = OpLabel
+         %20 = OpCompositeExtract %float %v 0
+         %17 = OpQuantizeToF16 %float %20
+         %23 = OpCompositeExtract %float %v 1
          %21 = OpQuantizeToF16 %float %23
-         %24 = OpCompositeConstruct %v3float %14 %18 %21
-               OpReturnValue %24
+         %26 = OpCompositeExtract %float %v 2
+         %24 = OpQuantizeToF16 %float %26
+         %27 = OpCompositeConstruct %v3float %17 %21 %24
+               OpReturnValue %27
                OpFunctionEnd
-%quantizeToF16_e8fd14 = OpFunction %void None %25
-         %28 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %33
-        %res = OpVariable %_ptr_Function_v3float Function %33
-               OpStore %arg_0 %30
-         %35 = OpLoad %v3float %arg_0
-         %34 = OpFunctionCall %v3float %tint_quantizeToF16 %35
-               OpStore %res %34
+%quantizeToF16_e8fd14 = OpFunction %void None %28
+         %31 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %36
+        %res = OpVariable %_ptr_Function_v3float Function %36
+               OpStore %arg_0 %33
+         %38 = OpLoad %v3float %arg_0
+         %37 = OpFunctionCall %v3float %tint_quantizeToF16 %38
+               OpStore %res %37
+         %42 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %43 = OpLoad %v3float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %quantizeToF16_e8fd14
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %quantizeToF16_e8fd14
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %25
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %28
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %25
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %quantizeToF16_e8fd14
+%fragment_main = OpFunction %void None %28
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %quantizeToF16_e8fd14
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %25
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %quantizeToF16_e8fd14
+%compute_main = OpFunction %void None %28
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %quantizeToF16_e8fd14
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.wgsl b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.wgsl
index 8583c11..cbe0926 100644
--- a/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/quantizeToF16/e8fd14.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn quantizeToF16_e8fd14() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = quantizeToF16(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   quantizeToF16_e8fd14();
diff --git a/test/tint/builtins/gen/var/radians/09b7fc.wgsl b/test/tint/builtins/gen/var/radians/09b7fc.wgsl
index 02b0f07..53e599f 100644
--- a/test/tint/builtins/gen/var/radians/09b7fc.wgsl
+++ b/test/tint/builtins/gen/var/radians/09b7fc.wgsl
@@ -25,7 +25,9 @@
 fn radians_09b7fc() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = radians(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.dxc.hlsl
index ff0a882..38f95ca 100644
--- a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_09b7fc() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tint_radians(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.fxc.hlsl
index ff0a882..38f95ca 100644
--- a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_09b7fc() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tint_radians(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.glsl b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.glsl
index 7ffb9aa..c882f7b 100644
--- a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void radians_09b7fc() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void radians_09b7fc() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void radians_09b7fc() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.msl b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.msl
index 9ac1d95..67aa4ef 100644
--- a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 0.01745329251994329547;
 }
 
-void radians_09b7fc() {
+void radians_09b7fc(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = tint_radians(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_09b7fc();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  radians_09b7fc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_09b7fc();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  radians_09b7fc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_09b7fc();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  radians_09b7fc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.spvasm
index 0d4dee7..a5a40a8 100644
--- a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_09b7fc "radians_09b7fc"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%radians_09b7fc = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%radians_09b7fc = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Radians %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Radians %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %radians_09b7fc
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %radians_09b7fc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %radians_09b7fc
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %radians_09b7fc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %radians_09b7fc
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %radians_09b7fc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.wgsl
index 7fc38b5..ae73a2a 100644
--- a/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/radians/09b7fc.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn radians_09b7fc() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = radians(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_09b7fc();
diff --git a/test/tint/builtins/gen/var/radians/208fd9.wgsl b/test/tint/builtins/gen/var/radians/208fd9.wgsl
index fef9085..3dc1082 100644
--- a/test/tint/builtins/gen/var/radians/208fd9.wgsl
+++ b/test/tint/builtins/gen/var/radians/208fd9.wgsl
@@ -27,7 +27,9 @@
 fn radians_208fd9() {
   var arg_0 = 1.h;
   var res: f16 = radians(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.dxc.hlsl
index a593ba0..747c936 100644
--- a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_208fd9() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tint_radians(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.fxc.hlsl
index 5046cda..8390b8f 100644
--- a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.fxc.hlsl
@@ -1,12 +1,15 @@
 SKIP: FAILED
 
 float16_t tint_radians(float16_t param_0) {
-  return param_0 * 0.017453292519943295;
+  return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_208fd9() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tint_radians(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.glsl b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.glsl
index 4dacc28..c524c63 100644
--- a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.glsl
@@ -6,9 +6,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void radians_208fd9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -33,9 +38,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void radians_208fd9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -54,9 +64,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void radians_208fd9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.msl b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.msl
index b217676..9bd54c4 100644
--- a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 0.01745329251994329547;
 }
 
-void radians_208fd9() {
+void radians_208fd9(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = tint_radians(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_208fd9();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  radians_208fd9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_208fd9();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  radians_208fd9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_208fd9();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  radians_208fd9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.spvasm
index abf0521..8d1aadb 100644
--- a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_208fd9 "radians_208fd9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_208fd9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%radians_208fd9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Radians %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Radians %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %radians_208fd9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %radians_208fd9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %radians_208fd9
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %radians_208fd9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %radians_208fd9
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %radians_208fd9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.wgsl
index 15a8933..4e142cc 100644
--- a/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/radians/208fd9.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn radians_208fd9() {
   var arg_0 = 1.0h;
   var res : f16 = radians(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_208fd9();
diff --git a/test/tint/builtins/gen/var/radians/379214.wgsl b/test/tint/builtins/gen/var/radians/379214.wgsl
index 23569e7..8e47c2d 100644
--- a/test/tint/builtins/gen/var/radians/379214.wgsl
+++ b/test/tint/builtins/gen/var/radians/379214.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = radians(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_379214();
diff --git a/test/tint/builtins/gen/var/radians/44a9f8.wgsl b/test/tint/builtins/gen/var/radians/44a9f8.wgsl
index 4f64479..a058669 100644
--- a/test/tint/builtins/gen/var/radians/44a9f8.wgsl
+++ b/test/tint/builtins/gen/var/radians/44a9f8.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = radians(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_44a9f8();
diff --git a/test/tint/builtins/gen/var/radians/44f20b.wgsl b/test/tint/builtins/gen/var/radians/44f20b.wgsl
index fdf2d52..10d42e4 100644
--- a/test/tint/builtins/gen/var/radians/44f20b.wgsl
+++ b/test/tint/builtins/gen/var/radians/44f20b.wgsl
@@ -27,7 +27,9 @@
 fn radians_44f20b() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = radians(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.dxc.hlsl
index ee81bfa..8b30255 100644
--- a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_44f20b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tint_radians(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.fxc.hlsl
index a28ca62..cc44989 100644
--- a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.fxc.hlsl
@@ -1,12 +1,15 @@
 SKIP: FAILED
 
 vector<float16_t, 4> tint_radians(vector<float16_t, 4> param_0) {
-  return param_0 * 0.017453292519943295;
+  return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_44f20b() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tint_radians(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.glsl b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.glsl
index 1918fac..19da18b 100644
--- a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.glsl
@@ -6,9 +6,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void radians_44f20b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -33,9 +38,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void radians_44f20b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -54,9 +64,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void radians_44f20b() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.msl b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.msl
index 77b4d1f..b689ea3 100644
--- a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 0.01745329251994329547;
 }
 
-void radians_44f20b() {
+void radians_44f20b(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = tint_radians(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_44f20b();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  radians_44f20b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_44f20b();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  radians_44f20b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_44f20b();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  radians_44f20b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.spvasm
index 7c4cd8f..1a4e9a0 100644
--- a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_44f20b "radians_44f20b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_44f20b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Radians %22
-               OpStore %res %20
+%radians_44f20b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Radians %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %radians_44f20b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %radians_44f20b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %radians_44f20b
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %radians_44f20b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %radians_44f20b
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %radians_44f20b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.wgsl
index c0de07d..d31f65c 100644
--- a/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/radians/44f20b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn radians_44f20b() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = radians(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_44f20b();
diff --git a/test/tint/builtins/gen/var/radians/524a91.wgsl b/test/tint/builtins/gen/var/radians/524a91.wgsl
index 0b217c0..4cf4689 100644
--- a/test/tint/builtins/gen/var/radians/524a91.wgsl
+++ b/test/tint/builtins/gen/var/radians/524a91.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = radians(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_524a91();
diff --git a/test/tint/builtins/gen/var/radians/61687a.wgsl b/test/tint/builtins/gen/var/radians/61687a.wgsl
index de47dbf..a72b7b4 100644
--- a/test/tint/builtins/gen/var/radians/61687a.wgsl
+++ b/test/tint/builtins/gen/var/radians/61687a.wgsl
@@ -25,7 +25,9 @@
 fn radians_61687a() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = radians(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.dxc.hlsl
index af6889b..943aeea 100644
--- a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_61687a() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tint_radians(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.fxc.hlsl
index af6889b..943aeea 100644
--- a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_61687a() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tint_radians(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.glsl b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.glsl
index b768136..8b13d39 100644
--- a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void radians_61687a() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void radians_61687a() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void radians_61687a() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.msl b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.msl
index 36afee9..54d79cc 100644
--- a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 0.01745329251994329547;
 }
 
-void radians_61687a() {
+void radians_61687a(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = tint_radians(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_61687a();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  radians_61687a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_61687a();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  radians_61687a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_61687a();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  radians_61687a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.spvasm
index 637f457..af7f7e7 100644
--- a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_61687a "radians_61687a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%radians_61687a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Radians %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%radians_61687a = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Radians %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %radians_61687a
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %radians_61687a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %radians_61687a
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %radians_61687a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %radians_61687a
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %radians_61687a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.wgsl
index 9719b4e..ccbbeda 100644
--- a/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/radians/61687a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn radians_61687a() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = radians(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_61687a();
diff --git a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl
index 387746b..e5181f8 100644
--- a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl
+++ b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl
@@ -25,7 +25,9 @@
 fn radians_6b0ff2() {
   var arg_0 = 1.f;
   var res: f32 = radians(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.dxc.hlsl
index 6d6b9c4..aff1b57 100644
--- a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_6b0ff2() {
   float arg_0 = 1.0f;
   float res = tint_radians(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.fxc.hlsl
index 6d6b9c4..aff1b57 100644
--- a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_6b0ff2() {
   float arg_0 = 1.0f;
   float res = tint_radians(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.glsl b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.glsl
index 23092e3..2e0d958 100644
--- a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void radians_6b0ff2() {
   float arg_0 = 1.0f;
   float res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void radians_6b0ff2() {
   float arg_0 = 1.0f;
   float res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void radians_6b0ff2() {
   float arg_0 = 1.0f;
   float res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.msl b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.msl
index 4a87200..d5a4a97 100644
--- a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 0.01745329251994329547;
 }
 
-void radians_6b0ff2() {
+void radians_6b0ff2(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = tint_radians(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_6b0ff2();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  radians_6b0ff2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_6b0ff2();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  radians_6b0ff2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_6b0ff2();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  radians_6b0ff2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.spvasm
index ddbe63a..a7d4e3a 100644
--- a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_6b0ff2 "radians_6b0ff2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%radians_6b0ff2 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%radians_6b0ff2 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Radians %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Radians %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %radians_6b0ff2
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %radians_6b0ff2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %radians_6b0ff2
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %radians_6b0ff2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %radians_6b0ff2
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %radians_6b0ff2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.wgsl
index a5d9253..0ea97b8 100644
--- a/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/radians/6b0ff2.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn radians_6b0ff2() {
   var arg_0 = 1.0f;
   var res : f32 = radians(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_6b0ff2();
diff --git a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl
index cce0ce0..9ddec35 100644
--- a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl
+++ b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl
@@ -27,7 +27,9 @@
 fn radians_7ea4c7() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = radians(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.dxc.hlsl
index 4380e09..fa99efc 100644
--- a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_7ea4c7() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tint_radians(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.fxc.hlsl
index ef48984..1303076 100644
--- a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.fxc.hlsl
@@ -1,12 +1,15 @@
 SKIP: FAILED
 
 vector<float16_t, 3> tint_radians(vector<float16_t, 3> param_0) {
-  return param_0 * 0.017453292519943295;
+  return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_7ea4c7() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tint_radians(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.glsl b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.glsl
index 9115110..23decc1 100644
--- a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.glsl
@@ -6,9 +6,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void radians_7ea4c7() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -33,9 +38,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void radians_7ea4c7() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -54,9 +64,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void radians_7ea4c7() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.msl b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.msl
index 6ff5c2d..65e1c7c 100644
--- a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 0.01745329251994329547;
 }
 
-void radians_7ea4c7() {
+void radians_7ea4c7(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = tint_radians(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_7ea4c7();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  radians_7ea4c7(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_7ea4c7();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  radians_7ea4c7(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_7ea4c7();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  radians_7ea4c7(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.spvasm
index 5348b48..0a61d99 100644
--- a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_7ea4c7 "radians_7ea4c7"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_7ea4c7 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Radians %22
-               OpStore %res %20
+%radians_7ea4c7 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Radians %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %radians_7ea4c7
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %radians_7ea4c7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %radians_7ea4c7
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %radians_7ea4c7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %radians_7ea4c7
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %radians_7ea4c7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.wgsl
index 2c5ac74..4af9ca8 100644
--- a/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/radians/7ea4c7.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn radians_7ea4c7() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = radians(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_7ea4c7();
diff --git a/test/tint/builtins/gen/var/radians/bff231.wgsl b/test/tint/builtins/gen/var/radians/bff231.wgsl
index a38f95f..afb211a 100644
--- a/test/tint/builtins/gen/var/radians/bff231.wgsl
+++ b/test/tint/builtins/gen/var/radians/bff231.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = radians(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_bff231();
diff --git a/test/tint/builtins/gen/var/radians/f96258.wgsl b/test/tint/builtins/gen/var/radians/f96258.wgsl
index 0fb7fce..81b219e 100644
--- a/test/tint/builtins/gen/var/radians/f96258.wgsl
+++ b/test/tint/builtins/gen/var/radians/f96258.wgsl
@@ -25,7 +25,9 @@
 fn radians_f96258() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = radians(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.dxc.hlsl
index b91cd1f..eb07b82 100644
--- a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_f96258() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tint_radians(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.fxc.hlsl
index b91cd1f..eb07b82 100644
--- a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.fxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_f96258() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tint_radians(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.glsl b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.glsl
index ed858c2..a0280e0 100644
--- a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.glsl
@@ -5,9 +5,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void radians_f96258() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void radians_f96258() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void radians_f96258() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.msl b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.msl
index 3bb960b..e21b03f 100644
--- a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 0.01745329251994329547;
 }
 
-void radians_f96258() {
+void radians_f96258(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = tint_radians(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_f96258();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  radians_f96258(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_f96258();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  radians_f96258(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_f96258();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  radians_f96258(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.spvasm b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.spvasm
index b0f5711..64666cb 100644
--- a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_f96258 "radians_f96258"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%radians_f96258 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Radians %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%radians_f96258 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Radians %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %radians_f96258
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %radians_f96258
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %radians_f96258
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %radians_f96258
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %radians_f96258
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %radians_f96258
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.wgsl b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.wgsl
index 5a92c60..4c89311 100644
--- a/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/radians/f96258.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn radians_f96258() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = radians(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_f96258();
diff --git a/test/tint/builtins/gen/var/radians/fbacf0.wgsl b/test/tint/builtins/gen/var/radians/fbacf0.wgsl
index da67ac4..f47adca 100644
--- a/test/tint/builtins/gen/var/radians/fbacf0.wgsl
+++ b/test/tint/builtins/gen/var/radians/fbacf0.wgsl
@@ -27,7 +27,9 @@
 fn radians_fbacf0() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = radians(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.dxc.hlsl
index 398353d..8333471 100644
--- a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.dxc.hlsl
@@ -2,9 +2,12 @@
   return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_fbacf0() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tint_radians(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.fxc.hlsl
index 5c2608d..bcc79ab 100644
--- a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.fxc.hlsl
@@ -1,12 +1,15 @@
 SKIP: FAILED
 
 vector<float16_t, 2> tint_radians(vector<float16_t, 2> param_0) {
-  return param_0 * 0.017453292519943295;
+  return param_0 * 0.01745329251994329547;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void radians_fbacf0() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tint_radians(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.glsl b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.glsl
index ec4e4ca..0d56f17 100644
--- a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.glsl
@@ -6,9 +6,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void radians_fbacf0() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -33,9 +38,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void radians_fbacf0() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -54,9 +64,14 @@
 }
 
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void radians_fbacf0() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tint_radians(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.msl b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.msl
index ebf5567..2f3fffa 100644
--- a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.msl
@@ -6,34 +6,35 @@
   return param_0 * 0.01745329251994329547;
 }
 
-void radians_fbacf0() {
+void radians_fbacf0(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = tint_radians(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  radians_fbacf0();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  radians_fbacf0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  radians_fbacf0();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  radians_fbacf0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  radians_fbacf0();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  radians_fbacf0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.spvasm
index 76e0fb0..66f7aa7 100644
--- a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %radians_fbacf0 "radians_fbacf0"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%radians_fbacf0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Radians %22
-               OpStore %res %20
+%radians_fbacf0 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Radians %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %radians_fbacf0
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %radians_fbacf0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %radians_fbacf0
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %radians_fbacf0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %radians_fbacf0
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %radians_fbacf0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.wgsl
index d155eb7..340360c 100644
--- a/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/radians/fbacf0.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn radians_fbacf0() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = radians(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   radians_fbacf0();
diff --git a/test/tint/builtins/gen/var/reflect/05357e.wgsl b/test/tint/builtins/gen/var/reflect/05357e.wgsl
index bd2475d..ee386b0 100644
--- a/test/tint/builtins/gen/var/reflect/05357e.wgsl
+++ b/test/tint/builtins/gen/var/reflect/05357e.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<f32>(1.f);
   var res: vec4<f32> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.dxc.hlsl
index 0cda7e5..decab69 100644
--- a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_05357e() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = reflect(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.fxc.hlsl
index 0cda7e5..decab69 100644
--- a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_05357e() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = reflect(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.glsl b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.glsl
index adf9b8f..918e59e 100644
--- a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void reflect_05357e() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void reflect_05357e() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void reflect_05357e() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.msl b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.msl
index 9742733..3bc67cf 100644
--- a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_05357e() {
+void reflect_05357e(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 res = reflect(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_05357e();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  reflect_05357e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_05357e();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  reflect_05357e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_05357e();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  reflect_05357e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.spvasm
index 06d192d..eb630f3 100644
--- a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_05357e "reflect_05357e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,44 +38,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpTypeFunction %v4float
-%reflect_05357e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
+%reflect_05357e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-         %20 = OpLoad %v4float %arg_0
-         %21 = OpLoad %v4float %arg_1
-         %18 = OpExtInst %v4float %19 Reflect %20 %21
-               OpStore %res %18
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+         %23 = OpLoad %v4float %arg_0
+         %24 = OpLoad %v4float %arg_1
+         %21 = OpExtInst %v4float %22 Reflect %23 %24
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %reflect_05357e
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %reflect_05357e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %reflect_05357e
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reflect_05357e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %reflect_05357e
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %reflect_05357e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.wgsl
index c453132..06db41b 100644
--- a/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reflect/05357e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<f32>(1.0f);
   var res : vec4<f32> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_05357e();
diff --git a/test/tint/builtins/gen/var/reflect/310de5.wgsl b/test/tint/builtins/gen/var/reflect/310de5.wgsl
index a354db4..6fc9822 100644
--- a/test/tint/builtins/gen/var/reflect/310de5.wgsl
+++ b/test/tint/builtins/gen/var/reflect/310de5.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<f16>(1.h);
   var res: vec4<f16> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.dxc.hlsl
index e43742c..32dd1bf 100644
--- a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_310de5() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = reflect(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.fxc.hlsl
index f99ed02..03e87f0 100644
--- a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_310de5() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = reflect(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.glsl b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.glsl
index 92460b0..a5a6280 100644
--- a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void reflect_310de5() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void reflect_310de5() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void reflect_310de5() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.msl b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.msl
index 682016a..0f9ae0c 100644
--- a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_310de5() {
+void reflect_310de5(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 res = reflect(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_310de5();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  reflect_310de5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_310de5();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  reflect_310de5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_310de5();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  reflect_310de5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.spvasm
index e73d061..ed22720 100644
--- a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_310de5 "reflect_310de5"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_310de5 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4half %arg_0
-         %24 = OpLoad %v4half %arg_1
-         %21 = OpExtInst %v4half %22 Reflect %23 %24
-               OpStore %res %21
+%reflect_310de5 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4half %arg_0
+         %27 = OpLoad %v4half %arg_1
+         %24 = OpExtInst %v4half %25 Reflect %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %33 = OpLoad %v4half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %reflect_310de5
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %reflect_310de5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reflect_310de5
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %reflect_310de5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %reflect_310de5
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %reflect_310de5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.wgsl
index eacdcf5..62bde09 100644
--- a/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reflect/310de5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<f16>(1.0h);
   var res : vec4<f16> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_310de5();
diff --git a/test/tint/builtins/gen/var/reflect/61ca21.wgsl b/test/tint/builtins/gen/var/reflect/61ca21.wgsl
index 8db93dc..c0ee180 100644
--- a/test/tint/builtins/gen/var/reflect/61ca21.wgsl
+++ b/test/tint/builtins/gen/var/reflect/61ca21.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: vec3<f16> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.dxc.hlsl
index 83cb3d7..cfd9706 100644
--- a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_61ca21() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = reflect(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.fxc.hlsl
index e89e032..fad0898 100644
--- a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_61ca21() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = reflect(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.glsl b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.glsl
index c7865a3..50eec83 100644
--- a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void reflect_61ca21() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void reflect_61ca21() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void reflect_61ca21() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.msl b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.msl
index 630d7d8..a85fe46 100644
--- a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_61ca21() {
+void reflect_61ca21(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 res = reflect(arg_0, arg_1);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_61ca21();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  reflect_61ca21(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_61ca21();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  reflect_61ca21(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_61ca21();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  reflect_61ca21(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.spvasm
index c44d319..c294abf 100644
--- a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_61ca21 "reflect_61ca21"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_61ca21 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3half %arg_0
-         %24 = OpLoad %v3half %arg_1
-         %21 = OpExtInst %v3half %22 Reflect %23 %24
-               OpStore %res %21
+%reflect_61ca21 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3half %arg_0
+         %27 = OpLoad %v3half %arg_1
+         %24 = OpExtInst %v3half %25 Reflect %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %33 = OpLoad %v3half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %reflect_61ca21
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %reflect_61ca21
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reflect_61ca21
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %reflect_61ca21
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %reflect_61ca21
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %reflect_61ca21
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.wgsl
index 312bd78..a4c31d4 100644
--- a/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reflect/61ca21.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : vec3<f16> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_61ca21();
diff --git a/test/tint/builtins/gen/var/reflect/a8baf2.wgsl b/test/tint/builtins/gen/var/reflect/a8baf2.wgsl
index c2d3817..52cdc80 100644
--- a/test/tint/builtins/gen/var/reflect/a8baf2.wgsl
+++ b/test/tint/builtins/gen/var/reflect/a8baf2.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = reflect(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_a8baf2();
diff --git a/test/tint/builtins/gen/var/reflect/b61e10.wgsl b/test/tint/builtins/gen/var/reflect/b61e10.wgsl
index f70d3d9..711218c 100644
--- a/test/tint/builtins/gen/var/reflect/b61e10.wgsl
+++ b/test/tint/builtins/gen/var/reflect/b61e10.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<f32>(1.f);
   var res: vec2<f32> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.dxc.hlsl
index 6692420..5890482 100644
--- a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_b61e10() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = reflect(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.fxc.hlsl
index 6692420..5890482 100644
--- a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_b61e10() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = reflect(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.glsl b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.glsl
index fe7a35a..23dcaec 100644
--- a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void reflect_b61e10() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void reflect_b61e10() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void reflect_b61e10() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.msl b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.msl
index c565be7..155e310 100644
--- a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_b61e10() {
+void reflect_b61e10(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 res = reflect(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_b61e10();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  reflect_b61e10(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_b61e10();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  reflect_b61e10(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_b61e10();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  reflect_b61e10(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.spvasm
index 998b514..2c97ff6 100644
--- a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_b61e10 "reflect_b61e10"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
-%reflect_b61e10 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v2float %arg_0
-         %23 = OpLoad %v2float %arg_1
-         %20 = OpExtInst %v2float %21 Reflect %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %33 = OpTypeFunction %v4float
+%reflect_b61e10 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v2float %arg_0
+         %26 = OpLoad %v2float %arg_1
+         %23 = OpExtInst %v2float %24 Reflect %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %32 = OpLoad %v2float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %reflect_b61e10
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %reflect_b61e10
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %reflect_b61e10
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %reflect_b61e10
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %reflect_b61e10
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %reflect_b61e10
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.wgsl
index 0a94288..fbb73af 100644
--- a/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reflect/b61e10.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<f32>(1.0f);
   var res : vec2<f32> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_b61e10();
diff --git a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl
index 530f7e3..c022313 100644
--- a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl
+++ b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<f16>(1.h);
   var res: vec2<f16> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.dxc.hlsl
index af87c6f..54c4010 100644
--- a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_bb15ac() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = reflect(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.fxc.hlsl
index d0cec07..f370764 100644
--- a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_bb15ac() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = reflect(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.glsl b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.glsl
index 6c0db69..82f47ef 100644
--- a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void reflect_bb15ac() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void reflect_bb15ac() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void reflect_bb15ac() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.msl b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.msl
index ea9a2f4..bfbf424 100644
--- a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_bb15ac() {
+void reflect_bb15ac(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 res = reflect(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_bb15ac();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  reflect_bb15ac(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_bb15ac();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  reflect_bb15ac(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_bb15ac();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  reflect_bb15ac(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.spvasm
index 3cd3744..85c5c4c 100644
--- a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_bb15ac "reflect_bb15ac"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reflect_bb15ac = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2half %arg_0
-         %24 = OpLoad %v2half %arg_1
-         %21 = OpExtInst %v2half %22 Reflect %23 %24
-               OpStore %res %21
+%reflect_bb15ac = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2half %arg_0
+         %27 = OpLoad %v2half %arg_1
+         %24 = OpExtInst %v2half %25 Reflect %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %33 = OpLoad %v2half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %reflect_bb15ac
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %reflect_bb15ac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reflect_bb15ac
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %reflect_bb15ac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %reflect_bb15ac
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %reflect_bb15ac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.wgsl
index a92b1de..e9c5629 100644
--- a/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reflect/bb15ac.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<f16>(1.0h);
   var res : vec2<f16> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_bb15ac();
diff --git a/test/tint/builtins/gen/var/reflect/bba2d0.wgsl b/test/tint/builtins/gen/var/reflect/bba2d0.wgsl
index 6010b5d..36f0523 100644
--- a/test/tint/builtins/gen/var/reflect/bba2d0.wgsl
+++ b/test/tint/builtins/gen/var/reflect/bba2d0.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1.);
   var res = reflect(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_bba2d0();
diff --git a/test/tint/builtins/gen/var/reflect/d7e210.wgsl b/test/tint/builtins/gen/var/reflect/d7e210.wgsl
index 7fc7db2..fb16b2f 100644
--- a/test/tint/builtins/gen/var/reflect/d7e210.wgsl
+++ b/test/tint/builtins/gen/var/reflect/d7e210.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1.);
   var res = reflect(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_d7e210();
diff --git a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl
index b793784..51a83b0 100644
--- a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl
+++ b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: vec3<f32> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.dxc.hlsl
index 454cc0f..1f637f5 100644
--- a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_f47fdb() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = reflect(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.fxc.hlsl
index 454cc0f..1f637f5 100644
--- a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reflect_f47fdb() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = reflect(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.glsl b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.glsl
index f2dd2c4..e28515b 100644
--- a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void reflect_f47fdb() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void reflect_f47fdb() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void reflect_f47fdb() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = reflect(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.msl b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.msl
index 6a48267..71d8b03 100644
--- a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reflect_f47fdb() {
+void reflect_f47fdb(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 res = reflect(arg_0, arg_1);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reflect_f47fdb();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  reflect_f47fdb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reflect_f47fdb();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  reflect_f47fdb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reflect_f47fdb();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  reflect_f47fdb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.spvasm
index 256904a..6bfa1d5 100644
--- a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reflect_f47fdb "reflect_f47fdb"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %25 = OpTypeFunction %v4float
-%reflect_f47fdb = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v3float %arg_0
-         %23 = OpLoad %v3float %arg_1
-         %20 = OpExtInst %v3float %21 Reflect %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %33 = OpTypeFunction %v4float
+%reflect_f47fdb = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v3float %arg_0
+         %26 = OpLoad %v3float %arg_1
+         %23 = OpExtInst %v3float %24 Reflect %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %32 = OpLoad %v3float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %reflect_f47fdb
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %reflect_f47fdb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %reflect_f47fdb
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %reflect_f47fdb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %reflect_f47fdb
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %reflect_f47fdb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.wgsl
index f0e8a24..86388ae 100644
--- a/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reflect/f47fdb.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : vec3<f32> = reflect(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reflect_f47fdb();
diff --git a/test/tint/builtins/gen/var/refract/0594ba.wgsl b/test/tint/builtins/gen/var/refract/0594ba.wgsl
index b78b564..b5a90b6 100644
--- a/test/tint/builtins/gen/var/refract/0594ba.wgsl
+++ b/test/tint/builtins/gen/var/refract/0594ba.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(1.h);
   var arg_2 = 1.h;
   var res: vec4<f16> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.dxc.hlsl
index 3d07673..0c15ab0 100644
--- a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_0594ba() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 4> res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.fxc.hlsl
index 33db6ca..e7cee23 100644
--- a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_0594ba() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 4> res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.glsl b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.glsl
index 149be20..8956c18 100644
--- a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void refract_0594ba() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec4 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void refract_0594ba() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec4 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void refract_0594ba() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec4 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.msl b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.msl
index 19e502d..9999a0c 100644
--- a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_0594ba() {
+void refract_0594ba(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half arg_2 = 1.0h;
   half4 res = refract(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_0594ba();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  refract_0594ba(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_0594ba();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  refract_0594ba(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_0594ba();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  refract_0594ba(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.spvasm b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.spvasm
index e55d03f..6504c93 100644
--- a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %25 = OpExtInstImport "GLSL.std.450"
+         %28 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_0594ba "refract_0594ba"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,53 +43,62 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %30 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_0594ba = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_half Function %23
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%refract_0594ba = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_half Function %26
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %half_0x1p_0
-         %26 = OpLoad %v4half %arg_0
-         %27 = OpLoad %v4half %arg_1
-         %28 = OpLoad %half %arg_2
-         %24 = OpExtInst %v4half %25 Refract %26 %27 %28
-               OpStore %res %24
+         %29 = OpLoad %v4half %arg_0
+         %30 = OpLoad %v4half %arg_1
+         %31 = OpLoad %half %arg_2
+         %27 = OpExtInst %v4half %28 Refract %29 %30 %31
+               OpStore %res %27
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %37 = OpLoad %v4half %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %refract_0594ba
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %refract_0594ba
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %refract_0594ba
+%fragment_main = OpFunction %void None %14
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %refract_0594ba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %refract_0594ba
+%compute_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %refract_0594ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.wgsl b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.wgsl
index 71253e2..ac4035b 100644
--- a/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/refract/0594ba.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(1.0h);
   var arg_2 = 1.0h;
   var res : vec4<f16> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_0594ba();
diff --git a/test/tint/builtins/gen/var/refract/570cb3.wgsl b/test/tint/builtins/gen/var/refract/570cb3.wgsl
index 258400f..8b7111f 100644
--- a/test/tint/builtins/gen/var/refract/570cb3.wgsl
+++ b/test/tint/builtins/gen/var/refract/570cb3.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(1.h);
   var arg_2 = 1.h;
   var res: vec2<f16> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.dxc.hlsl
index baacca5..05e7ec9 100644
--- a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_570cb3() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 2> res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.fxc.hlsl
index 96b3d5f..10f48b3 100644
--- a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_570cb3() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 2> res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.glsl b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.glsl
index 500142c..4ac1edd 100644
--- a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void refract_570cb3() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec2 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void refract_570cb3() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec2 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void refract_570cb3() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec2 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.msl b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.msl
index c0c6968..e9299e3 100644
--- a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_570cb3() {
+void refract_570cb3(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half arg_2 = 1.0h;
   half2 res = refract(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_570cb3();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  refract_570cb3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_570cb3();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  refract_570cb3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_570cb3();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  refract_570cb3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.spvasm
index 41b402f..9aa369b 100644
--- a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %25 = OpExtInstImport "GLSL.std.450"
+         %28 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_570cb3 "refract_570cb3"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,53 +43,62 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %30 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_570cb3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_half Function %23
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%refract_570cb3 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_half Function %26
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %half_0x1p_0
-         %26 = OpLoad %v2half %arg_0
-         %27 = OpLoad %v2half %arg_1
-         %28 = OpLoad %half %arg_2
-         %24 = OpExtInst %v2half %25 Refract %26 %27 %28
-               OpStore %res %24
+         %29 = OpLoad %v2half %arg_0
+         %30 = OpLoad %v2half %arg_1
+         %31 = OpLoad %half %arg_2
+         %27 = OpExtInst %v2half %28 Refract %29 %30 %31
+               OpStore %res %27
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %37 = OpLoad %v2half %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %refract_570cb3
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %refract_570cb3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %refract_570cb3
+%fragment_main = OpFunction %void None %14
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %refract_570cb3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %refract_570cb3
+%compute_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %refract_570cb3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.wgsl
index 8d79962..9e457e7 100644
--- a/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/refract/570cb3.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(1.0h);
   var arg_2 = 1.0h;
   var res : vec2<f16> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_570cb3();
diff --git a/test/tint/builtins/gen/var/refract/7e02e6.wgsl b/test/tint/builtins/gen/var/refract/7e02e6.wgsl
index 446c622..8a5d77a 100644
--- a/test/tint/builtins/gen/var/refract/7e02e6.wgsl
+++ b/test/tint/builtins/gen/var/refract/7e02e6.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(1.f);
   var arg_2 = 1.f;
   var res: vec4<f32> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.dxc.hlsl
index 420f537..7a9576a 100644
--- a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_7e02e6() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float arg_2 = 1.0f;
   float4 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.fxc.hlsl
index 420f537..7a9576a 100644
--- a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_7e02e6() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float arg_2 = 1.0f;
   float4 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.glsl b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.glsl
index 0f3be37..e92e164 100644
--- a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void refract_7e02e6() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float arg_2 = 1.0f;
   vec4 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void refract_7e02e6() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float arg_2 = 1.0f;
   vec4 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void refract_7e02e6() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   float arg_2 = 1.0f;
   vec4 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.msl b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.msl
index e3336a1..7a4dd24 100644
--- a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_7e02e6() {
+void refract_7e02e6(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float arg_2 = 1.0f;
   float4 res = refract(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_7e02e6();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  refract_7e02e6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_7e02e6();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  refract_7e02e6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_7e02e6();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  refract_7e02e6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.spvasm
index d968b0b..d242e4c 100644
--- a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_7e02e6 "refract_7e02e6"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,48 +39,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Function_float = OpTypePointer Function %float
-         %26 = OpTypeFunction %v4float
-%refract_7e02e6 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %34 = OpTypeFunction %v4float
+%refract_7e02e6 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
       %arg_2 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
                OpStore %arg_2 %float_1
-         %22 = OpLoad %v4float %arg_0
-         %23 = OpLoad %v4float %arg_1
-         %24 = OpLoad %float %arg_2
-         %20 = OpExtInst %v4float %21 Refract %22 %23 %24
-               OpStore %res %20
+         %25 = OpLoad %v4float %arg_0
+         %26 = OpLoad %v4float %arg_1
+         %27 = OpLoad %float %arg_2
+         %23 = OpExtInst %v4float %24 Refract %25 %26 %27
+               OpStore %res %23
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %33 = OpLoad %v4float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %refract_7e02e6
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %refract_7e02e6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %refract_7e02e6
+%fragment_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %refract_7e02e6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %refract_7e02e6
+%compute_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %refract_7e02e6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.wgsl
index 1b09ad8..fc0e7ed 100644
--- a/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/refract/7e02e6.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(1.0f);
   var arg_2 = 1.0f;
   var res : vec4<f32> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_7e02e6();
diff --git a/test/tint/builtins/gen/var/refract/8984af.wgsl b/test/tint/builtins/gen/var/refract/8984af.wgsl
index 00be9d5..7d46d56 100644
--- a/test/tint/builtins/gen/var/refract/8984af.wgsl
+++ b/test/tint/builtins/gen/var/refract/8984af.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(1.h);
   var arg_2 = 1.h;
   var res: vec3<f16> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.dxc.hlsl
index c8cf77a..9af720a 100644
--- a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_8984af() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 3> res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.fxc.hlsl
index 1ec42f0..449f15b 100644
--- a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_8984af() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   float16_t arg_2 = float16_t(1.0h);
   vector<float16_t, 3> res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.glsl b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.glsl
index 7a086c4..3a3a469 100644
--- a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void refract_8984af() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec3 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void refract_8984af() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec3 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void refract_8984af() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   float16_t arg_2 = 1.0hf;
   f16vec3 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.msl b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.msl
index c5919df..149c561 100644
--- a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_8984af() {
+void refract_8984af(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half arg_2 = 1.0h;
   half3 res = refract(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_8984af();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  refract_8984af(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_8984af();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  refract_8984af(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_8984af();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  refract_8984af(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.spvasm b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.spvasm
index a85e642..ad1e4fc 100644
--- a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %25 = OpExtInstImport "GLSL.std.450"
+         %28 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_8984af "refract_8984af"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,53 +43,62 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
 %_ptr_Function_half = OpTypePointer Function %half
-         %23 = OpConstantNull %half
-         %30 = OpTypeFunction %v4float
+         %26 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%refract_8984af = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_half Function %23
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%refract_8984af = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_half Function %26
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %half_0x1p_0
-         %26 = OpLoad %v3half %arg_0
-         %27 = OpLoad %v3half %arg_1
-         %28 = OpLoad %half %arg_2
-         %24 = OpExtInst %v3half %25 Refract %26 %27 %28
-               OpStore %res %24
+         %29 = OpLoad %v3half %arg_0
+         %30 = OpLoad %v3half %arg_1
+         %31 = OpLoad %half %arg_2
+         %27 = OpExtInst %v3half %28 Refract %29 %30 %31
+               OpStore %res %27
+         %36 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %37 = OpLoad %v3half %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %refract_8984af
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %refract_8984af
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %refract_8984af
+%fragment_main = OpFunction %void None %14
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %refract_8984af
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %refract_8984af
+%compute_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %refract_8984af
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.wgsl b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.wgsl
index 66bd307..21b3591 100644
--- a/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/refract/8984af.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(1.0h);
   var arg_2 = 1.0h;
   var res : vec3<f16> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_8984af();
diff --git a/test/tint/builtins/gen/var/refract/8c192a.wgsl b/test/tint/builtins/gen/var/refract/8c192a.wgsl
index 903f0df..864f244 100644
--- a/test/tint/builtins/gen/var/refract/8c192a.wgsl
+++ b/test/tint/builtins/gen/var/refract/8c192a.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = refract(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_8c192a();
diff --git a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl
index 50b6c2a..1d78c2e 100644
--- a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl
+++ b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(1.f);
   var arg_2 = 1.f;
   var res: vec3<f32> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.dxc.hlsl
index 67f5603..1911ab5 100644
--- a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_cbc1d2() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float arg_2 = 1.0f;
   float3 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.fxc.hlsl
index 67f5603..1911ab5 100644
--- a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_cbc1d2() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float arg_2 = 1.0f;
   float3 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.glsl b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.glsl
index 70113c8..da3c95e 100644
--- a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void refract_cbc1d2() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float arg_2 = 1.0f;
   vec3 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void refract_cbc1d2() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float arg_2 = 1.0f;
   vec3 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void refract_cbc1d2() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   float arg_2 = 1.0f;
   vec3 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.msl b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.msl
index 7313ac6..6f084c7 100644
--- a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_cbc1d2() {
+void refract_cbc1d2(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float arg_2 = 1.0f;
   float3 res = refract(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_cbc1d2();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  refract_cbc1d2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_cbc1d2();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  refract_cbc1d2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_cbc1d2();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  refract_cbc1d2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.spvasm
index e11f35d..b9ed868 100644
--- a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_cbc1d2 "refract_cbc1d2"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,50 +39,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %28 = OpTypeFunction %v4float
-%refract_cbc1d2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %36 = OpTypeFunction %v4float
+%refract_cbc1d2 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
       %arg_2 = OpVariable %_ptr_Function_float Function %8
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
                OpStore %arg_2 %float_1
-         %24 = OpLoad %v3float %arg_0
-         %25 = OpLoad %v3float %arg_1
-         %26 = OpLoad %float %arg_2
-         %22 = OpExtInst %v3float %23 Refract %24 %25 %26
-               OpStore %res %22
+         %27 = OpLoad %v3float %arg_0
+         %28 = OpLoad %v3float %arg_1
+         %29 = OpLoad %float %arg_2
+         %25 = OpExtInst %v3float %26 Refract %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %35 = OpLoad %v3float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %refract_cbc1d2
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %refract_cbc1d2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %refract_cbc1d2
+%fragment_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %refract_cbc1d2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %refract_cbc1d2
+%compute_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %refract_cbc1d2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.wgsl
index 807c0ee..d4ec40b 100644
--- a/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/refract/cbc1d2.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(1.0f);
   var arg_2 = 1.0f;
   var res : vec3<f32> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_cbc1d2();
diff --git a/test/tint/builtins/gen/var/refract/cd905f.wgsl b/test/tint/builtins/gen/var/refract/cd905f.wgsl
index 87cf606..60f9528 100644
--- a/test/tint/builtins/gen/var/refract/cd905f.wgsl
+++ b/test/tint/builtins/gen/var/refract/cd905f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(1.f);
   var arg_2 = 1.f;
   var res: vec2<f32> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.dxc.hlsl
index 2fe95fd..87af175 100644
--- a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_cd905f() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float arg_2 = 1.0f;
   float2 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.fxc.hlsl
index 2fe95fd..87af175 100644
--- a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void refract_cd905f() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float arg_2 = 1.0f;
   float2 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.glsl b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.glsl
index 530fad6..e251d38 100644
--- a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void refract_cd905f() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float arg_2 = 1.0f;
   vec2 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void refract_cd905f() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float arg_2 = 1.0f;
   vec2 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void refract_cd905f() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   float arg_2 = 1.0f;
   vec2 res = refract(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.msl b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.msl
index b9986c4..a8f2292 100644
--- a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void refract_cd905f() {
+void refract_cd905f(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float arg_2 = 1.0f;
   float2 res = refract(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  refract_cd905f();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  refract_cd905f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  refract_cd905f();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  refract_cd905f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  refract_cd905f();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  refract_cd905f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.spvasm
index 4b74ab2..f835797 100644
--- a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %refract_cd905f "refract_cd905f"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,50 +39,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %28 = OpTypeFunction %v4float
-%refract_cd905f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %36 = OpTypeFunction %v4float
+%refract_cd905f = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
       %arg_2 = OpVariable %_ptr_Function_float Function %8
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
                OpStore %arg_2 %float_1
-         %24 = OpLoad %v2float %arg_0
-         %25 = OpLoad %v2float %arg_1
-         %26 = OpLoad %float %arg_2
-         %22 = OpExtInst %v2float %23 Refract %24 %25 %26
-               OpStore %res %22
+         %27 = OpLoad %v2float %arg_0
+         %28 = OpLoad %v2float %arg_1
+         %29 = OpLoad %float %arg_2
+         %25 = OpExtInst %v2float %26 Refract %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %35 = OpLoad %v2float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %refract_cd905f
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %refract_cd905f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %refract_cd905f
+%fragment_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %refract_cd905f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %refract_cd905f
+%compute_main = OpFunction %void None %13
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %refract_cd905f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.wgsl
index 832641f..fa3a2a8 100644
--- a/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/refract/cd905f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(1.0f);
   var arg_2 = 1.0f;
   var res : vec2<f32> = refract(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_cd905f();
diff --git a/test/tint/builtins/gen/var/refract/cf1629.wgsl b/test/tint/builtins/gen/var/refract/cf1629.wgsl
index d7197e0..9b3c9e3 100644
--- a/test/tint/builtins/gen/var/refract/cf1629.wgsl
+++ b/test/tint/builtins/gen/var/refract/cf1629.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = refract(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_cf1629();
diff --git a/test/tint/builtins/gen/var/refract/d7569b.wgsl b/test/tint/builtins/gen/var/refract/d7569b.wgsl
index fe92eff..779db5a 100644
--- a/test/tint/builtins/gen/var/refract/d7569b.wgsl
+++ b/test/tint/builtins/gen/var/refract/d7569b.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 1.;
   var res = refract(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   refract_d7569b();
diff --git a/test/tint/builtins/gen/var/reverseBits/222177.wgsl b/test/tint/builtins/gen/var/reverseBits/222177.wgsl
index 0e6e37c..d20c24e 100644
--- a/test/tint/builtins/gen/var/reverseBits/222177.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/222177.wgsl
@@ -25,7 +25,9 @@
 fn reverseBits_222177() {
   var arg_0 = vec2<i32>(1i);
   var res: vec2<i32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.dxc.hlsl
index 2f576da..927aec2 100644
--- a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_222177() {
   int2 arg_0 = (1).xx;
   int2 res = asint(reversebits(asuint(arg_0)));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.fxc.hlsl
index 2f576da..927aec2 100644
--- a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_222177() {
   int2 arg_0 = (1).xx;
   int2 res = asint(reversebits(asuint(arg_0)));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.glsl b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.glsl
index e3f8da2..eb8e7c2 100644
--- a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void reverseBits_222177() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void reverseBits_222177() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void reverseBits_222177() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.msl b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.msl
index c717678..1fca455 100644
--- a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_222177() {
+void reverseBits_222177(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 res = reverse_bits(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_222177();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  reverseBits_222177(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_222177();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_222177(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_222177();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_222177(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.spvasm
index 17502f6e..694e6a1 100644
--- a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_222177 "reverseBits_222177"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_222177 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v2int %arg_0
-         %20 = OpBitReverse %v2int %21
-               OpStore %res %20
+%reverseBits_222177 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v2int %arg_0
+         %23 = OpBitReverse %v2int %24
+               OpStore %res %23
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %30 = OpLoad %v2int %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %reverseBits_222177
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %reverseBits_222177
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_222177
+%fragment_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reverseBits_222177
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reverseBits_222177
+%compute_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %reverseBits_222177
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.wgsl
index 5be6d2a..6d14820 100644
--- a/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/222177.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn reverseBits_222177() {
   var arg_0 = vec2<i32>(1i);
   var res : vec2<i32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_222177();
diff --git a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl
index e75ce03..c8ab194 100644
--- a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl
@@ -25,7 +25,9 @@
 fn reverseBits_35fea9() {
   var arg_0 = vec4<u32>(1u);
   var res: vec4<u32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.dxc.hlsl
index cd247be..5b458b2 100644
--- a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_35fea9() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = reversebits(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.fxc.hlsl
index cd247be..5b458b2 100644
--- a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_35fea9() {
   uint4 arg_0 = (1u).xxxx;
   uint4 res = reversebits(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.glsl b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.glsl
index d1dcef5..e13a645 100644
--- a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void reverseBits_35fea9() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void reverseBits_35fea9() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void reverseBits_35fea9() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.msl b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.msl
index 4844c1e..5ab98fe 100644
--- a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_35fea9() {
+void reverseBits_35fea9(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 res = reverse_bits(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_35fea9();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  reverseBits_35fea9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_35fea9();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_35fea9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_35fea9();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_35fea9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.spvasm
index 9348ffa..0723f42 100644
--- a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_35fea9 "reverseBits_35fea9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_35fea9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %19
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v4uint %arg_0
-         %20 = OpBitReverse %v4uint %21
-               OpStore %res %20
+%reverseBits_35fea9 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %22
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v4uint %arg_0
+         %23 = OpBitReverse %v4uint %24
+               OpStore %res %23
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %29 = OpLoad %v4uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %reverseBits_35fea9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %reverseBits_35fea9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_35fea9
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reverseBits_35fea9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reverseBits_35fea9
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %reverseBits_35fea9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.wgsl
index 72c7a80..5e0f993 100644
--- a/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/35fea9.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn reverseBits_35fea9() {
   var arg_0 = vec4<u32>(1u);
   var res : vec4<u32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_35fea9();
diff --git a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl
index 205ea11..f031424 100644
--- a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl
@@ -25,7 +25,9 @@
 fn reverseBits_4dbd6f() {
   var arg_0 = vec4<i32>(1i);
   var res: vec4<i32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.dxc.hlsl
index ae134e7..cf91bb1 100644
--- a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_4dbd6f() {
   int4 arg_0 = (1).xxxx;
   int4 res = asint(reversebits(asuint(arg_0)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.fxc.hlsl
index ae134e7..cf91bb1 100644
--- a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_4dbd6f() {
   int4 arg_0 = (1).xxxx;
   int4 res = asint(reversebits(asuint(arg_0)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.glsl b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.glsl
index cf503b5..29975d0 100644
--- a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void reverseBits_4dbd6f() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void reverseBits_4dbd6f() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void reverseBits_4dbd6f() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.msl b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.msl
index bbf569e..90ccee3 100644
--- a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_4dbd6f() {
+void reverseBits_4dbd6f(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 res = reverse_bits(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_4dbd6f();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  reverseBits_4dbd6f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_4dbd6f();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_4dbd6f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_4dbd6f();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_4dbd6f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.spvasm
index 5d0079c..236810c 100644
--- a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_4dbd6f "reverseBits_4dbd6f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_4dbd6f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v4int %arg_0
-         %20 = OpBitReverse %v4int %21
-               OpStore %res %20
+%reverseBits_4dbd6f = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v4int %arg_0
+         %23 = OpBitReverse %v4int %24
+               OpStore %res %23
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %30 = OpLoad %v4int %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %reverseBits_4dbd6f
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %reverseBits_4dbd6f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_4dbd6f
+%fragment_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reverseBits_4dbd6f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reverseBits_4dbd6f
+%compute_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %reverseBits_4dbd6f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.wgsl
index da84b88..2d37fc5 100644
--- a/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/4dbd6f.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn reverseBits_4dbd6f() {
   var arg_0 = vec4<i32>(1i);
   var res : vec4<i32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_4dbd6f();
diff --git a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl
index 5e8ff44..92a0065 100644
--- a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl
@@ -25,7 +25,9 @@
 fn reverseBits_7c4269() {
   var arg_0 = 1i;
   var res: i32 = reverseBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.dxc.hlsl
index c3ab61c..792ebe8 100644
--- a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_7c4269() {
   int arg_0 = 1;
   int res = asint(reversebits(asuint(arg_0)));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.fxc.hlsl
index c3ab61c..792ebe8 100644
--- a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_7c4269() {
   int arg_0 = 1;
   int res = asint(reversebits(asuint(arg_0)));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.glsl b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.glsl
index 7f5a812..b6b5c9b 100644
--- a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void reverseBits_7c4269() {
   int arg_0 = 1;
   int res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void reverseBits_7c4269() {
   int arg_0 = 1;
   int res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void reverseBits_7c4269() {
   int arg_0 = 1;
   int res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.msl b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.msl
index 2fd16d1..fca2454 100644
--- a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_7c4269() {
+void reverseBits_7c4269(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int res = reverse_bits(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_7c4269();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  reverseBits_7c4269(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_7c4269();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_7c4269(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_7c4269();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_7c4269(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.spvasm
index bd35052..412285d 100644
--- a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_7c4269 "reverseBits_7c4269"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,43 +36,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %21 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_7c4269 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %17
-        %res = OpVariable %_ptr_Function_int Function %17
+%reverseBits_7c4269 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %20
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %arg_0 %int_1
-         %19 = OpLoad %int %arg_0
-         %18 = OpBitReverse %int %19
-               OpStore %res %18
+         %22 = OpLoad %int %arg_0
+         %21 = OpBitReverse %int %22
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %28 = OpLoad %int %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %reverseBits_7c4269
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %reverseBits_7c4269
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %reverseBits_7c4269
+%fragment_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %reverseBits_7c4269
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %reverseBits_7c4269
+%compute_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %reverseBits_7c4269
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.wgsl
index dd2d69c..56a3bbe 100644
--- a/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/7c4269.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn reverseBits_7c4269() {
   var arg_0 = 1i;
   var res : i32 = reverseBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_7c4269();
diff --git a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl
index d89e7a0..1bc8761 100644
--- a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl
@@ -25,7 +25,9 @@
 fn reverseBits_a6ccd4() {
   var arg_0 = vec3<u32>(1u);
   var res: vec3<u32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.dxc.hlsl
index c2a6155..8d49f2f 100644
--- a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_a6ccd4() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = reversebits(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.fxc.hlsl
index c2a6155..8d49f2f 100644
--- a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_a6ccd4() {
   uint3 arg_0 = (1u).xxx;
   uint3 res = reversebits(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.glsl b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.glsl
index 56b2a39..65917bb 100644
--- a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void reverseBits_a6ccd4() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void reverseBits_a6ccd4() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void reverseBits_a6ccd4() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.msl b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.msl
index 6f9406d..6f5deb2 100644
--- a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_a6ccd4() {
+void reverseBits_a6ccd4(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 res = reverse_bits(arg_0);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_a6ccd4();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  reverseBits_a6ccd4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_a6ccd4();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_a6ccd4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_a6ccd4();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_a6ccd4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.spvasm
index c9ba300..1e3eec8 100644
--- a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_a6ccd4 "reverseBits_a6ccd4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_a6ccd4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %19
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v3uint %arg_0
-         %20 = OpBitReverse %v3uint %21
-               OpStore %res %20
+%reverseBits_a6ccd4 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %22
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v3uint %arg_0
+         %23 = OpBitReverse %v3uint %24
+               OpStore %res %23
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %reverseBits_a6ccd4
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %reverseBits_a6ccd4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_a6ccd4
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reverseBits_a6ccd4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reverseBits_a6ccd4
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %reverseBits_a6ccd4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.wgsl
index 3ec855f..07e3d06 100644
--- a/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/a6ccd4.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn reverseBits_a6ccd4() {
   var arg_0 = vec3<u32>(1u);
   var res : vec3<u32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_a6ccd4();
diff --git a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl
index 67701e4..688a0f2 100644
--- a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl
@@ -25,7 +25,9 @@
 fn reverseBits_c21bc1() {
   var arg_0 = vec3<i32>(1i);
   var res: vec3<i32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.dxc.hlsl
index 30e0917..0e30686 100644
--- a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_c21bc1() {
   int3 arg_0 = (1).xxx;
   int3 res = asint(reversebits(asuint(arg_0)));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.fxc.hlsl
index 30e0917..0e30686 100644
--- a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_c21bc1() {
   int3 arg_0 = (1).xxx;
   int3 res = asint(reversebits(asuint(arg_0)));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.glsl b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.glsl
index e880e50..9a56a26 100644
--- a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void reverseBits_c21bc1() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void reverseBits_c21bc1() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void reverseBits_c21bc1() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.msl b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.msl
index 8c29516..24228f3 100644
--- a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_c21bc1() {
+void reverseBits_c21bc1(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 res = reverse_bits(arg_0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_c21bc1();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  reverseBits_c21bc1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_c21bc1();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_c21bc1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_c21bc1();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_c21bc1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.spvasm
index 147d95e..c23652b 100644
--- a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_c21bc1 "reverseBits_c21bc1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_c21bc1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v3int %arg_0
-         %20 = OpBitReverse %v3int %21
-               OpStore %res %20
+%reverseBits_c21bc1 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v3int %arg_0
+         %23 = OpBitReverse %v3int %24
+               OpStore %res %23
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %30 = OpLoad %v3int %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %reverseBits_c21bc1
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %reverseBits_c21bc1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_c21bc1
+%fragment_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reverseBits_c21bc1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reverseBits_c21bc1
+%compute_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %reverseBits_c21bc1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.wgsl
index 7f593fd..b2b8ef3 100644
--- a/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/c21bc1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn reverseBits_c21bc1() {
   var arg_0 = vec3<i32>(1i);
   var res : vec3<i32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_c21bc1();
diff --git a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl
index 5c56cc1..968e13b 100644
--- a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl
@@ -25,7 +25,9 @@
 fn reverseBits_e1f4c1() {
   var arg_0 = vec2<u32>(1u);
   var res: vec2<u32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.dxc.hlsl
index 106f38f..6826910 100644
--- a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_e1f4c1() {
   uint2 arg_0 = (1u).xx;
   uint2 res = reversebits(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.fxc.hlsl
index 106f38f..6826910 100644
--- a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_e1f4c1() {
   uint2 arg_0 = (1u).xx;
   uint2 res = reversebits(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.glsl b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.glsl
index 88033b6..8b74d6f 100644
--- a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void reverseBits_e1f4c1() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void reverseBits_e1f4c1() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void reverseBits_e1f4c1() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.msl b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.msl
index c481bb8..379597e 100644
--- a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_e1f4c1() {
+void reverseBits_e1f4c1(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 res = reverse_bits(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_e1f4c1();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  reverseBits_e1f4c1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_e1f4c1();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_e1f4c1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_e1f4c1();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_e1f4c1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.spvasm
index 512c925..1bc7dc0 100644
--- a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_e1f4c1 "reverseBits_e1f4c1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +36,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_e1f4c1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %19
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %v2uint %arg_0
-         %20 = OpBitReverse %v2uint %21
-               OpStore %res %20
+%reverseBits_e1f4c1 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %22
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %v2uint %arg_0
+         %23 = OpBitReverse %v2uint %24
+               OpStore %res %23
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %reverseBits_e1f4c1
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %reverseBits_e1f4c1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %14
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %reverseBits_e1f4c1
+%fragment_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %reverseBits_e1f4c1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %reverseBits_e1f4c1
+%compute_main = OpFunction %void None %14
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %reverseBits_e1f4c1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.wgsl
index 5b76ac2..64c4282 100644
--- a/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/e1f4c1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn reverseBits_e1f4c1() {
   var arg_0 = vec2<u32>(1u);
   var res : vec2<u32> = reverseBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_e1f4c1();
diff --git a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl
index d7ca484..f3adeb3 100644
--- a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl
@@ -25,7 +25,9 @@
 fn reverseBits_e31adf() {
   var arg_0 = 1u;
   var res: u32 = reverseBits(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.dxc.hlsl
index 3574631..8dfd653 100644
--- a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_e31adf() {
   uint arg_0 = 1u;
   uint res = reversebits(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.fxc.hlsl
index 3574631..8dfd653 100644
--- a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void reverseBits_e31adf() {
   uint arg_0 = 1u;
   uint res = reversebits(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.glsl b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.glsl
index 0acaf13..b19b001 100644
--- a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void reverseBits_e31adf() {
   uint arg_0 = 1u;
   uint res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void reverseBits_e31adf() {
   uint arg_0 = 1u;
   uint res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void reverseBits_e31adf() {
   uint arg_0 = 1u;
   uint res = bitfieldReverse(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.msl b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.msl
index 5948fce..79dabd5 100644
--- a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void reverseBits_e31adf() {
+void reverseBits_e31adf(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint res = reverse_bits(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  reverseBits_e31adf();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  reverseBits_e31adf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  reverseBits_e31adf();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  reverseBits_e31adf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  reverseBits_e31adf();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  reverseBits_e31adf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.spvasm
index 3dbf2b2..c9fc75b 100644
--- a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %reverseBits_e31adf "reverseBits_e31adf"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,43 +36,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-         %21 = OpTypeFunction %v4float
+         %20 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%reverseBits_e31adf = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_uint Function %17
+%reverseBits_e31adf = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
-         %19 = OpLoad %uint %arg_0
-         %18 = OpBitReverse %uint %19
-               OpStore %res %18
+         %22 = OpLoad %uint %arg_0
+         %21 = OpBitReverse %uint %22
+               OpStore %res %21
+         %26 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %27 = OpLoad %uint %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %reverseBits_e31adf
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %reverseBits_e31adf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %13
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %reverseBits_e31adf
+%fragment_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %reverseBits_e31adf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %reverseBits_e31adf
+%compute_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %reverseBits_e31adf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.wgsl
index 7489031..a8cf62b 100644
--- a/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/reverseBits/e31adf.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn reverseBits_e31adf() {
   var arg_0 = 1u;
   var res : u32 = reverseBits(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   reverseBits_e31adf();
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl b/test/tint/builtins/gen/var/round/106c0b.wgsl
index 7c77f82..f4d5e6a 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl
@@ -25,7 +25,9 @@
 fn round_106c0b() {
   var arg_0 = vec4<f32>(3.5f);
   var res: vec4<f32> = round(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.dxc.hlsl
index c0d5f98..37a7885 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_106c0b() {
   float4 arg_0 = (3.5f).xxxx;
   float4 res = round(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.fxc.hlsl
index c0d5f98..37a7885 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_106c0b() {
   float4 arg_0 = (3.5f).xxxx;
   float4 res = round(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.glsl
index 84edebf..78273ec 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void round_106c0b() {
   vec4 arg_0 = vec4(3.5f);
   vec4 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void round_106c0b() {
   vec4 arg_0 = vec4(3.5f);
   vec4 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void round_106c0b() {
   vec4 arg_0 = vec4(3.5f);
   vec4 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.msl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.msl
index e35922e..2ceb8d1 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_106c0b() {
+void round_106c0b(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(3.5f);
   float4 res = rint(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_106c0b();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  round_106c0b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_106c0b();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  round_106c0b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_106c0b();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  round_106c0b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.spvasm
index ce01c78..9fa0d67 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_106c0b "round_106c0b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_3_5 = OpConstant %float 3.5
-         %14 = OpConstantComposite %v4float %float_3_5 %float_3_5 %float_3_5 %float_3_5
+         %17 = OpConstantComposite %v4float %float_3_5 %float_3_5 %float_3_5 %float_3_5
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_106c0b = OpFunction %void None %9
-         %12 = OpLabel
+%round_106c0b = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 RoundEven %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 RoundEven %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %round_106c0b
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %round_106c0b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %round_106c0b
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %round_106c0b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %round_106c0b
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %round_106c0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.wgsl
index 129028b..e1b09dc 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn round_106c0b() {
   var arg_0 = vec4<f32>(3.5f);
   var res : vec4<f32> = round(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_106c0b();
diff --git a/test/tint/builtins/gen/var/round/184d5a.wgsl b/test/tint/builtins/gen/var/round/184d5a.wgsl
index 175eca3..fc32550 100644
--- a/test/tint/builtins/gen/var/round/184d5a.wgsl
+++ b/test/tint/builtins/gen/var/round/184d5a.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(3.5);
   var res = round(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_184d5a();
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl b/test/tint/builtins/gen/var/round/1c7897.wgsl
index 9eac08e..97fa10e 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl
@@ -25,7 +25,9 @@
 fn round_1c7897() {
   var arg_0 = vec3<f32>(3.5f);
   var res: vec3<f32> = round(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.dxc.hlsl
index b41ad5d..dcca5dc 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_1c7897() {
   float3 arg_0 = (3.5f).xxx;
   float3 res = round(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.fxc.hlsl
index b41ad5d..dcca5dc 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_1c7897() {
   float3 arg_0 = (3.5f).xxx;
   float3 res = round(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.glsl
index 1a4453d..182cce5 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void round_1c7897() {
   vec3 arg_0 = vec3(3.5f);
   vec3 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void round_1c7897() {
   vec3 arg_0 = vec3(3.5f);
   vec3 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void round_1c7897() {
   vec3 arg_0 = vec3(3.5f);
   vec3 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.msl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.msl
index f7efbda..f041dd1 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_1c7897() {
+void round_1c7897(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(3.5f);
   float3 res = rint(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_1c7897();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  round_1c7897(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_1c7897();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  round_1c7897(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_1c7897();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  round_1c7897(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.spvasm
index 02c1b23..101f475 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_1c7897 "round_1c7897"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_3_5 = OpConstant %float 3.5
-         %15 = OpConstantComposite %v3float %float_3_5 %float_3_5 %float_3_5
+         %18 = OpConstantComposite %v3float %float_3_5 %float_3_5 %float_3_5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_1c7897 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 RoundEven %21
-               OpStore %res %19
+%round_1c7897 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 RoundEven %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %round_1c7897
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %round_1c7897
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_1c7897
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %round_1c7897
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %round_1c7897
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %round_1c7897
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.wgsl
index e644d19..d0b3457 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn round_1c7897() {
   var arg_0 = vec3<f32>(3.5f);
   var res : vec3<f32> = round(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_1c7897();
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl b/test/tint/builtins/gen/var/round/52c84d.wgsl
index 1bef0ea..2f43814 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl
@@ -25,7 +25,9 @@
 fn round_52c84d() {
   var arg_0 = vec2<f32>(3.5f);
   var res: vec2<f32> = round(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.dxc.hlsl
index 45e93bb..ad68e69 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_52c84d() {
   float2 arg_0 = (3.5f).xx;
   float2 res = round(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.fxc.hlsl
index 45e93bb..ad68e69 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_52c84d() {
   float2 arg_0 = (3.5f).xx;
   float2 res = round(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.glsl
index 0d66f20..d11ef5d 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void round_52c84d() {
   vec2 arg_0 = vec2(3.5f);
   vec2 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void round_52c84d() {
   vec2 arg_0 = vec2(3.5f);
   vec2 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void round_52c84d() {
   vec2 arg_0 = vec2(3.5f);
   vec2 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.msl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.msl
index 3b5b707..fd1a172 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_52c84d() {
+void round_52c84d(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(3.5f);
   float2 res = rint(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_52c84d();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  round_52c84d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_52c84d();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  round_52c84d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_52c84d();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  round_52c84d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.spvasm
index 9abdd19..dde53eb 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_52c84d "round_52c84d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_3_5 = OpConstant %float 3.5
-         %15 = OpConstantComposite %v2float %float_3_5 %float_3_5
+         %18 = OpConstantComposite %v2float %float_3_5 %float_3_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_52c84d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 RoundEven %21
-               OpStore %res %19
+%round_52c84d = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 RoundEven %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %round_52c84d
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %round_52c84d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_52c84d
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %round_52c84d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %round_52c84d
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %round_52c84d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.wgsl
index c017b09..86cef3a 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn round_52c84d() {
   var arg_0 = vec2<f32>(3.5f);
   var res : vec2<f32> = round(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_52c84d();
diff --git a/test/tint/builtins/gen/var/round/773a8f.wgsl b/test/tint/builtins/gen/var/round/773a8f.wgsl
index e5c9393..0f4d254 100644
--- a/test/tint/builtins/gen/var/round/773a8f.wgsl
+++ b/test/tint/builtins/gen/var/round/773a8f.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 3.5;
   var res = round(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_773a8f();
diff --git a/test/tint/builtins/gen/var/round/8fdca3.wgsl b/test/tint/builtins/gen/var/round/8fdca3.wgsl
index 07c3c24..9bc9f0d 100644
--- a/test/tint/builtins/gen/var/round/8fdca3.wgsl
+++ b/test/tint/builtins/gen/var/round/8fdca3.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(3.5);
   var res = round(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_8fdca3();
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl b/test/tint/builtins/gen/var/round/9078ef.wgsl
index ec8ec54..acfebda 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl
@@ -27,7 +27,9 @@
 fn round_9078ef() {
   var arg_0 = 3.5h;
   var res: f16 = round(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.dxc.hlsl
index 3f465c9..e4fb385 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_9078ef() {
   float16_t arg_0 = float16_t(3.5h);
   float16_t res = round(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.fxc.hlsl
index ed3e148..956c07f 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_9078ef() {
-  float16_t arg_0 = float16_t(3.3984375h);
+  float16_t arg_0 = float16_t(3.5h);
   float16_t res = round(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.glsl
index 5fe11aa..c4f1ff0 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void round_9078ef() {
   float16_t arg_0 = 3.5hf;
   float16_t res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void round_9078ef() {
   float16_t arg_0 = 3.5hf;
   float16_t res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void round_9078ef() {
   float16_t arg_0 = 3.5hf;
   float16_t res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.msl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.msl
index 14da505..0d2fac4 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_9078ef() {
+void round_9078ef(device half* const tint_symbol_1) {
   half arg_0 = 3.5h;
   half res = rint(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_9078ef();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  round_9078ef(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_9078ef();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  round_9078ef(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_9078ef();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  round_9078ef(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.spvasm
index 1b3b587..4ebeac2 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_9078ef "round_9078ef"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_cp_1 = OpConstant %half 0x1.cp+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_9078ef = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%round_9078ef = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1_cp_1
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 RoundEven %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 RoundEven %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %round_9078ef
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %round_9078ef
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %round_9078ef
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %round_9078ef
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %round_9078ef
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %round_9078ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.wgsl
index 4ba193e..b9d6661 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn round_9078ef() {
   var arg_0 = 3.5h;
   var res : f16 = round(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_9078ef();
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl b/test/tint/builtins/gen/var/round/9edc38.wgsl
index 39ea9fd..83c7127 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl
@@ -25,7 +25,9 @@
 fn round_9edc38() {
   var arg_0 = 3.5f;
   var res: f32 = round(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.dxc.hlsl
index 6c6d0e5..5c09d16 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_9edc38() {
   float arg_0 = 3.5f;
   float res = round(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.fxc.hlsl
index 6c6d0e5..5c09d16 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_9edc38() {
   float arg_0 = 3.5f;
   float res = round(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.glsl
index 84da2d8..8114437 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void round_9edc38() {
   float arg_0 = 3.5f;
   float res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void round_9edc38() {
   float arg_0 = 3.5f;
   float res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void round_9edc38() {
   float arg_0 = 3.5f;
   float res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.msl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.msl
index d64a376..28152d7 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_9edc38() {
+void round_9edc38(device float* const tint_symbol_1) {
   float arg_0 = 3.5f;
   float res = rint(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_9edc38();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  round_9edc38(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_9edc38();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  round_9edc38(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_9edc38();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  round_9edc38(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.spvasm
index d817cdb..e43eb91 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_9edc38 "round_9edc38"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_3_5 = OpConstant %float 3.5
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_9edc38 = OpFunction %void None %9
-         %12 = OpLabel
+%round_9edc38 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_3_5
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 RoundEven %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 RoundEven %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %round_9edc38
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %round_9edc38
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %round_9edc38
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %round_9edc38
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_9edc38
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %round_9edc38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.wgsl
index a2f0a1f..89d96e8 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn round_9edc38() {
   var arg_0 = 3.5f;
   var res : f32 = round(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_9edc38();
diff --git a/test/tint/builtins/gen/var/round/a1673d.wgsl b/test/tint/builtins/gen/var/round/a1673d.wgsl
index 09b3094..8812a77 100644
--- a/test/tint/builtins/gen/var/round/a1673d.wgsl
+++ b/test/tint/builtins/gen/var/round/a1673d.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(3.5);
   var res = round(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_a1673d();
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl b/test/tint/builtins/gen/var/round/d87e84.wgsl
index 8b11473..3b1c764 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl
@@ -27,7 +27,9 @@
 fn round_d87e84() {
   var arg_0 = vec2<f16>(3.5h);
   var res: vec2<f16> = round(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.dxc.hlsl
index 9895f74b..2a01f0a 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_d87e84() {
   vector<float16_t, 2> arg_0 = (float16_t(3.5h)).xx;
   vector<float16_t, 2> res = round(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.fxc.hlsl
index c09e44f..531e516 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_d87e84() {
-  vector<float16_t, 2> arg_0 = (float16_t(3.3984375h)).xx;
+  vector<float16_t, 2> arg_0 = (float16_t(3.5h)).xx;
   vector<float16_t, 2> res = round(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.glsl
index 2d6d5a8..1f8bf23 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void round_d87e84() {
   f16vec2 arg_0 = f16vec2(3.5hf);
   f16vec2 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void round_d87e84() {
   f16vec2 arg_0 = f16vec2(3.5hf);
   f16vec2 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void round_d87e84() {
   f16vec2 arg_0 = f16vec2(3.5hf);
   f16vec2 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.msl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.msl
index 2a9ee39..551e4df 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_d87e84() {
+void round_d87e84(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(3.5h);
   half2 res = rint(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_d87e84();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  round_d87e84(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_d87e84();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  round_d87e84(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_d87e84();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  round_d87e84(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.spvasm
index 1696b37..74fdb39 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_d87e84 "round_d87e84"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_cp_1 = OpConstant %half 0x1.cp+1
-         %16 = OpConstantComposite %v2half %half_0x1_cp_1 %half_0x1_cp_1
+         %19 = OpConstantComposite %v2half %half_0x1_cp_1 %half_0x1_cp_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_d87e84 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 RoundEven %22
-               OpStore %res %20
+%round_d87e84 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 RoundEven %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %round_d87e84
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %round_d87e84
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %round_d87e84
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %round_d87e84
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %round_d87e84
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %round_d87e84
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.wgsl
index f91e883..8b6e553 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn round_d87e84() {
   var arg_0 = vec2<f16>(3.5h);
   var res : vec2<f16> = round(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_d87e84();
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl
index a4fbeab..dfac69f 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl
@@ -27,7 +27,9 @@
 fn round_e1bba2() {
   var arg_0 = vec3<f16>(3.5h);
   var res: vec3<f16> = round(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.dxc.hlsl
index a92457e..544ef7f 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_e1bba2() {
   vector<float16_t, 3> arg_0 = (float16_t(3.5h)).xxx;
   vector<float16_t, 3> res = round(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.fxc.hlsl
index 762bb62..84d41c4 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_e1bba2() {
-  vector<float16_t, 3> arg_0 = (float16_t(3.3984375h)).xxx;
+  vector<float16_t, 3> arg_0 = (float16_t(3.5h)).xxx;
   vector<float16_t, 3> res = round(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.glsl
index 8d58b62..e305e2b 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void round_e1bba2() {
   f16vec3 arg_0 = f16vec3(3.5hf);
   f16vec3 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void round_e1bba2() {
   f16vec3 arg_0 = f16vec3(3.5hf);
   f16vec3 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void round_e1bba2() {
   f16vec3 arg_0 = f16vec3(3.5hf);
   f16vec3 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.msl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.msl
index cc62ca3..da90b41 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_e1bba2() {
+void round_e1bba2(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(3.5h);
   half3 res = rint(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_e1bba2();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  round_e1bba2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_e1bba2();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  round_e1bba2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_e1bba2();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  round_e1bba2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.spvasm
index e23c3a1..984dab4 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_e1bba2 "round_e1bba2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_cp_1 = OpConstant %half 0x1.cp+1
-         %16 = OpConstantComposite %v3half %half_0x1_cp_1 %half_0x1_cp_1 %half_0x1_cp_1
+         %19 = OpConstantComposite %v3half %half_0x1_cp_1 %half_0x1_cp_1 %half_0x1_cp_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_e1bba2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 RoundEven %22
-               OpStore %res %20
+%round_e1bba2 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 RoundEven %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %round_e1bba2
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %round_e1bba2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %round_e1bba2
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %round_e1bba2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %round_e1bba2
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %round_e1bba2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.wgsl
index 7cce6c4..75cf80a 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn round_e1bba2() {
   var arg_0 = vec3<f16>(3.5h);
   var res : vec3<f16> = round(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_e1bba2();
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl b/test/tint/builtins/gen/var/round/f665b5.wgsl
index 3b7fd3a..f4e36db 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl
@@ -27,7 +27,9 @@
 fn round_f665b5() {
   var arg_0 = vec4<f16>(3.5h);
   var res: vec4<f16> = round(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.dxc.hlsl
index f789e47..86ebb56 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_f665b5() {
   vector<float16_t, 4> arg_0 = (float16_t(3.5h)).xxxx;
   vector<float16_t, 4> res = round(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.fxc.hlsl
index fd541db..982e87b 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void round_f665b5() {
-  vector<float16_t, 4> arg_0 = (float16_t(3.3984375h)).xxxx;
+  vector<float16_t, 4> arg_0 = (float16_t(3.5h)).xxxx;
   vector<float16_t, 4> res = round(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.glsl
index 344164d..cfd3fe7 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void round_f665b5() {
   f16vec4 arg_0 = f16vec4(3.5hf);
   f16vec4 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void round_f665b5() {
   f16vec4 arg_0 = f16vec4(3.5hf);
   f16vec4 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void round_f665b5() {
   f16vec4 arg_0 = f16vec4(3.5hf);
   f16vec4 res = round(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.msl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.msl
index 1e6e527..e8fecd5 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void round_f665b5() {
+void round_f665b5(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(3.5h);
   half4 res = rint(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  round_f665b5();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  round_f665b5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  round_f665b5();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  round_f665b5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  round_f665b5();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  round_f665b5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.spvasm
index aee30a5..eb1a49a 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %round_f665b5 "round_f665b5"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_cp_1 = OpConstant %half 0x1.cp+1
-         %16 = OpConstantComposite %v4half %half_0x1_cp_1 %half_0x1_cp_1 %half_0x1_cp_1 %half_0x1_cp_1
+         %19 = OpConstantComposite %v4half %half_0x1_cp_1 %half_0x1_cp_1 %half_0x1_cp_1 %half_0x1_cp_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%round_f665b5 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 RoundEven %22
-               OpStore %res %20
+%round_f665b5 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 RoundEven %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %round_f665b5
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %round_f665b5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %round_f665b5
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %round_f665b5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %round_f665b5
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %round_f665b5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.wgsl
index 4773a82..db8d1aa 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn round_f665b5() {
   var arg_0 = vec4<f16>(3.5h);
   var res : vec4<f16> = round(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   round_f665b5();
diff --git a/test/tint/builtins/gen/var/saturate/270da5.wgsl b/test/tint/builtins/gen/var/saturate/270da5.wgsl
index 84fe79d..880776e 100644
--- a/test/tint/builtins/gen/var/saturate/270da5.wgsl
+++ b/test/tint/builtins/gen/var/saturate/270da5.wgsl
@@ -25,7 +25,9 @@
 fn saturate_270da5() {
   var arg_0 = 2.f;
   var res: f32 = saturate(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.dxc.hlsl
index 1695ed7..9e05330 100644
--- a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_270da5() {
   float arg_0 = 2.0f;
   float res = saturate(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.fxc.hlsl
index 1695ed7..9e05330 100644
--- a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_270da5() {
   float arg_0 = 2.0f;
   float res = saturate(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.glsl b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.glsl
index 7a37078..187a54f 100644
--- a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return clamp(v, 0.0f, 1.0f);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void saturate_270da5() {
   float arg_0 = 2.0f;
   float res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return clamp(v, 0.0f, 1.0f);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void saturate_270da5() {
   float arg_0 = 2.0f;
   float res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return clamp(v, 0.0f, 1.0f);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void saturate_270da5() {
   float arg_0 = 2.0f;
   float res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.msl b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.msl
index 4d4aa56..d8494d0 100644
--- a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_270da5() {
+void saturate_270da5(device float* const tint_symbol_1) {
   float arg_0 = 2.0f;
   float res = saturate(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_270da5();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  saturate_270da5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_270da5();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  saturate_270da5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_270da5();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  saturate_270da5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.spvasm
index abfdea7..e8ad282 100644
--- a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
-         %14 = OpExtInstImport "GLSL.std.450"
+         %17 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_saturate "tint_saturate"
                OpName %v "v"
                OpName %saturate_270da5 "saturate_270da5"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,48 +39,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-          %9 = OpTypeFunction %float %float
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %12 = OpTypeFunction %float %float
     %float_1 = OpConstant %float 1
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %19 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
 %_ptr_Function_float = OpTypePointer Function %float
-         %26 = OpTypeFunction %v4float
-%tint_saturate = OpFunction %float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
+%tint_saturate = OpFunction %float None %12
           %v = OpFunctionParameter %float
-         %12 = OpLabel
-         %13 = OpExtInst %float %14 NClamp %v %8 %float_1
-               OpReturnValue %13
+         %15 = OpLabel
+         %16 = OpExtInst %float %17 NClamp %v %8 %float_1
+               OpReturnValue %16
                OpFunctionEnd
-%saturate_270da5 = OpFunction %void None %16
-         %19 = OpLabel
+%saturate_270da5 = OpFunction %void None %19
+         %22 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_2
-         %24 = OpLoad %float %arg_0
-         %23 = OpFunctionCall %float %tint_saturate %24
-               OpStore %res %23
+         %27 = OpLoad %float %arg_0
+         %26 = OpFunctionCall %float %tint_saturate %27
+               OpStore %res %26
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %saturate_270da5
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %saturate_270da5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %19
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %saturate_270da5
+%fragment_main = OpFunction %void None %19
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %saturate_270da5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %saturate_270da5
+%compute_main = OpFunction %void None %19
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %saturate_270da5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.wgsl
index 4012b51..5f4ad21 100644
--- a/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/saturate/270da5.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn saturate_270da5() {
   var arg_0 = 2.0f;
   var res : f32 = saturate(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_270da5();
diff --git a/test/tint/builtins/gen/var/saturate/462535.wgsl b/test/tint/builtins/gen/var/saturate/462535.wgsl
index 7ab447b..d135d28 100644
--- a/test/tint/builtins/gen/var/saturate/462535.wgsl
+++ b/test/tint/builtins/gen/var/saturate/462535.wgsl
@@ -27,7 +27,9 @@
 fn saturate_462535() {
   var arg_0 = vec3<f16>(2.h);
   var res: vec3<f16> = saturate(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.dxc.hlsl
index c7862df..4d7c1a1 100644
--- a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_462535() {
   vector<float16_t, 3> arg_0 = (float16_t(2.0h)).xxx;
   vector<float16_t, 3> res = saturate(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.fxc.hlsl
index 7195459..dbd4655 100644
--- a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_462535() {
   vector<float16_t, 3> arg_0 = (float16_t(2.0h)).xxx;
   vector<float16_t, 3> res = saturate(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.glsl b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.glsl
index 411803d..19e5f62 100644
--- a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return clamp(v, f16vec3(0.0hf), f16vec3(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void saturate_462535() {
   f16vec3 arg_0 = f16vec3(2.0hf);
   f16vec3 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return clamp(v, f16vec3(0.0hf), f16vec3(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void saturate_462535() {
   f16vec3 arg_0 = f16vec3(2.0hf);
   f16vec3 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return clamp(v, f16vec3(0.0hf), f16vec3(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void saturate_462535() {
   f16vec3 arg_0 = f16vec3(2.0hf);
   f16vec3 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.msl b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.msl
index d37a009..c894dd0 100644
--- a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_462535() {
+void saturate_462535(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(2.0h);
   half3 res = saturate(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_462535();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  saturate_462535(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_462535();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  saturate_462535(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_462535();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  saturate_462535(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.spvasm b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.spvasm
index 02fb93d..924db95 100644
--- a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_saturate "tint_saturate"
                OpName %v "v"
                OpName %saturate_462535 "saturate_462535"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,52 +45,61 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-          %9 = OpTypeFunction %v3half %v3half
-         %17 = OpConstantNull %v3half
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v3half %v3half
+         %20 = OpConstantNull %v3half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %22 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %25 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %28 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %31 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_saturate = OpFunction %v3half None %9
+%tint_saturate = OpFunction %v3half None %14
           %v = OpFunctionParameter %v3half
-         %14 = OpLabel
-         %15 = OpExtInst %v3half %16 NClamp %v %17 %19
-               OpReturnValue %15
+         %17 = OpLabel
+         %18 = OpExtInst %v3half %19 NClamp %v %20 %22
+               OpReturnValue %18
                OpFunctionEnd
-%saturate_462535 = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %17
-        %res = OpVariable %_ptr_Function_v3half Function %17
-               OpStore %arg_0 %25
-         %29 = OpLoad %v3half %arg_0
-         %28 = OpFunctionCall %v3half %tint_saturate %29
-               OpStore %res %28
+%saturate_462535 = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %20
+        %res = OpVariable %_ptr_Function_v3half Function %20
+               OpStore %arg_0 %28
+         %32 = OpLoad %v3half %arg_0
+         %31 = OpFunctionCall %v3half %tint_saturate %32
+               OpStore %res %31
+         %37 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %38 = OpLoad %v3half %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %saturate_462535
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %saturate_462535
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %23
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %saturate_462535
+%fragment_main = OpFunction %void None %23
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %saturate_462535
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %saturate_462535
+%compute_main = OpFunction %void None %23
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %saturate_462535
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.wgsl b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.wgsl
index 3b7c1e5..177a13b 100644
--- a/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/saturate/462535.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn saturate_462535() {
   var arg_0 = vec3<f16>(2.0h);
   var res : vec3<f16> = saturate(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_462535();
diff --git a/test/tint/builtins/gen/var/saturate/4ed8d7.wgsl b/test/tint/builtins/gen/var/saturate/4ed8d7.wgsl
index ef05a7f..e195cf8 100644
--- a/test/tint/builtins/gen/var/saturate/4ed8d7.wgsl
+++ b/test/tint/builtins/gen/var/saturate/4ed8d7.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(2.);
   var res = saturate(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_4ed8d7();
diff --git a/test/tint/builtins/gen/var/saturate/51567f.wgsl b/test/tint/builtins/gen/var/saturate/51567f.wgsl
index 8479f08..7db5d04 100644
--- a/test/tint/builtins/gen/var/saturate/51567f.wgsl
+++ b/test/tint/builtins/gen/var/saturate/51567f.wgsl
@@ -25,7 +25,9 @@
 fn saturate_51567f() {
   var arg_0 = vec2<f32>(2.f);
   var res: vec2<f32> = saturate(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.dxc.hlsl
index 1f65313..20f7b18 100644
--- a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_51567f() {
   float2 arg_0 = (2.0f).xx;
   float2 res = saturate(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.fxc.hlsl
index 1f65313..20f7b18 100644
--- a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_51567f() {
   float2 arg_0 = (2.0f).xx;
   float2 res = saturate(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.glsl b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.glsl
index fb43f00..604df23 100644
--- a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return clamp(v, vec2(0.0f), vec2(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void saturate_51567f() {
   vec2 arg_0 = vec2(2.0f);
   vec2 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return clamp(v, vec2(0.0f), vec2(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void saturate_51567f() {
   vec2 arg_0 = vec2(2.0f);
   vec2 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return clamp(v, vec2(0.0f), vec2(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void saturate_51567f() {
   vec2 arg_0 = vec2(2.0f);
   vec2 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.msl b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.msl
index e21f23d..b66c9e4 100644
--- a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_51567f() {
+void saturate_51567f(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(2.0f);
   float2 res = saturate(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_51567f();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  saturate_51567f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_51567f();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  saturate_51567f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_51567f();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  saturate_51567f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.spvasm
index 968e7e7..fc72437 100644
--- a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
-         %15 = OpExtInstImport "GLSL.std.450"
+         %18 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_saturate "tint_saturate"
                OpName %v "v"
                OpName %saturate_51567f "saturate_51567f"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,51 +40,60 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
     %v2float = OpTypeVector %float 2
-          %9 = OpTypeFunction %v2float %v2float
-         %16 = OpConstantNull %v2float
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %v2float %v2float
+         %19 = OpConstantNull %v2float
     %float_1 = OpConstant %float 1
-         %18 = OpConstantComposite %v2float %float_1 %float_1
+         %21 = OpConstantComposite %v2float %float_1 %float_1
        %void = OpTypeVoid
-         %19 = OpTypeFunction %void
+         %22 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %24 = OpConstantComposite %v2float %float_2 %float_2
+         %27 = OpConstantComposite %v2float %float_2 %float_2
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %30 = OpTypeFunction %v4float
-%tint_saturate = OpFunction %v2float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %38 = OpTypeFunction %v4float
+%tint_saturate = OpFunction %v2float None %13
           %v = OpFunctionParameter %v2float
-         %13 = OpLabel
-         %14 = OpExtInst %v2float %15 NClamp %v %16 %18
-               OpReturnValue %14
+         %16 = OpLabel
+         %17 = OpExtInst %v2float %18 NClamp %v %19 %21
+               OpReturnValue %17
                OpFunctionEnd
-%saturate_51567f = OpFunction %void None %19
-         %22 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %16
-        %res = OpVariable %_ptr_Function_v2float Function %16
-               OpStore %arg_0 %24
-         %28 = OpLoad %v2float %arg_0
-         %27 = OpFunctionCall %v2float %tint_saturate %28
-               OpStore %res %27
+%saturate_51567f = OpFunction %void None %22
+         %25 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %19
+        %res = OpVariable %_ptr_Function_v2float Function %19
+               OpStore %arg_0 %27
+         %31 = OpLoad %v2float %arg_0
+         %30 = OpFunctionCall %v2float %tint_saturate %31
+               OpStore %res %30
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %37 = OpLoad %v2float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %saturate_51567f
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %saturate_51567f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %19
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %22
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %19
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %saturate_51567f
+%fragment_main = OpFunction %void None %22
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %saturate_51567f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %19
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %saturate_51567f
+%compute_main = OpFunction %void None %22
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %saturate_51567f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.wgsl
index 8668958..b746377 100644
--- a/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/saturate/51567f.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn saturate_51567f() {
   var arg_0 = vec2<f32>(2.0f);
   var res : vec2<f32> = saturate(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_51567f();
diff --git a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl
index ddd305c..48c86e9 100644
--- a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl
+++ b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl
@@ -25,7 +25,9 @@
 fn saturate_6bcddf() {
   var arg_0 = vec3<f32>(2.f);
   var res: vec3<f32> = saturate(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.dxc.hlsl
index 80587b0..f4a40b6 100644
--- a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_6bcddf() {
   float3 arg_0 = (2.0f).xxx;
   float3 res = saturate(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.fxc.hlsl
index 80587b0..f4a40b6 100644
--- a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_6bcddf() {
   float3 arg_0 = (2.0f).xxx;
   float3 res = saturate(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.glsl b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.glsl
index a797e12..1a97179 100644
--- a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return clamp(v, vec3(0.0f), vec3(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void saturate_6bcddf() {
   vec3 arg_0 = vec3(2.0f);
   vec3 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return clamp(v, vec3(0.0f), vec3(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void saturate_6bcddf() {
   vec3 arg_0 = vec3(2.0f);
   vec3 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return clamp(v, vec3(0.0f), vec3(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void saturate_6bcddf() {
   vec3 arg_0 = vec3(2.0f);
   vec3 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.msl b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.msl
index 8aa26cf..dbeadf7 100644
--- a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_6bcddf() {
+void saturate_6bcddf(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(2.0f);
   float3 res = saturate(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_6bcddf();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  saturate_6bcddf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_6bcddf();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  saturate_6bcddf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_6bcddf();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  saturate_6bcddf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.spvasm
index 1d5b452..6b4f262 100644
--- a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
-         %15 = OpExtInstImport "GLSL.std.450"
+         %18 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_saturate "tint_saturate"
                OpName %v "v"
                OpName %saturate_6bcddf "saturate_6bcddf"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,51 +40,60 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
     %v3float = OpTypeVector %float 3
-          %9 = OpTypeFunction %v3float %v3float
-         %16 = OpConstantNull %v3float
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %v3float %v3float
+         %19 = OpConstantNull %v3float
     %float_1 = OpConstant %float 1
-         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
        %void = OpTypeVoid
-         %19 = OpTypeFunction %void
+         %22 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %24 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+         %27 = OpConstantComposite %v3float %float_2 %float_2 %float_2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %30 = OpTypeFunction %v4float
-%tint_saturate = OpFunction %v3float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %38 = OpTypeFunction %v4float
+%tint_saturate = OpFunction %v3float None %13
           %v = OpFunctionParameter %v3float
-         %13 = OpLabel
-         %14 = OpExtInst %v3float %15 NClamp %v %16 %18
-               OpReturnValue %14
+         %16 = OpLabel
+         %17 = OpExtInst %v3float %18 NClamp %v %19 %21
+               OpReturnValue %17
                OpFunctionEnd
-%saturate_6bcddf = OpFunction %void None %19
-         %22 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %16
-        %res = OpVariable %_ptr_Function_v3float Function %16
-               OpStore %arg_0 %24
-         %28 = OpLoad %v3float %arg_0
-         %27 = OpFunctionCall %v3float %tint_saturate %28
-               OpStore %res %27
+%saturate_6bcddf = OpFunction %void None %22
+         %25 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %19
+        %res = OpVariable %_ptr_Function_v3float Function %19
+               OpStore %arg_0 %27
+         %31 = OpLoad %v3float %arg_0
+         %30 = OpFunctionCall %v3float %tint_saturate %31
+               OpStore %res %30
+         %36 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %37 = OpLoad %v3float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %saturate_6bcddf
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %saturate_6bcddf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %19
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %22
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %19
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %saturate_6bcddf
+%fragment_main = OpFunction %void None %22
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %saturate_6bcddf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %19
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %saturate_6bcddf
+%compute_main = OpFunction %void None %22
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %saturate_6bcddf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.wgsl
index e34311a..f47670b 100644
--- a/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/saturate/6bcddf.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn saturate_6bcddf() {
   var arg_0 = vec3<f32>(2.0f);
   var res : vec3<f32> = saturate(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_6bcddf();
diff --git a/test/tint/builtins/gen/var/saturate/78b37c.wgsl b/test/tint/builtins/gen/var/saturate/78b37c.wgsl
index 220f0f9..14fd374 100644
--- a/test/tint/builtins/gen/var/saturate/78b37c.wgsl
+++ b/test/tint/builtins/gen/var/saturate/78b37c.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 2.;
   var res = saturate(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_78b37c();
diff --git a/test/tint/builtins/gen/var/saturate/a5b571.wgsl b/test/tint/builtins/gen/var/saturate/a5b571.wgsl
index b8265af..106a635 100644
--- a/test/tint/builtins/gen/var/saturate/a5b571.wgsl
+++ b/test/tint/builtins/gen/var/saturate/a5b571.wgsl
@@ -25,7 +25,9 @@
 fn saturate_a5b571() {
   var arg_0 = vec4<f32>(2.f);
   var res: vec4<f32> = saturate(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.dxc.hlsl
index ab8cf85..6be4407 100644
--- a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_a5b571() {
   float4 arg_0 = (2.0f).xxxx;
   float4 res = saturate(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.fxc.hlsl
index ab8cf85..6be4407 100644
--- a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_a5b571() {
   float4 arg_0 = (2.0f).xxxx;
   float4 res = saturate(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.glsl b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.glsl
index 89b06af..6ba81f5 100644
--- a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.glsl
@@ -4,9 +4,14 @@
   return clamp(v, vec4(0.0f), vec4(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void saturate_a5b571() {
   vec4 arg_0 = vec4(2.0f);
   vec4 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -29,9 +34,14 @@
   return clamp(v, vec4(0.0f), vec4(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void saturate_a5b571() {
   vec4 arg_0 = vec4(2.0f);
   vec4 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,9 +58,14 @@
   return clamp(v, vec4(0.0f), vec4(1.0f));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void saturate_a5b571() {
   vec4 arg_0 = vec4(2.0f);
   vec4 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.msl b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.msl
index 24f08fd..4530144 100644
--- a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_a5b571() {
+void saturate_a5b571(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(2.0f);
   float4 res = saturate(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_a5b571();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  saturate_a5b571(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_a5b571();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  saturate_a5b571(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_a5b571();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  saturate_a5b571(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.spvasm b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.spvasm
index 866662f..1056c14 100644
--- a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
-         %14 = OpExtInstImport "GLSL.std.450"
+         %17 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_saturate "tint_saturate"
                OpName %v "v"
                OpName %saturate_a5b571 "saturate_a5b571"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,50 +39,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-          %9 = OpTypeFunction %v4float %v4float
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %12 = OpTypeFunction %v4float %v4float
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %19 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
        %void = OpTypeVoid
-         %17 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %22 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+         %25 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %28 = OpTypeFunction %v4float
-%tint_saturate = OpFunction %v4float None %9
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %36 = OpTypeFunction %v4float
+%tint_saturate = OpFunction %v4float None %12
           %v = OpFunctionParameter %v4float
-         %12 = OpLabel
-         %13 = OpExtInst %v4float %14 NClamp %v %5 %16
-               OpReturnValue %13
+         %15 = OpLabel
+         %16 = OpExtInst %v4float %17 NClamp %v %5 %19
+               OpReturnValue %16
                OpFunctionEnd
-%saturate_a5b571 = OpFunction %void None %17
-         %20 = OpLabel
+%saturate_a5b571 = OpFunction %void None %20
+         %23 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %22
-         %26 = OpLoad %v4float %arg_0
-         %25 = OpFunctionCall %v4float %tint_saturate %26
-               OpStore %res %25
+               OpStore %arg_0 %25
+         %29 = OpLoad %v4float %arg_0
+         %28 = OpFunctionCall %v4float %tint_saturate %29
+               OpStore %res %28
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %saturate_a5b571
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %saturate_a5b571
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %17
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %20
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %17
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %saturate_a5b571
+%fragment_main = OpFunction %void None %20
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %saturate_a5b571
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %17
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %saturate_a5b571
+%compute_main = OpFunction %void None %20
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %saturate_a5b571
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.wgsl b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.wgsl
index db30eba..e609c6b 100644
--- a/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/saturate/a5b571.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn saturate_a5b571() {
   var arg_0 = vec4<f32>(2.0f);
   var res : vec4<f32> = saturate(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_a5b571();
diff --git a/test/tint/builtins/gen/var/saturate/cd2028.wgsl b/test/tint/builtins/gen/var/saturate/cd2028.wgsl
index 7fd2b6d..3a94c19 100644
--- a/test/tint/builtins/gen/var/saturate/cd2028.wgsl
+++ b/test/tint/builtins/gen/var/saturate/cd2028.wgsl
@@ -27,7 +27,9 @@
 fn saturate_cd2028() {
   var arg_0 = vec2<f16>(2.h);
   var res: vec2<f16> = saturate(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.dxc.hlsl
index 2aa5970..e62ca95 100644
--- a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_cd2028() {
   vector<float16_t, 2> arg_0 = (float16_t(2.0h)).xx;
   vector<float16_t, 2> res = saturate(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.fxc.hlsl
index 1fb11bf..f3933ff 100644
--- a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_cd2028() {
   vector<float16_t, 2> arg_0 = (float16_t(2.0h)).xx;
   vector<float16_t, 2> res = saturate(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.glsl b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.glsl
index 3ccd12e..0c7188d 100644
--- a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return clamp(v, f16vec2(0.0hf), f16vec2(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void saturate_cd2028() {
   f16vec2 arg_0 = f16vec2(2.0hf);
   f16vec2 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return clamp(v, f16vec2(0.0hf), f16vec2(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void saturate_cd2028() {
   f16vec2 arg_0 = f16vec2(2.0hf);
   f16vec2 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return clamp(v, f16vec2(0.0hf), f16vec2(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void saturate_cd2028() {
   f16vec2 arg_0 = f16vec2(2.0hf);
   f16vec2 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.msl b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.msl
index 6e99b73..954f79b 100644
--- a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_cd2028() {
+void saturate_cd2028(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(2.0h);
   half2 res = saturate(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_cd2028();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  saturate_cd2028(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_cd2028();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  saturate_cd2028(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_cd2028();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  saturate_cd2028(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.spvasm b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.spvasm
index 9f9cc1b..80620bb 100644
--- a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_saturate "tint_saturate"
                OpName %v "v"
                OpName %saturate_cd2028 "saturate_cd2028"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,52 +45,61 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-          %9 = OpTypeFunction %v2half %v2half
-         %17 = OpConstantNull %v2half
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v2half %v2half
+         %20 = OpConstantNull %v2half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %22 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %25 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
+         %28 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %31 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_saturate = OpFunction %v2half None %9
+%tint_saturate = OpFunction %v2half None %14
           %v = OpFunctionParameter %v2half
-         %14 = OpLabel
-         %15 = OpExtInst %v2half %16 NClamp %v %17 %19
-               OpReturnValue %15
+         %17 = OpLabel
+         %18 = OpExtInst %v2half %19 NClamp %v %20 %22
+               OpReturnValue %18
                OpFunctionEnd
-%saturate_cd2028 = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %17
-        %res = OpVariable %_ptr_Function_v2half Function %17
-               OpStore %arg_0 %25
-         %29 = OpLoad %v2half %arg_0
-         %28 = OpFunctionCall %v2half %tint_saturate %29
-               OpStore %res %28
+%saturate_cd2028 = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %20
+        %res = OpVariable %_ptr_Function_v2half Function %20
+               OpStore %arg_0 %28
+         %32 = OpLoad %v2half %arg_0
+         %31 = OpFunctionCall %v2half %tint_saturate %32
+               OpStore %res %31
+         %37 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %38 = OpLoad %v2half %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %saturate_cd2028
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %saturate_cd2028
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %23
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %saturate_cd2028
+%fragment_main = OpFunction %void None %23
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %saturate_cd2028
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %saturate_cd2028
+%compute_main = OpFunction %void None %23
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %saturate_cd2028
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.wgsl b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.wgsl
index 99c183e..e1c0bc4 100644
--- a/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/saturate/cd2028.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn saturate_cd2028() {
   var arg_0 = vec2<f16>(2.0h);
   var res : vec2<f16> = saturate(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_cd2028();
diff --git a/test/tint/builtins/gen/var/saturate/d55822.wgsl b/test/tint/builtins/gen/var/saturate/d55822.wgsl
index 8cdc1f3..f1fe9cb 100644
--- a/test/tint/builtins/gen/var/saturate/d55822.wgsl
+++ b/test/tint/builtins/gen/var/saturate/d55822.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(2.);
   var res = saturate(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_d55822();
diff --git a/test/tint/builtins/gen/var/saturate/dcde71.wgsl b/test/tint/builtins/gen/var/saturate/dcde71.wgsl
index 3fce2f8..5f8b2ec 100644
--- a/test/tint/builtins/gen/var/saturate/dcde71.wgsl
+++ b/test/tint/builtins/gen/var/saturate/dcde71.wgsl
@@ -27,7 +27,9 @@
 fn saturate_dcde71() {
   var arg_0 = vec4<f16>(2.h);
   var res: vec4<f16> = saturate(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.dxc.hlsl
index 36d0301..43c633c 100644
--- a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_dcde71() {
   vector<float16_t, 4> arg_0 = (float16_t(2.0h)).xxxx;
   vector<float16_t, 4> res = saturate(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.fxc.hlsl
index a77de73..58cc15d 100644
--- a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_dcde71() {
   vector<float16_t, 4> arg_0 = (float16_t(2.0h)).xxxx;
   vector<float16_t, 4> res = saturate(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.glsl b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.glsl
index e206c34..377884c 100644
--- a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return clamp(v, f16vec4(0.0hf), f16vec4(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void saturate_dcde71() {
   f16vec4 arg_0 = f16vec4(2.0hf);
   f16vec4 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return clamp(v, f16vec4(0.0hf), f16vec4(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void saturate_dcde71() {
   f16vec4 arg_0 = f16vec4(2.0hf);
   f16vec4 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return clamp(v, f16vec4(0.0hf), f16vec4(1.0hf));
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void saturate_dcde71() {
   f16vec4 arg_0 = f16vec4(2.0hf);
   f16vec4 res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.msl b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.msl
index 09a1cf9..84e80ad 100644
--- a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_dcde71() {
+void saturate_dcde71(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(2.0h);
   half4 res = saturate(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_dcde71();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  saturate_dcde71(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_dcde71();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  saturate_dcde71(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_dcde71();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  saturate_dcde71(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.spvasm b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.spvasm
index d426936..60ca5c9 100644
--- a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
+         %19 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_saturate "tint_saturate"
                OpName %v "v"
                OpName %saturate_dcde71 "saturate_dcde71"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,52 +45,61 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-          %9 = OpTypeFunction %v4half %v4half
-         %17 = OpConstantNull %v4half
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %14 = OpTypeFunction %v4half %v4half
+         %20 = OpConstantNull %v4half
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %22 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
        %void = OpTypeVoid
-         %20 = OpTypeFunction %void
+         %23 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %25 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %28 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %31 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_saturate = OpFunction %v4half None %9
+%tint_saturate = OpFunction %v4half None %14
           %v = OpFunctionParameter %v4half
-         %14 = OpLabel
-         %15 = OpExtInst %v4half %16 NClamp %v %17 %19
-               OpReturnValue %15
+         %17 = OpLabel
+         %18 = OpExtInst %v4half %19 NClamp %v %20 %22
+               OpReturnValue %18
                OpFunctionEnd
-%saturate_dcde71 = OpFunction %void None %20
-         %23 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %17
-        %res = OpVariable %_ptr_Function_v4half Function %17
-               OpStore %arg_0 %25
-         %29 = OpLoad %v4half %arg_0
-         %28 = OpFunctionCall %v4half %tint_saturate %29
-               OpStore %res %28
+%saturate_dcde71 = OpFunction %void None %23
+         %26 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %20
+        %res = OpVariable %_ptr_Function_v4half Function %20
+               OpStore %arg_0 %28
+         %32 = OpLoad %v4half %arg_0
+         %31 = OpFunctionCall %v4half %tint_saturate %32
+               OpStore %res %31
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %38 = OpLoad %v4half %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %saturate_dcde71
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %saturate_dcde71
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %20
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %23
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %20
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %saturate_dcde71
+%fragment_main = OpFunction %void None %23
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %saturate_dcde71
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %20
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %saturate_dcde71
+%compute_main = OpFunction %void None %23
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %saturate_dcde71
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.wgsl b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.wgsl
index ed3ba5d..9991ea9 100644
--- a/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/saturate/dcde71.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn saturate_dcde71() {
   var arg_0 = vec4<f16>(2.0h);
   var res : vec4<f16> = saturate(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_dcde71();
diff --git a/test/tint/builtins/gen/var/saturate/e40fb6.wgsl b/test/tint/builtins/gen/var/saturate/e40fb6.wgsl
index cdea5fa..65b6f32 100644
--- a/test/tint/builtins/gen/var/saturate/e40fb6.wgsl
+++ b/test/tint/builtins/gen/var/saturate/e40fb6.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(2.);
   var res = saturate(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_e40fb6();
diff --git a/test/tint/builtins/gen/var/saturate/e8df56.wgsl b/test/tint/builtins/gen/var/saturate/e8df56.wgsl
index 7bbe656..2105fd4 100644
--- a/test/tint/builtins/gen/var/saturate/e8df56.wgsl
+++ b/test/tint/builtins/gen/var/saturate/e8df56.wgsl
@@ -27,7 +27,9 @@
 fn saturate_e8df56() {
   var arg_0 = 2.h;
   var res: f16 = saturate(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.dxc.hlsl
index 6084be0..20424c8 100644
--- a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_e8df56() {
   float16_t arg_0 = float16_t(2.0h);
   float16_t res = saturate(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.fxc.hlsl
index abf5769..4bf07e3 100644
--- a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void saturate_e8df56() {
   float16_t arg_0 = float16_t(2.0h);
   float16_t res = saturate(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.glsl b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.glsl
index fb11511..e95042a 100644
--- a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.glsl
@@ -5,9 +5,14 @@
   return clamp(v, 0.0hf, 1.0hf);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void saturate_e8df56() {
   float16_t arg_0 = 2.0hf;
   float16_t res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -31,9 +36,14 @@
   return clamp(v, 0.0hf, 1.0hf);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void saturate_e8df56() {
   float16_t arg_0 = 2.0hf;
   float16_t res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -51,9 +61,14 @@
   return clamp(v, 0.0hf, 1.0hf);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void saturate_e8df56() {
   float16_t arg_0 = 2.0hf;
   float16_t res = tint_saturate(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.msl b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.msl
index b3313d9..45f950a 100644
--- a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void saturate_e8df56() {
+void saturate_e8df56(device half* const tint_symbol_1) {
   half arg_0 = 2.0h;
   half res = saturate(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  saturate_e8df56();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  saturate_e8df56(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  saturate_e8df56();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  saturate_e8df56(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  saturate_e8df56();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  saturate_e8df56(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.spvasm b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.spvasm
index 57db5b4..32536d4 100644
--- a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %15 = OpExtInstImport "GLSL.std.450"
+         %18 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_saturate "tint_saturate"
                OpName %v "v"
                OpName %saturate_e8df56 "saturate_e8df56"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,50 +44,59 @@
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %half = OpTypeFloat 16
-          %9 = OpTypeFunction %half %half
-         %16 = OpConstantNull %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %13 = OpTypeFunction %half %half
+         %19 = OpConstantNull %half
 %half_0x1p_0 = OpConstant %half 0x1p+0
        %void = OpTypeVoid
-         %18 = OpTypeFunction %void
+         %21 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %28 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tint_saturate = OpFunction %half None %9
+%tint_saturate = OpFunction %half None %13
           %v = OpFunctionParameter %half
-         %13 = OpLabel
-         %14 = OpExtInst %half %15 NClamp %v %16 %half_0x1p_0
-               OpReturnValue %14
+         %16 = OpLabel
+         %17 = OpExtInst %half %18 NClamp %v %19 %half_0x1p_0
+               OpReturnValue %17
                OpFunctionEnd
-%saturate_e8df56 = OpFunction %void None %18
-         %21 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %16
-        %res = OpVariable %_ptr_Function_half Function %16
+%saturate_e8df56 = OpFunction %void None %21
+         %24 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %19
+        %res = OpVariable %_ptr_Function_half Function %19
                OpStore %arg_0 %half_0x1p_1
-         %26 = OpLoad %half %arg_0
-         %25 = OpFunctionCall %half %tint_saturate %26
-               OpStore %res %25
+         %29 = OpLoad %half %arg_0
+         %28 = OpFunctionCall %half %tint_saturate %29
+               OpStore %res %28
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %saturate_e8df56
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %saturate_e8df56
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %18
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %21
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %18
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %saturate_e8df56
+%fragment_main = OpFunction %void None %21
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %saturate_e8df56
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %18
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %saturate_e8df56
+%compute_main = OpFunction %void None %21
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %saturate_e8df56
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.wgsl b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.wgsl
index 111db59..e891c87 100644
--- a/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/saturate/e8df56.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn saturate_e8df56() {
   var arg_0 = 2.0h;
   var res : f16 = saturate(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   saturate_e8df56();
diff --git a/test/tint/builtins/gen/var/select/00b848.wgsl b/test/tint/builtins/gen/var/select/00b848.wgsl
index 9206aa4..39501ea 100644
--- a/test/tint/builtins/gen/var/select/00b848.wgsl
+++ b/test/tint/builtins/gen/var/select/00b848.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = vec2<bool>(true);
   var res: vec2<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.dxc.hlsl
index c132cca..769f1a7 100644
--- a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_00b848() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   bool2 arg_2 = (true).xx;
   int2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.fxc.hlsl
index c132cca..769f1a7 100644
--- a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_00b848() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   bool2 arg_2 = (true).xx;
   int2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.glsl
index 2663ba3..8336837 100644
--- a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_00b848() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   bvec2 arg_2 = bvec2(true);
   ivec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_00b848() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   bvec2 arg_2 = bvec2(true);
   ivec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_00b848() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   bvec2 arg_2 = bvec2(true);
   ivec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.msl b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.msl
index b62d66f..5954475 100644
--- a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_00b848() {
+void select_00b848(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 arg_1 = int2(1);
   bool2 arg_2 = bool2(true);
   int2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_00b848();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  select_00b848(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_00b848();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  select_00b848(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_00b848();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  select_00b848(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.spvasm
index 355f688..6c63c09 100644
--- a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_00b848 "select_00b848"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,57 +38,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
+         %22 = OpConstantNull %v2int
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v2bool %true %true
+         %27 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %27 = OpConstantNull %v2bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_00b848 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2bool Function %27
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v2bool %arg_2
-         %30 = OpLoad %v2int %arg_1
-         %31 = OpLoad %v2int %arg_0
-         %28 = OpSelect %v2int %29 %30 %31
-               OpStore %res %28
+%select_00b848 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+      %arg_2 = OpVariable %_ptr_Function_v2bool Function %30
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v2bool %arg_2
+         %33 = OpLoad %v2int %arg_1
+         %34 = OpLoad %v2int %arg_0
+         %31 = OpSelect %v2int %32 %33 %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %40 = OpLoad %v2int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_00b848
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_00b848
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_00b848
+%fragment_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_00b848
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_00b848
+%compute_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_00b848
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.wgsl
index c4cd92c..14c283a 100644
--- a/test/tint/builtins/gen/var/select/00b848.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/00b848.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = vec2<bool>(true);
   var res : vec2<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_00b848();
diff --git a/test/tint/builtins/gen/var/select/01e2cd.wgsl b/test/tint/builtins/gen/var/select/01e2cd.wgsl
index 4bab239..83b9f4f 100644
--- a/test/tint/builtins/gen/var/select/01e2cd.wgsl
+++ b/test/tint/builtins/gen/var/select/01e2cd.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = vec3<bool>(true);
   var res: vec3<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.dxc.hlsl
index e3d6bc8..7731b6e 100644
--- a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_01e2cd() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   bool3 arg_2 = (true).xxx;
   int3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.fxc.hlsl
index e3d6bc8..7731b6e 100644
--- a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_01e2cd() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   bool3 arg_2 = (true).xxx;
   int3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.glsl
index 644cc43..0eac9de 100644
--- a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_01e2cd() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   bvec3 arg_2 = bvec3(true);
   ivec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_01e2cd() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   bvec3 arg_2 = bvec3(true);
   ivec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_01e2cd() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   bvec3 arg_2 = bvec3(true);
   ivec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.msl b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.msl
index 5f68736..e920bbe 100644
--- a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_01e2cd() {
+void select_01e2cd(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 arg_1 = int3(1);
   bool3 arg_2 = bool3(true);
   int3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_01e2cd();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  select_01e2cd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_01e2cd();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  select_01e2cd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_01e2cd();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  select_01e2cd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.spvasm
index b4bc496..0c6d72b 100644
--- a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_01e2cd "select_01e2cd"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,57 +38,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
+         %22 = OpConstantNull %v3int
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v3bool %true %true %true
+         %27 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %27 = OpConstantNull %v3bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_01e2cd = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3bool Function %27
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v3bool %arg_2
-         %30 = OpLoad %v3int %arg_1
-         %31 = OpLoad %v3int %arg_0
-         %28 = OpSelect %v3int %29 %30 %31
-               OpStore %res %28
+%select_01e2cd = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
+      %arg_2 = OpVariable %_ptr_Function_v3bool Function %30
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v3bool %arg_2
+         %33 = OpLoad %v3int %arg_1
+         %34 = OpLoad %v3int %arg_0
+         %31 = OpSelect %v3int %32 %33 %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %40 = OpLoad %v3int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_01e2cd
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_01e2cd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_01e2cd
+%fragment_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_01e2cd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_01e2cd
+%compute_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_01e2cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.wgsl
index 631a301..0099672 100644
--- a/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/01e2cd.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = vec3<bool>(true);
   var res : vec3<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_01e2cd();
diff --git a/test/tint/builtins/gen/var/select/087ea4.wgsl b/test/tint/builtins/gen/var/select/087ea4.wgsl
index a80c8a0..fc210ff 100644
--- a/test/tint/builtins/gen/var/select/087ea4.wgsl
+++ b/test/tint/builtins/gen/var/select/087ea4.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<u32>(1u);
   var arg_2 = true;
   var res: vec4<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.dxc.hlsl
index 455752c..a90d277 100644
--- a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_087ea4() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   bool arg_2 = true;
   uint4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.fxc.hlsl
index 455752c..a90d277 100644
--- a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_087ea4() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   bool arg_2 = true;
   uint4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.glsl
index 1c9cbfb..3753e0d 100644
--- a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_087ea4() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   bool arg_2 = true;
   uvec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_087ea4() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   bool arg_2 = true;
   uvec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_087ea4() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   bool arg_2 = true;
   uvec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.msl b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.msl
index 7888548..b39d1db 100644
--- a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_087ea4() {
+void select_087ea4(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 arg_1 = uint4(1u);
   bool arg_2 = true;
   uint4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_087ea4();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  select_087ea4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_087ea4();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  select_087ea4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_087ea4();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  select_087ea4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.spvasm
index db71937..30f1e1c 100644
--- a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_087ea4 "select_087ea4"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,60 +38,68 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
+         %22 = OpConstantNull %v4uint
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v4bool = OpTypeVector %bool 4
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %33 = OpConstantNull %v4bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4bool
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_087ea4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4uint Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v4bool Function %33
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_087ea4 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4uint Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v4bool Function %36
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v4uint %arg_1
-         %29 = OpLoad %v4uint %arg_0
-         %34 = OpCompositeConstruct %v4bool %27 %27 %27 %27
-         %26 = OpSelect %v4uint %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v4uint %arg_1
+         %32 = OpLoad %v4uint %arg_0
+         %37 = OpCompositeConstruct %v4bool %30 %30 %30 %30
+         %29 = OpSelect %v4uint %37 %31 %32
+               OpStore %res %29
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_087ea4
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %select_087ea4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_087ea4
+%fragment_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %select_087ea4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_087ea4
+%compute_main = OpFunction %void None %14
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %select_087ea4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.wgsl
index 3e20ae7..4096c2d 100644
--- a/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/087ea4.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<u32>(1u);
   var arg_2 = true;
   var res : vec4<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_087ea4();
diff --git a/test/tint/builtins/gen/var/select/089657.wgsl b/test/tint/builtins/gen/var/select/089657.wgsl
index f448bc9..ee98a53 100644
--- a/test/tint/builtins/gen/var/select/089657.wgsl
+++ b/test/tint/builtins/gen/var/select/089657.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = true;
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_089657();
diff --git a/test/tint/builtins/gen/var/select/10e73b.wgsl b/test/tint/builtins/gen/var/select/10e73b.wgsl
index 6f51852..d06d7c2 100644
--- a/test/tint/builtins/gen/var/select/10e73b.wgsl
+++ b/test/tint/builtins/gen/var/select/10e73b.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = 1.h;
   var arg_2 = true;
   var res: f16 = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.dxc.hlsl
index 8a7cabf..4c526c9 100644
--- a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_10e73b() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   bool arg_2 = true;
   float16_t res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.fxc.hlsl
index a2065d3..038705d 100644
--- a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_10e73b() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   bool arg_2 = true;
   float16_t res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.glsl
index 4ceb10b..8c15238b 100644
--- a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void select_10e73b() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   bool arg_2 = true;
   float16_t res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void select_10e73b() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   bool arg_2 = true;
   float16_t res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void select_10e73b() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   bool arg_2 = true;
   float16_t res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.msl b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.msl
index a085f08..0e2a882 100644
--- a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_10e73b() {
+void select_10e73b(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   bool arg_2 = true;
   half res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_10e73b();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  select_10e73b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_10e73b();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  select_10e73b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_10e73b();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  select_10e73b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.spvasm
index 7ecaa7b..4a02881 100644
--- a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_10e73b "select_10e73b"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,53 +42,62 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
+         %20 = OpConstantNull %half
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %23 = OpConstantNull %bool
-         %29 = OpTypeFunction %v4float
+         %26 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_10e73b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-      %arg_2 = OpVariable %_ptr_Function_bool Function %23
-        %res = OpVariable %_ptr_Function_half Function %17
+%select_10e73b = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+      %arg_2 = OpVariable %_ptr_Function_bool Function %26
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
                OpStore %arg_2 %true
-         %25 = OpLoad %bool %arg_2
-         %26 = OpLoad %half %arg_1
-         %27 = OpLoad %half %arg_0
-         %24 = OpSelect %half %25 %26 %27
-               OpStore %res %24
+         %28 = OpLoad %bool %arg_2
+         %29 = OpLoad %half %arg_1
+         %30 = OpLoad %half %arg_0
+         %27 = OpSelect %half %28 %29 %30
+               OpStore %res %27
+         %35 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %36 = OpLoad %half %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %select_10e73b
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %select_10e73b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_10e73b
+%fragment_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_10e73b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %select_10e73b
+%compute_main = OpFunction %void None %13
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %select_10e73b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.wgsl
index aff79a1..8cdcf0e 100644
--- a/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/10e73b.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = 1.0h;
   var arg_2 = true;
   var res : f16 = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_10e73b();
diff --git a/test/tint/builtins/gen/var/select/17441a.wgsl b/test/tint/builtins/gen/var/select/17441a.wgsl
index 7d12e4b..31b35eb 100644
--- a/test/tint/builtins/gen/var/select/17441a.wgsl
+++ b/test/tint/builtins/gen/var/select/17441a.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = true;
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_17441a();
diff --git a/test/tint/builtins/gen/var/select/1ada2a.wgsl b/test/tint/builtins/gen/var/select/1ada2a.wgsl
index 0af5544..e48e212 100644
--- a/test/tint/builtins/gen/var/select/1ada2a.wgsl
+++ b/test/tint/builtins/gen/var/select/1ada2a.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(1.h);
   var arg_2 = true;
   var res: vec3<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.dxc.hlsl
index 58add5f..37f42c3 100644
--- a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_1ada2a() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   bool arg_2 = true;
   vector<float16_t, 3> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.fxc.hlsl
index 93e4d37..752beda 100644
--- a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_1ada2a() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   bool arg_2 = true;
   vector<float16_t, 3> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.glsl
index 48d699f..78a0ab8 100644
--- a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_1ada2a() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   bool arg_2 = true;
   f16vec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_1ada2a() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   bool arg_2 = true;
   f16vec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_1ada2a() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   bool arg_2 = true;
   f16vec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.msl b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.msl
index 83e1b0f..7b641bc 100644
--- a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_1ada2a() {
+void select_1ada2a(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   bool arg_2 = true;
   half3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_1ada2a();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  select_1ada2a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_1ada2a();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  select_1ada2a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_1ada2a();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  select_1ada2a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.spvasm
index 7f9c734..b217168 100644
--- a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_1ada2a "select_1ada2a"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,60 +42,69 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %33 = OpConstantNull %v3bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_1ada2a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v3bool Function %33
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_1ada2a = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v3bool Function %36
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v3half %arg_1
-         %29 = OpLoad %v3half %arg_0
-         %34 = OpCompositeConstruct %v3bool %27 %27 %27
-         %26 = OpSelect %v3half %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v3half %arg_1
+         %32 = OpLoad %v3half %arg_0
+         %37 = OpCompositeConstruct %v3bool %30 %30 %30
+         %29 = OpSelect %v3half %37 %31 %32
+               OpStore %res %29
+         %42 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %43 = OpLoad %v3half %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_1ada2a
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_1ada2a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_1ada2a
+%fragment_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_1ada2a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_1ada2a
+%compute_main = OpFunction %void None %14
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %select_1ada2a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.wgsl
index 59b0b8b..7117aff 100644
--- a/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/1ada2a.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(1.0h);
   var arg_2 = true;
   var res : vec3<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_1ada2a();
diff --git a/test/tint/builtins/gen/var/select/1e960b.wgsl b/test/tint/builtins/gen/var/select/1e960b.wgsl
index 12f8a46..606263e 100644
--- a/test/tint/builtins/gen/var/select/1e960b.wgsl
+++ b/test/tint/builtins/gen/var/select/1e960b.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = vec2<bool>(true);
   var res: vec2<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.dxc.hlsl
index 9ff45c6..bab3d7a 100644
--- a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_1e960b() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   bool2 arg_2 = (true).xx;
   uint2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.fxc.hlsl
index 9ff45c6..bab3d7a 100644
--- a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_1e960b() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   bool2 arg_2 = (true).xx;
   uint2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.glsl
index 8033d8d..142c5af 100644
--- a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_1e960b() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   bvec2 arg_2 = bvec2(true);
   uvec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_1e960b() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   bvec2 arg_2 = bvec2(true);
   uvec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_1e960b() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   bvec2 arg_2 = bvec2(true);
   uvec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.msl b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.msl
index 6d78b32..285ed47 100644
--- a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_1e960b() {
+void select_1e960b(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 arg_1 = uint2(1u);
   bool2 arg_2 = bool2(true);
   uint2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_1e960b();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  select_1e960b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_1e960b();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  select_1e960b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_1e960b();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  select_1e960b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.spvasm
index 87cd7dd..1c68788 100644
--- a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_1e960b "select_1e960b"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,57 +38,65 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
+         %22 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v2bool %true %true
+         %27 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %27 = OpConstantNull %v2bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2bool
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_1e960b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2bool Function %27
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v2bool %arg_2
-         %30 = OpLoad %v2uint %arg_1
-         %31 = OpLoad %v2uint %arg_0
-         %28 = OpSelect %v2uint %29 %30 %31
-               OpStore %res %28
+%select_1e960b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+      %arg_2 = OpVariable %_ptr_Function_v2bool Function %30
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v2bool %arg_2
+         %33 = OpLoad %v2uint %arg_1
+         %34 = OpLoad %v2uint %arg_0
+         %31 = OpSelect %v2uint %32 %33 %34
+               OpStore %res %31
+         %38 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %39 = OpLoad %v2uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_1e960b
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %select_1e960b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_1e960b
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %select_1e960b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_1e960b
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %select_1e960b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.wgsl
index 4fd5fc1..4450404 100644
--- a/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/1e960b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = vec2<bool>(true);
   var res : vec2<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_1e960b();
diff --git a/test/tint/builtins/gen/var/select/1f4d93.wgsl b/test/tint/builtins/gen/var/select/1f4d93.wgsl
index d7f016c..a375291 100644
--- a/test/tint/builtins/gen/var/select/1f4d93.wgsl
+++ b/test/tint/builtins/gen/var/select/1f4d93.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec2<bool>(true);
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_1f4d93();
diff --git a/test/tint/builtins/gen/var/select/266aff.wgsl b/test/tint/builtins/gen/var/select/266aff.wgsl
index 2daf70e..8f0521d 100644
--- a/test/tint/builtins/gen/var/select/266aff.wgsl
+++ b/test/tint/builtins/gen/var/select/266aff.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(1.f);
   var arg_2 = vec2<bool>(true);
   var res: vec2<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.dxc.hlsl
index 6501b19..1e301b6 100644
--- a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_266aff() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   bool2 arg_2 = (true).xx;
   float2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.fxc.hlsl
index 6501b19..1e301b6 100644
--- a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_266aff() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   bool2 arg_2 = (true).xx;
   float2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.glsl
index 1b53051..f922003 100644
--- a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_266aff() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   bvec2 arg_2 = bvec2(true);
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_266aff() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   bvec2 arg_2 = bvec2(true);
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_266aff() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   bvec2 arg_2 = bvec2(true);
   vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.msl b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.msl
index 40ec58d..b42267a 100644
--- a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_266aff() {
+void select_266aff(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   bool2 arg_2 = bool2(true);
   float2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_266aff();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  select_266aff(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_266aff();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  select_266aff(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_266aff();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  select_266aff(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.spvasm
index c575bbb..398d972 100644
--- a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_266aff "select_266aff"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,55 +38,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %23 = OpConstantComposite %v2bool %true %true
+         %26 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %26 = OpConstantNull %v2bool
-         %32 = OpTypeFunction %v4float
-%select_266aff = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v2bool Function %26
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %23
-         %28 = OpLoad %v2bool %arg_2
-         %29 = OpLoad %v2float %arg_1
-         %30 = OpLoad %v2float %arg_0
-         %27 = OpSelect %v2float %28 %29 %30
-               OpStore %res %27
+         %29 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %40 = OpTypeFunction %v4float
+%select_266aff = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v2bool Function %29
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %26
+         %31 = OpLoad %v2bool %arg_2
+         %32 = OpLoad %v2float %arg_1
+         %33 = OpLoad %v2float %arg_0
+         %30 = OpSelect %v2float %31 %32 %33
+               OpStore %res %30
+         %38 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %39 = OpLoad %v2float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %select_266aff
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %select_266aff
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %select_266aff
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %select_266aff
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %select_266aff
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %select_266aff
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.wgsl
index d966901..06c0746 100644
--- a/test/tint/builtins/gen/var/select/266aff.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/266aff.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(1.0f);
   var arg_2 = vec2<bool>(true);
   var res : vec2<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_266aff();
diff --git a/test/tint/builtins/gen/var/select/28a27e.wgsl b/test/tint/builtins/gen/var/select/28a27e.wgsl
index d1b2133..631474c 100644
--- a/test/tint/builtins/gen/var/select/28a27e.wgsl
+++ b/test/tint/builtins/gen/var/select/28a27e.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = vec3<bool>(true);
   var res: vec3<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.dxc.hlsl
index de3886c..bf5c251 100644
--- a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_28a27e() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   bool3 arg_2 = (true).xxx;
   uint3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.fxc.hlsl
index de3886c..bf5c251 100644
--- a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_28a27e() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   bool3 arg_2 = (true).xxx;
   uint3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.glsl
index 33d750b..2f8093b 100644
--- a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_28a27e() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   bvec3 arg_2 = bvec3(true);
   uvec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_28a27e() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   bvec3 arg_2 = bvec3(true);
   uvec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_28a27e() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   bvec3 arg_2 = bvec3(true);
   uvec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.msl b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.msl
index 35ea1d8..7e65026 100644
--- a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_28a27e() {
+void select_28a27e(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 arg_1 = uint3(1u);
   bool3 arg_2 = bool3(true);
   uint3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_28a27e();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  select_28a27e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_28a27e();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  select_28a27e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_28a27e();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  select_28a27e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.spvasm
index 991b271..117c705 100644
--- a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_28a27e "select_28a27e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,57 +38,65 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
+         %22 = OpConstantNull %v3uint
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v3bool %true %true %true
+         %27 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %27 = OpConstantNull %v3bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v3bool
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_28a27e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3bool Function %27
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v3bool %arg_2
-         %30 = OpLoad %v3uint %arg_1
-         %31 = OpLoad %v3uint %arg_0
-         %28 = OpSelect %v3uint %29 %30 %31
-               OpStore %res %28
+%select_28a27e = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
+      %arg_2 = OpVariable %_ptr_Function_v3bool Function %30
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v3bool %arg_2
+         %33 = OpLoad %v3uint %arg_1
+         %34 = OpLoad %v3uint %arg_0
+         %31 = OpSelect %v3uint %32 %33 %34
+               OpStore %res %31
+         %38 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %39 = OpLoad %v3uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_28a27e
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %select_28a27e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_28a27e
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %select_28a27e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_28a27e
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %select_28a27e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.wgsl
index 257d5e3..5d6306c 100644
--- a/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/28a27e.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = vec3<bool>(true);
   var res : vec3<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_28a27e();
diff --git a/test/tint/builtins/gen/var/select/2c96d4.wgsl b/test/tint/builtins/gen/var/select/2c96d4.wgsl
index 250d84d..cf5e7fb 100644
--- a/test/tint/builtins/gen/var/select/2c96d4.wgsl
+++ b/test/tint/builtins/gen/var/select/2c96d4.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec3<bool>(true);
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_2c96d4();
diff --git a/test/tint/builtins/gen/var/select/3a14be.wgsl b/test/tint/builtins/gen/var/select/3a14be.wgsl
index cbe494f..c09b658 100644
--- a/test/tint/builtins/gen/var/select/3a14be.wgsl
+++ b/test/tint/builtins/gen/var/select/3a14be.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = true;
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_3a14be();
diff --git a/test/tint/builtins/gen/var/select/3c25ce.wgsl b/test/tint/builtins/gen/var/select/3c25ce.wgsl
index 367c609..4705935 100644
--- a/test/tint/builtins/gen/var/select/3c25ce.wgsl
+++ b/test/tint/builtins/gen/var/select/3c25ce.wgsl
@@ -27,7 +27,10 @@
   var arg_1 = vec3<bool>(true);
   var arg_2 = true;
   var res: vec3<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all(res == vec3<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.dxc.hlsl
index 54ab3e6..b25796d 100644
--- a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_3c25ce() {
   bool3 arg_0 = (true).xxx;
   bool3 arg_1 = (true).xxx;
   bool arg_2 = true;
   bool3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.fxc.hlsl
index 54ab3e6..b25796d 100644
--- a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_3c25ce() {
   bool3 arg_0 = (true).xxx;
   bool3 arg_1 = (true).xxx;
   bool arg_2 = true;
   bool3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.glsl
index d1c2ced..f3da958 100644
--- a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_3c25ce() {
   bvec3 arg_0 = bvec3(true);
   bvec3 arg_1 = bvec3(true);
   bool arg_2 = true;
   bvec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_3c25ce() {
   bvec3 arg_0 = bvec3(true);
   bvec3 arg_1 = bvec3(true);
   bool arg_2 = true;
   bvec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_3c25ce() {
   bvec3 arg_0 = bvec3(true);
   bvec3 arg_1 = bvec3(true);
   bool arg_2 = true;
   bvec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.msl b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.msl
index b81bb64..ead5ad5 100644
--- a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_3c25ce() {
+void select_3c25ce(device int* const tint_symbol_1) {
   bool3 arg_0 = bool3(true);
   bool3 arg_1 = bool3(true);
   bool arg_2 = true;
   bool3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = select(0, 1, all((res == bool3(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_3c25ce();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_3c25ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_3c25ce();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_3c25ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_3c25ce();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_3c25ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.spvasm
index c92d3ee..bad559d 100644
--- a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_3c25ce "select_3c25ce"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,55 +38,70 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v3bool %true %true %true
+         %20 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %19 = OpConstantNull %v3bool
+         %23 = OpConstantNull %v3bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %23 = OpConstantNull %bool
-         %31 = OpTypeFunction %v4float
+         %27 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %44 = OpConstantNull %int
+         %45 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_3c25ce = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3bool Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3bool Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %23
-         %28 = OpVariable %_ptr_Function_v3bool Function %19
-        %res = OpVariable %_ptr_Function_v3bool Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_3c25ce = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3bool Function %23
+      %arg_1 = OpVariable %_ptr_Function_v3bool Function %23
+      %arg_2 = OpVariable %_ptr_Function_bool Function %27
+         %32 = OpVariable %_ptr_Function_v3bool Function %23
+        %res = OpVariable %_ptr_Function_v3bool Function %23
+               OpStore %arg_0 %20
+               OpStore %arg_1 %20
                OpStore %arg_2 %true
-         %25 = OpLoad %bool %arg_2
-         %26 = OpLoad %v3bool %arg_1
-         %27 = OpLoad %v3bool %arg_0
-         %29 = OpCompositeConstruct %v3bool %25 %25 %25
-         %24 = OpSelect %v3bool %29 %26 %27
-               OpStore %res %24
+         %29 = OpLoad %bool %arg_2
+         %30 = OpLoad %v3bool %arg_1
+         %31 = OpLoad %v3bool %arg_0
+         %33 = OpCompositeConstruct %v3bool %29 %29 %29
+         %28 = OpSelect %v3bool %33 %30 %31
+               OpStore %res %28
+         %38 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %41 = OpLoad %v3bool %res
+         %42 = OpLogicalEqual %v3bool %41 %23
+         %40 = OpAll %bool %42
+         %39 = OpSelect %int %40 %int_1 %44
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %select_3c25ce
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %select_3c25ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %select_3c25ce
+%fragment_main = OpFunction %void None %13
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %select_3c25ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %select_3c25ce
+%compute_main = OpFunction %void None %13
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %select_3c25ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.wgsl
index 89f2280..ea471ff 100644
--- a/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/3c25ce.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<bool>(true);
   var arg_2 = true;
   var res : vec3<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all((res == vec3<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_3c25ce();
diff --git a/test/tint/builtins/gen/var/select/416e14.wgsl b/test/tint/builtins/gen/var/select/416e14.wgsl
index 8cd9739..b082993 100644
--- a/test/tint/builtins/gen/var/select/416e14.wgsl
+++ b/test/tint/builtins/gen/var/select/416e14.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1.f;
   var arg_2 = true;
   var res: f32 = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.dxc.hlsl
index b3d12d4..da688fb 100644
--- a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_416e14() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   bool arg_2 = true;
   float res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.fxc.hlsl
index b3d12d4..da688fb 100644
--- a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_416e14() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   bool arg_2 = true;
   float res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.glsl
index fb88928..18ad57b 100644
--- a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void select_416e14() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   bool arg_2 = true;
   float res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void select_416e14() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   bool arg_2 = true;
   float res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void select_416e14() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   bool arg_2 = true;
   float res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.msl b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.msl
index 1829479..8ee57f7 100644
--- a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_416e14() {
+void select_416e14(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   bool arg_2 = true;
   float res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_416e14();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  select_416e14(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_416e14();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  select_416e14(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_416e14();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  select_416e14(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.spvasm
index c541b5a..f71e08a 100644
--- a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_416e14 "select_416e14"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,50 +38,59 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %21 = OpConstantNull %bool
-         %27 = OpTypeFunction %v4float
-%select_416e14 = OpFunction %void None %9
-         %12 = OpLabel
+         %24 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %35 = OpTypeFunction %v4float
+%select_416e14 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
-      %arg_2 = OpVariable %_ptr_Function_bool Function %21
+      %arg_2 = OpVariable %_ptr_Function_bool Function %24
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
                OpStore %arg_2 %true
-         %23 = OpLoad %bool %arg_2
-         %24 = OpLoad %float %arg_1
-         %25 = OpLoad %float %arg_0
-         %22 = OpSelect %float %23 %24 %25
-               OpStore %res %22
+         %26 = OpLoad %bool %arg_2
+         %27 = OpLoad %float %arg_1
+         %28 = OpLoad %float %arg_0
+         %25 = OpSelect %float %26 %27 %28
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %34 = OpLoad %float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_416e14
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %select_416e14
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_416e14
+%fragment_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_416e14
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_416e14
+%compute_main = OpFunction %void None %12
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_416e14
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.wgsl
index 94af34a..572bb3e 100644
--- a/test/tint/builtins/gen/var/select/416e14.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/416e14.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1.0f;
   var arg_2 = true;
   var res : f32 = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_416e14();
diff --git a/test/tint/builtins/gen/var/select/431dfb.wgsl b/test/tint/builtins/gen/var/select/431dfb.wgsl
index 2921fe7..46ce7c9 100644
--- a/test/tint/builtins/gen/var/select/431dfb.wgsl
+++ b/test/tint/builtins/gen/var/select/431dfb.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec2<bool>(true);
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_431dfb();
diff --git a/test/tint/builtins/gen/var/select/43741e.wgsl b/test/tint/builtins/gen/var/select/43741e.wgsl
index 62d6d08..4cb301d 100644
--- a/test/tint/builtins/gen/var/select/43741e.wgsl
+++ b/test/tint/builtins/gen/var/select/43741e.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<bool>(true);
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_43741e();
diff --git a/test/tint/builtins/gen/var/select/494051.wgsl b/test/tint/builtins/gen/var/select/494051.wgsl
index 6dc6a4c..110d7ac 100644
--- a/test/tint/builtins/gen/var/select/494051.wgsl
+++ b/test/tint/builtins/gen/var/select/494051.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = true;
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_494051();
diff --git a/test/tint/builtins/gen/var/select/4c4738.wgsl b/test/tint/builtins/gen/var/select/4c4738.wgsl
index 3945eba..302e80e 100644
--- a/test/tint/builtins/gen/var/select/4c4738.wgsl
+++ b/test/tint/builtins/gen/var/select/4c4738.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<bool>(true);
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_4c4738();
diff --git a/test/tint/builtins/gen/var/select/4e60da.wgsl b/test/tint/builtins/gen/var/select/4e60da.wgsl
index e9d3673..a2b7895 100644
--- a/test/tint/builtins/gen/var/select/4e60da.wgsl
+++ b/test/tint/builtins/gen/var/select/4e60da.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = true;
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_4e60da();
diff --git a/test/tint/builtins/gen/var/select/51b047.wgsl b/test/tint/builtins/gen/var/select/51b047.wgsl
index 12c076d..923f57a 100644
--- a/test/tint/builtins/gen/var/select/51b047.wgsl
+++ b/test/tint/builtins/gen/var/select/51b047.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = true;
   var res: vec2<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.dxc.hlsl
index 40aa3f4..4e3b576 100644
--- a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_51b047() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   bool arg_2 = true;
   uint2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.fxc.hlsl
index 40aa3f4..4e3b576 100644
--- a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_51b047() {
   uint2 arg_0 = (1u).xx;
   uint2 arg_1 = (1u).xx;
   bool arg_2 = true;
   uint2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.glsl
index 06473db..f703fed 100644
--- a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_51b047() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   bool arg_2 = true;
   uvec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_51b047() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   bool arg_2 = true;
   uvec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void select_51b047() {
   uvec2 arg_0 = uvec2(1u);
   uvec2 arg_1 = uvec2(1u);
   bool arg_2 = true;
   uvec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.msl b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.msl
index fc7391b..32593b8 100644
--- a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_51b047() {
+void select_51b047(device uint2* const tint_symbol_1) {
   uint2 arg_0 = uint2(1u);
   uint2 arg_1 = uint2(1u);
   bool arg_2 = true;
   uint2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_51b047();
+float4 vertex_main_inner(device uint2* const tint_symbol_2) {
+  select_51b047(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_51b047();
+fragment void fragment_main(device uint2* tint_symbol_4 [[buffer(0)]]) {
+  select_51b047(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_51b047();
+kernel void compute_main(device uint2* tint_symbol_5 [[buffer(0)]]) {
+  select_51b047(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.spvasm
index 0b88ea7..abf98fe 100644
--- a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_51b047 "select_51b047"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,60 +38,68 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %19 = OpConstantNull %v2uint
+         %22 = OpConstantNull %v2uint
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %33 = OpConstantNull %v2bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v2bool
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_51b047 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v2bool Function %33
-        %res = OpVariable %_ptr_Function_v2uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_51b047 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v2bool Function %36
+        %res = OpVariable %_ptr_Function_v2uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v2uint %arg_1
-         %29 = OpLoad %v2uint %arg_0
-         %34 = OpCompositeConstruct %v2bool %27 %27
-         %26 = OpSelect %v2uint %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v2uint %arg_1
+         %32 = OpLoad %v2uint %arg_0
+         %37 = OpCompositeConstruct %v2bool %30 %30
+         %29 = OpSelect %v2uint %37 %31 %32
+               OpStore %res %29
+         %41 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %42 = OpLoad %v2uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_51b047
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %select_51b047
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_51b047
+%fragment_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %select_51b047
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_51b047
+%compute_main = OpFunction %void None %14
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %select_51b047
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.wgsl
index a5412ed..79651db 100644
--- a/test/tint/builtins/gen/var/select/51b047.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/51b047.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = true;
   var res : vec2<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_51b047();
diff --git a/test/tint/builtins/gen/var/select/53d518.wgsl b/test/tint/builtins/gen/var/select/53d518.wgsl
index 0c5bfc8..13cce37 100644
--- a/test/tint/builtins/gen/var/select/53d518.wgsl
+++ b/test/tint/builtins/gen/var/select/53d518.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(1.h);
   var arg_2 = vec3<bool>(true);
   var res: vec3<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.dxc.hlsl
index 130b0ce..aa3d7f8 100644
--- a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_53d518() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   bool3 arg_2 = (true).xxx;
   vector<float16_t, 3> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.fxc.hlsl
index 4949509..4ee04fe 100644
--- a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_53d518() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   bool3 arg_2 = (true).xxx;
   vector<float16_t, 3> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.glsl
index 969204f..a35f1dd 100644
--- a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_53d518() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   bvec3 arg_2 = bvec3(true);
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_53d518() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   bvec3 arg_2 = bvec3(true);
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void select_53d518() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   bvec3 arg_2 = bvec3(true);
   f16vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.msl b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.msl
index 113cf61..5cc3a42 100644
--- a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_53d518() {
+void select_53d518(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   bool3 arg_2 = bool3(true);
   half3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_53d518();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  select_53d518(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_53d518();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  select_53d518(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_53d518();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  select_53d518(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.spvasm
index 11f9b70..03a70e0 100644
--- a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_53d518 "select_53d518"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,57 +42,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v3bool %true %true %true
+         %27 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %27 = OpConstantNull %v3bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_53d518 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3bool Function %27
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v3bool %arg_2
-         %30 = OpLoad %v3half %arg_1
-         %31 = OpLoad %v3half %arg_0
-         %28 = OpSelect %v3half %29 %30 %31
-               OpStore %res %28
+%select_53d518 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v3bool Function %30
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v3bool %arg_2
+         %33 = OpLoad %v3half %arg_1
+         %34 = OpLoad %v3half %arg_0
+         %31 = OpSelect %v3half %32 %33 %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %40 = OpLoad %v3half %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_53d518
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_53d518
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_53d518
+%fragment_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_53d518
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_53d518
+%compute_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_53d518
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.wgsl
index ef25de8..7eb6964 100644
--- a/test/tint/builtins/gen/var/select/53d518.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/53d518.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(1.0h);
   var arg_2 = vec3<bool>(true);
   var res : vec3<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_53d518();
diff --git a/test/tint/builtins/gen/var/select/713567.wgsl b/test/tint/builtins/gen/var/select/713567.wgsl
index 91e2887..4f449d4 100644
--- a/test/tint/builtins/gen/var/select/713567.wgsl
+++ b/test/tint/builtins/gen/var/select/713567.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(1.f);
   var arg_2 = true;
   var res: vec4<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/713567.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/713567.wgsl.expected.dxc.hlsl
index 9d70108..e0e0331 100644
--- a/test/tint/builtins/gen/var/select/713567.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/713567.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_713567() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   bool arg_2 = true;
   float4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/713567.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/713567.wgsl.expected.fxc.hlsl
index 9d70108..e0e0331 100644
--- a/test/tint/builtins/gen/var/select/713567.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/713567.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_713567() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   bool arg_2 = true;
   float4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/713567.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/713567.wgsl.expected.glsl
index e5090f0..62bd2be 100644
--- a/test/tint/builtins/gen/var/select/713567.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/713567.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_713567() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   bool arg_2 = true;
   vec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_713567() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   bool arg_2 = true;
   vec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_713567() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   bool arg_2 = true;
   vec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/713567.wgsl.expected.msl b/test/tint/builtins/gen/var/select/713567.wgsl.expected.msl
index fe42ab0..a12e568 100644
--- a/test/tint/builtins/gen/var/select/713567.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/713567.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_713567() {
+void select_713567(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   bool arg_2 = true;
   float4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_713567();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  select_713567(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_713567();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  select_713567(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_713567();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  select_713567(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/713567.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/713567.wgsl.expected.spvasm
index b8bd586..7f34249 100644
--- a/test/tint/builtins/gen/var/select/713567.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/713567.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_713567 "select_713567"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,56 +38,65 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %22 = OpConstantNull %bool
+         %25 = OpConstantNull %bool
      %v4bool = OpTypeVector %bool 4
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %30 = OpConstantNull %v4bool
-         %33 = OpTypeFunction %v4float
-%select_713567 = OpFunction %void None %9
-         %12 = OpLabel
+         %33 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
+%select_713567 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
-      %arg_2 = OpVariable %_ptr_Function_bool Function %22
-         %28 = OpVariable %_ptr_Function_v4bool Function %30
+      %arg_2 = OpVariable %_ptr_Function_bool Function %25
+         %31 = OpVariable %_ptr_Function_v4bool Function %33
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
                OpStore %arg_2 %true
-         %24 = OpLoad %bool %arg_2
-         %25 = OpLoad %v4float %arg_1
-         %26 = OpLoad %v4float %arg_0
-         %31 = OpCompositeConstruct %v4bool %24 %24 %24 %24
-         %23 = OpSelect %v4float %31 %25 %26
-               OpStore %res %23
+         %27 = OpLoad %bool %arg_2
+         %28 = OpLoad %v4float %arg_1
+         %29 = OpLoad %v4float %arg_0
+         %34 = OpCompositeConstruct %v4bool %27 %27 %27 %27
+         %26 = OpSelect %v4float %34 %28 %29
+               OpStore %res %26
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_713567
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_713567
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %12
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %select_713567
+%fragment_main = OpFunction %void None %12
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %select_713567
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %select_713567
+%compute_main = OpFunction %void None %12
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %select_713567
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/713567.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/713567.wgsl.expected.wgsl
index 62cfc1a..1f0d01a 100644
--- a/test/tint/builtins/gen/var/select/713567.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/713567.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(1.0f);
   var arg_2 = true;
   var res : vec4<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_713567();
diff --git a/test/tint/builtins/gen/var/select/78be5f.wgsl b/test/tint/builtins/gen/var/select/78be5f.wgsl
index 2245ec4..a971bce 100644
--- a/test/tint/builtins/gen/var/select/78be5f.wgsl
+++ b/test/tint/builtins/gen/var/select/78be5f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(1.f);
   var arg_2 = true;
   var res: vec3<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.dxc.hlsl
index 997acbe..f090298 100644
--- a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_78be5f() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   bool arg_2 = true;
   float3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.fxc.hlsl
index 997acbe..f090298 100644
--- a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_78be5f() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   bool arg_2 = true;
   float3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.glsl
index 35920b7..73db658 100644
--- a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_78be5f() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   bool arg_2 = true;
   vec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_78be5f() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   bool arg_2 = true;
   vec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_78be5f() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   bool arg_2 = true;
   vec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.msl b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.msl
index 251735f..ad0e9ff 100644
--- a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_78be5f() {
+void select_78be5f(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   bool arg_2 = true;
   float3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_78be5f();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  select_78be5f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_78be5f();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  select_78be5f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_78be5f();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  select_78be5f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.spvasm
index 07585b8..77a7a9a 100644
--- a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_78be5f "select_78be5f"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,58 +38,67 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %24 = OpConstantNull %bool
+         %27 = OpConstantNull %bool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %32 = OpConstantNull %v3bool
-         %35 = OpTypeFunction %v4float
-%select_78be5f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_2 = OpVariable %_ptr_Function_bool Function %24
-         %30 = OpVariable %_ptr_Function_v3bool Function %32
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
+         %35 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %43 = OpTypeFunction %v4float
+%select_78be5f = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_2 = OpVariable %_ptr_Function_bool Function %27
+         %33 = OpVariable %_ptr_Function_v3bool Function %35
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
                OpStore %arg_2 %true
-         %26 = OpLoad %bool %arg_2
-         %27 = OpLoad %v3float %arg_1
-         %28 = OpLoad %v3float %arg_0
-         %33 = OpCompositeConstruct %v3bool %26 %26 %26
-         %25 = OpSelect %v3float %33 %27 %28
-               OpStore %res %25
+         %29 = OpLoad %bool %arg_2
+         %30 = OpLoad %v3float %arg_1
+         %31 = OpLoad %v3float %arg_0
+         %36 = OpCompositeConstruct %v3bool %29 %29 %29
+         %28 = OpSelect %v3float %36 %30 %31
+               OpStore %res %28
+         %41 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %42 = OpLoad %v3float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %select_78be5f
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %select_78be5f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %select_78be5f
+%fragment_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %select_78be5f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %select_78be5f
+%compute_main = OpFunction %void None %13
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %select_78be5f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.wgsl
index ca853b9..b6c73fd 100644
--- a/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/78be5f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(1.0f);
   var arg_2 = true;
   var res : vec3<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_78be5f();
diff --git a/test/tint/builtins/gen/var/select/80a9a9.wgsl b/test/tint/builtins/gen/var/select/80a9a9.wgsl
index 4797149..aef1c9e 100644
--- a/test/tint/builtins/gen/var/select/80a9a9.wgsl
+++ b/test/tint/builtins/gen/var/select/80a9a9.wgsl
@@ -27,7 +27,10 @@
   var arg_1 = vec3<bool>(true);
   var arg_2 = vec3<bool>(true);
   var res: vec3<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all(res == vec3<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.dxc.hlsl
index 12841d9..818a567 100644
--- a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_80a9a9() {
   bool3 arg_0 = (true).xxx;
   bool3 arg_1 = (true).xxx;
   bool3 arg_2 = (true).xxx;
   bool3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.fxc.hlsl
index 12841d9..818a567 100644
--- a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_80a9a9() {
   bool3 arg_0 = (true).xxx;
   bool3 arg_1 = (true).xxx;
   bool3 arg_2 = (true).xxx;
   bool3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.glsl
index b2d3f5c..ae911fe 100644
--- a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_80a9a9() {
   bvec3 arg_0 = bvec3(true);
   bvec3 arg_1 = bvec3(true);
   bvec3 arg_2 = bvec3(true);
   bvec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_80a9a9() {
   bvec3 arg_0 = bvec3(true);
   bvec3 arg_1 = bvec3(true);
   bvec3 arg_2 = bvec3(true);
   bvec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_80a9a9() {
   bvec3 arg_0 = bvec3(true);
   bvec3 arg_1 = bvec3(true);
   bvec3 arg_2 = bvec3(true);
   bvec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec3(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.msl b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.msl
index 74edbe1..43169a4 100644
--- a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_80a9a9() {
+void select_80a9a9(device int* const tint_symbol_1) {
   bool3 arg_0 = bool3(true);
   bool3 arg_1 = bool3(true);
   bool3 arg_2 = bool3(true);
   bool3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = select(0, 1, all((res == bool3(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_80a9a9();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_80a9a9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_80a9a9();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_80a9a9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_80a9a9();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_80a9a9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.spvasm
index 9699fed..7e1e5ce 100644
--- a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_80a9a9 "select_80a9a9"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,51 +38,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v3bool %true %true %true
+         %20 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %19 = OpConstantNull %v3bool
-         %27 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %40 = OpConstantNull %int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_80a9a9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3bool Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3bool Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3bool Function %19
-        %res = OpVariable %_ptr_Function_v3bool Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %23 = OpLoad %v3bool %arg_2
-         %24 = OpLoad %v3bool %arg_1
-         %25 = OpLoad %v3bool %arg_0
-         %22 = OpSelect %v3bool %23 %24 %25
-               OpStore %res %22
+%select_80a9a9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3bool Function %23
+      %arg_1 = OpVariable %_ptr_Function_v3bool Function %23
+      %arg_2 = OpVariable %_ptr_Function_v3bool Function %23
+        %res = OpVariable %_ptr_Function_v3bool Function %23
+               OpStore %arg_0 %20
+               OpStore %arg_1 %20
+               OpStore %arg_2 %20
+         %27 = OpLoad %v3bool %arg_2
+         %28 = OpLoad %v3bool %arg_1
+         %29 = OpLoad %v3bool %arg_0
+         %26 = OpSelect %v3bool %27 %28 %29
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %37 = OpLoad %v3bool %res
+         %38 = OpLogicalEqual %v3bool %37 %23
+         %36 = OpAll %bool %38
+         %35 = OpSelect %int %36 %int_1 %40
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_80a9a9
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_80a9a9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %select_80a9a9
+%fragment_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_80a9a9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %select_80a9a9
+%compute_main = OpFunction %void None %13
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_80a9a9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.wgsl
index a016f65..ed907f8 100644
--- a/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/80a9a9.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<bool>(true);
   var arg_2 = vec3<bool>(true);
   var res : vec3<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all((res == vec3<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_80a9a9();
diff --git a/test/tint/builtins/gen/var/select/830dd9.wgsl b/test/tint/builtins/gen/var/select/830dd9.wgsl
index 9b0b560..1fb8542 100644
--- a/test/tint/builtins/gen/var/select/830dd9.wgsl
+++ b/test/tint/builtins/gen/var/select/830dd9.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(1.h);
   var arg_2 = true;
   var res: vec4<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.dxc.hlsl
index 890f9b9..9401d1c 100644
--- a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_830dd9() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   bool arg_2 = true;
   vector<float16_t, 4> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.fxc.hlsl
index 100c558..9354ecb 100644
--- a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_830dd9() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   bool arg_2 = true;
   vector<float16_t, 4> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.glsl
index 91f87b0..8974383 100644
--- a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_830dd9() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   bool arg_2 = true;
   f16vec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_830dd9() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   bool arg_2 = true;
   f16vec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_830dd9() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   bool arg_2 = true;
   f16vec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.msl b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.msl
index 6c7ba53..bd7b10a 100644
--- a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_830dd9() {
+void select_830dd9(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   bool arg_2 = true;
   half4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_830dd9();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  select_830dd9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_830dd9();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  select_830dd9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_830dd9();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  select_830dd9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.spvasm
index c45ef5d..ba9b3c3 100644
--- a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_830dd9 "select_830dd9"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,60 +42,69 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v4bool = OpTypeVector %bool 4
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %33 = OpConstantNull %v4bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_830dd9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v4bool Function %33
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_830dd9 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v4bool Function %36
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v4half %arg_1
-         %29 = OpLoad %v4half %arg_0
-         %34 = OpCompositeConstruct %v4bool %27 %27 %27 %27
-         %26 = OpSelect %v4half %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v4half %arg_1
+         %32 = OpLoad %v4half %arg_0
+         %37 = OpCompositeConstruct %v4bool %30 %30 %30 %30
+         %29 = OpSelect %v4half %37 %31 %32
+               OpStore %res %29
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %43 = OpLoad %v4half %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_830dd9
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_830dd9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_830dd9
+%fragment_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_830dd9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_830dd9
+%compute_main = OpFunction %void None %14
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %select_830dd9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.wgsl
index 5f7afc7..069e63b 100644
--- a/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/830dd9.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(1.0h);
   var arg_2 = true;
   var res : vec4<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_830dd9();
diff --git a/test/tint/builtins/gen/var/select/86f9bd.wgsl b/test/tint/builtins/gen/var/select/86f9bd.wgsl
index 626b415..75a7e30 100644
--- a/test/tint/builtins/gen/var/select/86f9bd.wgsl
+++ b/test/tint/builtins/gen/var/select/86f9bd.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(1.h);
   var arg_2 = true;
   var res: vec2<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.dxc.hlsl
index ce7f4ee..5c84682 100644
--- a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_86f9bd() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   bool arg_2 = true;
   vector<float16_t, 2> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.fxc.hlsl
index 5deab4e..6b19e4f 100644
--- a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_86f9bd() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   bool arg_2 = true;
   vector<float16_t, 2> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.glsl
index c39942a..e8f269d 100644
--- a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_86f9bd() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   bool arg_2 = true;
   f16vec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_86f9bd() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   bool arg_2 = true;
   f16vec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_86f9bd() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   bool arg_2 = true;
   f16vec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.msl b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.msl
index 8ba3008..e0d2197 100644
--- a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_86f9bd() {
+void select_86f9bd(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   bool arg_2 = true;
   half2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_86f9bd();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  select_86f9bd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_86f9bd();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  select_86f9bd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_86f9bd();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  select_86f9bd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.spvasm
index 697e75c..bfae955 100644
--- a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_86f9bd "select_86f9bd"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,60 +42,69 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %33 = OpConstantNull %v2bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_86f9bd = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v2bool Function %33
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_86f9bd = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v2bool Function %36
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v2half %arg_1
-         %29 = OpLoad %v2half %arg_0
-         %34 = OpCompositeConstruct %v2bool %27 %27
-         %26 = OpSelect %v2half %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v2half %arg_1
+         %32 = OpLoad %v2half %arg_0
+         %37 = OpCompositeConstruct %v2bool %30 %30
+         %29 = OpSelect %v2half %37 %31 %32
+               OpStore %res %29
+         %42 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %43 = OpLoad %v2half %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_86f9bd
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_86f9bd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_86f9bd
+%fragment_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_86f9bd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_86f9bd
+%compute_main = OpFunction %void None %14
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %select_86f9bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.wgsl
index 0dc3a0e..6304ac6 100644
--- a/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/86f9bd.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(1.0h);
   var arg_2 = true;
   var res : vec2<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_86f9bd();
diff --git a/test/tint/builtins/gen/var/select/8fa62c.wgsl b/test/tint/builtins/gen/var/select/8fa62c.wgsl
index 0fbee4a..8214143 100644
--- a/test/tint/builtins/gen/var/select/8fa62c.wgsl
+++ b/test/tint/builtins/gen/var/select/8fa62c.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = true;
   var res: vec3<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.dxc.hlsl
index 8e5ca94..0455add 100644
--- a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_8fa62c() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   bool arg_2 = true;
   int3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.fxc.hlsl
index 8e5ca94..0455add 100644
--- a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_8fa62c() {
   int3 arg_0 = (1).xxx;
   int3 arg_1 = (1).xxx;
   bool arg_2 = true;
   int3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.glsl
index 4f54fba..361cf4a 100644
--- a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_8fa62c() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   bool arg_2 = true;
   ivec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_8fa62c() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   bool arg_2 = true;
   ivec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void select_8fa62c() {
   ivec3 arg_0 = ivec3(1);
   ivec3 arg_1 = ivec3(1);
   bool arg_2 = true;
   ivec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.msl b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.msl
index c5d92e8..9551265 100644
--- a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_8fa62c() {
+void select_8fa62c(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 arg_1 = int3(1);
   bool arg_2 = true;
   int3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_8fa62c();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  select_8fa62c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_8fa62c();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  select_8fa62c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_8fa62c();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  select_8fa62c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.spvasm
index d90c6ea..bd92537 100644
--- a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_8fa62c "select_8fa62c"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,60 +38,69 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
+         %22 = OpConstantNull %v3int
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %33 = OpConstantNull %v3bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_8fa62c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v3bool Function %33
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_8fa62c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v3bool Function %36
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v3int %arg_1
-         %29 = OpLoad %v3int %arg_0
-         %34 = OpCompositeConstruct %v3bool %27 %27 %27
-         %26 = OpSelect %v3int %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v3int %arg_1
+         %32 = OpLoad %v3int %arg_0
+         %37 = OpCompositeConstruct %v3bool %30 %30 %30
+         %29 = OpSelect %v3int %37 %31 %32
+               OpStore %res %29
+         %42 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %43 = OpLoad %v3int %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_8fa62c
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_8fa62c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_8fa62c
+%fragment_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_8fa62c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_8fa62c
+%compute_main = OpFunction %void None %14
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %select_8fa62c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.wgsl
index 4be16e0..ea7e438 100644
--- a/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/8fa62c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = true;
   var res : vec3<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_8fa62c();
diff --git a/test/tint/builtins/gen/var/select/99f883.wgsl b/test/tint/builtins/gen/var/select/99f883.wgsl
index 27bd2e3..b5ffcb3 100644
--- a/test/tint/builtins/gen/var/select/99f883.wgsl
+++ b/test/tint/builtins/gen/var/select/99f883.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = true;
   var res: u32 = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.dxc.hlsl
index ece0b4e..0ab48fd 100644
--- a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_99f883() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   bool arg_2 = true;
   uint res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.fxc.hlsl
index ece0b4e..0ab48fd 100644
--- a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_99f883() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   bool arg_2 = true;
   uint res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.glsl
index 1a92d98..5d9a375 100644
--- a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void select_99f883() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   bool arg_2 = true;
   uint res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void select_99f883() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   bool arg_2 = true;
   uint res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void select_99f883() {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   bool arg_2 = true;
   uint res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.msl b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.msl
index 34011c8..3147fda 100644
--- a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_99f883() {
+void select_99f883(device uint* const tint_symbol_1) {
   uint arg_0 = 1u;
   uint arg_1 = 1u;
   bool arg_2 = true;
   uint res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_99f883();
+float4 vertex_main_inner(device uint* const tint_symbol_2) {
+  select_99f883(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_99f883();
+fragment void fragment_main(device uint* tint_symbol_4 [[buffer(0)]]) {
+  select_99f883(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_99f883();
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]]) {
+  select_99f883(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.spvasm
index 9ba6aac..df83623 100644
--- a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_99f883 "select_99f883"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,53 +38,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
+         %20 = OpConstantNull %uint
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %23 = OpConstantNull %bool
-         %29 = OpTypeFunction %v4float
+         %26 = OpConstantNull %bool
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_99f883 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-      %arg_1 = OpVariable %_ptr_Function_uint Function %17
-      %arg_2 = OpVariable %_ptr_Function_bool Function %23
-        %res = OpVariable %_ptr_Function_uint Function %17
+%select_99f883 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
+      %arg_1 = OpVariable %_ptr_Function_uint Function %20
+      %arg_2 = OpVariable %_ptr_Function_bool Function %26
+        %res = OpVariable %_ptr_Function_uint Function %20
                OpStore %arg_0 %uint_1
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %true
-         %25 = OpLoad %bool %arg_2
-         %26 = OpLoad %uint %arg_1
-         %27 = OpLoad %uint %arg_0
-         %24 = OpSelect %uint %25 %26 %27
-               OpStore %res %24
+         %28 = OpLoad %bool %arg_2
+         %29 = OpLoad %uint %arg_1
+         %30 = OpLoad %uint %arg_0
+         %27 = OpSelect %uint %28 %29 %30
+               OpStore %res %27
+         %34 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %35 = OpLoad %uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %select_99f883
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %select_99f883
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_99f883
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %select_99f883
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %select_99f883
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %select_99f883
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.wgsl
index 1f34678..4b6a8aa 100644
--- a/test/tint/builtins/gen/var/select/99f883.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/99f883.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1u;
   var arg_2 = true;
   var res : u32 = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_99f883();
diff --git a/test/tint/builtins/gen/var/select/9b478d.wgsl b/test/tint/builtins/gen/var/select/9b478d.wgsl
index 927eb44..7d6a2a9 100644
--- a/test/tint/builtins/gen/var/select/9b478d.wgsl
+++ b/test/tint/builtins/gen/var/select/9b478d.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = true;
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_9b478d();
diff --git a/test/tint/builtins/gen/var/select/a081f1.wgsl b/test/tint/builtins/gen/var/select/a081f1.wgsl
index 3d10597..d698731 100644
--- a/test/tint/builtins/gen/var/select/a081f1.wgsl
+++ b/test/tint/builtins/gen/var/select/a081f1.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(1.h);
   var arg_2 = vec4<bool>(true);
   var res: vec4<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.dxc.hlsl
index cd9b433..6cd57c4 100644
--- a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_a081f1() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   bool4 arg_2 = (true).xxxx;
   vector<float16_t, 4> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.fxc.hlsl
index a9964cf..43eaa62 100644
--- a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_a081f1() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   bool4 arg_2 = (true).xxxx;
   vector<float16_t, 4> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.glsl
index 3d77f2d..e3122b2 100644
--- a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_a081f1() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   bvec4 arg_2 = bvec4(true);
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_a081f1() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   bvec4 arg_2 = bvec4(true);
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void select_a081f1() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   bvec4 arg_2 = bvec4(true);
   f16vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.msl b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.msl
index bf3fe02..7a31d96 100644
--- a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_a081f1() {
+void select_a081f1(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   bool4 arg_2 = bool4(true);
   half4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_a081f1();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  select_a081f1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_a081f1();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  select_a081f1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_a081f1();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  select_a081f1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.spvasm
index 81f19a7..6dff4c8 100644
--- a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_a081f1 "select_a081f1"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,57 +42,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v4bool %true %true %true %true
+         %27 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %27 = OpConstantNull %v4bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_a081f1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4bool Function %27
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v4bool %arg_2
-         %30 = OpLoad %v4half %arg_1
-         %31 = OpLoad %v4half %arg_0
-         %28 = OpSelect %v4half %29 %30 %31
-               OpStore %res %28
+%select_a081f1 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v4bool Function %30
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v4bool %arg_2
+         %33 = OpLoad %v4half %arg_1
+         %34 = OpLoad %v4half %arg_0
+         %31 = OpSelect %v4half %32 %33 %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %40 = OpLoad %v4half %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_a081f1
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_a081f1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_a081f1
+%fragment_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_a081f1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_a081f1
+%compute_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_a081f1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.wgsl
index 73b30df..a0765cb 100644
--- a/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/a081f1.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(1.0h);
   var arg_2 = vec4<bool>(true);
   var res : vec4<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_a081f1();
diff --git a/test/tint/builtins/gen/var/select/a2860e.wgsl b/test/tint/builtins/gen/var/select/a2860e.wgsl
index 9788782..072ea91 100644
--- a/test/tint/builtins/gen/var/select/a2860e.wgsl
+++ b/test/tint/builtins/gen/var/select/a2860e.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<i32>(1i);
   var arg_2 = vec4<bool>(true);
   var res: vec4<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.dxc.hlsl
index 9cfb0e5..9384191 100644
--- a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_a2860e() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   bool4 arg_2 = (true).xxxx;
   int4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.fxc.hlsl
index 9cfb0e5..9384191 100644
--- a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_a2860e() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   bool4 arg_2 = (true).xxxx;
   int4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.glsl
index cccde14..7700faa 100644
--- a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_a2860e() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   bvec4 arg_2 = bvec4(true);
   ivec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_a2860e() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   bvec4 arg_2 = bvec4(true);
   ivec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_a2860e() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   bvec4 arg_2 = bvec4(true);
   ivec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.msl b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.msl
index 2b70f32..2359ffb 100644
--- a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_a2860e() {
+void select_a2860e(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 arg_1 = int4(1);
   bool4 arg_2 = bool4(true);
   int4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_a2860e();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  select_a2860e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_a2860e();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  select_a2860e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_a2860e();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  select_a2860e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.spvasm
index ff3b0ac..dc46581 100644
--- a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_a2860e "select_a2860e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,57 +38,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
+         %22 = OpConstantNull %v4int
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v4bool %true %true %true %true
+         %27 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %27 = OpConstantNull %v4bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_a2860e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4bool Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v4bool %arg_2
-         %30 = OpLoad %v4int %arg_1
-         %31 = OpLoad %v4int %arg_0
-         %28 = OpSelect %v4int %29 %30 %31
-               OpStore %res %28
+%select_a2860e = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %22
+      %arg_2 = OpVariable %_ptr_Function_v4bool Function %30
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v4bool %arg_2
+         %33 = OpLoad %v4int %arg_1
+         %34 = OpLoad %v4int %arg_0
+         %31 = OpSelect %v4int %32 %33 %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %40 = OpLoad %v4int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_a2860e
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_a2860e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_a2860e
+%fragment_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_a2860e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_a2860e
+%compute_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_a2860e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.wgsl
index 361cf3d..3468ad1 100644
--- a/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/a2860e.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<i32>(1i);
   var arg_2 = vec4<bool>(true);
   var res : vec4<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_a2860e();
diff --git a/test/tint/builtins/gen/var/select/ab069f.wgsl b/test/tint/builtins/gen/var/select/ab069f.wgsl
index 052fc6b..96ca595 100644
--- a/test/tint/builtins/gen/var/select/ab069f.wgsl
+++ b/test/tint/builtins/gen/var/select/ab069f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<i32>(1i);
   var arg_2 = true;
   var res: vec4<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.dxc.hlsl
index b1ef504..eda483e 100644
--- a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ab069f() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   bool arg_2 = true;
   int4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.fxc.hlsl
index b1ef504..eda483e 100644
--- a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ab069f() {
   int4 arg_0 = (1).xxxx;
   int4 arg_1 = (1).xxxx;
   bool arg_2 = true;
   int4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.glsl
index da8260c..fd6ecb5 100644
--- a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_ab069f() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   bool arg_2 = true;
   ivec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_ab069f() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   bool arg_2 = true;
   ivec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void select_ab069f() {
   ivec4 arg_0 = ivec4(1);
   ivec4 arg_1 = ivec4(1);
   bool arg_2 = true;
   ivec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.msl b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.msl
index df7f500..365cb8d 100644
--- a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_ab069f() {
+void select_ab069f(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 arg_1 = int4(1);
   bool arg_2 = true;
   int4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_ab069f();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  select_ab069f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_ab069f();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  select_ab069f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_ab069f();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  select_ab069f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.spvasm
index fc0ca02..40123e0 100644
--- a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_ab069f "select_ab069f"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,60 +38,69 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
+         %22 = OpConstantNull %v4int
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v4bool = OpTypeVector %bool 4
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %33 = OpConstantNull %v4bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_ab069f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4int Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v4bool Function %33
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_ab069f = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4int Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v4bool Function %36
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v4int %arg_1
-         %29 = OpLoad %v4int %arg_0
-         %34 = OpCompositeConstruct %v4bool %27 %27 %27 %27
-         %26 = OpSelect %v4int %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v4int %arg_1
+         %32 = OpLoad %v4int %arg_0
+         %37 = OpCompositeConstruct %v4bool %30 %30 %30 %30
+         %29 = OpSelect %v4int %37 %31 %32
+               OpStore %res %29
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %43 = OpLoad %v4int %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_ab069f
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_ab069f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_ab069f
+%fragment_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_ab069f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_ab069f
+%compute_main = OpFunction %void None %14
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %select_ab069f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.wgsl
index deee19d..11eb08c 100644
--- a/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/ab069f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<i32>(1i);
   var arg_2 = true;
   var res : vec4<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_ab069f();
diff --git a/test/tint/builtins/gen/var/select/b04721.wgsl b/test/tint/builtins/gen/var/select/b04721.wgsl
index be22dc3..e8862cb 100644
--- a/test/tint/builtins/gen/var/select/b04721.wgsl
+++ b/test/tint/builtins/gen/var/select/b04721.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = true;
   var res: vec3<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.dxc.hlsl
index 286d318..cdce69d 100644
--- a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_b04721() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   bool arg_2 = true;
   uint3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.fxc.hlsl
index 286d318..cdce69d 100644
--- a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_b04721() {
   uint3 arg_0 = (1u).xxx;
   uint3 arg_1 = (1u).xxx;
   bool arg_2 = true;
   uint3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.glsl
index 9b37f75..dd3491c 100644
--- a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_b04721() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   bool arg_2 = true;
   uvec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_b04721() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   bool arg_2 = true;
   uvec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void select_b04721() {
   uvec3 arg_0 = uvec3(1u);
   uvec3 arg_1 = uvec3(1u);
   bool arg_2 = true;
   uvec3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.msl b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.msl
index ec77e1e..fe6d41e 100644
--- a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_b04721() {
+void select_b04721(device packed_uint3* const tint_symbol_1) {
   uint3 arg_0 = uint3(1u);
   uint3 arg_1 = uint3(1u);
   bool arg_2 = true;
   uint3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_b04721();
+float4 vertex_main_inner(device packed_uint3* const tint_symbol_2) {
+  select_b04721(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_uint3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_b04721();
+fragment void fragment_main(device packed_uint3* tint_symbol_4 [[buffer(0)]]) {
+  select_b04721(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_b04721();
+kernel void compute_main(device packed_uint3* tint_symbol_5 [[buffer(0)]]) {
+  select_b04721(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.spvasm
index a2d40b8..c02a616 100644
--- a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_b04721 "select_b04721"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,60 +38,68 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %19 = OpConstantNull %v3uint
+         %22 = OpConstantNull %v3uint
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %33 = OpConstantNull %v3bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v3bool
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_b04721 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v3bool Function %33
-        %res = OpVariable %_ptr_Function_v3uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_b04721 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v3bool Function %36
+        %res = OpVariable %_ptr_Function_v3uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v3uint %arg_1
-         %29 = OpLoad %v3uint %arg_0
-         %34 = OpCompositeConstruct %v3bool %27 %27 %27
-         %26 = OpSelect %v3uint %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v3uint %arg_1
+         %32 = OpLoad %v3uint %arg_0
+         %37 = OpCompositeConstruct %v3bool %30 %30 %30
+         %29 = OpSelect %v3uint %37 %31 %32
+               OpStore %res %29
+         %41 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %42 = OpLoad %v3uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_b04721
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %select_b04721
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_b04721
+%fragment_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %select_b04721
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_b04721
+%compute_main = OpFunction %void None %14
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %select_b04721
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.wgsl
index 3eec22a..4006aa5 100644
--- a/test/tint/builtins/gen/var/select/b04721.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/b04721.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = true;
   var res : vec3<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_b04721();
diff --git a/test/tint/builtins/gen/var/select/b93806.wgsl b/test/tint/builtins/gen/var/select/b93806.wgsl
index 7c05225..9e9c946 100644
--- a/test/tint/builtins/gen/var/select/b93806.wgsl
+++ b/test/tint/builtins/gen/var/select/b93806.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec3<bool>(true);
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_b93806();
diff --git a/test/tint/builtins/gen/var/select/bb447f.wgsl b/test/tint/builtins/gen/var/select/bb447f.wgsl
index bb73ce9..f7bdd26 100644
--- a/test/tint/builtins/gen/var/select/bb447f.wgsl
+++ b/test/tint/builtins/gen/var/select/bb447f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = true;
   var res: vec2<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.dxc.hlsl
index 54054a5..b1103af 100644
--- a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bb447f() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   bool arg_2 = true;
   int2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.fxc.hlsl
index 54054a5..b1103af 100644
--- a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bb447f() {
   int2 arg_0 = (1).xx;
   int2 arg_1 = (1).xx;
   bool arg_2 = true;
   int2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.glsl
index 2e1cd76..4ef7166 100644
--- a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_bb447f() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   bool arg_2 = true;
   ivec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_bb447f() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   bool arg_2 = true;
   ivec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void select_bb447f() {
   ivec2 arg_0 = ivec2(1);
   ivec2 arg_1 = ivec2(1);
   bool arg_2 = true;
   ivec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.msl b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.msl
index 6028b17..0def09f 100644
--- a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_bb447f() {
+void select_bb447f(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 arg_1 = int2(1);
   bool arg_2 = true;
   int2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_bb447f();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  select_bb447f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_bb447f();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  select_bb447f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_bb447f();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  select_bb447f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.spvasm
index ba42bca..1323209 100644
--- a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_bb447f "select_bb447f"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,60 +38,69 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
+         %22 = OpConstantNull %v2int
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %25 = OpConstantNull %bool
+         %28 = OpConstantNull %bool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %33 = OpConstantNull %v2bool
-         %36 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %44 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_bb447f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %25
-         %31 = OpVariable %_ptr_Function_v2bool Function %33
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_bb447f = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+      %arg_2 = OpVariable %_ptr_Function_bool Function %28
+         %34 = OpVariable %_ptr_Function_v2bool Function %36
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
                OpStore %arg_2 %true
-         %27 = OpLoad %bool %arg_2
-         %28 = OpLoad %v2int %arg_1
-         %29 = OpLoad %v2int %arg_0
-         %34 = OpCompositeConstruct %v2bool %27 %27
-         %26 = OpSelect %v2int %34 %28 %29
-               OpStore %res %26
+         %30 = OpLoad %bool %arg_2
+         %31 = OpLoad %v2int %arg_1
+         %32 = OpLoad %v2int %arg_0
+         %37 = OpCompositeConstruct %v2bool %30 %30
+         %29 = OpSelect %v2int %37 %31 %32
+               OpStore %res %29
+         %42 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %43 = OpLoad %v2int %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_bb447f
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_bb447f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_bb447f
+%fragment_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_bb447f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %select_bb447f
+%compute_main = OpFunction %void None %14
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %select_bb447f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.wgsl
index 1275623..4c49141 100644
--- a/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/bb447f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = true;
   var res : vec2<i32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_bb447f();
diff --git a/test/tint/builtins/gen/var/select/bb8aae.wgsl b/test/tint/builtins/gen/var/select/bb8aae.wgsl
index 1d0aae6..cd4ac0f 100644
--- a/test/tint/builtins/gen/var/select/bb8aae.wgsl
+++ b/test/tint/builtins/gen/var/select/bb8aae.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(1.f);
   var arg_2 = vec4<bool>(true);
   var res: vec4<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.dxc.hlsl
index 5b54bb0..f25be38 100644
--- a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bb8aae() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   bool4 arg_2 = (true).xxxx;
   float4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.fxc.hlsl
index 5b54bb0..f25be38 100644
--- a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bb8aae() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   bool4 arg_2 = (true).xxxx;
   float4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.glsl
index 11f1221..fa4c216 100644
--- a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_bb8aae() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   bvec4 arg_2 = bvec4(true);
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_bb8aae() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   bvec4 arg_2 = bvec4(true);
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void select_bb8aae() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   bvec4 arg_2 = bvec4(true);
   vec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.msl b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.msl
index aa41986..e535f12 100644
--- a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_bb8aae() {
+void select_bb8aae(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   bool4 arg_2 = bool4(true);
   float4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_bb8aae();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  select_bb8aae(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_bb8aae();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  select_bb8aae(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_bb8aae();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  select_bb8aae(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.spvasm
index bf31dcf..07b8827 100644
--- a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_bb8aae "select_bb8aae"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,53 +38,62 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %21 = OpConstantComposite %v4bool %true %true %true %true
+         %24 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %24 = OpConstantNull %v4bool
-         %30 = OpTypeFunction %v4float
-%select_bb8aae = OpFunction %void None %9
-         %12 = OpLabel
+         %27 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %38 = OpTypeFunction %v4float
+%select_bb8aae = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
-      %arg_2 = OpVariable %_ptr_Function_v4bool Function %24
+      %arg_2 = OpVariable %_ptr_Function_v4bool Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-               OpStore %arg_2 %21
-         %26 = OpLoad %v4bool %arg_2
-         %27 = OpLoad %v4float %arg_1
-         %28 = OpLoad %v4float %arg_0
-         %25 = OpSelect %v4float %26 %27 %28
-               OpStore %res %25
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+               OpStore %arg_2 %24
+         %29 = OpLoad %v4bool %arg_2
+         %30 = OpLoad %v4float %arg_1
+         %31 = OpLoad %v4float %arg_0
+         %28 = OpSelect %v4float %29 %30 %31
+               OpStore %res %28
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %37 = OpLoad %v4float %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %select_bb8aae
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %select_bb8aae
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_bb8aae
+%fragment_main = OpFunction %void None %12
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_bb8aae
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %select_bb8aae
+%compute_main = OpFunction %void None %12
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %select_bb8aae
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.wgsl
index e0075a1..c729c3e 100644
--- a/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/bb8aae.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(1.0f);
   var arg_2 = vec4<bool>(true);
   var res : vec4<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_bb8aae();
diff --git a/test/tint/builtins/gen/var/select/bf3d29.wgsl b/test/tint/builtins/gen/var/select/bf3d29.wgsl
index 97325e4..cc0e80e 100644
--- a/test/tint/builtins/gen/var/select/bf3d29.wgsl
+++ b/test/tint/builtins/gen/var/select/bf3d29.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(1.f);
   var arg_2 = true;
   var res: vec2<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.dxc.hlsl
index 639514d..041da8b 100644
--- a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bf3d29() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   bool arg_2 = true;
   float2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.fxc.hlsl
index 639514d..041da8b 100644
--- a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_bf3d29() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   bool arg_2 = true;
   float2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.glsl
index f6e0706..2970dd5 100644
--- a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_bf3d29() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   bool arg_2 = true;
   vec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_bf3d29() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   bool arg_2 = true;
   vec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void select_bf3d29() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   bool arg_2 = true;
   vec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.msl b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.msl
index 174b98e..d1f25bf 100644
--- a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_bf3d29() {
+void select_bf3d29(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   bool arg_2 = true;
   float2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_bf3d29();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  select_bf3d29(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_bf3d29();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  select_bf3d29(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_bf3d29();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  select_bf3d29(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.spvasm
index 89a1163..e09d815 100644
--- a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_bf3d29 "select_bf3d29"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,58 +38,67 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %24 = OpConstantNull %bool
+         %27 = OpConstantNull %bool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %32 = OpConstantNull %v2bool
-         %35 = OpTypeFunction %v4float
-%select_bf3d29 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_2 = OpVariable %_ptr_Function_bool Function %24
-         %30 = OpVariable %_ptr_Function_v2bool Function %32
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
+         %35 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %43 = OpTypeFunction %v4float
+%select_bf3d29 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_2 = OpVariable %_ptr_Function_bool Function %27
+         %33 = OpVariable %_ptr_Function_v2bool Function %35
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
                OpStore %arg_2 %true
-         %26 = OpLoad %bool %arg_2
-         %27 = OpLoad %v2float %arg_1
-         %28 = OpLoad %v2float %arg_0
-         %33 = OpCompositeConstruct %v2bool %26 %26
-         %25 = OpSelect %v2float %33 %27 %28
-               OpStore %res %25
+         %29 = OpLoad %bool %arg_2
+         %30 = OpLoad %v2float %arg_1
+         %31 = OpLoad %v2float %arg_0
+         %36 = OpCompositeConstruct %v2bool %29 %29
+         %28 = OpSelect %v2float %36 %30 %31
+               OpStore %res %28
+         %41 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %42 = OpLoad %v2float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %select_bf3d29
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %select_bf3d29
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %select_bf3d29
+%fragment_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %select_bf3d29
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %select_bf3d29
+%compute_main = OpFunction %void None %13
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %select_bf3d29
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.wgsl
index b05a10e..f3b1dd8 100644
--- a/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/bf3d29.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(1.0f);
   var arg_2 = true;
   var res : vec2<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_bf3d29();
diff --git a/test/tint/builtins/gen/var/select/c31f9e.wgsl b/test/tint/builtins/gen/var/select/c31f9e.wgsl
index 2d597ba..aeefc63 100644
--- a/test/tint/builtins/gen/var/select/c31f9e.wgsl
+++ b/test/tint/builtins/gen/var/select/c31f9e.wgsl
@@ -27,7 +27,10 @@
   var arg_1 = true;
   var arg_2 = true;
   var res: bool = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all(res == bool()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.dxc.hlsl
index 3be461a..0254e10 100644
--- a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c31f9e() {
   bool arg_0 = true;
   bool arg_1 = true;
   bool arg_2 = true;
   bool res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.fxc.hlsl
index 3be461a..0254e10 100644
--- a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c31f9e() {
   bool arg_0 = true;
   bool arg_1 = true;
   bool arg_2 = true;
   bool res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == false)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.glsl
index 0f2507e..b1c01a5 100644
--- a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c31f9e() {
   bool arg_0 = true;
   bool arg_1 = true;
   bool arg_2 = true;
   bool res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c31f9e() {
   bool arg_0 = true;
   bool arg_1 = true;
   bool arg_2 = true;
   bool res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c31f9e() {
   bool arg_0 = true;
   bool arg_1 = true;
   bool arg_2 = true;
   bool res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = ((res == false) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.msl b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.msl
index d3176b3..6491d2c 100644
--- a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_c31f9e() {
+void select_c31f9e(device int* const tint_symbol_1) {
   bool arg_0 = true;
   bool arg_1 = true;
   bool arg_2 = true;
   bool res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = select(0, 1, all((res == false)));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_c31f9e();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_c31f9e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_c31f9e();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_c31f9e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_c31f9e();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_c31f9e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.spvasm
index 794f566..c087119 100644
--- a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_c31f9e "select_c31f9e"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,49 +38,63 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %17 = OpConstantNull %bool
-         %25 = OpTypeFunction %v4float
+         %21 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %38 = OpConstantNull %int
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_c31f9e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_bool Function %17
-      %arg_1 = OpVariable %_ptr_Function_bool Function %17
-      %arg_2 = OpVariable %_ptr_Function_bool Function %17
-        %res = OpVariable %_ptr_Function_bool Function %17
+%select_c31f9e = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_bool Function %21
+      %arg_1 = OpVariable %_ptr_Function_bool Function %21
+      %arg_2 = OpVariable %_ptr_Function_bool Function %21
+        %res = OpVariable %_ptr_Function_bool Function %21
                OpStore %arg_0 %true
                OpStore %arg_1 %true
                OpStore %arg_2 %true
-         %21 = OpLoad %bool %arg_2
-         %22 = OpLoad %bool %arg_1
-         %23 = OpLoad %bool %arg_0
-         %20 = OpSelect %bool %21 %22 %23
-               OpStore %res %20
+         %25 = OpLoad %bool %arg_2
+         %26 = OpLoad %bool %arg_1
+         %27 = OpLoad %bool %arg_0
+         %24 = OpSelect %bool %25 %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %35 = OpLoad %bool %res
+         %36 = OpLogicalEqual %bool %35 %21
+         %33 = OpSelect %int %36 %int_1 %38
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %select_c31f9e
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %select_c31f9e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %select_c31f9e
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %select_c31f9e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %select_c31f9e
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %select_c31f9e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.wgsl
index 1fa4500..cc7aebc 100644
--- a/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/c31f9e.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = true;
   var arg_2 = true;
   var res : bool = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all((res == bool())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_c31f9e();
diff --git a/test/tint/builtins/gen/var/select/c41bd1.wgsl b/test/tint/builtins/gen/var/select/c41bd1.wgsl
index dd1d005..f1da3d4 100644
--- a/test/tint/builtins/gen/var/select/c41bd1.wgsl
+++ b/test/tint/builtins/gen/var/select/c41bd1.wgsl
@@ -27,7 +27,10 @@
   var arg_1 = vec4<bool>(true);
   var arg_2 = true;
   var res: vec4<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all(res == vec4<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.dxc.hlsl
index 3dbc9b2..ca44ec7 100644
--- a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c41bd1() {
   bool4 arg_0 = (true).xxxx;
   bool4 arg_1 = (true).xxxx;
   bool arg_2 = true;
   bool4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xxxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.fxc.hlsl
index 3dbc9b2..ca44ec7 100644
--- a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c41bd1() {
   bool4 arg_0 = (true).xxxx;
   bool4 arg_1 = (true).xxxx;
   bool arg_2 = true;
   bool4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xxxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.glsl
index 048a70d..0071cf9 100644
--- a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c41bd1() {
   bvec4 arg_0 = bvec4(true);
   bvec4 arg_1 = bvec4(true);
   bool arg_2 = true;
   bvec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c41bd1() {
   bvec4 arg_0 = bvec4(true);
   bvec4 arg_1 = bvec4(true);
   bool arg_2 = true;
   bvec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_c41bd1() {
   bvec4 arg_0 = bvec4(true);
   bvec4 arg_1 = bvec4(true);
   bool arg_2 = true;
   bvec4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.msl b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.msl
index 0f35981..f2056fe 100644
--- a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_c41bd1() {
+void select_c41bd1(device int* const tint_symbol_1) {
   bool4 arg_0 = bool4(true);
   bool4 arg_1 = bool4(true);
   bool arg_2 = true;
   bool4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = select(0, 1, all((res == bool4(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_c41bd1();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_c41bd1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_c41bd1();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_c41bd1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_c41bd1();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_c41bd1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.spvasm
index c1c88b5..4eb796d 100644
--- a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_c41bd1 "select_c41bd1"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,55 +38,70 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v4bool %true %true %true %true
+         %20 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %19 = OpConstantNull %v4bool
+         %23 = OpConstantNull %v4bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %23 = OpConstantNull %bool
-         %31 = OpTypeFunction %v4float
+         %27 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %44 = OpConstantNull %int
+         %45 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_c41bd1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4bool Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4bool Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %23
-         %28 = OpVariable %_ptr_Function_v4bool Function %19
-        %res = OpVariable %_ptr_Function_v4bool Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_c41bd1 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4bool Function %23
+      %arg_1 = OpVariable %_ptr_Function_v4bool Function %23
+      %arg_2 = OpVariable %_ptr_Function_bool Function %27
+         %32 = OpVariable %_ptr_Function_v4bool Function %23
+        %res = OpVariable %_ptr_Function_v4bool Function %23
+               OpStore %arg_0 %20
+               OpStore %arg_1 %20
                OpStore %arg_2 %true
-         %25 = OpLoad %bool %arg_2
-         %26 = OpLoad %v4bool %arg_1
-         %27 = OpLoad %v4bool %arg_0
-         %29 = OpCompositeConstruct %v4bool %25 %25 %25 %25
-         %24 = OpSelect %v4bool %29 %26 %27
-               OpStore %res %24
+         %29 = OpLoad %bool %arg_2
+         %30 = OpLoad %v4bool %arg_1
+         %31 = OpLoad %v4bool %arg_0
+         %33 = OpCompositeConstruct %v4bool %29 %29 %29 %29
+         %28 = OpSelect %v4bool %33 %30 %31
+               OpStore %res %28
+         %38 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %41 = OpLoad %v4bool %res
+         %42 = OpLogicalEqual %v4bool %41 %23
+         %40 = OpAll %bool %42
+         %39 = OpSelect %int %40 %int_1 %44
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %select_c41bd1
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %select_c41bd1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %select_c41bd1
+%fragment_main = OpFunction %void None %13
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %select_c41bd1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %select_c41bd1
+%compute_main = OpFunction %void None %13
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %select_c41bd1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.wgsl
index aeeb85c..b416d7e 100644
--- a/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/c41bd1.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<bool>(true);
   var arg_2 = true;
   var res : vec4<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all((res == vec4<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_c41bd1();
diff --git a/test/tint/builtins/gen/var/select/c4a4ef.wgsl b/test/tint/builtins/gen/var/select/c4a4ef.wgsl
index 9502b65..dfe790c 100644
--- a/test/tint/builtins/gen/var/select/c4a4ef.wgsl
+++ b/test/tint/builtins/gen/var/select/c4a4ef.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<u32>(1u);
   var arg_2 = vec4<bool>(true);
   var res: vec4<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.dxc.hlsl
index 2ef3ebd..04ad2ce 100644
--- a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c4a4ef() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   bool4 arg_2 = (true).xxxx;
   uint4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.fxc.hlsl
index 2ef3ebd..04ad2ce 100644
--- a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_c4a4ef() {
   uint4 arg_0 = (1u).xxxx;
   uint4 arg_1 = (1u).xxxx;
   bool4 arg_2 = (true).xxxx;
   uint4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.glsl
index d75fbb7..eea27e0 100644
--- a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_c4a4ef() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   bvec4 arg_2 = bvec4(true);
   uvec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_c4a4ef() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   bvec4 arg_2 = bvec4(true);
   uvec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void select_c4a4ef() {
   uvec4 arg_0 = uvec4(1u);
   uvec4 arg_1 = uvec4(1u);
   bvec4 arg_2 = bvec4(true);
   uvec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.msl b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.msl
index 7e6eb78..1c32a5a 100644
--- a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_c4a4ef() {
+void select_c4a4ef(device uint4* const tint_symbol_1) {
   uint4 arg_0 = uint4(1u);
   uint4 arg_1 = uint4(1u);
   bool4 arg_2 = bool4(true);
   uint4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_c4a4ef();
+float4 vertex_main_inner(device uint4* const tint_symbol_2) {
+  select_c4a4ef(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_c4a4ef();
+fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
+  select_c4a4ef(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_c4a4ef();
+kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
+  select_c4a4ef(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.spvasm
index 620f545..5de366b 100644
--- a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_c4a4ef "select_c4a4ef"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,57 +38,65 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
-         %16 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+         %19 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %19 = OpConstantNull %v4uint
+         %22 = OpConstantNull %v4uint
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v4bool %true %true %true %true
+         %27 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %27 = OpConstantNull %v4bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v4bool
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_c4a4ef = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4uint Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4uint Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4bool Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v4bool %arg_2
-         %30 = OpLoad %v4uint %arg_1
-         %31 = OpLoad %v4uint %arg_0
-         %28 = OpSelect %v4uint %29 %30 %31
-               OpStore %res %28
+%select_c4a4ef = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4uint Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4uint Function %22
+      %arg_2 = OpVariable %_ptr_Function_v4bool Function %30
+        %res = OpVariable %_ptr_Function_v4uint Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v4bool %arg_2
+         %33 = OpLoad %v4uint %arg_1
+         %34 = OpLoad %v4uint %arg_0
+         %31 = OpSelect %v4uint %32 %33 %34
+               OpStore %res %31
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %39 = OpLoad %v4uint %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_c4a4ef
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %select_c4a4ef
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_c4a4ef
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %select_c4a4ef
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_c4a4ef
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %select_c4a4ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.wgsl
index a155e76..9fc2b3f 100644
--- a/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/c4a4ef.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<u32>(1u);
   var arg_2 = vec4<bool>(true);
   var res : vec4<u32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_c4a4ef();
diff --git a/test/tint/builtins/gen/var/select/cb9301.wgsl b/test/tint/builtins/gen/var/select/cb9301.wgsl
index 0948d3d..9fcb086 100644
--- a/test/tint/builtins/gen/var/select/cb9301.wgsl
+++ b/test/tint/builtins/gen/var/select/cb9301.wgsl
@@ -27,7 +27,10 @@
   var arg_1 = vec2<bool>(true);
   var arg_2 = vec2<bool>(true);
   var res: vec2<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all(res == vec2<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.dxc.hlsl
index 76b1344..24bf081 100644
--- a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_cb9301() {
   bool2 arg_0 = (true).xx;
   bool2 arg_1 = (true).xx;
   bool2 arg_2 = (true).xx;
   bool2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.fxc.hlsl
index 76b1344..24bf081 100644
--- a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_cb9301() {
   bool2 arg_0 = (true).xx;
   bool2 arg_1 = (true).xx;
   bool2 arg_2 = (true).xx;
   bool2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.glsl
index 8c7e5d2..d8a9f13 100644
--- a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_cb9301() {
   bvec2 arg_0 = bvec2(true);
   bvec2 arg_1 = bvec2(true);
   bvec2 arg_2 = bvec2(true);
   bvec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_cb9301() {
   bvec2 arg_0 = bvec2(true);
   bvec2 arg_1 = bvec2(true);
   bvec2 arg_2 = bvec2(true);
   bvec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_cb9301() {
   bvec2 arg_0 = bvec2(true);
   bvec2 arg_1 = bvec2(true);
   bvec2 arg_2 = bvec2(true);
   bvec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.msl b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.msl
index 3bdecab..2d5af19 100644
--- a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_cb9301() {
+void select_cb9301(device int* const tint_symbol_1) {
   bool2 arg_0 = bool2(true);
   bool2 arg_1 = bool2(true);
   bool2 arg_2 = bool2(true);
   bool2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = select(0, 1, all((res == bool2(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_cb9301();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_cb9301(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_cb9301();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_cb9301(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_cb9301();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_cb9301(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.spvasm
index 0060df1..81f6768 100644
--- a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_cb9301 "select_cb9301"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,51 +38,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v2bool %true %true
+         %20 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %19 = OpConstantNull %v2bool
-         %27 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %40 = OpConstantNull %int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_cb9301 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2bool Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2bool Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2bool Function %19
-        %res = OpVariable %_ptr_Function_v2bool Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %23 = OpLoad %v2bool %arg_2
-         %24 = OpLoad %v2bool %arg_1
-         %25 = OpLoad %v2bool %arg_0
-         %22 = OpSelect %v2bool %23 %24 %25
-               OpStore %res %22
+%select_cb9301 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2bool Function %23
+      %arg_1 = OpVariable %_ptr_Function_v2bool Function %23
+      %arg_2 = OpVariable %_ptr_Function_v2bool Function %23
+        %res = OpVariable %_ptr_Function_v2bool Function %23
+               OpStore %arg_0 %20
+               OpStore %arg_1 %20
+               OpStore %arg_2 %20
+         %27 = OpLoad %v2bool %arg_2
+         %28 = OpLoad %v2bool %arg_1
+         %29 = OpLoad %v2bool %arg_0
+         %26 = OpSelect %v2bool %27 %28 %29
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %37 = OpLoad %v2bool %res
+         %38 = OpLogicalEqual %v2bool %37 %23
+         %36 = OpAll %bool %38
+         %35 = OpSelect %int %36 %int_1 %40
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_cb9301
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_cb9301
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %select_cb9301
+%fragment_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_cb9301
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %select_cb9301
+%compute_main = OpFunction %void None %13
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_cb9301
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.wgsl
index e5744ba..ed85cca 100644
--- a/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/cb9301.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<bool>(true);
   var arg_2 = vec2<bool>(true);
   var res : vec2<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all((res == vec2<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_cb9301();
diff --git a/test/tint/builtins/gen/var/select/dfab3b.wgsl b/test/tint/builtins/gen/var/select/dfab3b.wgsl
index 6becfda..b60ed43 100644
--- a/test/tint/builtins/gen/var/select/dfab3b.wgsl
+++ b/test/tint/builtins/gen/var/select/dfab3b.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = true;
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_dfab3b();
diff --git a/test/tint/builtins/gen/var/select/e381c3.wgsl b/test/tint/builtins/gen/var/select/e381c3.wgsl
index b752d20..74f7cc9 100644
--- a/test/tint/builtins/gen/var/select/e381c3.wgsl
+++ b/test/tint/builtins/gen/var/select/e381c3.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = true;
   var res = select(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_e381c3();
diff --git a/test/tint/builtins/gen/var/select/e3e028.wgsl b/test/tint/builtins/gen/var/select/e3e028.wgsl
index 828c371..6f43d31 100644
--- a/test/tint/builtins/gen/var/select/e3e028.wgsl
+++ b/test/tint/builtins/gen/var/select/e3e028.wgsl
@@ -27,7 +27,10 @@
   var arg_1 = vec4<bool>(true);
   var arg_2 = vec4<bool>(true);
   var res: vec4<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all(res == vec4<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.dxc.hlsl
index 2d1efcf..60754af 100644
--- a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_e3e028() {
   bool4 arg_0 = (true).xxxx;
   bool4 arg_1 = (true).xxxx;
   bool4 arg_2 = (true).xxxx;
   bool4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xxxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.fxc.hlsl
index 2d1efcf..60754af 100644
--- a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_e3e028() {
   bool4 arg_0 = (true).xxxx;
   bool4 arg_1 = (true).xxxx;
   bool4 arg_2 = (true).xxxx;
   bool4 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xxxx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.glsl
index afdfd70..8e52828 100644
--- a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_e3e028() {
   bvec4 arg_0 = bvec4(true);
   bvec4 arg_1 = bvec4(true);
   bvec4 arg_2 = bvec4(true);
   bvec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_e3e028() {
   bvec4 arg_0 = bvec4(true);
   bvec4 arg_1 = bvec4(true);
   bvec4 arg_2 = bvec4(true);
   bvec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_e3e028() {
   bvec4 arg_0 = bvec4(true);
   bvec4 arg_1 = bvec4(true);
   bvec4 arg_2 = bvec4(true);
   bvec4 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = (all(equal(res, bvec4(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.msl b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.msl
index 817ec0d..5ba7bfa 100644
--- a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_e3e028() {
+void select_e3e028(device int* const tint_symbol_1) {
   bool4 arg_0 = bool4(true);
   bool4 arg_1 = bool4(true);
   bool4 arg_2 = bool4(true);
   bool4 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = select(0, 1, all((res == bool4(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_e3e028();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_e3e028(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_e3e028();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_e3e028(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_e3e028();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_e3e028(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.spvasm
index c5e95ac..8f70f2c 100644
--- a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_e3e028 "select_e3e028"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,51 +38,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v4bool = OpTypeVector %bool 4
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v4bool %true %true %true %true
+         %20 = OpConstantComposite %v4bool %true %true %true %true
 %_ptr_Function_v4bool = OpTypePointer Function %v4bool
-         %19 = OpConstantNull %v4bool
-         %27 = OpTypeFunction %v4float
+         %23 = OpConstantNull %v4bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %40 = OpConstantNull %int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_e3e028 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4bool Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4bool Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4bool Function %19
-        %res = OpVariable %_ptr_Function_v4bool Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %16
-         %23 = OpLoad %v4bool %arg_2
-         %24 = OpLoad %v4bool %arg_1
-         %25 = OpLoad %v4bool %arg_0
-         %22 = OpSelect %v4bool %23 %24 %25
-               OpStore %res %22
+%select_e3e028 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4bool Function %23
+      %arg_1 = OpVariable %_ptr_Function_v4bool Function %23
+      %arg_2 = OpVariable %_ptr_Function_v4bool Function %23
+        %res = OpVariable %_ptr_Function_v4bool Function %23
+               OpStore %arg_0 %20
+               OpStore %arg_1 %20
+               OpStore %arg_2 %20
+         %27 = OpLoad %v4bool %arg_2
+         %28 = OpLoad %v4bool %arg_1
+         %29 = OpLoad %v4bool %arg_0
+         %26 = OpSelect %v4bool %27 %28 %29
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %37 = OpLoad %v4bool %res
+         %38 = OpLogicalEqual %v4bool %37 %23
+         %36 = OpAll %bool %38
+         %35 = OpSelect %int %36 %int_1 %40
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %select_e3e028
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_e3e028
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %select_e3e028
+%fragment_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_e3e028
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %select_e3e028
+%compute_main = OpFunction %void None %13
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_e3e028
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.wgsl
index 69fe77f..52e4969 100644
--- a/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/e3e028.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<bool>(true);
   var arg_2 = vec4<bool>(true);
   var res : vec4<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all((res == vec4<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_e3e028();
diff --git a/test/tint/builtins/gen/var/select/ebfea2.wgsl b/test/tint/builtins/gen/var/select/ebfea2.wgsl
index 3c42358..ee4d5d4 100644
--- a/test/tint/builtins/gen/var/select/ebfea2.wgsl
+++ b/test/tint/builtins/gen/var/select/ebfea2.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(1.f);
   var arg_2 = vec3<bool>(true);
   var res: vec3<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.dxc.hlsl
index e60468f..3d5a170 100644
--- a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ebfea2() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   bool3 arg_2 = (true).xxx;
   float3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.fxc.hlsl
index e60468f..3d5a170 100644
--- a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ebfea2() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   bool3 arg_2 = (true).xxx;
   float3 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.glsl
index 38126c6..3b4a3fe 100644
--- a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_ebfea2() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   bvec3 arg_2 = bvec3(true);
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_ebfea2() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   bvec3 arg_2 = bvec3(true);
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void select_ebfea2() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   bvec3 arg_2 = bvec3(true);
   vec3 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.msl b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.msl
index 10ce571..8946b17 100644
--- a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_ebfea2() {
+void select_ebfea2(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   bool3 arg_2 = bool3(true);
   float3 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_ebfea2();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  select_ebfea2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_ebfea2();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  select_ebfea2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_ebfea2();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  select_ebfea2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.spvasm
index 0657b5e..6e07e15 100644
--- a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_ebfea2 "select_ebfea2"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,55 +38,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
        %true = OpConstantTrue %bool
-         %23 = OpConstantComposite %v3bool %true %true %true
+         %26 = OpConstantComposite %v3bool %true %true %true
 %_ptr_Function_v3bool = OpTypePointer Function %v3bool
-         %26 = OpConstantNull %v3bool
-         %32 = OpTypeFunction %v4float
-%select_ebfea2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v3bool Function %26
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-               OpStore %arg_2 %23
-         %28 = OpLoad %v3bool %arg_2
-         %29 = OpLoad %v3float %arg_1
-         %30 = OpLoad %v3float %arg_0
-         %27 = OpSelect %v3float %28 %29 %30
-               OpStore %res %27
+         %29 = OpConstantNull %v3bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %40 = OpTypeFunction %v4float
+%select_ebfea2 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v3bool Function %29
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+               OpStore %arg_2 %26
+         %31 = OpLoad %v3bool %arg_2
+         %32 = OpLoad %v3float %arg_1
+         %33 = OpLoad %v3float %arg_0
+         %30 = OpSelect %v3float %31 %32 %33
+               OpStore %res %30
+         %38 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %39 = OpLoad %v3float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %select_ebfea2
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %select_ebfea2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %select_ebfea2
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %select_ebfea2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %select_ebfea2
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %select_ebfea2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.wgsl
index 97db546..9bea2fe 100644
--- a/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/ebfea2.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(1.0f);
   var arg_2 = vec3<bool>(true);
   var res : vec3<f32> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_ebfea2();
diff --git a/test/tint/builtins/gen/var/select/ed7c13.wgsl b/test/tint/builtins/gen/var/select/ed7c13.wgsl
index eb3330a..4babdec 100644
--- a/test/tint/builtins/gen/var/select/ed7c13.wgsl
+++ b/test/tint/builtins/gen/var/select/ed7c13.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(1.h);
   var arg_2 = vec2<bool>(true);
   var res: vec2<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.dxc.hlsl
index 3068de6..4d18fd5 100644
--- a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ed7c13() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   bool2 arg_2 = (true).xx;
   vector<float16_t, 2> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.fxc.hlsl
index 69ac474..09e3ce0 100644
--- a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ed7c13() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   bool2 arg_2 = (true).xx;
   vector<float16_t, 2> res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.glsl
index f4541b5..a63a36e 100644
--- a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_ed7c13() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   bvec2 arg_2 = bvec2(true);
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_ed7c13() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   bvec2 arg_2 = bvec2(true);
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void select_ed7c13() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   bvec2 arg_2 = bvec2(true);
   f16vec2 res = mix(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.msl b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.msl
index b48bdd8..d00044d 100644
--- a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_ed7c13() {
+void select_ed7c13(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   bool2 arg_2 = bool2(true);
   half2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_ed7c13();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  select_ed7c13(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_ed7c13();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  select_ed7c13(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_ed7c13();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  select_ed7c13(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.spvasm
index b69e849..c70f226 100644
--- a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_ed7c13 "select_ed7c13"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,57 +42,66 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %24 = OpConstantComposite %v2bool %true %true
+         %27 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %27 = OpConstantNull %v2bool
-         %33 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_ed7c13 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2bool Function %27
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-               OpStore %arg_2 %24
-         %29 = OpLoad %v2bool %arg_2
-         %30 = OpLoad %v2half %arg_1
-         %31 = OpLoad %v2half %arg_0
-         %28 = OpSelect %v2half %29 %30 %31
-               OpStore %res %28
+%select_ed7c13 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v2bool Function %30
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+               OpStore %arg_2 %27
+         %32 = OpLoad %v2bool %arg_2
+         %33 = OpLoad %v2half %arg_1
+         %34 = OpLoad %v2half %arg_0
+         %31 = OpSelect %v2half %32 %33 %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %40 = OpLoad %v2half %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %select_ed7c13
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %select_ed7c13
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %select_ed7c13
+%fragment_main = OpFunction %void None %14
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %select_ed7c13
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %select_ed7c13
+%compute_main = OpFunction %void None %14
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %select_ed7c13
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.wgsl
index 06d7ad3..fb4d271 100644
--- a/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/ed7c13.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(1.0h);
   var arg_2 = vec2<bool>(true);
   var res : vec2<f16> = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_ed7c13();
diff --git a/test/tint/builtins/gen/var/select/ed8a15.wgsl b/test/tint/builtins/gen/var/select/ed8a15.wgsl
index fd5055b..72cbe32 100644
--- a/test/tint/builtins/gen/var/select/ed8a15.wgsl
+++ b/test/tint/builtins/gen/var/select/ed8a15.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1i;
   var arg_2 = true;
   var res: i32 = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.dxc.hlsl
index a47eb0e..9943b11 100644
--- a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ed8a15() {
   int arg_0 = 1;
   int arg_1 = 1;
   bool arg_2 = true;
   int res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.fxc.hlsl
index a47eb0e..9943b11 100644
--- a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_ed8a15() {
   int arg_0 = 1;
   int arg_1 = 1;
   bool arg_2 = true;
   int res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.glsl
index 57b434c..4737066 100644
--- a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_ed8a15() {
   int arg_0 = 1;
   int arg_1 = 1;
   bool arg_2 = true;
   int res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_ed8a15() {
   int arg_0 = 1;
   int arg_1 = 1;
   bool arg_2 = true;
   int res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_ed8a15() {
   int arg_0 = 1;
   int arg_1 = 1;
   bool arg_2 = true;
   int res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.msl b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.msl
index dba6c41..75d902f 100644
--- a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_ed8a15() {
+void select_ed8a15(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int arg_1 = 1;
   bool arg_2 = true;
   int res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_ed8a15();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_ed8a15(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_ed8a15();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_ed8a15(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_ed8a15();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_ed8a15(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.spvasm
index ecd306f..a995a77 100644
--- a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_ed8a15 "select_ed8a15"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,53 +38,62 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
+         %20 = OpConstantNull %int
        %bool = OpTypeBool
        %true = OpConstantTrue %bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %23 = OpConstantNull %bool
-         %29 = OpTypeFunction %v4float
+         %26 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_ed8a15 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %17
-      %arg_1 = OpVariable %_ptr_Function_int Function %17
-      %arg_2 = OpVariable %_ptr_Function_bool Function %23
-        %res = OpVariable %_ptr_Function_int Function %17
+%select_ed8a15 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %20
+      %arg_1 = OpVariable %_ptr_Function_int Function %20
+      %arg_2 = OpVariable %_ptr_Function_bool Function %26
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %arg_0 %int_1
                OpStore %arg_1 %int_1
                OpStore %arg_2 %true
-         %25 = OpLoad %bool %arg_2
-         %26 = OpLoad %int %arg_1
-         %27 = OpLoad %int %arg_0
-         %24 = OpSelect %int %25 %26 %27
-               OpStore %res %24
+         %28 = OpLoad %bool %arg_2
+         %29 = OpLoad %int %arg_1
+         %30 = OpLoad %int %arg_0
+         %27 = OpSelect %int %28 %29 %30
+               OpStore %res %27
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %36 = OpLoad %int %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %select_ed8a15
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %select_ed8a15
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %select_ed8a15
+%fragment_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %select_ed8a15
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %select_ed8a15
+%compute_main = OpFunction %void None %13
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %select_ed8a15
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.wgsl
index 0314f16..e13ddd9 100644
--- a/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/ed8a15.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 1i;
   var arg_2 = true;
   var res : i32 = select(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_ed8a15();
diff --git a/test/tint/builtins/gen/var/select/fb7e53.wgsl b/test/tint/builtins/gen/var/select/fb7e53.wgsl
index bc57d35..90e03a5 100644
--- a/test/tint/builtins/gen/var/select/fb7e53.wgsl
+++ b/test/tint/builtins/gen/var/select/fb7e53.wgsl
@@ -27,7 +27,10 @@
   var arg_1 = vec2<bool>(true);
   var arg_2 = true;
   var res: vec2<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all(res == vec2<bool>()));
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.dxc.hlsl
index db58f48..b20d9d1 100644
--- a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_fb7e53() {
   bool2 arg_0 = (true).xx;
   bool2 arg_1 = (true).xx;
   bool arg_2 = true;
   bool2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.fxc.hlsl
index db58f48..b20d9d1 100644
--- a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void select_fb7e53() {
   bool2 arg_0 = (true).xx;
   bool2 arg_1 = (true).xx;
   bool arg_2 = true;
   bool2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.Store(0u, asuint((all((res == (false).xx)) ? 1 : 0)));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.glsl b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.glsl
index ba17a1b..0ca9a06 100644
--- a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_fb7e53() {
   bvec2 arg_0 = bvec2(true);
   bvec2 arg_1 = bvec2(true);
   bool arg_2 = true;
   bvec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_fb7e53() {
   bvec2 arg_0 = bvec2(true);
   bvec2 arg_1 = bvec2(true);
   bool arg_2 = true;
   bvec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void select_fb7e53() {
   bvec2 arg_0 = bvec2(true);
   bvec2 arg_1 = bvec2(true);
   bool arg_2 = true;
   bvec2 res = (arg_2 ? arg_1 : arg_0);
+  prevent_dce.inner = (all(equal(res, bvec2(false))) ? 1 : 0);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.msl b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.msl
index 4f7aebf..9ca2a86 100644
--- a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void select_fb7e53() {
+void select_fb7e53(device int* const tint_symbol_1) {
   bool2 arg_0 = bool2(true);
   bool2 arg_1 = bool2(true);
   bool arg_2 = true;
   bool2 res = select(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = select(0, 1, all((res == bool2(false))));
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  select_fb7e53();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  select_fb7e53(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  select_fb7e53();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  select_fb7e53(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  select_fb7e53();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  select_fb7e53(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.spvasm b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.spvasm
index ce869a9..1cf437f 100644
--- a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %select_fb7e53 "select_fb7e53"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,55 +38,70 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+        %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
-         %16 = OpConstantComposite %v2bool %true %true
+         %20 = OpConstantComposite %v2bool %true %true
 %_ptr_Function_v2bool = OpTypePointer Function %v2bool
-         %19 = OpConstantNull %v2bool
+         %23 = OpConstantNull %v2bool
 %_ptr_Function_bool = OpTypePointer Function %bool
-         %23 = OpConstantNull %bool
-         %31 = OpTypeFunction %v4float
+         %27 = OpConstantNull %bool
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_1 = OpConstant %int 1
+         %44 = OpConstantNull %int
+         %45 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%select_fb7e53 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2bool Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2bool Function %19
-      %arg_2 = OpVariable %_ptr_Function_bool Function %23
-         %28 = OpVariable %_ptr_Function_v2bool Function %19
-        %res = OpVariable %_ptr_Function_v2bool Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
+%select_fb7e53 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2bool Function %23
+      %arg_1 = OpVariable %_ptr_Function_v2bool Function %23
+      %arg_2 = OpVariable %_ptr_Function_bool Function %27
+         %32 = OpVariable %_ptr_Function_v2bool Function %23
+        %res = OpVariable %_ptr_Function_v2bool Function %23
+               OpStore %arg_0 %20
+               OpStore %arg_1 %20
                OpStore %arg_2 %true
-         %25 = OpLoad %bool %arg_2
-         %26 = OpLoad %v2bool %arg_1
-         %27 = OpLoad %v2bool %arg_0
-         %29 = OpCompositeConstruct %v2bool %25 %25
-         %24 = OpSelect %v2bool %29 %26 %27
-               OpStore %res %24
+         %29 = OpLoad %bool %arg_2
+         %30 = OpLoad %v2bool %arg_1
+         %31 = OpLoad %v2bool %arg_0
+         %33 = OpCompositeConstruct %v2bool %29 %29
+         %28 = OpSelect %v2bool %33 %30 %31
+               OpStore %res %28
+         %38 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %41 = OpLoad %v2bool %res
+         %42 = OpLogicalEqual %v2bool %41 %23
+         %40 = OpAll %bool %42
+         %39 = OpSelect %int %40 %int_1 %44
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %select_fb7e53
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %select_fb7e53
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %13
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %select_fb7e53
+%fragment_main = OpFunction %void None %13
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %select_fb7e53
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %select_fb7e53
+%compute_main = OpFunction %void None %13
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %select_fb7e53
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.wgsl b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.wgsl
index c2ab9199..8bd6be4 100644
--- a/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/select/fb7e53.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<bool>(true);
   var arg_2 = true;
   var res : vec2<bool> = select(arg_0, arg_1, arg_2);
+  prevent_dce = select(0, 1, all((res == vec2<bool>())));
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   select_fb7e53();
diff --git a/test/tint/builtins/gen/var/sign/0799fd.wgsl b/test/tint/builtins/gen/var/sign/0799fd.wgsl
index 7f7c3fb..d52fbb3 100644
--- a/test/tint/builtins/gen/var/sign/0799fd.wgsl
+++ b/test/tint/builtins/gen/var/sign/0799fd.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = sign(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_0799fd();
diff --git a/test/tint/builtins/gen/var/sign/159665.wgsl b/test/tint/builtins/gen/var/sign/159665.wgsl
index b49e5f1..33a13dc 100644
--- a/test/tint/builtins/gen/var/sign/159665.wgsl
+++ b/test/tint/builtins/gen/var/sign/159665.wgsl
@@ -25,7 +25,9 @@
 fn sign_159665() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.dxc.hlsl
index 66f2d8c..4344f73 100644
--- a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_159665() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = float3(sign(arg_0));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.fxc.hlsl
index 66f2d8c..4344f73 100644
--- a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_159665() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = float3(sign(arg_0));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.glsl
index 1666599..5c323d9 100644
--- a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sign_159665() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sign_159665() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sign_159665() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.msl
index 4d43529..9eeacc0 100644
--- a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_159665() {
+void sign_159665(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = sign(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_159665();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  sign_159665(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_159665();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  sign_159665(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_159665();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  sign_159665(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.spvasm
index 490da92..117b131 100644
--- a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_159665 "sign_159665"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%sign_159665 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 FSign %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%sign_159665 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 FSign %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sign_159665
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sign_159665
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sign_159665
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sign_159665
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sign_159665
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sign_159665
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.wgsl
index b93768d..044379c 100644
--- a/test/tint/builtins/gen/var/sign/159665.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/159665.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sign_159665() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_159665();
diff --git a/test/tint/builtins/gen/var/sign/160933.wgsl b/test/tint/builtins/gen/var/sign/160933.wgsl
index c382af0..6b404c7 100644
--- a/test/tint/builtins/gen/var/sign/160933.wgsl
+++ b/test/tint/builtins/gen/var/sign/160933.wgsl
@@ -27,7 +27,9 @@
 fn sign_160933() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.dxc.hlsl
index 0f56714..758e0ed 100644
--- a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_160933() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = vector<float16_t, 4>(sign(arg_0));
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.fxc.hlsl
index 472eafe..8b6e1aa 100644
--- a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_160933() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = vector<float16_t, 4>(sign(arg_0));
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.glsl
index e31e264..7779a29 100644
--- a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sign_160933() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sign_160933() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sign_160933() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.msl
index a8ae5d2..67b1f52 100644
--- a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_160933() {
+void sign_160933(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_160933();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  sign_160933(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_160933();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  sign_160933(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_160933();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  sign_160933(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.spvasm
index 5700e0d..32d6990 100644
--- a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_160933 "sign_160933"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_160933 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 FSign %22
-               OpStore %res %20
+%sign_160933 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 FSign %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sign_160933
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sign_160933
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sign_160933
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sign_160933
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sign_160933
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sign_160933
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.wgsl
index 625ce07..a4d130c 100644
--- a/test/tint/builtins/gen/var/sign/160933.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/160933.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sign_160933() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_160933();
diff --git a/test/tint/builtins/gen/var/sign/3233fa.wgsl b/test/tint/builtins/gen/var/sign/3233fa.wgsl
index 4d9f7dc..c6c7b67 100644
--- a/test/tint/builtins/gen/var/sign/3233fa.wgsl
+++ b/test/tint/builtins/gen/var/sign/3233fa.wgsl
@@ -25,7 +25,9 @@
 fn sign_3233fa() {
   var arg_0 = 1i;
   var res: i32 = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.dxc.hlsl
index 0cc495e..b7ef0af 100644
--- a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_3233fa() {
   int arg_0 = 1;
   int res = int(sign(arg_0));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.fxc.hlsl
index 0cc495e..b7ef0af 100644
--- a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_3233fa() {
   int arg_0 = 1;
   int res = int(sign(arg_0));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.glsl
index f4f84d2..43fdb49 100644
--- a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void sign_3233fa() {
   int arg_0 = 1;
   int res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void sign_3233fa() {
   int arg_0 = 1;
   int res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void sign_3233fa() {
   int arg_0 = 1;
   int res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.msl
index 751f6d4..7592257 100644
--- a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(select(-1, 1, (v > 0)), 0, (v == 0));
 }
 
-void sign_3233fa() {
+void sign_3233fa(device int* const tint_symbol_1) {
   int arg_0 = 1;
   int res = tint_sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_3233fa();
+float4 vertex_main_inner(device int* const tint_symbol_2) {
+  sign_3233fa(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_3233fa();
+fragment void fragment_main(device int* tint_symbol_4 [[buffer(0)]]) {
+  sign_3233fa(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_3233fa();
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]]) {
+  sign_3233fa(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.spvasm
index ad98d17..32b8d40 100644
--- a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_3233fa "sign_3233fa"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %17 = OpConstantNull %int
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_3233fa = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_int Function %17
-        %res = OpVariable %_ptr_Function_int Function %17
+%sign_3233fa = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_int Function %20
+        %res = OpVariable %_ptr_Function_int Function %20
                OpStore %arg_0 %int_1
-         %20 = OpLoad %int %arg_0
-         %18 = OpExtInst %int %19 SSign %20
-               OpStore %res %18
+         %23 = OpLoad %int %arg_0
+         %21 = OpExtInst %int %22 SSign %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %29 = OpLoad %int %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %sign_3233fa
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %sign_3233fa
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sign_3233fa
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sign_3233fa
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sign_3233fa
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sign_3233fa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.wgsl
index 557a380..0ad6e01 100644
--- a/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/3233fa.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sign_3233fa() {
   var arg_0 = 1i;
   var res : i32 = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_3233fa();
diff --git a/test/tint/builtins/gen/var/sign/3a39ac.wgsl b/test/tint/builtins/gen/var/sign/3a39ac.wgsl
index 271a626..e7bc28b 100644
--- a/test/tint/builtins/gen/var/sign/3a39ac.wgsl
+++ b/test/tint/builtins/gen/var/sign/3a39ac.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1;
   var res = sign(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_3a39ac();
diff --git a/test/tint/builtins/gen/var/sign/3bdab6.wgsl b/test/tint/builtins/gen/var/sign/3bdab6.wgsl
index ae19673..0f974c6 100644
--- a/test/tint/builtins/gen/var/sign/3bdab6.wgsl
+++ b/test/tint/builtins/gen/var/sign/3bdab6.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1);
   var res = sign(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_3bdab6();
diff --git a/test/tint/builtins/gen/var/sign/55339e.wgsl b/test/tint/builtins/gen/var/sign/55339e.wgsl
index b79eabc..e1f5a17 100644
--- a/test/tint/builtins/gen/var/sign/55339e.wgsl
+++ b/test/tint/builtins/gen/var/sign/55339e.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1);
   var res = sign(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_55339e();
diff --git a/test/tint/builtins/gen/var/sign/58d779.wgsl b/test/tint/builtins/gen/var/sign/58d779.wgsl
index 5ea8e6c..a9cf97a 100644
--- a/test/tint/builtins/gen/var/sign/58d779.wgsl
+++ b/test/tint/builtins/gen/var/sign/58d779.wgsl
@@ -25,7 +25,9 @@
 fn sign_58d779() {
   var arg_0 = vec4<i32>(1i);
   var res: vec4<i32> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.dxc.hlsl
index 6e66a1bc..c0280b8 100644
--- a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_58d779() {
   int4 arg_0 = (1).xxxx;
   int4 res = int4(sign(arg_0));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.fxc.hlsl
index 6e66a1bc..c0280b8 100644
--- a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_58d779() {
   int4 arg_0 = (1).xxxx;
   int4 res = int4(sign(arg_0));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.glsl
index 3aec644f..a79f7d0 100644
--- a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void sign_58d779() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void sign_58d779() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void sign_58d779() {
   ivec4 arg_0 = ivec4(1);
   ivec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.msl
index 3c295c7..70e28d3 100644
--- a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(select(int4(-1), int4(1), (v > int4(0))), int4(0), (v == int4(0)));
 }
 
-void sign_58d779() {
+void sign_58d779(device int4* const tint_symbol_1) {
   int4 arg_0 = int4(1);
   int4 res = tint_sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_58d779();
+float4 vertex_main_inner(device int4* const tint_symbol_2) {
+  sign_58d779(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_58d779();
+fragment void fragment_main(device int4* tint_symbol_4 [[buffer(0)]]) {
+  sign_58d779(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_58d779();
+kernel void compute_main(device int4* tint_symbol_5 [[buffer(0)]]) {
+  sign_58d779(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.spvasm
index 17d6278..dd7b0f2 100644
--- a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_58d779 "sign_58d779"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %19 = OpConstantNull %v4int
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_58d779 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4int Function %19
-        %res = OpVariable %_ptr_Function_v4int Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4int %arg_0
-         %20 = OpExtInst %v4int %21 SSign %22
-               OpStore %res %20
+%sign_58d779 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4int Function %22
+        %res = OpVariable %_ptr_Function_v4int Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4int %arg_0
+         %23 = OpExtInst %v4int %24 SSign %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %31 = OpLoad %v4int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sign_58d779
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sign_58d779
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sign_58d779
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sign_58d779
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sign_58d779
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sign_58d779
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.wgsl
index 2e22a76..99cd4eb 100644
--- a/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/58d779.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sign_58d779() {
   var arg_0 = vec4<i32>(1i);
   var res : vec4<i32> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_58d779();
diff --git a/test/tint/builtins/gen/var/sign/5d283a.wgsl b/test/tint/builtins/gen/var/sign/5d283a.wgsl
index b8b7487..4f02281 100644
--- a/test/tint/builtins/gen/var/sign/5d283a.wgsl
+++ b/test/tint/builtins/gen/var/sign/5d283a.wgsl
@@ -27,7 +27,9 @@
 fn sign_5d283a() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.dxc.hlsl
index 1b7200d..2307256 100644
--- a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_5d283a() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = vector<float16_t, 3>(sign(arg_0));
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.fxc.hlsl
index 783023d..541058c 100644
--- a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_5d283a() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = vector<float16_t, 3>(sign(arg_0));
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.glsl
index 6f2f92b..6c2b97f 100644
--- a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sign_5d283a() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sign_5d283a() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sign_5d283a() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.msl
index 70bde15..0afee14 100644
--- a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_5d283a() {
+void sign_5d283a(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = sign(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_5d283a();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  sign_5d283a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_5d283a();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  sign_5d283a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_5d283a();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  sign_5d283a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.spvasm
index 76df641..c854480 100644
--- a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_5d283a "sign_5d283a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_5d283a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 FSign %22
-               OpStore %res %20
+%sign_5d283a = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 FSign %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sign_5d283a
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sign_5d283a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sign_5d283a
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sign_5d283a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sign_5d283a
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sign_5d283a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.wgsl
index c4f3b37..299ae34 100644
--- a/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/5d283a.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sign_5d283a() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_5d283a();
diff --git a/test/tint/builtins/gen/var/sign/7c85ea.wgsl b/test/tint/builtins/gen/var/sign/7c85ea.wgsl
index 08bd054..be96c28 100644
--- a/test/tint/builtins/gen/var/sign/7c85ea.wgsl
+++ b/test/tint/builtins/gen/var/sign/7c85ea.wgsl
@@ -27,7 +27,9 @@
 fn sign_7c85ea() {
   var arg_0 = 1.h;
   var res: f16 = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.dxc.hlsl
index 17807f9..365fc6a 100644
--- a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_7c85ea() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = float16_t(sign(arg_0));
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.fxc.hlsl
index f0ff48b..8dbf1d5 100644
--- a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_7c85ea() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = float16_t(sign(arg_0));
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.glsl
index 91cd452..16a3031 100644
--- a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sign_7c85ea() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sign_7c85ea() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sign_7c85ea() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.msl
index 4915d78..3b40bcd 100644
--- a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_7c85ea() {
+void sign_7c85ea(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_7c85ea();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  sign_7c85ea(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_7c85ea();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  sign_7c85ea(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_7c85ea();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  sign_7c85ea(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.spvasm
index 34b6478..b38da90 100644
--- a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_7c85ea "sign_7c85ea"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_7c85ea = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%sign_7c85ea = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 FSign %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 FSign %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %sign_7c85ea
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %sign_7c85ea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sign_7c85ea
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sign_7c85ea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sign_7c85ea
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sign_7c85ea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.wgsl
index 76a4a97..eb2b9ae 100644
--- a/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/7c85ea.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sign_7c85ea() {
   var arg_0 = 1.0h;
   var res : f16 = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_7c85ea();
diff --git a/test/tint/builtins/gen/var/sign/926015.wgsl b/test/tint/builtins/gen/var/sign/926015.wgsl
index 4176661..dad08f6 100644
--- a/test/tint/builtins/gen/var/sign/926015.wgsl
+++ b/test/tint/builtins/gen/var/sign/926015.wgsl
@@ -25,7 +25,9 @@
 fn sign_926015() {
   var arg_0 = vec2<i32>(1i);
   var res: vec2<i32> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.dxc.hlsl
index 5421ab2..4dad9bc 100644
--- a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_926015() {
   int2 arg_0 = (1).xx;
   int2 res = int2(sign(arg_0));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.fxc.hlsl
index 5421ab2..4dad9bc 100644
--- a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_926015() {
   int2 arg_0 = (1).xx;
   int2 res = int2(sign(arg_0));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.glsl
index fbae07f..ed3785e 100644
--- a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void sign_926015() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void sign_926015() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec2 inner;
+} prevent_dce;
+
 void sign_926015() {
   ivec2 arg_0 = ivec2(1);
   ivec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.msl
index ade181b..bf8d115 100644
--- a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(select(int2(-1), int2(1), (v > int2(0))), int2(0), (v == int2(0)));
 }
 
-void sign_926015() {
+void sign_926015(device int2* const tint_symbol_1) {
   int2 arg_0 = int2(1);
   int2 res = tint_sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_926015();
+float4 vertex_main_inner(device int2* const tint_symbol_2) {
+  sign_926015(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device int2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_926015();
+fragment void fragment_main(device int2* tint_symbol_4 [[buffer(0)]]) {
+  sign_926015(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_926015();
+kernel void compute_main(device int2* tint_symbol_5 [[buffer(0)]]) {
+  sign_926015(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.spvasm
index 4843bb9..c90fabf 100644
--- a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_926015 "sign_926015"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
+%prevent_dce_block = OpTypeStruct %v2int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v2int %int_1 %int_1
+         %19 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %19 = OpConstantNull %v2int
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2int = OpTypePointer StorageBuffer %v2int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_926015 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2int Function %19
-        %res = OpVariable %_ptr_Function_v2int Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2int %arg_0
-         %20 = OpExtInst %v2int %21 SSign %22
-               OpStore %res %20
+%sign_926015 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2int Function %22
+        %res = OpVariable %_ptr_Function_v2int Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2int %arg_0
+         %23 = OpExtInst %v2int %24 SSign %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2int %prevent_dce %uint_0
+         %31 = OpLoad %v2int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sign_926015
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sign_926015
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sign_926015
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sign_926015
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sign_926015
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sign_926015
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.wgsl
index aa9ff99..cba2158 100644
--- a/test/tint/builtins/gen/var/sign/926015.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/926015.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sign_926015() {
   var arg_0 = vec2<i32>(1i);
   var res : vec2<i32> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_926015();
diff --git a/test/tint/builtins/gen/var/sign/943b2e.wgsl b/test/tint/builtins/gen/var/sign/943b2e.wgsl
index 1d91d05..faf5bc6 100644
--- a/test/tint/builtins/gen/var/sign/943b2e.wgsl
+++ b/test/tint/builtins/gen/var/sign/943b2e.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1);
   var res = sign(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_943b2e();
diff --git a/test/tint/builtins/gen/var/sign/9603b1.wgsl b/test/tint/builtins/gen/var/sign/9603b1.wgsl
index 83b9821..133d0cd 100644
--- a/test/tint/builtins/gen/var/sign/9603b1.wgsl
+++ b/test/tint/builtins/gen/var/sign/9603b1.wgsl
@@ -25,7 +25,9 @@
 fn sign_9603b1() {
   var arg_0 = vec3<i32>(1i);
   var res: vec3<i32> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.dxc.hlsl
index 1a54c84..6bc61ae 100644
--- a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_9603b1() {
   int3 arg_0 = (1).xxx;
   int3 res = int3(sign(arg_0));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.fxc.hlsl
index 1a54c84..6bc61ae 100644
--- a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_9603b1() {
   int3 arg_0 = (1).xxx;
   int3 res = int3(sign(arg_0));
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.glsl
index 135c629..4b176c6 100644
--- a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void sign_9603b1() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void sign_9603b1() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec3 inner;
+} prevent_dce;
+
 void sign_9603b1() {
   ivec3 arg_0 = ivec3(1);
   ivec3 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.msl
index a98e688..43f43c8 100644
--- a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.msl
@@ -5,34 +5,35 @@
   return select(select(int3(-1), int3(1), (v > int3(0))), int3(0), (v == int3(0)));
 }
 
-void sign_9603b1() {
+void sign_9603b1(device packed_int3* const tint_symbol_1) {
   int3 arg_0 = int3(1);
   int3 res = tint_sign(arg_0);
+  *(tint_symbol_1) = packed_int3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_9603b1();
+float4 vertex_main_inner(device packed_int3* const tint_symbol_2) {
+  sign_9603b1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_int3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_9603b1();
+fragment void fragment_main(device packed_int3* tint_symbol_4 [[buffer(0)]]) {
+  sign_9603b1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_9603b1();
+kernel void compute_main(device packed_int3* tint_symbol_5 [[buffer(0)]]) {
+  sign_9603b1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.spvasm
index 7054e3c..bbf0794 100644
--- a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_9603b1 "sign_9603b1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,45 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
+%prevent_dce_block = OpTypeStruct %v3int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-         %16 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %19 = OpConstantNull %v3int
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_9603b1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3int Function %19
-        %res = OpVariable %_ptr_Function_v3int Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3int %arg_0
-         %20 = OpExtInst %v3int %21 SSign %22
-               OpStore %res %20
+%sign_9603b1 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3int Function %22
+        %res = OpVariable %_ptr_Function_v3int Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3int %arg_0
+         %23 = OpExtInst %v3int %24 SSign %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0
+         %31 = OpLoad %v3int %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sign_9603b1
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sign_9603b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sign_9603b1
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sign_9603b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sign_9603b1
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sign_9603b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.wgsl
index 61d1f04..39f2f14 100644
--- a/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/9603b1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sign_9603b1() {
   var arg_0 = vec3<i32>(1i);
   var res : vec3<i32> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_9603b1();
diff --git a/test/tint/builtins/gen/var/sign/ab6301.wgsl b/test/tint/builtins/gen/var/sign/ab6301.wgsl
index 89a1334..91c95c4 100644
--- a/test/tint/builtins/gen/var/sign/ab6301.wgsl
+++ b/test/tint/builtins/gen/var/sign/ab6301.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = sign(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_ab6301();
diff --git a/test/tint/builtins/gen/var/sign/b8f634.wgsl b/test/tint/builtins/gen/var/sign/b8f634.wgsl
index 531fe0a..cc300a4 100644
--- a/test/tint/builtins/gen/var/sign/b8f634.wgsl
+++ b/test/tint/builtins/gen/var/sign/b8f634.wgsl
@@ -25,7 +25,9 @@
 fn sign_b8f634() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.dxc.hlsl
index 61cd17f..fed8449 100644
--- a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_b8f634() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = float4(sign(arg_0));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.fxc.hlsl
index 61cd17f..fed8449 100644
--- a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_b8f634() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = float4(sign(arg_0));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.glsl
index 8ef9f02..758d77b 100644
--- a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sign_b8f634() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sign_b8f634() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sign_b8f634() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.msl
index 78e7a17..66ae6a7 100644
--- a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_b8f634() {
+void sign_b8f634(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_b8f634();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  sign_b8f634(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_b8f634();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  sign_b8f634(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_b8f634();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  sign_b8f634(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.spvasm
index 39b2cc4..37d528a 100644
--- a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_b8f634 "sign_b8f634"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%sign_b8f634 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%sign_b8f634 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 FSign %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 FSign %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %sign_b8f634
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %sign_b8f634
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sign_b8f634
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sign_b8f634
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sign_b8f634
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sign_b8f634
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.wgsl
index efd95ce..3b6af40 100644
--- a/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/b8f634.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sign_b8f634() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_b8f634();
diff --git a/test/tint/builtins/gen/var/sign/c8289c.wgsl b/test/tint/builtins/gen/var/sign/c8289c.wgsl
index 72e234e..8a8709d 100644
--- a/test/tint/builtins/gen/var/sign/c8289c.wgsl
+++ b/test/tint/builtins/gen/var/sign/c8289c.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = sign(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_c8289c();
diff --git a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl
index 8849d7c..72ed627 100644
--- a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl
+++ b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl
@@ -27,7 +27,9 @@
 fn sign_ccdb3c() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.dxc.hlsl
index cf827fd..383159e 100644
--- a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_ccdb3c() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = vector<float16_t, 2>(sign(arg_0));
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.fxc.hlsl
index da1980d..33d9cbf 100644
--- a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_ccdb3c() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = vector<float16_t, 2>(sign(arg_0));
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.glsl
index 380c133..ed6c856 100644
--- a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sign_ccdb3c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sign_ccdb3c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sign_ccdb3c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.msl
index 4245527..8669cef 100644
--- a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_ccdb3c() {
+void sign_ccdb3c(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_ccdb3c();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  sign_ccdb3c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_ccdb3c();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  sign_ccdb3c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_ccdb3c();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  sign_ccdb3c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.spvasm
index 5bc4abb..fc2225f 100644
--- a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_ccdb3c "sign_ccdb3c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sign_ccdb3c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 FSign %22
-               OpStore %res %20
+%sign_ccdb3c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 FSign %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sign_ccdb3c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sign_ccdb3c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sign_ccdb3c
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sign_ccdb3c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sign_ccdb3c
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sign_ccdb3c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.wgsl
index 38d2f95..08820f1 100644
--- a/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/ccdb3c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sign_ccdb3c() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_ccdb3c();
diff --git a/test/tint/builtins/gen/var/sign/d065d8.wgsl b/test/tint/builtins/gen/var/sign/d065d8.wgsl
index ee8a07b..73a48f7 100644
--- a/test/tint/builtins/gen/var/sign/d065d8.wgsl
+++ b/test/tint/builtins/gen/var/sign/d065d8.wgsl
@@ -25,7 +25,9 @@
 fn sign_d065d8() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.dxc.hlsl
index 514562e..7426df9 100644
--- a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_d065d8() {
   float2 arg_0 = (1.0f).xx;
   float2 res = float2(sign(arg_0));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.fxc.hlsl
index 514562e..7426df9 100644
--- a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_d065d8() {
   float2 arg_0 = (1.0f).xx;
   float2 res = float2(sign(arg_0));
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.glsl
index e70621c..5bc7699 100644
--- a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sign_d065d8() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sign_d065d8() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sign_d065d8() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.msl
index cc59629..681886b 100644
--- a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_d065d8() {
+void sign_d065d8(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_d065d8();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  sign_d065d8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_d065d8();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  sign_d065d8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_d065d8();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  sign_d065d8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.spvasm
index b751984..1d3cb10 100644
--- a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_d065d8 "sign_d065d8"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%sign_d065d8 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 FSign %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%sign_d065d8 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 FSign %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sign_d065d8
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sign_d065d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sign_d065d8
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sign_d065d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sign_d065d8
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sign_d065d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.wgsl
index f92d409..fc3678c 100644
--- a/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/d065d8.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sign_d065d8() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_d065d8();
diff --git a/test/tint/builtins/gen/var/sign/dd790e.wgsl b/test/tint/builtins/gen/var/sign/dd790e.wgsl
index c5154ac..351a531 100644
--- a/test/tint/builtins/gen/var/sign/dd790e.wgsl
+++ b/test/tint/builtins/gen/var/sign/dd790e.wgsl
@@ -25,7 +25,9 @@
 fn sign_dd790e() {
   var arg_0 = 1.f;
   var res: f32 = sign(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.dxc.hlsl
index 7a84431..33f0a88 100644
--- a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_dd790e() {
   float arg_0 = 1.0f;
   float res = float(sign(arg_0));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.fxc.hlsl
index 7a84431..33f0a88 100644
--- a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sign_dd790e() {
   float arg_0 = 1.0f;
   float res = float(sign(arg_0));
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.glsl b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.glsl
index a347670..0adc572 100644
--- a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sign_dd790e() {
   float arg_0 = 1.0f;
   float res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sign_dd790e() {
   float arg_0 = 1.0f;
   float res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sign_dd790e() {
   float arg_0 = 1.0f;
   float res = sign(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.msl b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.msl
index 8f79ad2..4a5c7e0 100644
--- a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sign_dd790e() {
+void sign_dd790e(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = sign(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sign_dd790e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  sign_dd790e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sign_dd790e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  sign_dd790e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sign_dd790e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  sign_dd790e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.spvasm
index 8ef69f0..915d8b2 100644
--- a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sign_dd790e "sign_dd790e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%sign_dd790e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%sign_dd790e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 FSign %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 FSign %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sign_dd790e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sign_dd790e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sign_dd790e
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sign_dd790e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sign_dd790e
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sign_dd790e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.wgsl
index 0fa70cc..e9576f8 100644
--- a/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sign/dd790e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sign_dd790e() {
   var arg_0 = 1.0f;
   var res : f32 = sign(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_dd790e();
diff --git a/test/tint/builtins/gen/var/sign/f5da6a.wgsl b/test/tint/builtins/gen/var/sign/f5da6a.wgsl
index c11264a..a8985fc 100644
--- a/test/tint/builtins/gen/var/sign/f5da6a.wgsl
+++ b/test/tint/builtins/gen/var/sign/f5da6a.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = sign(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sign_f5da6a();
diff --git a/test/tint/builtins/gen/var/sin/01f241.wgsl b/test/tint/builtins/gen/var/sin/01f241.wgsl
index b20e8a6..2e864d1 100644
--- a/test/tint/builtins/gen/var/sin/01f241.wgsl
+++ b/test/tint/builtins/gen/var/sin/01f241.wgsl
@@ -25,7 +25,9 @@
 fn sin_01f241() {
   var arg_0 = vec3<f32>(1.57079632679f);
   var res: vec3<f32> = sin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.dxc.hlsl
index 4051809..59e2427 100644
--- a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_01f241() {
   float3 arg_0 = (1.57079637050628662109f).xxx;
   float3 res = sin(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.fxc.hlsl
index 4051809..59e2427 100644
--- a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_01f241() {
   float3 arg_0 = (1.57079637050628662109f).xxx;
   float3 res = sin(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.glsl
index 29acf4c..3d8ea4b 100644
--- a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sin_01f241() {
   vec3 arg_0 = vec3(1.57079637050628662109f);
   vec3 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sin_01f241() {
   vec3 arg_0 = vec3(1.57079637050628662109f);
   vec3 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sin_01f241() {
   vec3 arg_0 = vec3(1.57079637050628662109f);
   vec3 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.msl
index da49e30..73fa587 100644
--- a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_01f241() {
+void sin_01f241(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.57079637050628662109f);
   float3 res = sin(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_01f241();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  sin_01f241(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_01f241();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  sin_01f241(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_01f241();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  sin_01f241(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.spvasm
index 851e12c..b19e051 100644
--- a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_01f241 "sin_01f241"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_1_57079637 = OpConstant %float 1.57079637
-         %15 = OpConstantComposite %v3float %float_1_57079637 %float_1_57079637 %float_1_57079637
+         %18 = OpConstantComposite %v3float %float_1_57079637 %float_1_57079637 %float_1_57079637
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_01f241 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Sin %21
-               OpStore %res %19
+ %sin_01f241 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Sin %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sin_01f241
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sin_01f241
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sin_01f241
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sin_01f241
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %sin_01f241
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %sin_01f241
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.wgsl
index b51abc7..8875ff9 100644
--- a/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sin/01f241.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sin_01f241() {
   var arg_0 = vec3<f32>(1.57079637050628662109f);
   var res : vec3<f32> = sin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_01f241();
diff --git a/test/tint/builtins/gen/var/sin/15b2c6.wgsl b/test/tint/builtins/gen/var/sin/15b2c6.wgsl
index dffbdc1..71b970b 100644
--- a/test/tint/builtins/gen/var/sin/15b2c6.wgsl
+++ b/test/tint/builtins/gen/var/sin/15b2c6.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.57079632679);
   var res = sin(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_15b2c6();
diff --git a/test/tint/builtins/gen/var/sin/2c903b.wgsl b/test/tint/builtins/gen/var/sin/2c903b.wgsl
index 29c7c1b..b6a9df6 100644
--- a/test/tint/builtins/gen/var/sin/2c903b.wgsl
+++ b/test/tint/builtins/gen/var/sin/2c903b.wgsl
@@ -27,7 +27,9 @@
 fn sin_2c903b() {
   var arg_0 = vec3<f16>(1.57079632679h);
   var res: vec3<f16> = sin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.dxc.hlsl
index 685aeb2..72a0ef4 100644
--- a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_2c903b() {
   vector<float16_t, 3> arg_0 = (float16_t(1.5703125h)).xxx;
   vector<float16_t, 3> res = sin(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.fxc.hlsl
index 8a7b8bf..43c6cd3 100644
--- a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_2c903b() {
   vector<float16_t, 3> arg_0 = (float16_t(1.5703125h)).xxx;
   vector<float16_t, 3> res = sin(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.glsl
index 243c457..b9e2a6f 100644
--- a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sin_2c903b() {
   f16vec3 arg_0 = f16vec3(1.5703125hf);
   f16vec3 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sin_2c903b() {
   f16vec3 arg_0 = f16vec3(1.5703125hf);
   f16vec3 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sin_2c903b() {
   f16vec3 arg_0 = f16vec3(1.5703125hf);
   f16vec3 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.msl
index 22dc935..7244d0a 100644
--- a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_2c903b() {
+void sin_2c903b(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.5703125h);
   half3 res = sin(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_2c903b();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  sin_2c903b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_2c903b();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  sin_2c903b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_2c903b();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  sin_2c903b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.spvasm
index 4623cee..14e09f7 100644
--- a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_2c903b "sin_2c903b"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92p_0 = OpConstant %half 0x1.92p+0
-         %16 = OpConstantComposite %v3half %half_0x1_92p_0 %half_0x1_92p_0 %half_0x1_92p_0
+         %19 = OpConstantComposite %v3half %half_0x1_92p_0 %half_0x1_92p_0 %half_0x1_92p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_2c903b = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Sin %22
-               OpStore %res %20
+ %sin_2c903b = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Sin %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sin_2c903b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sin_2c903b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sin_2c903b
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sin_2c903b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sin_2c903b
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sin_2c903b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.wgsl
index 3481568..2722dba 100644
--- a/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sin/2c903b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sin_2c903b() {
   var arg_0 = vec3<f16>(1.5703125h);
   var res : vec3<f16> = sin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_2c903b();
diff --git a/test/tint/builtins/gen/var/sin/3cca11.wgsl b/test/tint/builtins/gen/var/sin/3cca11.wgsl
index c84fa1e..8f4d72e3 100644
--- a/test/tint/builtins/gen/var/sin/3cca11.wgsl
+++ b/test/tint/builtins/gen/var/sin/3cca11.wgsl
@@ -27,7 +27,9 @@
 fn sin_3cca11() {
   var arg_0 = vec2<f16>(1.57079632679h);
   var res: vec2<f16> = sin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.dxc.hlsl
index 747798b..26e13da 100644
--- a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_3cca11() {
   vector<float16_t, 2> arg_0 = (float16_t(1.5703125h)).xx;
   vector<float16_t, 2> res = sin(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.fxc.hlsl
index 4925733..9d7b049 100644
--- a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_3cca11() {
   vector<float16_t, 2> arg_0 = (float16_t(1.5703125h)).xx;
   vector<float16_t, 2> res = sin(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.glsl
index 9b71f4f..9eb39e5 100644
--- a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sin_3cca11() {
   f16vec2 arg_0 = f16vec2(1.5703125hf);
   f16vec2 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sin_3cca11() {
   f16vec2 arg_0 = f16vec2(1.5703125hf);
   f16vec2 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sin_3cca11() {
   f16vec2 arg_0 = f16vec2(1.5703125hf);
   f16vec2 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.msl
index 9f37112..284ebad 100644
--- a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_3cca11() {
+void sin_3cca11(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.5703125h);
   half2 res = sin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_3cca11();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  sin_3cca11(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_3cca11();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  sin_3cca11(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_3cca11();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  sin_3cca11(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.spvasm
index db3abd2..7205ed5 100644
--- a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_3cca11 "sin_3cca11"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92p_0 = OpConstant %half 0x1.92p+0
-         %16 = OpConstantComposite %v2half %half_0x1_92p_0 %half_0x1_92p_0
+         %19 = OpConstantComposite %v2half %half_0x1_92p_0 %half_0x1_92p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_3cca11 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Sin %22
-               OpStore %res %20
+ %sin_3cca11 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Sin %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sin_3cca11
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sin_3cca11
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sin_3cca11
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sin_3cca11
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sin_3cca11
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sin_3cca11
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.wgsl
index 29c6f7d..28c43c4 100644
--- a/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sin/3cca11.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sin_3cca11() {
   var arg_0 = vec2<f16>(1.5703125h);
   var res : vec2<f16> = sin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_3cca11();
diff --git a/test/tint/builtins/gen/var/sin/4e3979.wgsl b/test/tint/builtins/gen/var/sin/4e3979.wgsl
index 74f0723..b51376d 100644
--- a/test/tint/builtins/gen/var/sin/4e3979.wgsl
+++ b/test/tint/builtins/gen/var/sin/4e3979.wgsl
@@ -25,7 +25,9 @@
 fn sin_4e3979() {
   var arg_0 = vec4<f32>(1.57079632679f);
   var res: vec4<f32> = sin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.dxc.hlsl
index 1f709f1..617f48e 100644
--- a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_4e3979() {
   float4 arg_0 = (1.57079637050628662109f).xxxx;
   float4 res = sin(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.fxc.hlsl
index 1f709f1..617f48e 100644
--- a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_4e3979() {
   float4 arg_0 = (1.57079637050628662109f).xxxx;
   float4 res = sin(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.glsl
index ea55bca..7706214 100644
--- a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sin_4e3979() {
   vec4 arg_0 = vec4(1.57079637050628662109f);
   vec4 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sin_4e3979() {
   vec4 arg_0 = vec4(1.57079637050628662109f);
   vec4 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sin_4e3979() {
   vec4 arg_0 = vec4(1.57079637050628662109f);
   vec4 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.msl
index aa887b4..866b5d6 100644
--- a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_4e3979() {
+void sin_4e3979(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.57079637050628662109f);
   float4 res = sin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_4e3979();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  sin_4e3979(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_4e3979();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  sin_4e3979(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_4e3979();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  sin_4e3979(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.spvasm
index 13aab5b..bb95897 100644
--- a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_4e3979 "sin_4e3979"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_1_57079637 = OpConstant %float 1.57079637
-         %14 = OpConstantComposite %v4float %float_1_57079637 %float_1_57079637 %float_1_57079637 %float_1_57079637
+         %17 = OpConstantComposite %v4float %float_1_57079637 %float_1_57079637 %float_1_57079637 %float_1_57079637
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_4e3979 = OpFunction %void None %9
-         %12 = OpLabel
+ %sin_4e3979 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Sin %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Sin %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %sin_4e3979
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %sin_4e3979
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %sin_4e3979
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %sin_4e3979
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sin_4e3979
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sin_4e3979
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.wgsl
index f8b7622..a62729b 100644
--- a/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sin/4e3979.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sin_4e3979() {
   var arg_0 = vec4<f32>(1.57079637050628662109f);
   var res : vec4<f32> = sin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_4e3979();
diff --git a/test/tint/builtins/gen/var/sin/5c0712.wgsl b/test/tint/builtins/gen/var/sin/5c0712.wgsl
index 8d1fa31..d21db1f 100644
--- a/test/tint/builtins/gen/var/sin/5c0712.wgsl
+++ b/test/tint/builtins/gen/var/sin/5c0712.wgsl
@@ -27,7 +27,9 @@
 fn sin_5c0712() {
   var arg_0 = vec4<f16>(1.57079632679h);
   var res: vec4<f16> = sin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.dxc.hlsl
index 3d2eb53..8333232 100644
--- a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_5c0712() {
   vector<float16_t, 4> arg_0 = (float16_t(1.5703125h)).xxxx;
   vector<float16_t, 4> res = sin(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.fxc.hlsl
index 419dd04..0ff6cb6 100644
--- a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_5c0712() {
   vector<float16_t, 4> arg_0 = (float16_t(1.5703125h)).xxxx;
   vector<float16_t, 4> res = sin(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.glsl
index d959716..6781911 100644
--- a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sin_5c0712() {
   f16vec4 arg_0 = f16vec4(1.5703125hf);
   f16vec4 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sin_5c0712() {
   f16vec4 arg_0 = f16vec4(1.5703125hf);
   f16vec4 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sin_5c0712() {
   f16vec4 arg_0 = f16vec4(1.5703125hf);
   f16vec4 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.msl
index 46e55c2..2097b3e 100644
--- a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_5c0712() {
+void sin_5c0712(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.5703125h);
   half4 res = sin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_5c0712();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  sin_5c0712(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_5c0712();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  sin_5c0712(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_5c0712();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  sin_5c0712(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.spvasm
index 239747a..a41a54d 100644
--- a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_5c0712 "sin_5c0712"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_92p_0 = OpConstant %half 0x1.92p+0
-         %16 = OpConstantComposite %v4half %half_0x1_92p_0 %half_0x1_92p_0 %half_0x1_92p_0 %half_0x1_92p_0
+         %19 = OpConstantComposite %v4half %half_0x1_92p_0 %half_0x1_92p_0 %half_0x1_92p_0 %half_0x1_92p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_5c0712 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Sin %22
-               OpStore %res %20
+ %sin_5c0712 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Sin %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sin_5c0712
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sin_5c0712
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sin_5c0712
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sin_5c0712
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sin_5c0712
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sin_5c0712
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.wgsl
index a4cc20f..bdc8ba6 100644
--- a/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sin/5c0712.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sin_5c0712() {
   var arg_0 = vec4<f16>(1.5703125h);
   var res : vec4<f16> = sin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_5c0712();
diff --git a/test/tint/builtins/gen/var/sin/66a59f.wgsl b/test/tint/builtins/gen/var/sin/66a59f.wgsl
index fb9be73b..74137f6 100644
--- a/test/tint/builtins/gen/var/sin/66a59f.wgsl
+++ b/test/tint/builtins/gen/var/sin/66a59f.wgsl
@@ -27,7 +27,9 @@
 fn sin_66a59f() {
   var arg_0 = 1.57079632679h;
   var res: f16 = sin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.dxc.hlsl
index b91b449..4d9386b 100644
--- a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_66a59f() {
   float16_t arg_0 = float16_t(1.5703125h);
   float16_t res = sin(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.fxc.hlsl
index 0870013..08dd07b 100644
--- a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_66a59f() {
   float16_t arg_0 = float16_t(1.5703125h);
   float16_t res = sin(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.glsl
index 8d25998..1c9e08d 100644
--- a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sin_66a59f() {
   float16_t arg_0 = 1.5703125hf;
   float16_t res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sin_66a59f() {
   float16_t arg_0 = 1.5703125hf;
   float16_t res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sin_66a59f() {
   float16_t arg_0 = 1.5703125hf;
   float16_t res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.msl
index e3c6ff4..a0db518 100644
--- a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_66a59f() {
+void sin_66a59f(device half* const tint_symbol_1) {
   half arg_0 = 1.5703125h;
   half res = sin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_66a59f();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  sin_66a59f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_66a59f();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  sin_66a59f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_66a59f();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  sin_66a59f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.spvasm
index 89dc7a4..e05ad10 100644
--- a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_66a59f "sin_66a59f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_92p_0 = OpConstant %half 0x1.92p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_66a59f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %sin_66a59f = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1_92p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Sin %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Sin %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %sin_66a59f
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %sin_66a59f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sin_66a59f
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sin_66a59f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sin_66a59f
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sin_66a59f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.wgsl
index 41a2b0c..f5061bc 100644
--- a/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sin/66a59f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sin_66a59f() {
   var arg_0 = 1.5703125h;
   var res : f16 = sin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_66a59f();
diff --git a/test/tint/builtins/gen/var/sin/67b03c.wgsl b/test/tint/builtins/gen/var/sin/67b03c.wgsl
index f1699d3..8698dae 100644
--- a/test/tint/builtins/gen/var/sin/67b03c.wgsl
+++ b/test/tint/builtins/gen/var/sin/67b03c.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.57079632679);
   var res = sin(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_67b03c();
diff --git a/test/tint/builtins/gen/var/sin/68d3ab.wgsl b/test/tint/builtins/gen/var/sin/68d3ab.wgsl
index c7dfb7e..a394584 100644
--- a/test/tint/builtins/gen/var/sin/68d3ab.wgsl
+++ b/test/tint/builtins/gen/var/sin/68d3ab.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.57079632679);
   var res = sin(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_68d3ab();
diff --git a/test/tint/builtins/gen/var/sin/a9ab19.wgsl b/test/tint/builtins/gen/var/sin/a9ab19.wgsl
index ce2e908..39d3b57 100644
--- a/test/tint/builtins/gen/var/sin/a9ab19.wgsl
+++ b/test/tint/builtins/gen/var/sin/a9ab19.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.57079632679;
   var res = sin(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_a9ab19();
diff --git a/test/tint/builtins/gen/var/sin/b78c91.wgsl b/test/tint/builtins/gen/var/sin/b78c91.wgsl
index 1818cb0..cfc1b2b 100644
--- a/test/tint/builtins/gen/var/sin/b78c91.wgsl
+++ b/test/tint/builtins/gen/var/sin/b78c91.wgsl
@@ -25,7 +25,9 @@
 fn sin_b78c91() {
   var arg_0 = 1.57079632679f;
   var res: f32 = sin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.dxc.hlsl
index 7071862..61caa57 100644
--- a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_b78c91() {
   float arg_0 = 1.57079637050628662109f;
   float res = sin(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.fxc.hlsl
index 7071862..61caa57 100644
--- a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_b78c91() {
   float arg_0 = 1.57079637050628662109f;
   float res = sin(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.glsl
index 5f36b7a..703e8bd 100644
--- a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sin_b78c91() {
   float arg_0 = 1.57079637050628662109f;
   float res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sin_b78c91() {
   float arg_0 = 1.57079637050628662109f;
   float res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sin_b78c91() {
   float arg_0 = 1.57079637050628662109f;
   float res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.msl
index 7480724..ee1e0e4 100644
--- a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_b78c91() {
+void sin_b78c91(device float* const tint_symbol_1) {
   float arg_0 = 1.57079637050628662109f;
   float res = sin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_b78c91();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  sin_b78c91(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_b78c91();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  sin_b78c91(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_b78c91();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  sin_b78c91(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.spvasm
index 2dfccb7..35515f7 100644
--- a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_b78c91 "sin_b78c91"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
 %float_1_57079637 = OpConstant %float 1.57079637
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_b78c91 = OpFunction %void None %9
-         %12 = OpLabel
+ %sin_b78c91 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1_57079637
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Sin %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Sin %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sin_b78c91
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sin_b78c91
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sin_b78c91
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sin_b78c91
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sin_b78c91
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sin_b78c91
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.wgsl
index adea4dd..65569d7 100644
--- a/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sin/b78c91.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sin_b78c91() {
   var arg_0 = 1.57079637050628662109f;
   var res : f32 = sin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_b78c91();
diff --git a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl
index b04e5d7..c85c9fa 100644
--- a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl
+++ b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl
@@ -25,7 +25,9 @@
 fn sin_fc8bc4() {
   var arg_0 = vec2<f32>(1.57079632679f);
   var res: vec2<f32> = sin(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.dxc.hlsl
index 1bc8dd5..60277f2 100644
--- a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_fc8bc4() {
   float2 arg_0 = (1.57079637050628662109f).xx;
   float2 res = sin(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.fxc.hlsl
index 1bc8dd5..60277f2 100644
--- a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sin_fc8bc4() {
   float2 arg_0 = (1.57079637050628662109f).xx;
   float2 res = sin(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.glsl
index 042f423..093a9a5 100644
--- a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sin_fc8bc4() {
   vec2 arg_0 = vec2(1.57079637050628662109f);
   vec2 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sin_fc8bc4() {
   vec2 arg_0 = vec2(1.57079637050628662109f);
   vec2 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sin_fc8bc4() {
   vec2 arg_0 = vec2(1.57079637050628662109f);
   vec2 res = sin(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.msl
index 588e37c..ff3cfd9 100644
--- a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sin_fc8bc4() {
+void sin_fc8bc4(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.57079637050628662109f);
   float2 res = sin(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sin_fc8bc4();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  sin_fc8bc4(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sin_fc8bc4();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  sin_fc8bc4(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sin_fc8bc4();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  sin_fc8bc4(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.spvasm
index 68801e7..6405588 100644
--- a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sin_fc8bc4 "sin_fc8bc4"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %float_1_57079637 = OpConstant %float 1.57079637
-         %15 = OpConstantComposite %v2float %float_1_57079637 %float_1_57079637
+         %18 = OpConstantComposite %v2float %float_1_57079637 %float_1_57079637
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %sin_fc8bc4 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Sin %21
-               OpStore %res %19
+ %sin_fc8bc4 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Sin %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sin_fc8bc4
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sin_fc8bc4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sin_fc8bc4
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sin_fc8bc4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %sin_fc8bc4
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %sin_fc8bc4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.wgsl
index b14487d..744e4d6 100644
--- a/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sin/fc8bc4.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sin_fc8bc4() {
   var arg_0 = vec2<f32>(1.57079637050628662109f);
   var res : vec2<f32> = sin(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sin_fc8bc4();
diff --git a/test/tint/builtins/gen/var/sinh/0908c1.wgsl b/test/tint/builtins/gen/var/sinh/0908c1.wgsl
index 290d1a1..7245e27 100644
--- a/test/tint/builtins/gen/var/sinh/0908c1.wgsl
+++ b/test/tint/builtins/gen/var/sinh/0908c1.wgsl
@@ -27,7 +27,9 @@
 fn sinh_0908c1() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = sinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.dxc.hlsl
index 7e501c8..2354588 100644
--- a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_0908c1() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.fxc.hlsl
index 95843ac..eb361d6 100644
--- a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_0908c1() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.glsl
index df65835..7ac46efe 100644
--- a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sinh_0908c1() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sinh_0908c1() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sinh_0908c1() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.msl
index 5a6a9db..715982c 100644
--- a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_0908c1() {
+void sinh_0908c1(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = sinh(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_0908c1();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  sinh_0908c1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_0908c1();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  sinh_0908c1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_0908c1();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  sinh_0908c1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.spvasm
index aa9d933..7b41a1c 100644
--- a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_0908c1 "sinh_0908c1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_0908c1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Sinh %22
-               OpStore %res %20
+%sinh_0908c1 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Sinh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sinh_0908c1
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sinh_0908c1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sinh_0908c1
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sinh_0908c1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sinh_0908c1
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sinh_0908c1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.wgsl
index 17bd34a..75ecfdc 100644
--- a/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sinh/0908c1.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sinh_0908c1() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = sinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_0908c1();
diff --git a/test/tint/builtins/gen/var/sinh/445e33.wgsl b/test/tint/builtins/gen/var/sinh/445e33.wgsl
index 626527a..48c6a89 100644
--- a/test/tint/builtins/gen/var/sinh/445e33.wgsl
+++ b/test/tint/builtins/gen/var/sinh/445e33.wgsl
@@ -25,7 +25,9 @@
 fn sinh_445e33() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = sinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.dxc.hlsl
index 29cc9fc..8c48ba3 100644
--- a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_445e33() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = sinh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.fxc.hlsl
index 29cc9fc..8c48ba3 100644
--- a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_445e33() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = sinh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.glsl
index 6df1cb3..961d7bd 100644
--- a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sinh_445e33() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sinh_445e33() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sinh_445e33() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.msl
index d4d686d21..73a7367 100644
--- a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_445e33() {
+void sinh_445e33(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = sinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_445e33();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  sinh_445e33(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_445e33();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  sinh_445e33(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_445e33();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  sinh_445e33(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.spvasm
index c58c7fa..1590cad 100644
--- a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_445e33 "sinh_445e33"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%sinh_445e33 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%sinh_445e33 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Sinh %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Sinh %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %sinh_445e33
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %sinh_445e33
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sinh_445e33
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sinh_445e33
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sinh_445e33
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sinh_445e33
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.wgsl
index 367c9eb..5c78d81 100644
--- a/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sinh/445e33.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sinh_445e33() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = sinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_445e33();
diff --git a/test/tint/builtins/gen/var/sinh/69cce2.wgsl b/test/tint/builtins/gen/var/sinh/69cce2.wgsl
index b807c69..3f8cd18 100644
--- a/test/tint/builtins/gen/var/sinh/69cce2.wgsl
+++ b/test/tint/builtins/gen/var/sinh/69cce2.wgsl
@@ -27,7 +27,9 @@
 fn sinh_69cce2() {
   var arg_0 = 1.h;
   var res: f16 = sinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.dxc.hlsl
index ff85a1f..be1406b 100644
--- a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_69cce2() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = sinh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.fxc.hlsl
index 9ad1a40..3dd5e21 100644
--- a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_69cce2() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = sinh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.glsl
index 73ce0f5..f697bc2 100644
--- a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sinh_69cce2() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sinh_69cce2() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sinh_69cce2() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.msl
index d5d0f38..f508fcb 100644
--- a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_69cce2() {
+void sinh_69cce2(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = sinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_69cce2();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  sinh_69cce2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_69cce2();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  sinh_69cce2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_69cce2();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  sinh_69cce2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.spvasm
index b953991..90e1c78 100644
--- a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_69cce2 "sinh_69cce2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_69cce2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%sinh_69cce2 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Sinh %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Sinh %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %sinh_69cce2
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %sinh_69cce2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sinh_69cce2
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sinh_69cce2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sinh_69cce2
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sinh_69cce2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.wgsl
index d8ef948..c9cf93d 100644
--- a/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sinh/69cce2.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sinh_69cce2() {
   var arg_0 = 1.0h;
   var res : f16 = sinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_69cce2();
diff --git a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl
index 522bef7..23749b4 100644
--- a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl
+++ b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = sinh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_77a2a3();
diff --git a/test/tint/builtins/gen/var/sinh/7bb598.wgsl b/test/tint/builtins/gen/var/sinh/7bb598.wgsl
index 48bc9d5..f56d8fd 100644
--- a/test/tint/builtins/gen/var/sinh/7bb598.wgsl
+++ b/test/tint/builtins/gen/var/sinh/7bb598.wgsl
@@ -25,7 +25,9 @@
 fn sinh_7bb598() {
   var arg_0 = 1.f;
   var res: f32 = sinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.dxc.hlsl
index 1aeb0cd..dbeafc6 100644
--- a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_7bb598() {
   float arg_0 = 1.0f;
   float res = sinh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.fxc.hlsl
index 1aeb0cd..dbeafc6 100644
--- a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_7bb598() {
   float arg_0 = 1.0f;
   float res = sinh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.glsl
index 90e5597..12fc4ca 100644
--- a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sinh_7bb598() {
   float arg_0 = 1.0f;
   float res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sinh_7bb598() {
   float arg_0 = 1.0f;
   float res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sinh_7bb598() {
   float arg_0 = 1.0f;
   float res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.msl
index f78c11e..0b497d7 100644
--- a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_7bb598() {
+void sinh_7bb598(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = sinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_7bb598();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  sinh_7bb598(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_7bb598();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  sinh_7bb598(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_7bb598();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  sinh_7bb598(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.spvasm
index bd605b4..6bf04be 100644
--- a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_7bb598 "sinh_7bb598"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%sinh_7bb598 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%sinh_7bb598 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Sinh %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Sinh %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sinh_7bb598
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sinh_7bb598
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sinh_7bb598
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sinh_7bb598
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sinh_7bb598
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sinh_7bb598
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.wgsl
index fb4583a..a957132 100644
--- a/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sinh/7bb598.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sinh_7bb598() {
   var arg_0 = 1.0f;
   var res : f32 = sinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_7bb598();
diff --git a/test/tint/builtins/gen/var/sinh/924f19.wgsl b/test/tint/builtins/gen/var/sinh/924f19.wgsl
index fc53fc9..c108142 100644
--- a/test/tint/builtins/gen/var/sinh/924f19.wgsl
+++ b/test/tint/builtins/gen/var/sinh/924f19.wgsl
@@ -27,7 +27,9 @@
 fn sinh_924f19() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = sinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.dxc.hlsl
index e948a02..a1be6fc 100644
--- a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_924f19() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.fxc.hlsl
index 85a043ae..31eed65 100644
--- a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_924f19() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.glsl
index 837cb8c..450d63c 100644
--- a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sinh_924f19() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sinh_924f19() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sinh_924f19() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.msl
index 1665954..ebe6946 100644
--- a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_924f19() {
+void sinh_924f19(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = sinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_924f19();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  sinh_924f19(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_924f19();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  sinh_924f19(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_924f19();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  sinh_924f19(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.spvasm
index 3e671c0..7c33d22 100644
--- a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_924f19 "sinh_924f19"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_924f19 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Sinh %22
-               OpStore %res %20
+%sinh_924f19 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Sinh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sinh_924f19
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sinh_924f19
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sinh_924f19
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sinh_924f19
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sinh_924f19
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sinh_924f19
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.wgsl
index e03599a..deb976a 100644
--- a/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sinh/924f19.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sinh_924f19() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = sinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_924f19();
diff --git a/test/tint/builtins/gen/var/sinh/9c1092.wgsl b/test/tint/builtins/gen/var/sinh/9c1092.wgsl
index 8de44c6..13c33ec 100644
--- a/test/tint/builtins/gen/var/sinh/9c1092.wgsl
+++ b/test/tint/builtins/gen/var/sinh/9c1092.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = sinh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_9c1092();
diff --git a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl
index 894a494..8a7da14 100644
--- a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl
+++ b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = sinh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_a3da7c();
diff --git a/test/tint/builtins/gen/var/sinh/b9860e.wgsl b/test/tint/builtins/gen/var/sinh/b9860e.wgsl
index 7c3f2d0..7fa612f 100644
--- a/test/tint/builtins/gen/var/sinh/b9860e.wgsl
+++ b/test/tint/builtins/gen/var/sinh/b9860e.wgsl
@@ -25,7 +25,9 @@
 fn sinh_b9860e() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = sinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.dxc.hlsl
index fc6a913..15176b2 100644
--- a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_b9860e() {
   float2 arg_0 = (1.0f).xx;
   float2 res = sinh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.fxc.hlsl
index fc6a913..15176b2 100644
--- a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_b9860e() {
   float2 arg_0 = (1.0f).xx;
   float2 res = sinh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.glsl
index 613603e..fcf39c6 100644
--- a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sinh_b9860e() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sinh_b9860e() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sinh_b9860e() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.msl
index c22f6a3..2018d5f 100644
--- a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_b9860e() {
+void sinh_b9860e(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = sinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_b9860e();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  sinh_b9860e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_b9860e();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  sinh_b9860e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_b9860e();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  sinh_b9860e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.spvasm
index 809a295..d728abe 100644
--- a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_b9860e "sinh_b9860e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%sinh_b9860e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Sinh %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%sinh_b9860e = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Sinh %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sinh_b9860e
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sinh_b9860e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sinh_b9860e
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sinh_b9860e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sinh_b9860e
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sinh_b9860e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.wgsl
index 33a4a41..d9ce960 100644
--- a/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sinh/b9860e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sinh_b9860e() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = sinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_b9860e();
diff --git a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl
index b30192a..6458013 100644
--- a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl
+++ b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl
@@ -27,7 +27,9 @@
 fn sinh_ba7e25() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = sinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.dxc.hlsl
index de6afbe..109375e 100644
--- a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_ba7e25() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.fxc.hlsl
index 7d7ab56..1008b88 100644
--- a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_ba7e25() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = sinh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.glsl
index 4f7b50f..ec97fa5 100644
--- a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sinh_ba7e25() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sinh_ba7e25() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sinh_ba7e25() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.msl
index dbc7595..2d4b5f3 100644
--- a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_ba7e25() {
+void sinh_ba7e25(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = sinh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_ba7e25();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  sinh_ba7e25(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_ba7e25();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  sinh_ba7e25(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_ba7e25();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  sinh_ba7e25(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.spvasm
index 8d5a2d7..3d2626c 100644
--- a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_ba7e25 "sinh_ba7e25"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sinh_ba7e25 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Sinh %22
-               OpStore %res %20
+%sinh_ba7e25 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Sinh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sinh_ba7e25
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sinh_ba7e25
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sinh_ba7e25
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sinh_ba7e25
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sinh_ba7e25
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sinh_ba7e25
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.wgsl
index 16b2c7e..721893d 100644
--- a/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sinh/ba7e25.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sinh_ba7e25() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = sinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_ba7e25();
diff --git a/test/tint/builtins/gen/var/sinh/c4df74.wgsl b/test/tint/builtins/gen/var/sinh/c4df74.wgsl
index 38d7789..c92e546 100644
--- a/test/tint/builtins/gen/var/sinh/c4df74.wgsl
+++ b/test/tint/builtins/gen/var/sinh/c4df74.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = sinh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_c4df74();
diff --git a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl
index 8a54cb8..5a52089 100644
--- a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl
+++ b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl
@@ -25,7 +25,9 @@
 fn sinh_c9a5eb() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = sinh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.dxc.hlsl
index 92ed2f7..109938d 100644
--- a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_c9a5eb() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = sinh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.fxc.hlsl
index 92ed2f7..109938d 100644
--- a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sinh_c9a5eb() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = sinh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.glsl
index 2eab0a2..fbc734c 100644
--- a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sinh_c9a5eb() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sinh_c9a5eb() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sinh_c9a5eb() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sinh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.msl
index ba15966..aad48a4 100644
--- a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sinh_c9a5eb() {
+void sinh_c9a5eb(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = sinh(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sinh_c9a5eb();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  sinh_c9a5eb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sinh_c9a5eb();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  sinh_c9a5eb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sinh_c9a5eb();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  sinh_c9a5eb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.spvasm
index f5619cd..fd313ad 100644
--- a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sinh_c9a5eb "sinh_c9a5eb"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%sinh_c9a5eb = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Sinh %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%sinh_c9a5eb = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Sinh %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sinh_c9a5eb
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sinh_c9a5eb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sinh_c9a5eb
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sinh_c9a5eb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sinh_c9a5eb
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sinh_c9a5eb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.wgsl
index 90f08fb..f1f0b83 100644
--- a/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sinh/c9a5eb.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sinh_c9a5eb() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = sinh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sinh_c9a5eb();
diff --git a/test/tint/builtins/gen/var/smoothstep/0c481b.wgsl b/test/tint/builtins/gen/var/smoothstep/0c481b.wgsl
index 88183f4..a452855 100644
--- a/test/tint/builtins/gen/var/smoothstep/0c481b.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/0c481b.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec2(3.);
   var res = smoothstep(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_0c481b();
diff --git a/test/tint/builtins/gen/var/smoothstep/0c4ffc.wgsl b/test/tint/builtins/gen/var/smoothstep/0c4ffc.wgsl
index a1c01d3..0d7b68f 100644
--- a/test/tint/builtins/gen/var/smoothstep/0c4ffc.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/0c4ffc.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec4(3.);
   var res = smoothstep(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_0c4ffc();
diff --git a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl
index ccd52ca..d0f73c0 100644
--- a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec2<f16>(4.h);
   var arg_2 = vec2<f16>(3.h);
   var res: vec2<f16> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.dxc.hlsl
index 80c0574..7339138 100644
--- a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_12c031() {
   vector<float16_t, 2> arg_0 = (float16_t(2.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(4.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(3.0h)).xx;
   vector<float16_t, 2> res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.fxc.hlsl
index f5f68c8..90ca1c6 100644
--- a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_12c031() {
   vector<float16_t, 2> arg_0 = (float16_t(2.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(4.0h)).xx;
   vector<float16_t, 2> arg_2 = (float16_t(3.0h)).xx;
   vector<float16_t, 2> res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.glsl b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.glsl
index 840ed94..4ef5c44 100644
--- a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void smoothstep_12c031() {
   f16vec2 arg_0 = f16vec2(2.0hf);
   f16vec2 arg_1 = f16vec2(4.0hf);
   f16vec2 arg_2 = f16vec2(3.0hf);
   f16vec2 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void smoothstep_12c031() {
   f16vec2 arg_0 = f16vec2(2.0hf);
   f16vec2 arg_1 = f16vec2(4.0hf);
   f16vec2 arg_2 = f16vec2(3.0hf);
   f16vec2 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void smoothstep_12c031() {
   f16vec2 arg_0 = f16vec2(2.0hf);
   f16vec2 arg_1 = f16vec2(4.0hf);
   f16vec2 arg_2 = f16vec2(3.0hf);
   f16vec2 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.msl b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.msl
index defb697..4e3e6e2 100644
--- a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_12c031() {
+void smoothstep_12c031(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(2.0h);
   half2 arg_1 = half2(4.0h);
   half2 arg_2 = half2(3.0h);
   half2 res = smoothstep(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_12c031();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  smoothstep_12c031(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_12c031();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_12c031(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_12c031();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_12c031(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.spvasm b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.spvasm
index 1947e34..4fd1256 100644
--- a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %27 = OpExtInstImport "GLSL.std.450"
+         %30 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_12c031 "smoothstep_12c031"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v2half %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
+         %22 = OpConstantNull %v2half
 %half_0x1p_2 = OpConstant %half 0x1p+2
-         %21 = OpConstantComposite %v2half %half_0x1p_2 %half_0x1p_2
+         %24 = OpConstantComposite %v2half %half_0x1p_2 %half_0x1p_2
 %half_0x1_8p_1 = OpConstant %half 0x1.8p+1
-         %24 = OpConstantComposite %v2half %half_0x1_8p_1 %half_0x1_8p_1
-         %32 = OpTypeFunction %v4float
+         %27 = OpConstantComposite %v2half %half_0x1_8p_1 %half_0x1_8p_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_12c031 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %21
-               OpStore %arg_2 %24
-         %28 = OpLoad %v2half %arg_0
-         %29 = OpLoad %v2half %arg_1
-         %30 = OpLoad %v2half %arg_2
-         %26 = OpExtInst %v2half %27 SmoothStep %28 %29 %30
-               OpStore %res %26
+%smoothstep_12c031 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %24
+               OpStore %arg_2 %27
+         %31 = OpLoad %v2half %arg_0
+         %32 = OpLoad %v2half %arg_1
+         %33 = OpLoad %v2half %arg_2
+         %29 = OpExtInst %v2half %30 SmoothStep %31 %32 %33
+               OpStore %res %29
+         %38 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %39 = OpLoad %v2half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %smoothstep_12c031
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %smoothstep_12c031
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %smoothstep_12c031
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %smoothstep_12c031
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %smoothstep_12c031
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %smoothstep_12c031
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.wgsl b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.wgsl
index fd38b2b..9021aa8 100644
--- a/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/12c031.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec2<f16>(4.0h);
   var arg_2 = vec2<f16>(3.0h);
   var res : vec2<f16> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_12c031();
diff --git a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl
index 2816f21..488d900 100644
--- a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<f32>(4.f);
   var arg_2 = vec2<f32>(3.f);
   var res: vec2<f32> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.dxc.hlsl
index 0eca40f..f516d2a 100644
--- a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_392c19() {
   float2 arg_0 = (2.0f).xx;
   float2 arg_1 = (4.0f).xx;
   float2 arg_2 = (3.0f).xx;
   float2 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.fxc.hlsl
index 0eca40f..f516d2a 100644
--- a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_392c19() {
   float2 arg_0 = (2.0f).xx;
   float2 arg_1 = (4.0f).xx;
   float2 arg_2 = (3.0f).xx;
   float2 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.glsl b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.glsl
index 637ab837..a32adf6 100644
--- a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void smoothstep_392c19() {
   vec2 arg_0 = vec2(2.0f);
   vec2 arg_1 = vec2(4.0f);
   vec2 arg_2 = vec2(3.0f);
   vec2 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void smoothstep_392c19() {
   vec2 arg_0 = vec2(2.0f);
   vec2 arg_1 = vec2(4.0f);
   vec2 arg_2 = vec2(3.0f);
   vec2 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void smoothstep_392c19() {
   vec2 arg_0 = vec2(2.0f);
   vec2 arg_1 = vec2(4.0f);
   vec2 arg_2 = vec2(3.0f);
   vec2 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.msl b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.msl
index 23cef1a..d702040 100644
--- a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_392c19() {
+void smoothstep_392c19(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(2.0f);
   float2 arg_1 = float2(4.0f);
   float2 arg_2 = float2(3.0f);
   float2 res = smoothstep(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_392c19();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  smoothstep_392c19(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_392c19();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_392c19(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_392c19();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_392c19(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.spvasm b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.spvasm
index bef0f06..eb635d9 100644
--- a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
-         %26 = OpExtInstImport "GLSL.std.450"
+         %29 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_392c19 "smoothstep_392c19"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,54 +39,63 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v2float %float_2 %float_2
+         %18 = OpConstantComposite %v2float %float_2 %float_2
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
     %float_4 = OpConstant %float 4
-         %20 = OpConstantComposite %v2float %float_4 %float_4
+         %23 = OpConstantComposite %v2float %float_4 %float_4
     %float_3 = OpConstant %float 3
-         %23 = OpConstantComposite %v2float %float_3 %float_3
-         %31 = OpTypeFunction %v4float
+         %26 = OpConstantComposite %v2float %float_3 %float_3
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_392c19 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %20
-               OpStore %arg_2 %23
-         %27 = OpLoad %v2float %arg_0
-         %28 = OpLoad %v2float %arg_1
-         %29 = OpLoad %v2float %arg_2
-         %25 = OpExtInst %v2float %26 SmoothStep %27 %28 %29
-               OpStore %res %25
+%smoothstep_392c19 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %23
+               OpStore %arg_2 %26
+         %30 = OpLoad %v2float %arg_0
+         %31 = OpLoad %v2float %arg_1
+         %32 = OpLoad %v2float %arg_2
+         %28 = OpExtInst %v2float %29 SmoothStep %30 %31 %32
+               OpStore %res %28
+         %37 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %38 = OpLoad %v2float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %smoothstep_392c19
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %smoothstep_392c19
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %smoothstep_392c19
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %smoothstep_392c19
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %smoothstep_392c19
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %smoothstep_392c19
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.wgsl b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.wgsl
index 43d4f57..3b544d9 100644
--- a/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/392c19.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec2<f32>(4.0f);
   var arg_2 = vec2<f32>(3.0f);
   var res : vec2<f32> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_392c19();
diff --git a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl
index e42e7d3..990b1e0 100644
--- a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec4<f32>(4.f);
   var arg_2 = vec4<f32>(3.f);
   var res: vec4<f32> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.dxc.hlsl
index 47ab386..c3cfacc 100644
--- a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_40864c() {
   float4 arg_0 = (2.0f).xxxx;
   float4 arg_1 = (4.0f).xxxx;
   float4 arg_2 = (3.0f).xxxx;
   float4 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.fxc.hlsl
index 47ab386..c3cfacc 100644
--- a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_40864c() {
   float4 arg_0 = (2.0f).xxxx;
   float4 arg_1 = (4.0f).xxxx;
   float4 arg_2 = (3.0f).xxxx;
   float4 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.glsl b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.glsl
index 58f1039..14a5b35 100644
--- a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void smoothstep_40864c() {
   vec4 arg_0 = vec4(2.0f);
   vec4 arg_1 = vec4(4.0f);
   vec4 arg_2 = vec4(3.0f);
   vec4 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void smoothstep_40864c() {
   vec4 arg_0 = vec4(2.0f);
   vec4 arg_1 = vec4(4.0f);
   vec4 arg_2 = vec4(3.0f);
   vec4 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void smoothstep_40864c() {
   vec4 arg_0 = vec4(2.0f);
   vec4 arg_1 = vec4(4.0f);
   vec4 arg_2 = vec4(3.0f);
   vec4 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.msl b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.msl
index c3bc43e..9feff94 100644
--- a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_40864c() {
+void smoothstep_40864c(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(2.0f);
   float4 arg_1 = float4(4.0f);
   float4 arg_2 = float4(3.0f);
   float4 res = smoothstep(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_40864c();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  smoothstep_40864c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_40864c();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_40864c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_40864c();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_40864c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.spvasm
index abe8bd6..7200932 100644
--- a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
-         %24 = OpExtInstImport "GLSL.std.450"
+         %27 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_40864c "smoothstep_40864c"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,52 +39,61 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %14 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
+         %17 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2
 %_ptr_Function_v4float = OpTypePointer Function %v4float
     %float_4 = OpConstant %float 4
-         %18 = OpConstantComposite %v4float %float_4 %float_4 %float_4 %float_4
+         %21 = OpConstantComposite %v4float %float_4 %float_4 %float_4 %float_4
     %float_3 = OpConstant %float 3
-         %21 = OpConstantComposite %v4float %float_3 %float_3 %float_3 %float_3
-         %29 = OpTypeFunction %v4float
+         %24 = OpConstantComposite %v4float %float_3 %float_3 %float_3 %float_3
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_40864c = OpFunction %void None %9
-         %12 = OpLabel
+%smoothstep_40864c = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
       %arg_2 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %18
-               OpStore %arg_2 %21
-         %25 = OpLoad %v4float %arg_0
-         %26 = OpLoad %v4float %arg_1
-         %27 = OpLoad %v4float %arg_2
-         %23 = OpExtInst %v4float %24 SmoothStep %25 %26 %27
-               OpStore %res %23
+               OpStore %arg_0 %17
+               OpStore %arg_1 %21
+               OpStore %arg_2 %24
+         %28 = OpLoad %v4float %arg_0
+         %29 = OpLoad %v4float %arg_1
+         %30 = OpLoad %v4float %arg_2
+         %26 = OpExtInst %v4float %27 SmoothStep %28 %29 %30
+               OpStore %res %26
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %36 = OpLoad %v4float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %smoothstep_40864c
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %smoothstep_40864c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %smoothstep_40864c
+%fragment_main = OpFunction %void None %12
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %smoothstep_40864c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %smoothstep_40864c
+%compute_main = OpFunction %void None %12
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %smoothstep_40864c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.wgsl
index 4d0b357..424aca2 100644
--- a/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/40864c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec4<f32>(4.0f);
   var arg_2 = vec4<f32>(3.0f);
   var res : vec4<f32> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_40864c();
diff --git a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl
index 1c84475..79896bb 100644
--- a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = 4.h;
   var arg_2 = 3.h;
   var res: f16 = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.dxc.hlsl
index af710b9..9527ba5 100644
--- a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_586e12() {
   float16_t arg_0 = float16_t(2.0h);
   float16_t arg_1 = float16_t(4.0h);
   float16_t arg_2 = float16_t(3.0h);
   float16_t res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.fxc.hlsl
index dc89e99..3ce6694 100644
--- a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_586e12() {
   float16_t arg_0 = float16_t(2.0h);
   float16_t arg_1 = float16_t(4.0h);
   float16_t arg_2 = float16_t(3.0h);
   float16_t res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.glsl b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.glsl
index e9079b9..474cf23 100644
--- a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void smoothstep_586e12() {
   float16_t arg_0 = 2.0hf;
   float16_t arg_1 = 4.0hf;
   float16_t arg_2 = 3.0hf;
   float16_t res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void smoothstep_586e12() {
   float16_t arg_0 = 2.0hf;
   float16_t arg_1 = 4.0hf;
   float16_t arg_2 = 3.0hf;
   float16_t res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void smoothstep_586e12() {
   float16_t arg_0 = 2.0hf;
   float16_t arg_1 = 4.0hf;
   float16_t arg_2 = 3.0hf;
   float16_t res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.msl b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.msl
index 1ae3693..be1eb43 100644
--- a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_586e12() {
+void smoothstep_586e12(device half* const tint_symbol_1) {
   half arg_0 = 2.0h;
   half arg_1 = 4.0h;
   half arg_2 = 3.0h;
   half res = smoothstep(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_586e12();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  smoothstep_586e12(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_586e12();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_586e12(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_586e12();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_586e12(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.spvasm b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.spvasm
index c8fb280..652eb42 100644
--- a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %23 = OpExtInstImport "GLSL.std.450"
+         %26 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_586e12 "smoothstep_586e12"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,51 +43,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
+         %20 = OpConstantNull %half
 %half_0x1p_2 = OpConstant %half 0x1p+2
 %half_0x1_8p_1 = OpConstant %half 0x1.8p+1
-         %28 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_586e12 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-      %arg_2 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%smoothstep_586e12 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+      %arg_2 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_1
                OpStore %arg_1 %half_0x1p_2
                OpStore %arg_2 %half_0x1_8p_1
-         %24 = OpLoad %half %arg_0
-         %25 = OpLoad %half %arg_1
-         %26 = OpLoad %half %arg_2
-         %22 = OpExtInst %half %23 SmoothStep %24 %25 %26
-               OpStore %res %22
+         %27 = OpLoad %half %arg_0
+         %28 = OpLoad %half %arg_1
+         %29 = OpLoad %half %arg_2
+         %25 = OpExtInst %half %26 SmoothStep %27 %28 %29
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %35 = OpLoad %half %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %smoothstep_586e12
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %smoothstep_586e12
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %smoothstep_586e12
+%fragment_main = OpFunction %void None %13
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %smoothstep_586e12
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %smoothstep_586e12
+%compute_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %smoothstep_586e12
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.wgsl b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.wgsl
index 5611bdb..c10269d 100644
--- a/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/586e12.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = 4.0h;
   var arg_2 = 3.0h;
   var res : f16 = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_586e12();
diff --git a/test/tint/builtins/gen/var/smoothstep/66e4bd.wgsl b/test/tint/builtins/gen/var/smoothstep/66e4bd.wgsl
index b08bf4f..bc3897b 100644
--- a/test/tint/builtins/gen/var/smoothstep/66e4bd.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/66e4bd.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = vec3(3.);
   var res = smoothstep(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_66e4bd();
diff --git a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl
index 7d80c88..45f229e 100644
--- a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 4.f;
   var arg_2 = 3.f;
   var res: f32 = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.dxc.hlsl
index 4c3db67..d550fe9 100644
--- a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_6c4975() {
   float arg_0 = 2.0f;
   float arg_1 = 4.0f;
   float arg_2 = 3.0f;
   float res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.fxc.hlsl
index 4c3db67..d550fe9 100644
--- a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_6c4975() {
   float arg_0 = 2.0f;
   float arg_1 = 4.0f;
   float arg_2 = 3.0f;
   float res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.glsl b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.glsl
index 30a4487..f286eac 100644
--- a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void smoothstep_6c4975() {
   float arg_0 = 2.0f;
   float arg_1 = 4.0f;
   float arg_2 = 3.0f;
   float res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void smoothstep_6c4975() {
   float arg_0 = 2.0f;
   float arg_1 = 4.0f;
   float arg_2 = 3.0f;
   float res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void smoothstep_6c4975() {
   float arg_0 = 2.0f;
   float arg_1 = 4.0f;
   float arg_2 = 3.0f;
   float res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.msl b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.msl
index e725191..9a79cb8 100644
--- a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_6c4975() {
+void smoothstep_6c4975(device float* const tint_symbol_1) {
   float arg_0 = 2.0f;
   float arg_1 = 4.0f;
   float arg_2 = 3.0f;
   float res = smoothstep(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_6c4975();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  smoothstep_6c4975(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_6c4975();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_6c4975(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_6c4975();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_6c4975(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.spvasm b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.spvasm
index edffd3c..4492c88 100644
--- a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_6c4975 "smoothstep_6c4975"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,16 +39,22 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
 %_ptr_Function_float = OpTypePointer Function %float
     %float_4 = OpConstant %float 4
     %float_3 = OpConstant %float 3
-         %26 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_6c4975 = OpFunction %void None %9
-         %12 = OpLabel
+%smoothstep_6c4975 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
       %arg_2 = OpVariable %_ptr_Function_float Function %8
@@ -49,32 +62,35 @@
                OpStore %arg_0 %float_2
                OpStore %arg_1 %float_4
                OpStore %arg_2 %float_3
-         %22 = OpLoad %float %arg_0
-         %23 = OpLoad %float %arg_1
-         %24 = OpLoad %float %arg_2
-         %20 = OpExtInst %float %21 SmoothStep %22 %23 %24
-               OpStore %res %20
+         %25 = OpLoad %float %arg_0
+         %26 = OpLoad %float %arg_1
+         %27 = OpLoad %float %arg_2
+         %23 = OpExtInst %float %24 SmoothStep %25 %26 %27
+               OpStore %res %23
+         %32 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %33 = OpLoad %float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %smoothstep_6c4975
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %smoothstep_6c4975
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %smoothstep_6c4975
+%fragment_main = OpFunction %void None %12
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %smoothstep_6c4975
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %smoothstep_6c4975
+%compute_main = OpFunction %void None %12
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %smoothstep_6c4975
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.wgsl b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.wgsl
index a9096e2..82dfa64 100644
--- a/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/6c4975.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = 4.0f;
   var arg_2 = 3.0f;
   var res : f32 = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_6c4975();
diff --git a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl
index 2bca005..267f1fb 100644
--- a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec3<f16>(4.h);
   var arg_2 = vec3<f16>(3.h);
   var res: vec3<f16> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.dxc.hlsl
index b7b85c7..524028d 100644
--- a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_6e7a74() {
   vector<float16_t, 3> arg_0 = (float16_t(2.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(4.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(3.0h)).xxx;
   vector<float16_t, 3> res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.fxc.hlsl
index b8c9cd2..66a7084 100644
--- a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_6e7a74() {
   vector<float16_t, 3> arg_0 = (float16_t(2.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(4.0h)).xxx;
   vector<float16_t, 3> arg_2 = (float16_t(3.0h)).xxx;
   vector<float16_t, 3> res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.glsl b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.glsl
index 6567caa..43af1bd 100644
--- a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void smoothstep_6e7a74() {
   f16vec3 arg_0 = f16vec3(2.0hf);
   f16vec3 arg_1 = f16vec3(4.0hf);
   f16vec3 arg_2 = f16vec3(3.0hf);
   f16vec3 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void smoothstep_6e7a74() {
   f16vec3 arg_0 = f16vec3(2.0hf);
   f16vec3 arg_1 = f16vec3(4.0hf);
   f16vec3 arg_2 = f16vec3(3.0hf);
   f16vec3 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void smoothstep_6e7a74() {
   f16vec3 arg_0 = f16vec3(2.0hf);
   f16vec3 arg_1 = f16vec3(4.0hf);
   f16vec3 arg_2 = f16vec3(3.0hf);
   f16vec3 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.msl b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.msl
index 15260cd..2ad974f 100644
--- a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_6e7a74() {
+void smoothstep_6e7a74(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(2.0h);
   half3 arg_1 = half3(4.0h);
   half3 arg_2 = half3(3.0h);
   half3 res = smoothstep(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_6e7a74();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  smoothstep_6e7a74(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_6e7a74();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_6e7a74(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_6e7a74();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_6e7a74(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.spvasm
index c4577e4..f11974f 100644
--- a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %27 = OpExtInstImport "GLSL.std.450"
+         %30 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_6e7a74 "smoothstep_6e7a74"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v3half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
+         %22 = OpConstantNull %v3half
 %half_0x1p_2 = OpConstant %half 0x1p+2
-         %21 = OpConstantComposite %v3half %half_0x1p_2 %half_0x1p_2 %half_0x1p_2
+         %24 = OpConstantComposite %v3half %half_0x1p_2 %half_0x1p_2 %half_0x1p_2
 %half_0x1_8p_1 = OpConstant %half 0x1.8p+1
-         %24 = OpConstantComposite %v3half %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1
-         %32 = OpTypeFunction %v4float
+         %27 = OpConstantComposite %v3half %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_6e7a74 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %21
-               OpStore %arg_2 %24
-         %28 = OpLoad %v3half %arg_0
-         %29 = OpLoad %v3half %arg_1
-         %30 = OpLoad %v3half %arg_2
-         %26 = OpExtInst %v3half %27 SmoothStep %28 %29 %30
-               OpStore %res %26
+%smoothstep_6e7a74 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %24
+               OpStore %arg_2 %27
+         %31 = OpLoad %v3half %arg_0
+         %32 = OpLoad %v3half %arg_1
+         %33 = OpLoad %v3half %arg_2
+         %29 = OpExtInst %v3half %30 SmoothStep %31 %32 %33
+               OpStore %res %29
+         %38 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %39 = OpLoad %v3half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %smoothstep_6e7a74
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %smoothstep_6e7a74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %smoothstep_6e7a74
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %smoothstep_6e7a74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %smoothstep_6e7a74
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %smoothstep_6e7a74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.wgsl
index 3e3ee0b..f11bbb9 100644
--- a/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/6e7a74.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec3<f16>(4.0h);
   var arg_2 = vec3<f16>(3.0h);
   var res : vec3<f16> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_6e7a74();
diff --git a/test/tint/builtins/gen/var/smoothstep/a80fff.wgsl b/test/tint/builtins/gen/var/smoothstep/a80fff.wgsl
index 4eb41ec..ab24578 100644
--- a/test/tint/builtins/gen/var/smoothstep/a80fff.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/a80fff.wgsl
@@ -28,7 +28,6 @@
   const arg_2 = 3.;
   var res = smoothstep(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_a80fff();
diff --git a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl
index 9230d9d..47b9572 100644
--- a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<f32>(4.f);
   var arg_2 = vec3<f32>(3.f);
   var res: vec3<f32> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.dxc.hlsl
index b0326ae..6338fea 100644
--- a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_aad1db() {
   float3 arg_0 = (2.0f).xxx;
   float3 arg_1 = (4.0f).xxx;
   float3 arg_2 = (3.0f).xxx;
   float3 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.fxc.hlsl
index b0326ae..6338fea 100644
--- a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_aad1db() {
   float3 arg_0 = (2.0f).xxx;
   float3 arg_1 = (4.0f).xxx;
   float3 arg_2 = (3.0f).xxx;
   float3 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.glsl b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.glsl
index db5f26c..91d2309 100644
--- a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void smoothstep_aad1db() {
   vec3 arg_0 = vec3(2.0f);
   vec3 arg_1 = vec3(4.0f);
   vec3 arg_2 = vec3(3.0f);
   vec3 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,11 +28,16 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void smoothstep_aad1db() {
   vec3 arg_0 = vec3(2.0f);
   vec3 arg_1 = vec3(4.0f);
   vec3 arg_2 = vec3(3.0f);
   vec3 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -40,11 +50,16 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void smoothstep_aad1db() {
   vec3 arg_0 = vec3(2.0f);
   vec3 arg_1 = vec3(4.0f);
   vec3 arg_2 = vec3(3.0f);
   vec3 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.msl b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.msl
index c624c50..5018cae 100644
--- a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_aad1db() {
+void smoothstep_aad1db(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(2.0f);
   float3 arg_1 = float3(4.0f);
   float3 arg_2 = float3(3.0f);
   float3 res = smoothstep(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_aad1db();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  smoothstep_aad1db(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_aad1db();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_aad1db(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_aad1db();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_aad1db(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.spvasm b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.spvasm
index ba68fbd..fa59f8a 100644
--- a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
-         %26 = OpExtInstImport "GLSL.std.450"
+         %29 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_aad1db "smoothstep_aad1db"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -24,6 +27,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,54 +39,63 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_2 = OpConstant %float 2
-         %15 = OpConstantComposite %v3float %float_2 %float_2 %float_2
+         %18 = OpConstantComposite %v3float %float_2 %float_2 %float_2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
     %float_4 = OpConstant %float 4
-         %20 = OpConstantComposite %v3float %float_4 %float_4 %float_4
+         %23 = OpConstantComposite %v3float %float_4 %float_4 %float_4
     %float_3 = OpConstant %float 3
-         %23 = OpConstantComposite %v3float %float_3 %float_3 %float_3
-         %31 = OpTypeFunction %v4float
+         %26 = OpConstantComposite %v3float %float_3 %float_3 %float_3
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_aad1db = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %20
-               OpStore %arg_2 %23
-         %27 = OpLoad %v3float %arg_0
-         %28 = OpLoad %v3float %arg_1
-         %29 = OpLoad %v3float %arg_2
-         %25 = OpExtInst %v3float %26 SmoothStep %27 %28 %29
-               OpStore %res %25
+%smoothstep_aad1db = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %23
+               OpStore %arg_2 %26
+         %30 = OpLoad %v3float %arg_0
+         %31 = OpLoad %v3float %arg_1
+         %32 = OpLoad %v3float %arg_2
+         %28 = OpExtInst %v3float %29 SmoothStep %30 %31 %32
+               OpStore %res %28
+         %37 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %38 = OpLoad %v3float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %smoothstep_aad1db
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %smoothstep_aad1db
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %smoothstep_aad1db
+%fragment_main = OpFunction %void None %13
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %smoothstep_aad1db
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %smoothstep_aad1db
+%compute_main = OpFunction %void None %13
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %smoothstep_aad1db
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.wgsl b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.wgsl
index 5151f51..fb1d82c 100644
--- a/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/aad1db.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
   var arg_1 = vec3<f32>(4.0f);
   var arg_2 = vec3<f32>(3.0f);
   var res : vec3<f32> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_aad1db();
diff --git a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl
index ecb985c..192d1c2 100644
--- a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl
@@ -29,7 +29,9 @@
   var arg_1 = vec4<f16>(4.h);
   var arg_2 = vec4<f16>(3.h);
   var res: vec4<f16> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.dxc.hlsl
index 67dca92..fa46f5b 100644
--- a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.dxc.hlsl
@@ -1,8 +1,11 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_c43ebd() {
   vector<float16_t, 4> arg_0 = (float16_t(2.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(4.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(3.0h)).xxxx;
   vector<float16_t, 4> res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.fxc.hlsl
index 9254eec..47b65c9 100644
--- a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,13 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void smoothstep_c43ebd() {
   vector<float16_t, 4> arg_0 = (float16_t(2.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(4.0h)).xxxx;
   vector<float16_t, 4> arg_2 = (float16_t(3.0h)).xxxx;
   vector<float16_t, 4> res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.glsl b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.glsl
index 5ea049d..3209fe1 100644
--- a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void smoothstep_c43ebd() {
   f16vec4 arg_0 = f16vec4(2.0hf);
   f16vec4 arg_1 = f16vec4(4.0hf);
   f16vec4 arg_2 = f16vec4(3.0hf);
   f16vec4 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void smoothstep_c43ebd() {
   f16vec4 arg_0 = f16vec4(2.0hf);
   f16vec4 arg_1 = f16vec4(4.0hf);
   f16vec4 arg_2 = f16vec4(3.0hf);
   f16vec4 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void smoothstep_c43ebd() {
   f16vec4 arg_0 = f16vec4(2.0hf);
   f16vec4 arg_1 = f16vec4(4.0hf);
   f16vec4 arg_2 = f16vec4(3.0hf);
   f16vec4 res = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.msl b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.msl
index c135f33..6d4d93b 100644
--- a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void smoothstep_c43ebd() {
+void smoothstep_c43ebd(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(2.0h);
   half4 arg_1 = half4(4.0h);
   half4 arg_2 = half4(3.0h);
   half4 res = smoothstep(arg_0, arg_1, arg_2);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  smoothstep_c43ebd();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  smoothstep_c43ebd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  smoothstep_c43ebd();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  smoothstep_c43ebd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  smoothstep_c43ebd();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  smoothstep_c43ebd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.spvasm
index 03ee908..4aabea5 100644
--- a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %27 = OpExtInstImport "GLSL.std.450"
+         %30 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %smoothstep_c43ebd "smoothstep_c43ebd"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -28,6 +31,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,64 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_1 = OpConstant %half 0x1p+1
-         %16 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
+         %19 = OpConstantComposite %v4half %half_0x1p_1 %half_0x1p_1 %half_0x1p_1 %half_0x1p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
+         %22 = OpConstantNull %v4half
 %half_0x1p_2 = OpConstant %half 0x1p+2
-         %21 = OpConstantComposite %v4half %half_0x1p_2 %half_0x1p_2 %half_0x1p_2 %half_0x1p_2
+         %24 = OpConstantComposite %v4half %half_0x1p_2 %half_0x1p_2 %half_0x1p_2 %half_0x1p_2
 %half_0x1_8p_1 = OpConstant %half 0x1.8p+1
-         %24 = OpConstantComposite %v4half %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1
-         %32 = OpTypeFunction %v4float
+         %27 = OpConstantComposite %v4half %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%smoothstep_c43ebd = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_2 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %21
-               OpStore %arg_2 %24
-         %28 = OpLoad %v4half %arg_0
-         %29 = OpLoad %v4half %arg_1
-         %30 = OpLoad %v4half %arg_2
-         %26 = OpExtInst %v4half %27 SmoothStep %28 %29 %30
-               OpStore %res %26
+%smoothstep_c43ebd = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_2 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %24
+               OpStore %arg_2 %27
+         %31 = OpLoad %v4half %arg_0
+         %32 = OpLoad %v4half %arg_1
+         %33 = OpLoad %v4half %arg_2
+         %29 = OpExtInst %v4half %30 SmoothStep %31 %32 %33
+               OpStore %res %29
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %39 = OpLoad %v4half %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %smoothstep_c43ebd
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %smoothstep_c43ebd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %14
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %smoothstep_c43ebd
+%fragment_main = OpFunction %void None %14
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %smoothstep_c43ebd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %smoothstep_c43ebd
+%compute_main = OpFunction %void None %14
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %smoothstep_c43ebd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.wgsl
index 206abd4..0444364 100644
--- a/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/smoothstep/c43ebd.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_1 = vec4<f16>(4.0h);
   var arg_2 = vec4<f16>(3.0h);
   var res : vec4<f16> = smoothstep(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   smoothstep_c43ebd();
diff --git a/test/tint/builtins/gen/var/sqrt/072192.wgsl b/test/tint/builtins/gen/var/sqrt/072192.wgsl
index 9eeed91..f3f6b0e 100644
--- a/test/tint/builtins/gen/var/sqrt/072192.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/072192.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = sqrt(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_072192();
diff --git a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl
index d253ffa..55d2d02 100644
--- a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl
@@ -25,7 +25,9 @@
 fn sqrt_20c74e() {
   var arg_0 = 1.f;
   var res: f32 = sqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.dxc.hlsl
index 6db93fc..33953bc 100644
--- a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_20c74e() {
   float arg_0 = 1.0f;
   float res = sqrt(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.fxc.hlsl
index 6db93fc..33953bc 100644
--- a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_20c74e() {
   float arg_0 = 1.0f;
   float res = sqrt(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.glsl b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.glsl
index 73ac8a5..aed6cc2 100644
--- a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sqrt_20c74e() {
   float arg_0 = 1.0f;
   float res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sqrt_20c74e() {
   float arg_0 = 1.0f;
   float res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void sqrt_20c74e() {
   float arg_0 = 1.0f;
   float res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.msl b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.msl
index 7f9093d..97beb02 100644
--- a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_20c74e() {
+void sqrt_20c74e(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = sqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_20c74e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  sqrt_20c74e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_20c74e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_20c74e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_20c74e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_20c74e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.spvasm
index e7b4506..f410136 100644
--- a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_20c74e "sqrt_20c74e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%sqrt_20c74e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%sqrt_20c74e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Sqrt %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Sqrt %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %sqrt_20c74e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %sqrt_20c74e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %sqrt_20c74e
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %sqrt_20c74e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sqrt_20c74e
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sqrt_20c74e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.wgsl
index 239eb47..87f705c 100644
--- a/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/20c74e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sqrt_20c74e() {
   var arg_0 = 1.0f;
   var res : f32 = sqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_20c74e();
diff --git a/test/tint/builtins/gen/var/sqrt/4ac2c5.wgsl b/test/tint/builtins/gen/var/sqrt/4ac2c5.wgsl
index 8f13124..25630f3 100644
--- a/test/tint/builtins/gen/var/sqrt/4ac2c5.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/4ac2c5.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = sqrt(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_4ac2c5();
diff --git a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl
index bca3cc3..33006a8 100644
--- a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl
@@ -27,7 +27,9 @@
 fn sqrt_803d1c() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = sqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.dxc.hlsl
index abaebf1..97cb2e7 100644
--- a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_803d1c() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = sqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.fxc.hlsl
index fbd9552..a57f306 100644
--- a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_803d1c() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = sqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.glsl b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.glsl
index 6525d31..e8f0464 100644
--- a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sqrt_803d1c() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sqrt_803d1c() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void sqrt_803d1c() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.msl b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.msl
index b940b55..3909606 100644
--- a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_803d1c() {
+void sqrt_803d1c(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = sqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_803d1c();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  sqrt_803d1c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_803d1c();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_803d1c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_803d1c();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_803d1c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.spvasm
index ead0628..58d4975 100644
--- a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_803d1c "sqrt_803d1c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sqrt_803d1c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Sqrt %22
-               OpStore %res %20
+%sqrt_803d1c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Sqrt %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sqrt_803d1c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sqrt_803d1c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sqrt_803d1c
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sqrt_803d1c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sqrt_803d1c
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sqrt_803d1c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.wgsl
index bf5e74b..97eba40 100644
--- a/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/803d1c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sqrt_803d1c() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = sqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_803d1c();
diff --git a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl
index 6ff8f4b..ab204b2 100644
--- a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl
@@ -27,7 +27,9 @@
 fn sqrt_895a0c() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = sqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.dxc.hlsl
index bbad199..34305d5 100644
--- a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_895a0c() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = sqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.fxc.hlsl
index 833715e..270e158 100644
--- a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_895a0c() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = sqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.glsl b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.glsl
index be0ef1f..45344a4 100644
--- a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sqrt_895a0c() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sqrt_895a0c() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void sqrt_895a0c() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.msl b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.msl
index 2f06dda..3d0e035 100644
--- a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_895a0c() {
+void sqrt_895a0c(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = sqrt(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_895a0c();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  sqrt_895a0c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_895a0c();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_895a0c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_895a0c();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_895a0c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.spvasm
index 658abf9..c6a3754 100644
--- a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_895a0c "sqrt_895a0c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sqrt_895a0c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Sqrt %22
-               OpStore %res %20
+%sqrt_895a0c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Sqrt %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sqrt_895a0c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sqrt_895a0c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sqrt_895a0c
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sqrt_895a0c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sqrt_895a0c
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sqrt_895a0c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.wgsl
index 7fe955f..50dc383 100644
--- a/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/895a0c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sqrt_895a0c() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = sqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_895a0c();
diff --git a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl
index ec99108..18e2049 100644
--- a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl
@@ -25,7 +25,9 @@
 fn sqrt_8c7024() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = sqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.dxc.hlsl
index 3c82b5d..3f4c7c7 100644
--- a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_8c7024() {
   float2 arg_0 = (1.0f).xx;
   float2 res = sqrt(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.fxc.hlsl
index 3c82b5d..3f4c7c7 100644
--- a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_8c7024() {
   float2 arg_0 = (1.0f).xx;
   float2 res = sqrt(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.glsl b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.glsl
index ca45d4a..64b1356 100644
--- a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sqrt_8c7024() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sqrt_8c7024() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void sqrt_8c7024() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.msl b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.msl
index d6cd786..571ff32 100644
--- a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_8c7024() {
+void sqrt_8c7024(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = sqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_8c7024();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  sqrt_8c7024(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_8c7024();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_8c7024(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_8c7024();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_8c7024(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.spvasm
index b49d96c..d95107b 100644
--- a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_8c7024 "sqrt_8c7024"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%sqrt_8c7024 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Sqrt %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%sqrt_8c7024 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Sqrt %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sqrt_8c7024
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sqrt_8c7024
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sqrt_8c7024
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sqrt_8c7024
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sqrt_8c7024
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sqrt_8c7024
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.wgsl
index 37caec7..47ad6f3 100644
--- a/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/8c7024.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sqrt_8c7024() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = sqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_8c7024();
diff --git a/test/tint/builtins/gen/var/sqrt/8da177.wgsl b/test/tint/builtins/gen/var/sqrt/8da177.wgsl
index 57219bb..4547faf 100644
--- a/test/tint/builtins/gen/var/sqrt/8da177.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/8da177.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = sqrt(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_8da177();
diff --git a/test/tint/builtins/gen/var/sqrt/9c5cbe.wgsl b/test/tint/builtins/gen/var/sqrt/9c5cbe.wgsl
index fd7b08c..0a5204da 100644
--- a/test/tint/builtins/gen/var/sqrt/9c5cbe.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/9c5cbe.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = sqrt(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_9c5cbe();
diff --git a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl
index 9bd6212..e47e0b8 100644
--- a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl
@@ -25,7 +25,9 @@
 fn sqrt_aa0d7a() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = sqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.dxc.hlsl
index 09b9d92..7697359 100644
--- a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_aa0d7a() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = sqrt(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.fxc.hlsl
index 09b9d92..7697359 100644
--- a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_aa0d7a() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = sqrt(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.glsl b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.glsl
index 8f5ac2a..0928323 100644
--- a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sqrt_aa0d7a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sqrt_aa0d7a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void sqrt_aa0d7a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.msl b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.msl
index ee5234d..540114b 100644
--- a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_aa0d7a() {
+void sqrt_aa0d7a(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = sqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_aa0d7a();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  sqrt_aa0d7a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_aa0d7a();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_aa0d7a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_aa0d7a();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_aa0d7a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.spvasm
index f48213a..865cfc7 100644
--- a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_aa0d7a "sqrt_aa0d7a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%sqrt_aa0d7a = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%sqrt_aa0d7a = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Sqrt %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Sqrt %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %sqrt_aa0d7a
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %sqrt_aa0d7a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %sqrt_aa0d7a
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %sqrt_aa0d7a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %sqrt_aa0d7a
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %sqrt_aa0d7a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.wgsl
index 9c7c972..dcce8c8 100644
--- a/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/aa0d7a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sqrt_aa0d7a() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = sqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_aa0d7a();
diff --git a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl
index 69a6b60..6ecd80ad 100644
--- a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl
@@ -27,7 +27,9 @@
 fn sqrt_d9ab4d() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = sqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.dxc.hlsl
index 75cbc98..88b3bdd 100644
--- a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_d9ab4d() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = sqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.fxc.hlsl
index 3fffdac..e684895 100644
--- a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_d9ab4d() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = sqrt(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.glsl b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.glsl
index b36f0ab..0a477ca 100644
--- a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sqrt_d9ab4d() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sqrt_d9ab4d() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void sqrt_d9ab4d() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.msl b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.msl
index 39cdb37..e940ed7 100644
--- a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_d9ab4d() {
+void sqrt_d9ab4d(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = sqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_d9ab4d();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  sqrt_d9ab4d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_d9ab4d();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_d9ab4d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_d9ab4d();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_d9ab4d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.spvasm
index 0707402..b279965 100644
--- a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_d9ab4d "sqrt_d9ab4d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sqrt_d9ab4d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Sqrt %22
-               OpStore %res %20
+%sqrt_d9ab4d = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Sqrt %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %sqrt_d9ab4d
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %sqrt_d9ab4d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %sqrt_d9ab4d
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %sqrt_d9ab4d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %sqrt_d9ab4d
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %sqrt_d9ab4d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.wgsl
index 3183b73..54732af 100644
--- a/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/d9ab4d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sqrt_d9ab4d() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = sqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_d9ab4d();
diff --git a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl
index ca64044..be25e43 100644
--- a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl
@@ -27,7 +27,9 @@
 fn sqrt_ec33e9() {
   var arg_0 = 1.h;
   var res: f16 = sqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.dxc.hlsl
index 4e3ec4e..332b5f7 100644
--- a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_ec33e9() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = sqrt(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.fxc.hlsl
index bacd81f..6b2cc9c 100644
--- a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_ec33e9() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = sqrt(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.glsl b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.glsl
index 513a08f..9cb0303 100644
--- a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sqrt_ec33e9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sqrt_ec33e9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void sqrt_ec33e9() {
   float16_t arg_0 = 1.0hf;
   float16_t res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.msl b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.msl
index 03e7d8b..51d5034 100644
--- a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_ec33e9() {
+void sqrt_ec33e9(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = sqrt(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_ec33e9();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  sqrt_ec33e9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_ec33e9();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_ec33e9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_ec33e9();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_ec33e9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.spvasm
index f4fea39..3bbe293 100644
--- a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_ec33e9 "sqrt_ec33e9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%sqrt_ec33e9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%sqrt_ec33e9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Sqrt %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Sqrt %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %sqrt_ec33e9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %sqrt_ec33e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sqrt_ec33e9
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sqrt_ec33e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sqrt_ec33e9
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sqrt_ec33e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.wgsl
index 103d857..b833393 100644
--- a/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/ec33e9.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn sqrt_ec33e9() {
   var arg_0 = 1.0h;
   var res : f16 = sqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_ec33e9();
diff --git a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl
index 9b15edf..8a84630 100644
--- a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl
@@ -25,7 +25,9 @@
 fn sqrt_f8c59a() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = sqrt(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.dxc.hlsl
index 5f7d971..672f019 100644
--- a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_f8c59a() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = sqrt(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.fxc.hlsl
index 5f7d971..672f019 100644
--- a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void sqrt_f8c59a() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = sqrt(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.glsl b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.glsl
index 45e447b..5c06a66 100644
--- a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sqrt_f8c59a() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sqrt_f8c59a() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void sqrt_f8c59a() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = sqrt(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.msl b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.msl
index c0abaeb..5d4c0dd 100644
--- a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void sqrt_f8c59a() {
+void sqrt_f8c59a(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = sqrt(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  sqrt_f8c59a();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  sqrt_f8c59a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  sqrt_f8c59a();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  sqrt_f8c59a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  sqrt_f8c59a();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  sqrt_f8c59a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.spvasm
index 7a009b5..1fc41ea 100644
--- a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %sqrt_f8c59a "sqrt_f8c59a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%sqrt_f8c59a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Sqrt %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%sqrt_f8c59a = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Sqrt %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %sqrt_f8c59a
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %sqrt_f8c59a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %sqrt_f8c59a
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %sqrt_f8c59a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %sqrt_f8c59a
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %sqrt_f8c59a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.wgsl
index 248cee4..49d5525 100644
--- a/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/sqrt/f8c59a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn sqrt_f8c59a() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = sqrt(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   sqrt_f8c59a();
diff --git a/test/tint/builtins/gen/var/step/07cb06.wgsl b/test/tint/builtins/gen/var/step/07cb06.wgsl
index f7b9249..03b74fc 100644
--- a/test/tint/builtins/gen/var/step/07cb06.wgsl
+++ b/test/tint/builtins/gen/var/step/07cb06.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec2<f16>(1.h);
   var arg_1 = vec2<f16>(1.h);
   var res: vec2<f16> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.dxc.hlsl
index 8bc21a5..63298d8 100644
--- a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_07cb06() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = step(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.fxc.hlsl
index ce0a99c..bcc868b 100644
--- a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_07cb06() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> arg_1 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = step(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.glsl
index a46b618..97cb546 100644
--- a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void step_07cb06() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void step_07cb06() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void step_07cb06() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 arg_1 = f16vec2(1.0hf);
   f16vec2 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.msl b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.msl
index af24038..6e0cda1 100644
--- a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_07cb06() {
+void step_07cb06(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 arg_1 = half2(1.0h);
   half2 res = step(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_07cb06();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  step_07cb06(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_07cb06();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  step_07cb06(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_07cb06();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  step_07cb06(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.spvasm
index 0e05e51..f3002f7 100644
--- a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_07cb06 "step_07cb06"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%step_07cb06 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v2half %arg_0
-         %24 = OpLoad %v2half %arg_1
-         %21 = OpExtInst %v2half %22 Step %23 %24
-               OpStore %res %21
+%step_07cb06 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v2half %arg_0
+         %27 = OpLoad %v2half %arg_1
+         %24 = OpExtInst %v2half %25 Step %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %33 = OpLoad %v2half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %step_07cb06
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %step_07cb06
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %step_07cb06
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %step_07cb06
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %step_07cb06
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %step_07cb06
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.wgsl
index a8b5b22..47ee1e4 100644
--- a/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/step/07cb06.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec2<f16>(1.0h);
   var arg_1 = vec2<f16>(1.0h);
   var res : vec2<f16> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_07cb06();
diff --git a/test/tint/builtins/gen/var/step/0b073b.wgsl b/test/tint/builtins/gen/var/step/0b073b.wgsl
index acf3c92..b9d393d 100644
--- a/test/tint/builtins/gen/var/step/0b073b.wgsl
+++ b/test/tint/builtins/gen/var/step/0b073b.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = 1.f;
   var arg_1 = 1.f;
   var res: f32 = step(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.dxc.hlsl
index 19c85c9..af89f6e 100644
--- a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_0b073b() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = step(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.fxc.hlsl
index 19c85c9..af89f6e 100644
--- a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_0b073b() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = step(arg_0, arg_1);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.glsl
index 3708760..aff82eb 100644
--- a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void step_0b073b() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void step_0b073b() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void step_0b073b() {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.msl b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.msl
index 275ddb6..ca87d7c 100644
--- a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_0b073b() {
+void step_0b073b(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float arg_1 = 1.0f;
   float res = step(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_0b073b();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  step_0b073b(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_0b073b();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  step_0b073b(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_0b073b();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  step_0b073b(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.spvasm
index a9e8e76..0dbbca4 100644
--- a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_0b073b "step_0b073b"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,43 +38,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpTypeFunction %v4float
-%step_0b073b = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %v4float
+%step_0b073b = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
       %arg_1 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
                OpStore %arg_1 %float_1
-         %19 = OpLoad %float %arg_0
-         %20 = OpLoad %float %arg_1
-         %17 = OpExtInst %float %18 Step %19 %20
-               OpStore %res %17
+         %22 = OpLoad %float %arg_0
+         %23 = OpLoad %float %arg_1
+         %20 = OpExtInst %float %21 Step %22 %23
+               OpStore %res %20
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %step_0b073b
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %step_0b073b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %step_0b073b
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %step_0b073b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %step_0b073b
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %step_0b073b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.wgsl
index f570285..ac7217a 100644
--- a/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/step/0b073b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = 1.0f;
   var arg_1 = 1.0f;
   var res : f32 = step(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_0b073b();
diff --git a/test/tint/builtins/gen/var/step/19accd.wgsl b/test/tint/builtins/gen/var/step/19accd.wgsl
index 79ffaf0..0567249 100644
--- a/test/tint/builtins/gen/var/step/19accd.wgsl
+++ b/test/tint/builtins/gen/var/step/19accd.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec2<f32>(1.f);
   var arg_1 = vec2<f32>(1.f);
   var res: vec2<f32> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.dxc.hlsl
index b59f521..bfe7ef4 100644
--- a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_19accd() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = step(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.fxc.hlsl
index b59f521..bfe7ef4 100644
--- a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_19accd() {
   float2 arg_0 = (1.0f).xx;
   float2 arg_1 = (1.0f).xx;
   float2 res = step(arg_0, arg_1);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.glsl
index 475218f..3068f27 100644
--- a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void step_19accd() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void step_19accd() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void step_19accd() {
   vec2 arg_0 = vec2(1.0f);
   vec2 arg_1 = vec2(1.0f);
   vec2 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.msl b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.msl
index affcc0b..25e7816 100644
--- a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_19accd() {
+void step_19accd(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 arg_1 = float2(1.0f);
   float2 res = step(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_19accd();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  step_19accd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_19accd();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  step_19accd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_19accd();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  step_19accd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.spvasm
index 4d25d5f..16629a2 100644
--- a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_19accd "step_19accd"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
-%step_19accd = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v2float %arg_0
-         %23 = OpLoad %v2float %arg_1
-         %20 = OpExtInst %v2float %21 Step %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %33 = OpTypeFunction %v4float
+%step_19accd = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v2float %arg_0
+         %26 = OpLoad %v2float %arg_1
+         %23 = OpExtInst %v2float %24 Step %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %32 = OpLoad %v2float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %step_19accd
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %step_19accd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %step_19accd
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %step_19accd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %step_19accd
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %step_19accd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.wgsl
index a474865..e50dc12 100644
--- a/test/tint/builtins/gen/var/step/19accd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/step/19accd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec2<f32>(1.0f);
   var arg_1 = vec2<f32>(1.0f);
   var res : vec2<f32> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_19accd();
diff --git a/test/tint/builtins/gen/var/step/334303.wgsl b/test/tint/builtins/gen/var/step/334303.wgsl
index 5d28913..08963cd 100644
--- a/test/tint/builtins/gen/var/step/334303.wgsl
+++ b/test/tint/builtins/gen/var/step/334303.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec3<f32>(1.f);
   var arg_1 = vec3<f32>(1.f);
   var res: vec3<f32> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/step/334303.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/334303.wgsl.expected.dxc.hlsl
index 4de9136..b293065 100644
--- a/test/tint/builtins/gen/var/step/334303.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/step/334303.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_334303() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = step(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/334303.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/334303.wgsl.expected.fxc.hlsl
index 4de9136..b293065 100644
--- a/test/tint/builtins/gen/var/step/334303.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/step/334303.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_334303() {
   float3 arg_0 = (1.0f).xxx;
   float3 arg_1 = (1.0f).xxx;
   float3 res = step(arg_0, arg_1);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/334303.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/334303.wgsl.expected.glsl
index b1bc1b6..fb9352d 100644
--- a/test/tint/builtins/gen/var/step/334303.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/step/334303.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void step_334303() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void step_334303() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void step_334303() {
   vec3 arg_0 = vec3(1.0f);
   vec3 arg_1 = vec3(1.0f);
   vec3 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/step/334303.wgsl.expected.msl b/test/tint/builtins/gen/var/step/334303.wgsl.expected.msl
index cac7c05..2fa35cd 100644
--- a/test/tint/builtins/gen/var/step/334303.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/step/334303.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_334303() {
+void step_334303(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 arg_1 = float3(1.0f);
   float3 res = step(arg_0, arg_1);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_334303();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  step_334303(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_334303();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  step_334303(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_334303();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  step_334303(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/step/334303.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/334303.wgsl.expected.spvasm
index 2f9fe018..f7a184a 100644
--- a/test/tint/builtins/gen/var/step/334303.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/step/334303.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_334303 "step_334303"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,46 +38,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %25 = OpTypeFunction %v4float
-%step_334303 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-      %arg_1 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-               OpStore %arg_1 %15
-         %22 = OpLoad %v3float %arg_0
-         %23 = OpLoad %v3float %arg_1
-         %20 = OpExtInst %v3float %21 Step %22 %23
-               OpStore %res %20
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %33 = OpTypeFunction %v4float
+%step_334303 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_1 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+               OpStore %arg_1 %18
+         %25 = OpLoad %v3float %arg_0
+         %26 = OpLoad %v3float %arg_1
+         %23 = OpExtInst %v3float %24 Step %25 %26
+               OpStore %res %23
+         %31 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %32 = OpLoad %v3float %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %step_334303
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %step_334303
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %step_334303
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %step_334303
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %step_334303
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %step_334303
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/334303.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/334303.wgsl.expected.wgsl
index 70b5507..14a96c8 100644
--- a/test/tint/builtins/gen/var/step/334303.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/step/334303.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec3<f32>(1.0f);
   var arg_1 = vec3<f32>(1.0f);
   var res : vec3<f32> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_334303();
diff --git a/test/tint/builtins/gen/var/step/38cd79.wgsl b/test/tint/builtins/gen/var/step/38cd79.wgsl
index a75dcc2..f6324bb 100644
--- a/test/tint/builtins/gen/var/step/38cd79.wgsl
+++ b/test/tint/builtins/gen/var/step/38cd79.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec4(1.);
   var res = step(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_38cd79();
diff --git a/test/tint/builtins/gen/var/step/415879.wgsl b/test/tint/builtins/gen/var/step/415879.wgsl
index 27e9ed5..e39e14c 100644
--- a/test/tint/builtins/gen/var/step/415879.wgsl
+++ b/test/tint/builtins/gen/var/step/415879.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec3(1.);
   var res = step(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_415879();
diff --git a/test/tint/builtins/gen/var/step/630d07.wgsl b/test/tint/builtins/gen/var/step/630d07.wgsl
index bf439eb..ce275e9 100644
--- a/test/tint/builtins/gen/var/step/630d07.wgsl
+++ b/test/tint/builtins/gen/var/step/630d07.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = 1.h;
   var arg_1 = 1.h;
   var res: f16 = step(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.dxc.hlsl
index 5faf39a..d0647ed 100644
--- a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_630d07() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = step(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.fxc.hlsl
index 7c9114f..59a6ce9 100644
--- a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_630d07() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t arg_1 = float16_t(1.0h);
   float16_t res = step(arg_0, arg_1);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.glsl
index b76c139..e768265 100644
--- a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void step_630d07() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void step_630d07() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void step_630d07() {
   float16_t arg_0 = 1.0hf;
   float16_t arg_1 = 1.0hf;
   float16_t res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.msl b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.msl
index f7ea9c9..09f49b7 100644
--- a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_630d07() {
+void step_630d07(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half arg_1 = 1.0h;
   half res = step(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_630d07();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  step_630d07(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_630d07();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  step_630d07(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_630d07();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  step_630d07(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.spvasm
index cdbdda6..e2fcf0f 100644
--- a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_630d07 "step_630d07"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,46 +42,55 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %24 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%step_630d07 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-      %arg_1 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%step_630d07 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+      %arg_1 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
                OpStore %arg_1 %half_0x1p_0
-         %21 = OpLoad %half %arg_0
-         %22 = OpLoad %half %arg_1
-         %19 = OpExtInst %half %20 Step %21 %22
-               OpStore %res %19
+         %24 = OpLoad %half %arg_0
+         %25 = OpLoad %half %arg_1
+         %22 = OpExtInst %half %23 Step %24 %25
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %31 = OpLoad %half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %step_630d07
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %step_630d07
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %step_630d07
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %step_630d07
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %step_630d07
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %step_630d07
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.wgsl
index 93dbf44..e01d5f9 100644
--- a/test/tint/builtins/gen/var/step/630d07.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/step/630d07.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = 1.0h;
   var arg_1 = 1.0h;
   var res : f16 = step(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_630d07();
diff --git a/test/tint/builtins/gen/var/step/7c7e5c.wgsl b/test/tint/builtins/gen/var/step/7c7e5c.wgsl
index 6023771..423fc39 100644
--- a/test/tint/builtins/gen/var/step/7c7e5c.wgsl
+++ b/test/tint/builtins/gen/var/step/7c7e5c.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = vec2(1.);
   var res = step(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_7c7e5c();
diff --git a/test/tint/builtins/gen/var/step/baa320.wgsl b/test/tint/builtins/gen/var/step/baa320.wgsl
index 97682d2..f74b615 100644
--- a/test/tint/builtins/gen/var/step/baa320.wgsl
+++ b/test/tint/builtins/gen/var/step/baa320.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec4<f16>(1.h);
   var arg_1 = vec4<f16>(1.h);
   var res: vec4<f16> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.dxc.hlsl
index a6dfc2b..b706f0e 100644
--- a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_baa320() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = step(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.fxc.hlsl
index 7a79030..1d50723 100644
--- a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_baa320() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> arg_1 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = step(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.glsl
index 1279b56..2c19b4e 100644
--- a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void step_baa320() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void step_baa320() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void step_baa320() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 arg_1 = f16vec4(1.0hf);
   f16vec4 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.msl b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.msl
index 721f39b..97b4fe5 100644
--- a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_baa320() {
+void step_baa320(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 arg_1 = half4(1.0h);
   half4 res = step(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_baa320();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  step_baa320(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_baa320();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  step_baa320(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_baa320();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  step_baa320(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.spvasm
index 8688f13..7c024c5 100644
--- a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_baa320 "step_baa320"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%step_baa320 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v4half %arg_0
-         %24 = OpLoad %v4half %arg_1
-         %21 = OpExtInst %v4half %22 Step %23 %24
-               OpStore %res %21
+%step_baa320 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v4half %arg_0
+         %27 = OpLoad %v4half %arg_1
+         %24 = OpExtInst %v4half %25 Step %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %33 = OpLoad %v4half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %step_baa320
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %step_baa320
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %step_baa320
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %step_baa320
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %step_baa320
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %step_baa320
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.wgsl
index 1b4a901..165e240 100644
--- a/test/tint/builtins/gen/var/step/baa320.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/step/baa320.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec4<f16>(1.0h);
   var arg_1 = vec4<f16>(1.0h);
   var res : vec4<f16> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_baa320();
diff --git a/test/tint/builtins/gen/var/step/cc6b61.wgsl b/test/tint/builtins/gen/var/step/cc6b61.wgsl
index e53c65f..f185ba9 100644
--- a/test/tint/builtins/gen/var/step/cc6b61.wgsl
+++ b/test/tint/builtins/gen/var/step/cc6b61.wgsl
@@ -28,7 +28,9 @@
   var arg_0 = vec3<f16>(1.h);
   var arg_1 = vec3<f16>(1.h);
   var res: vec3<f16> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.dxc.hlsl
index 964e48e..ddc03b9 100644
--- a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_cc6b61() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = step(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.fxc.hlsl
index 5d91570..374e8a2 100644
--- a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.fxc.hlsl
@@ -1,9 +1,12 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_cc6b61() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> arg_1 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = step(arg_0, arg_1);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.glsl
index 3484a43..8ce24cc 100644
--- a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void step_cc6b61() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void step_cc6b61() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void step_cc6b61() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 arg_1 = f16vec3(1.0hf);
   f16vec3 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.msl b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.msl
index 85fcf3b..54eebf8 100644
--- a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_cc6b61() {
+void step_cc6b61(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 arg_1 = half3(1.0h);
   half3 res = step(arg_0, arg_1);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_cc6b61();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  step_cc6b61(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_cc6b61();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  step_cc6b61(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_cc6b61();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  step_cc6b61(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.spvasm
index c650aac..f1a4473 100644
--- a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %22 = OpExtInstImport "GLSL.std.450"
+         %25 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_cc6b61 "step_cc6b61"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -27,6 +30,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,48 +42,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %26 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%step_cc6b61 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-      %arg_1 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-               OpStore %arg_1 %16
-         %23 = OpLoad %v3half %arg_0
-         %24 = OpLoad %v3half %arg_1
-         %21 = OpExtInst %v3half %22 Step %23 %24
-               OpStore %res %21
+%step_cc6b61 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+      %arg_1 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+               OpStore %arg_1 %19
+         %26 = OpLoad %v3half %arg_0
+         %27 = OpLoad %v3half %arg_1
+         %24 = OpExtInst %v3half %25 Step %26 %27
+               OpStore %res %24
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %33 = OpLoad %v3half %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %step_cc6b61
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %step_cc6b61
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %14
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %step_cc6b61
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %step_cc6b61
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %step_cc6b61
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %step_cc6b61
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.wgsl
index 2609b26..4737f3d 100644
--- a/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/step/cc6b61.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_0 = vec3<f16>(1.0h);
   var arg_1 = vec3<f16>(1.0h);
   var res : vec3<f16> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_cc6b61();
diff --git a/test/tint/builtins/gen/var/step/e2b337.wgsl b/test/tint/builtins/gen/var/step/e2b337.wgsl
index 77dbbee..28147c2 100644
--- a/test/tint/builtins/gen/var/step/e2b337.wgsl
+++ b/test/tint/builtins/gen/var/step/e2b337.wgsl
@@ -26,7 +26,9 @@
   var arg_0 = vec4<f32>(1.f);
   var arg_1 = vec4<f32>(1.f);
   var res: vec4<f32> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.dxc.hlsl
index 8c5c8d0..2d894a8 100644
--- a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.dxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_e2b337() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = step(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.fxc.hlsl
index 8c5c8d0..2d894a8 100644
--- a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.fxc.hlsl
@@ -1,7 +1,10 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void step_e2b337() {
   float4 arg_0 = (1.0f).xxxx;
   float4 arg_1 = (1.0f).xxxx;
   float4 res = step(arg_0, arg_1);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.glsl b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.glsl
index 7455c10..0424d9c 100644
--- a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void step_e2b337() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,10 +27,15 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void step_e2b337() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -38,10 +48,15 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void step_e2b337() {
   vec4 arg_0 = vec4(1.0f);
   vec4 arg_1 = vec4(1.0f);
   vec4 res = step(arg_0, arg_1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.msl b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.msl
index 1fc7c31..e412628 100644
--- a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void step_e2b337() {
+void step_e2b337(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 arg_1 = float4(1.0f);
   float4 res = step(arg_0, arg_1);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  step_e2b337();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  step_e2b337(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  step_e2b337();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  step_e2b337(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  step_e2b337();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  step_e2b337(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.spvasm b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.spvasm
index 2aa2b49..65f37de 100644
--- a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %step_e2b337 "step_e2b337"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
@@ -23,6 +26,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -31,44 +38,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpTypeFunction %v4float
-%step_e2b337 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %31 = OpTypeFunction %v4float
+%step_e2b337 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
       %arg_1 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-               OpStore %arg_1 %14
-         %20 = OpLoad %v4float %arg_0
-         %21 = OpLoad %v4float %arg_1
-         %18 = OpExtInst %v4float %19 Step %20 %21
-               OpStore %res %18
+               OpStore %arg_0 %17
+               OpStore %arg_1 %17
+         %23 = OpLoad %v4float %arg_0
+         %24 = OpLoad %v4float %arg_1
+         %21 = OpExtInst %v4float %22 Step %23 %24
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %30 = OpLoad %v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %step_e2b337
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %step_e2b337
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %step_e2b337
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %step_e2b337
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %step_e2b337
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %step_e2b337
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.wgsl b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.wgsl
index 5dd29a4..709ea0f 100644
--- a/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/step/e2b337.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
   var arg_0 = vec4<f32>(1.0f);
   var arg_1 = vec4<f32>(1.0f);
   var res : vec4<f32> = step(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_e2b337();
diff --git a/test/tint/builtins/gen/var/step/f9b70c.wgsl b/test/tint/builtins/gen/var/step/f9b70c.wgsl
index ab183d1..b556a1c 100644
--- a/test/tint/builtins/gen/var/step/f9b70c.wgsl
+++ b/test/tint/builtins/gen/var/step/f9b70c.wgsl
@@ -27,7 +27,6 @@
   const arg_1 = 1.;
   var res = step(arg_0, arg_1);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   step_f9b70c();
diff --git a/test/tint/builtins/gen/var/storageBarrier/d87211.wgsl b/test/tint/builtins/gen/var/storageBarrier/d87211.wgsl
index 19f8982..f5a56da 100644
--- a/test/tint/builtins/gen/var/storageBarrier/d87211.wgsl
+++ b/test/tint/builtins/gen/var/storageBarrier/d87211.wgsl
@@ -25,7 +25,6 @@
 fn storageBarrier_d87211() {
   storageBarrier();
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   storageBarrier_d87211();
diff --git a/test/tint/builtins/gen/var/tan/244e2a.wgsl b/test/tint/builtins/gen/var/tan/244e2a.wgsl
index 0484443..52b9143 100644
--- a/test/tint/builtins/gen/var/tan/244e2a.wgsl
+++ b/test/tint/builtins/gen/var/tan/244e2a.wgsl
@@ -25,7 +25,9 @@
 fn tan_244e2a() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = tan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.dxc.hlsl
index 415a64c..80f1a60 100644
--- a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_244e2a() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tan(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.fxc.hlsl
index 415a64c..80f1a60 100644
--- a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_244e2a() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tan(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.glsl b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.glsl
index 1785332..ed9c07d 100644
--- a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tan_244e2a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tan_244e2a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tan_244e2a() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.msl b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.msl
index 80d7476..17e4c98 100644
--- a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_244e2a() {
+void tan_244e2a(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = tan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_244e2a();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  tan_244e2a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_244e2a();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  tan_244e2a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_244e2a();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  tan_244e2a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.spvasm
index 5e53582..adcfddd 100644
--- a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_244e2a "tan_244e2a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
- %tan_244e2a = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+ %tan_244e2a = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Tan %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Tan %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %tan_244e2a
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %tan_244e2a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tan_244e2a
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tan_244e2a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %tan_244e2a
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %tan_244e2a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.wgsl
index 49715cc..6a854ac 100644
--- a/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tan/244e2a.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn tan_244e2a() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = tan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_244e2a();
diff --git a/test/tint/builtins/gen/var/tan/2f030e.wgsl b/test/tint/builtins/gen/var/tan/2f030e.wgsl
index e03b1ee..bf98793 100644
--- a/test/tint/builtins/gen/var/tan/2f030e.wgsl
+++ b/test/tint/builtins/gen/var/tan/2f030e.wgsl
@@ -25,7 +25,9 @@
 fn tan_2f030e() {
   var arg_0 = 1.f;
   var res: f32 = tan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.dxc.hlsl
index b3863b5..9d0f178 100644
--- a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_2f030e() {
   float arg_0 = 1.0f;
   float res = tan(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.fxc.hlsl
index b3863b5..9d0f178 100644
--- a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_2f030e() {
   float arg_0 = 1.0f;
   float res = tan(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.glsl b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.glsl
index 5075b83..0734874 100644
--- a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tan_2f030e() {
   float arg_0 = 1.0f;
   float res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tan_2f030e() {
   float arg_0 = 1.0f;
   float res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tan_2f030e() {
   float arg_0 = 1.0f;
   float res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.msl b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.msl
index ca719b5..de56888 100644
--- a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_2f030e() {
+void tan_2f030e(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = tan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_2f030e();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  tan_2f030e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_2f030e();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  tan_2f030e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_2f030e();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  tan_2f030e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.spvasm
index 57d1c9b..6118ac3 100644
--- a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_2f030e "tan_2f030e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
- %tan_2f030e = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+ %tan_2f030e = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Tan %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Tan %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %tan_2f030e
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %tan_2f030e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %tan_2f030e
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %tan_2f030e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tan_2f030e
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tan_2f030e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.wgsl
index f2fb49b..8c208bd 100644
--- a/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tan/2f030e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn tan_2f030e() {
   var arg_0 = 1.0f;
   var res : f32 = tan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_2f030e();
diff --git a/test/tint/builtins/gen/var/tan/311400.wgsl b/test/tint/builtins/gen/var/tan/311400.wgsl
index 2459950..a93ecec 100644
--- a/test/tint/builtins/gen/var/tan/311400.wgsl
+++ b/test/tint/builtins/gen/var/tan/311400.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = tan(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_311400();
diff --git a/test/tint/builtins/gen/var/tan/539e54.wgsl b/test/tint/builtins/gen/var/tan/539e54.wgsl
index d8a753f..bfa90d6 100644
--- a/test/tint/builtins/gen/var/tan/539e54.wgsl
+++ b/test/tint/builtins/gen/var/tan/539e54.wgsl
@@ -27,7 +27,9 @@
 fn tan_539e54() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = tan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.dxc.hlsl
index fd43be1..5561928 100644
--- a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_539e54() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tan(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.fxc.hlsl
index a498e41..5e664c4 100644
--- a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_539e54() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tan(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.glsl b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.glsl
index af83ad1..5a772b8 100644
--- a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tan_539e54() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tan_539e54() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tan_539e54() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.msl b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.msl
index cb30e6e..6bd6b43 100644
--- a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_539e54() {
+void tan_539e54(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = tan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_539e54();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  tan_539e54(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_539e54();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  tan_539e54(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_539e54();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  tan_539e54(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.spvasm
index c61601d..e9f6877 100644
--- a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_539e54 "tan_539e54"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_539e54 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Tan %22
-               OpStore %res %20
+ %tan_539e54 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Tan %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %tan_539e54
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %tan_539e54
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %tan_539e54
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %tan_539e54
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %tan_539e54
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %tan_539e54
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.wgsl
index 8112cdd..d9fab33 100644
--- a/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tan/539e54.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn tan_539e54() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = tan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_539e54();
diff --git a/test/tint/builtins/gen/var/tan/7be368.wgsl b/test/tint/builtins/gen/var/tan/7be368.wgsl
index 9f65208..f1232e1 100644
--- a/test/tint/builtins/gen/var/tan/7be368.wgsl
+++ b/test/tint/builtins/gen/var/tan/7be368.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = tan(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_7be368();
diff --git a/test/tint/builtins/gen/var/tan/7ea104.wgsl b/test/tint/builtins/gen/var/tan/7ea104.wgsl
index 46f4a2b..b6ff6d4 100644
--- a/test/tint/builtins/gen/var/tan/7ea104.wgsl
+++ b/test/tint/builtins/gen/var/tan/7ea104.wgsl
@@ -25,7 +25,9 @@
 fn tan_7ea104() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = tan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.dxc.hlsl
index 6090fd6..db24d68 100644
--- a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_7ea104() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tan(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.fxc.hlsl
index 6090fd6..db24d68 100644
--- a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_7ea104() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tan(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.glsl b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.glsl
index 3114bf0..13233eb 100644
--- a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tan_7ea104() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tan_7ea104() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tan_7ea104() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.msl b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.msl
index 0eb10fb..920e6af 100644
--- a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_7ea104() {
+void tan_7ea104(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = tan(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_7ea104();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  tan_7ea104(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_7ea104();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  tan_7ea104(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_7ea104();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  tan_7ea104(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.spvasm
index 69c8aeb..b0773e8 100644
--- a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_7ea104 "tan_7ea104"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
- %tan_7ea104 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Tan %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+ %tan_7ea104 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Tan %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %tan_7ea104
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %tan_7ea104
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tan_7ea104
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tan_7ea104
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %tan_7ea104
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %tan_7ea104
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.wgsl
index 99240ec..9c56e12 100644
--- a/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tan/7ea104.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn tan_7ea104() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = tan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_7ea104();
diff --git a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl
index 327a3e6..6c8cf46 100644
--- a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl
+++ b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl
@@ -25,7 +25,9 @@
 fn tan_8ce3e9() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = tan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.dxc.hlsl
index 66df261..64ae377 100644
--- a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_8ce3e9() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tan(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.fxc.hlsl
index 66df261..64ae377 100644
--- a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_8ce3e9() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tan(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.glsl b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.glsl
index 812a83e..d9dc182 100644
--- a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tan_8ce3e9() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tan_8ce3e9() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tan_8ce3e9() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.msl b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.msl
index 94890c4..804f7ab 100644
--- a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_8ce3e9() {
+void tan_8ce3e9(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = tan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_8ce3e9();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  tan_8ce3e9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_8ce3e9();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  tan_8ce3e9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_8ce3e9();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  tan_8ce3e9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.spvasm
index 09c5c1aa..6d86816 100644
--- a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_8ce3e9 "tan_8ce3e9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
- %tan_8ce3e9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Tan %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+ %tan_8ce3e9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Tan %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %tan_8ce3e9
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %tan_8ce3e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tan_8ce3e9
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tan_8ce3e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %tan_8ce3e9
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %tan_8ce3e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.wgsl
index 13d8264..aa58df5 100644
--- a/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tan/8ce3e9.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn tan_8ce3e9() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = tan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_8ce3e9();
diff --git a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl
index 0bb6701..6c7a30b 100644
--- a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl
+++ b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl
@@ -27,7 +27,9 @@
 fn tan_9f7c9c() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = tan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.dxc.hlsl
index 90ecf8e..335aeb3 100644
--- a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_9f7c9c() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tan(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.fxc.hlsl
index 447c915..68c0998 100644
--- a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_9f7c9c() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tan(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.glsl b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.glsl
index f32bf3c..a0dfce4 100644
--- a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tan_9f7c9c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tan_9f7c9c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tan_9f7c9c() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.msl b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.msl
index 94b6209..4731617 100644
--- a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_9f7c9c() {
+void tan_9f7c9c(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = tan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_9f7c9c();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  tan_9f7c9c(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_9f7c9c();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  tan_9f7c9c(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_9f7c9c();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  tan_9f7c9c(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.spvasm
index 57105f9..41f38b6 100644
--- a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_9f7c9c "tan_9f7c9c"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_9f7c9c = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Tan %22
-               OpStore %res %20
+ %tan_9f7c9c = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Tan %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %tan_9f7c9c
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %tan_9f7c9c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %tan_9f7c9c
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %tan_9f7c9c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %tan_9f7c9c
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %tan_9f7c9c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.wgsl
index be4538b..78c2fa7 100644
--- a/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tan/9f7c9c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn tan_9f7c9c() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = tan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_9f7c9c();
diff --git a/test/tint/builtins/gen/var/tan/a0966f.wgsl b/test/tint/builtins/gen/var/tan/a0966f.wgsl
index 4927177..2cec948 100644
--- a/test/tint/builtins/gen/var/tan/a0966f.wgsl
+++ b/test/tint/builtins/gen/var/tan/a0966f.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = tan(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_a0966f();
diff --git a/test/tint/builtins/gen/var/tan/ae26ae.wgsl b/test/tint/builtins/gen/var/tan/ae26ae.wgsl
index a86a149..22689d7 100644
--- a/test/tint/builtins/gen/var/tan/ae26ae.wgsl
+++ b/test/tint/builtins/gen/var/tan/ae26ae.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = tan(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_ae26ae();
diff --git a/test/tint/builtins/gen/var/tan/d4d491.wgsl b/test/tint/builtins/gen/var/tan/d4d491.wgsl
index 4757ac7..485926d 100644
--- a/test/tint/builtins/gen/var/tan/d4d491.wgsl
+++ b/test/tint/builtins/gen/var/tan/d4d491.wgsl
@@ -27,7 +27,9 @@
 fn tan_d4d491() {
   var arg_0 = 1.h;
   var res: f16 = tan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.dxc.hlsl
index 94b1682..f65b701 100644
--- a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_d4d491() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tan(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.fxc.hlsl
index 800f88a..d16807c 100644
--- a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_d4d491() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tan(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.glsl b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.glsl
index 7278b05..e8556c0 100644
--- a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tan_d4d491() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tan_d4d491() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tan_d4d491() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.msl b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.msl
index 93678f9..f63159c 100644
--- a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_d4d491() {
+void tan_d4d491(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = tan(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_d4d491();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  tan_d4d491(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_d4d491();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  tan_d4d491(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_d4d491();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  tan_d4d491(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.spvasm
index d1ce731..8413c6e 100644
--- a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_d4d491 "tan_d4d491"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_d4d491 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+ %tan_d4d491 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Tan %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Tan %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %tan_d4d491
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %tan_d4d491
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tan_d4d491
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tan_d4d491
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %tan_d4d491
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %tan_d4d491
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.wgsl
index d5af5d2..f22d4be 100644
--- a/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tan/d4d491.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn tan_d4d491() {
   var arg_0 = 1.0h;
   var res : f16 = tan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_d4d491();
diff --git a/test/tint/builtins/gen/var/tan/db0456.wgsl b/test/tint/builtins/gen/var/tan/db0456.wgsl
index 8fc579f..583233e 100644
--- a/test/tint/builtins/gen/var/tan/db0456.wgsl
+++ b/test/tint/builtins/gen/var/tan/db0456.wgsl
@@ -27,7 +27,9 @@
 fn tan_db0456() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = tan(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.dxc.hlsl
index ad3a043..678e39d 100644
--- a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_db0456() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tan(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.fxc.hlsl
index 62afb00..433d86f 100644
--- a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tan_db0456() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tan(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.glsl b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.glsl
index afc40d9..4230a2a 100644
--- a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tan_db0456() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tan_db0456() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tan_db0456() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tan(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.msl b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.msl
index f7948b3..3da82ac 100644
--- a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tan_db0456() {
+void tan_db0456(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = tan(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tan_db0456();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  tan_db0456(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tan_db0456();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  tan_db0456(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tan_db0456();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  tan_db0456(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.spvasm
index ce933ec..23bc2af 100644
--- a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tan_db0456 "tan_db0456"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
- %tan_db0456 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Tan %22
-               OpStore %res %20
+ %tan_db0456 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Tan %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %tan_db0456
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %tan_db0456
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %tan_db0456
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %tan_db0456
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %tan_db0456
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %tan_db0456
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.wgsl
index 30e819d..b66d8ed 100644
--- a/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tan/db0456.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn tan_db0456() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = tan(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tan_db0456();
diff --git a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl
index c8175f8..9bd9eee 100644
--- a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl
+++ b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl
@@ -27,7 +27,9 @@
 fn tanh_06a4fe() {
   var arg_0 = vec3<f16>(1.h);
   var res: vec3<f16> = tanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.dxc.hlsl
index b4221ea..6d08c1a 100644
--- a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_06a4fe() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.fxc.hlsl
index 745423a..e59caaf 100644
--- a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_06a4fe() {
   vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
   vector<float16_t, 3> res = tanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.glsl b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.glsl
index 0a8ceb5..8206fe0 100644
--- a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tanh_06a4fe() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tanh_06a4fe() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void tanh_06a4fe() {
   f16vec3 arg_0 = f16vec3(1.0hf);
   f16vec3 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.msl b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.msl
index 7bae70a..80bb572 100644
--- a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_06a4fe() {
+void tanh_06a4fe(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.0h);
   half3 res = tanh(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_06a4fe();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  tanh_06a4fe(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_06a4fe();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  tanh_06a4fe(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_06a4fe();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  tanh_06a4fe(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.spvasm
index aec3954..538ad8d 100644
--- a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_06a4fe "tanh_06a4fe"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_06a4fe = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Tanh %22
-               OpStore %res %20
+%tanh_06a4fe = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Tanh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %tanh_06a4fe
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %tanh_06a4fe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %tanh_06a4fe
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %tanh_06a4fe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %tanh_06a4fe
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %tanh_06a4fe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.wgsl
index 681b24d..5ce2299 100644
--- a/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tanh/06a4fe.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn tanh_06a4fe() {
   var arg_0 = vec3<f16>(1.0h);
   var res : vec3<f16> = tanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_06a4fe();
diff --git a/test/tint/builtins/gen/var/tanh/313aa1.wgsl b/test/tint/builtins/gen/var/tanh/313aa1.wgsl
index 2492207..0e6955c 100644
--- a/test/tint/builtins/gen/var/tanh/313aa1.wgsl
+++ b/test/tint/builtins/gen/var/tanh/313aa1.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.;
   var res = tanh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_313aa1();
diff --git a/test/tint/builtins/gen/var/tanh/5663c5.wgsl b/test/tint/builtins/gen/var/tanh/5663c5.wgsl
index 04c12a7..cd00e66 100644
--- a/test/tint/builtins/gen/var/tanh/5663c5.wgsl
+++ b/test/tint/builtins/gen/var/tanh/5663c5.wgsl
@@ -25,7 +25,9 @@
 fn tanh_5663c5() {
   var arg_0 = vec4<f32>(1.f);
   var res: vec4<f32> = tanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.dxc.hlsl
index 527fc5b..d4da2be 100644
--- a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5663c5() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tanh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.fxc.hlsl
index 527fc5b..d4da2be 100644
--- a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5663c5() {
   float4 arg_0 = (1.0f).xxxx;
   float4 res = tanh(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.glsl b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.glsl
index 715eac6..0fbe966 100644
--- a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tanh_5663c5() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tanh_5663c5() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void tanh_5663c5() {
   vec4 arg_0 = vec4(1.0f);
   vec4 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.msl b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.msl
index 1780f88..3141454 100644
--- a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_5663c5() {
+void tanh_5663c5(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.0f);
   float4 res = tanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_5663c5();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  tanh_5663c5(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_5663c5();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  tanh_5663c5(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_5663c5();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  tanh_5663c5(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.spvasm
index 4afbb8b..5b5bb43 100644
--- a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_5663c5 "tanh_5663c5"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
-%tanh_5663c5 = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
+%tanh_5663c5 = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Tanh %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Tanh %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %tanh_5663c5
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %tanh_5663c5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %tanh_5663c5
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %tanh_5663c5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %tanh_5663c5
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %tanh_5663c5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.wgsl
index 8c91cac..0c6570f 100644
--- a/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tanh/5663c5.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn tanh_5663c5() {
   var arg_0 = vec4<f32>(1.0f);
   var res : vec4<f32> = tanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_5663c5();
diff --git a/test/tint/builtins/gen/var/tanh/5724b3.wgsl b/test/tint/builtins/gen/var/tanh/5724b3.wgsl
index 65217ee..db391bc 100644
--- a/test/tint/builtins/gen/var/tanh/5724b3.wgsl
+++ b/test/tint/builtins/gen/var/tanh/5724b3.wgsl
@@ -25,7 +25,9 @@
 fn tanh_5724b3() {
   var arg_0 = vec2<f32>(1.f);
   var res: vec2<f32> = tanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.dxc.hlsl
index 2b68673..baf1ff4 100644
--- a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5724b3() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tanh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.fxc.hlsl
index 2b68673..baf1ff4 100644
--- a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5724b3() {
   float2 arg_0 = (1.0f).xx;
   float2 res = tanh(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.glsl b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.glsl
index 3eacd11..6f03ff6 100644
--- a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tanh_5724b3() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tanh_5724b3() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void tanh_5724b3() {
   vec2 arg_0 = vec2(1.0f);
   vec2 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.msl b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.msl
index dea0ceb..429b6ca 100644
--- a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_5724b3() {
+void tanh_5724b3(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.0f);
   float2 res = tanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_5724b3();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  tanh_5724b3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_5724b3();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  tanh_5724b3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_5724b3();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  tanh_5724b3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.spvasm
index 0b576dc..7bf774b 100644
--- a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_5724b3 "tanh_5724b3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
-%tanh_5724b3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Tanh %21
-               OpStore %res %19
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
+%tanh_5724b3 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Tanh %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %tanh_5724b3
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %tanh_5724b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tanh_5724b3
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tanh_5724b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %tanh_5724b3
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %tanh_5724b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.wgsl
index e7bea19..3cbb099 100644
--- a/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tanh/5724b3.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn tanh_5724b3() {
   var arg_0 = vec2<f32>(1.0f);
   var res : vec2<f32> = tanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_5724b3();
diff --git a/test/tint/builtins/gen/var/tanh/5b19af.wgsl b/test/tint/builtins/gen/var/tanh/5b19af.wgsl
index 81ae6f2..2c405e7 100644
--- a/test/tint/builtins/gen/var/tanh/5b19af.wgsl
+++ b/test/tint/builtins/gen/var/tanh/5b19af.wgsl
@@ -27,7 +27,9 @@
 fn tanh_5b19af() {
   var arg_0 = 1.h;
   var res: f16 = tanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.dxc.hlsl
index 0c02a94..db4682d 100644
--- a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5b19af() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tanh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.fxc.hlsl
index d73254e..5954aef 100644
--- a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_5b19af() {
   float16_t arg_0 = float16_t(1.0h);
   float16_t res = tanh(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.glsl b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.glsl
index 7dc44cd..0a05875 100644
--- a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tanh_5b19af() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tanh_5b19af() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void tanh_5b19af() {
   float16_t arg_0 = 1.0hf;
   float16_t res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.msl b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.msl
index d0920ac..2a6f5d1 100644
--- a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_5b19af() {
+void tanh_5b19af(device half* const tint_symbol_1) {
   half arg_0 = 1.0h;
   half res = tanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_5b19af();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  tanh_5b19af(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_5b19af();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  tanh_5b19af(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_5b19af();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  tanh_5b19af(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.spvasm
index 877e896..e8e763b 100644
--- a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_5b19af "tanh_5b19af"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_5b19af = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%tanh_5b19af = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Tanh %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Tanh %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %tanh_5b19af
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %tanh_5b19af
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tanh_5b19af
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tanh_5b19af
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %tanh_5b19af
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %tanh_5b19af
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.wgsl
index d5f3357..6cc053e 100644
--- a/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tanh/5b19af.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn tanh_5b19af() {
   var arg_0 = 1.0h;
   var res : f16 = tanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_5b19af();
diff --git a/test/tint/builtins/gen/var/tanh/6289fd.wgsl b/test/tint/builtins/gen/var/tanh/6289fd.wgsl
index 95f7e87..a72010a 100644
--- a/test/tint/builtins/gen/var/tanh/6289fd.wgsl
+++ b/test/tint/builtins/gen/var/tanh/6289fd.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.);
   var res = tanh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_6289fd();
diff --git a/test/tint/builtins/gen/var/tanh/6d105a.wgsl b/test/tint/builtins/gen/var/tanh/6d105a.wgsl
index b60f515..f5d9585 100644
--- a/test/tint/builtins/gen/var/tanh/6d105a.wgsl
+++ b/test/tint/builtins/gen/var/tanh/6d105a.wgsl
@@ -27,7 +27,9 @@
 fn tanh_6d105a() {
   var arg_0 = vec2<f16>(1.h);
   var res: vec2<f16> = tanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.dxc.hlsl
index 803f340..28dcae0 100644
--- a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_6d105a() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.fxc.hlsl
index 6911b65..066d402 100644
--- a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_6d105a() {
   vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
   vector<float16_t, 2> res = tanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.glsl b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.glsl
index e0ae1ca..8515933 100644
--- a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tanh_6d105a() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tanh_6d105a() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void tanh_6d105a() {
   f16vec2 arg_0 = f16vec2(1.0hf);
   f16vec2 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.msl b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.msl
index 0bd7275..6d2e884 100644
--- a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_6d105a() {
+void tanh_6d105a(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.0h);
   half2 res = tanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_6d105a();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  tanh_6d105a(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_6d105a();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  tanh_6d105a(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_6d105a();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  tanh_6d105a(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.spvasm
index f2528b2..a1a6aa2 100644
--- a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_6d105a "tanh_6d105a"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_6d105a = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Tanh %22
-               OpStore %res %20
+%tanh_6d105a = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Tanh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %tanh_6d105a
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %tanh_6d105a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %tanh_6d105a
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %tanh_6d105a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %tanh_6d105a
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %tanh_6d105a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.wgsl
index 7d07976..b1be386 100644
--- a/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tanh/6d105a.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn tanh_6d105a() {
   var arg_0 = vec2<f16>(1.0h);
   var res : vec2<f16> = tanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_6d105a();
diff --git a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl
index cd782f0..405f6b6 100644
--- a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl
+++ b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl
@@ -25,7 +25,9 @@
 fn tanh_9f9fb9() {
   var arg_0 = vec3<f32>(1.f);
   var res: vec3<f32> = tanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.dxc.hlsl
index 7af3f44..d467c0a 100644
--- a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_9f9fb9() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tanh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.fxc.hlsl
index 7af3f44..d467c0a 100644
--- a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_9f9fb9() {
   float3 arg_0 = (1.0f).xxx;
   float3 res = tanh(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.glsl b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.glsl
index 48c56e8..0a4fc08 100644
--- a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tanh_9f9fb9() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tanh_9f9fb9() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void tanh_9f9fb9() {
   vec3 arg_0 = vec3(1.0f);
   vec3 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.msl b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.msl
index abecf13..4c36a42 100644
--- a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_9f9fb9() {
+void tanh_9f9fb9(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.0f);
   float3 res = tanh(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_9f9fb9();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  tanh_9f9fb9(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_9f9fb9();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  tanh_9f9fb9(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_9f9fb9();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  tanh_9f9fb9(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.spvasm
index 007cba6..ba5baa2 100644
--- a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_9f9fb9 "tanh_9f9fb9"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,43 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
-%tanh_9f9fb9 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Tanh %21
-               OpStore %res %19
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
+%tanh_9f9fb9 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Tanh %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %tanh_9f9fb9
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %tanh_9f9fb9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tanh_9f9fb9
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tanh_9f9fb9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %tanh_9f9fb9
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %tanh_9f9fb9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.wgsl
index b32a672..34d1b3a 100644
--- a/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tanh/9f9fb9.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn tanh_9f9fb9() {
   var arg_0 = vec3<f32>(1.0f);
   var res : vec3<f32> = tanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_9f9fb9();
diff --git a/test/tint/builtins/gen/var/tanh/ac5d33.wgsl b/test/tint/builtins/gen/var/tanh/ac5d33.wgsl
index 972b2a1..35ce14e 100644
--- a/test/tint/builtins/gen/var/tanh/ac5d33.wgsl
+++ b/test/tint/builtins/gen/var/tanh/ac5d33.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.);
   var res = tanh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_ac5d33();
diff --git a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl
index 1353ca0..a96bce2 100644
--- a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl
+++ b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl
@@ -25,7 +25,9 @@
 fn tanh_c15fdb() {
   var arg_0 = 1.f;
   var res: f32 = tanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.dxc.hlsl
index 38d4981..6071d52 100644
--- a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_c15fdb() {
   float arg_0 = 1.0f;
   float res = tanh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.fxc.hlsl
index 38d4981..6071d52 100644
--- a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_c15fdb() {
   float arg_0 = 1.0f;
   float res = tanh(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.glsl b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.glsl
index 5682daf..3dfd7f1 100644
--- a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tanh_c15fdb() {
   float arg_0 = 1.0f;
   float res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tanh_c15fdb() {
   float arg_0 = 1.0f;
   float res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void tanh_c15fdb() {
   float arg_0 = 1.0f;
   float res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.msl b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.msl
index 81b4924..eac182d 100644
--- a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_c15fdb() {
+void tanh_c15fdb(device float* const tint_symbol_1) {
   float arg_0 = 1.0f;
   float res = tanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_c15fdb();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  tanh_c15fdb(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_c15fdb();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  tanh_c15fdb(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_c15fdb();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  tanh_c15fdb(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.spvasm
index 8722def..09ed1a5 100644
--- a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_c15fdb "tanh_c15fdb"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,40 +37,49 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
-%tanh_c15fdb = OpFunction %void None %9
-         %12 = OpLabel
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
+%tanh_c15fdb = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Tanh %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Tanh %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %tanh_c15fdb
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %tanh_c15fdb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %tanh_c15fdb
+%fragment_main = OpFunction %void None %12
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %tanh_c15fdb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %tanh_c15fdb
+%compute_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %tanh_c15fdb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.wgsl
index 6f0f550..73ed023 100644
--- a/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tanh/c15fdb.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn tanh_c15fdb() {
   var arg_0 = 1.0f;
   var res : f32 = tanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_c15fdb();
diff --git a/test/tint/builtins/gen/var/tanh/c48aa6.wgsl b/test/tint/builtins/gen/var/tanh/c48aa6.wgsl
index f189900..336e6ac 100644
--- a/test/tint/builtins/gen/var/tanh/c48aa6.wgsl
+++ b/test/tint/builtins/gen/var/tanh/c48aa6.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.);
   var res = tanh(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_c48aa6();
diff --git a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl
index a5ea176..867d804 100644
--- a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl
+++ b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl
@@ -27,7 +27,9 @@
 fn tanh_e8efb3() {
   var arg_0 = vec4<f16>(1.h);
   var res: vec4<f16> = tanh(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.dxc.hlsl
index 918a032..a06fe9f 100644
--- a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_e8efb3() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.fxc.hlsl
index dfe275a..e82e88b 100644
--- a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void tanh_e8efb3() {
   vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
   vector<float16_t, 4> res = tanh(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.glsl b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.glsl
index 1d317cc..d0dea5a 100644
--- a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tanh_e8efb3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tanh_e8efb3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void tanh_e8efb3() {
   f16vec4 arg_0 = f16vec4(1.0hf);
   f16vec4 res = tanh(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.msl b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.msl
index 19df615..b2870eb 100644
--- a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void tanh_e8efb3() {
+void tanh_e8efb3(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.0h);
   half4 res = tanh(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  tanh_e8efb3();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  tanh_e8efb3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  tanh_e8efb3();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  tanh_e8efb3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  tanh_e8efb3();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  tanh_e8efb3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.spvasm
index 4c6cb47..753bc25 100644
--- a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tanh_e8efb3 "tanh_e8efb3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %19 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%tanh_e8efb3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Tanh %22
-               OpStore %res %20
+%tanh_e8efb3 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Tanh %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %tanh_e8efb3
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %tanh_e8efb3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %tanh_e8efb3
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %tanh_e8efb3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %tanh_e8efb3
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %tanh_e8efb3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.wgsl
index 194fd5c..b12a394 100644
--- a/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/tanh/e8efb3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn tanh_e8efb3() {
   var arg_0 = vec4<f16>(1.0h);
   var res : vec4<f16> = tanh(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   tanh_e8efb3();
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl
index 2079209..17ede45 100644
--- a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_multisampled_2d<i32>) -> vec2<u32>
 fn textureDimensions_00348c() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.dxc.hlsl
index e613aa1..855ccf0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_00348c() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.fxc.hlsl
index e613aa1..855ccf0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_00348c() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.glsl
index dd2e0ef..7860031 100644
--- a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_00348c() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_00348c() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_00348c() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.msl
index cf3f493..a1204f5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_00348c(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureDimensions_00348c(texture2d_ms<int, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureDimensions_00348c(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_00348c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_00348c(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_00348c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_00348c(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_00348c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.spvasm
index 5045f2d..6a14db2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_00348c "textureDimensions_00348c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_00348c = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_00348c = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_00348c
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_00348c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_00348c
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_00348c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_00348c
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_00348c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.wgsl
index 17daeec..7ec345a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_00348c() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_00348c();
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl
index 1f251f3..e4a50c2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_022903() {
   var arg_1 = 1u;
   var res: u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.dxc.hlsl
index bd4bed3..9bc59ed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_022903() {
   uint arg_1 = 1u;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.fxc.hlsl
index bd4bed3..9bc59ed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_022903() {
   uint arg_1 = 1u;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.glsl
index e077da8..06d5925 100644
--- a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_022903() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_022903() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_022903() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.msl
index e5800b7..bcb14cd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_022903(texture1d<int, access::sample> tint_symbol_1) {
+void textureDimensions_022903(texture1d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureDimensions_022903(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_022903(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_022903(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_022903(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_022903(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_022903(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.spvasm
index 3cf4046..bae6a93 100644
--- a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_022903 "textureDimensions_022903"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,44 +45,52 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_022903 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %21
-        %res = OpVariable %_ptr_Function_uint Function %21
+%textureDimensions_022903 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_uint Function %24
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %22 = OpImageQuerySizeLod %uint %23 %24
-               OpStore %res %22
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %uint %26 %27
+               OpStore %res %25
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_022903
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_022903
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_022903
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_022903
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_022903
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_022903
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.wgsl
index d3eea65..6e4a7b7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_022903() {
   var arg_1 = 1u;
   var res : u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_022903();
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl
index 15aa62d..e680438 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_0890c6() {
   var arg_1 = 1u;
   var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
index deb887d..ad723b3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0890c6() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
index deb887d..ad723b3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0890c6() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.glsl
index 7b2d34c..ff3b2bf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_0890c6() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_0890c6() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_0890c6() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.msl
index 15b653c..f655a1a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_0890c6(texture3d<float, access::sample> tint_symbol_1) {
+void textureDimensions_0890c6(texture3d<float, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureDimensions_0890c6(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_0890c6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_0890c6(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_0890c6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_0890c6(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_0890c6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.spvasm
index 1d35261..9aee0f6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_0890c6 "textureDimensions_0890c6"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,47 +43,55 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v3uint = OpTypeVector %uint 3
+         %24 = OpConstantNull %uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %27 = OpConstantNull %v3uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_0890c6 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v3uint Function %27
+%textureDimensions_0890c6 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v3uint Function %30
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %v3uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %v3uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %34 = OpLoad %v3uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_0890c6
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_0890c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_0890c6
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_0890c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_0890c6
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_0890c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.wgsl
index 1f688e5..52814c2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_0890c6() {
   var arg_1 = 1u;
   var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_0890c6();
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl
index 6a49738..6458d84 100644
--- a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba32uint, write>) -> u32
 fn textureDimensions_09140b() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.dxc.hlsl
index f718b0a..952acac 100644
--- a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_09140b() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.fxc.hlsl
index f718b0a..952acac 100644
--- a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_09140b() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.glsl
index 24162f1..824dfcf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_09140b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_09140b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_09140b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.msl
index 5294978..5811c2f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_09140b(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_09140b(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_09140b(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_09140b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_09140b(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_09140b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_09140b(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_09140b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.spvasm
index f5cdeef..1db4e59 100644
--- a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_09140b "textureDimensions_09140b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,39 +45,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_09140b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_09140b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_09140b
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_09140b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_09140b
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_09140b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_09140b
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_09140b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.wgsl
index a07543a..19513a6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_09140b() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_09140b();
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl
index c3117f5..4c8cb77 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<r32float, write>) -> vec2<u32>
 fn textureDimensions_0baa0d() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
index b1a4736..3348dc8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0baa0d() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
index b1a4736..3348dc8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0baa0d() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.glsl
index 52bbc21..2586d8f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_0baa0d() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_0baa0d() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_0baa0d() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.msl
index 3776c05..165cb68 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_0baa0d(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_0baa0d(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_0baa0d(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_0baa0d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_0baa0d(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_0baa0d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_0baa0d(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_0baa0d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.spvasm
index f1c67a7..2dee716 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_0baa0d "textureDimensions_0baa0d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_0baa0d = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_0baa0d = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_0baa0d
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_0baa0d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_0baa0d
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_0baa0d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_0baa0d
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_0baa0d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.wgsl
index 8099e09..35d4e6e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_0baa0d() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_0baa0d();
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl
index 79bc102..52c419e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba16float, write>) -> u32
 fn textureDimensions_0c0b0c() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
index 5fb29dc..5782c8b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0c0b0c() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
index 5fb29dc..5782c8b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0c0b0c() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.glsl
index 21af8e8..5dc6e8a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_0c0b0c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_0c0b0c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_0c0b0c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.msl
index c100b1a..51203b8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_0c0b0c(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_0c0b0c(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_0c0b0c(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_0c0b0c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_0c0b0c(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_0c0b0c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_0c0b0c(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_0c0b0c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.spvasm
index 8ae986f..2a0cc16 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_0c0b0c "textureDimensions_0c0b0c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_0c0b0c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_0c0b0c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_0c0b0c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_0c0b0c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_0c0b0c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_0c0b0c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_0c0b0c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_0c0b0c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.wgsl
index c7aab96..2849ca8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_0c0b0c() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_0c0b0c();
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl
index f71346b..8893ac1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_0ff9a4() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
index 881ba99..accd6f5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0ff9a4() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
index 881ba99..accd6f5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_0ff9a4() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.msl
index 6243b2c..5f57612 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_0ff9a4(depthcube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_0ff9a4(depthcube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_0ff9a4(tint_symbol_2);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_0ff9a4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_0ff9a4(tint_symbol_4);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_0ff9a4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_0ff9a4(tint_symbol_5);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_0ff9a4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.spvasm
index 4a1c262..535ebcd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_0ff9a4 "textureDimensions_0ff9a4"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,50 +44,58 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_0ff9a4 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_0ff9a4 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %int_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %int %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %21 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %21
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %int %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_0ff9a4
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_0ff9a4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_0ff9a4
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_0ff9a4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_0ff9a4
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_0ff9a4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.wgsl
index c498d6f..b2098ae 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_0ff9a4() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_0ff9a4();
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl
index 50628d4..e0ee950 100644
--- a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_13f8db() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
index 78cf28b..97d1d35 100644
--- a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_13f8db() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
index 78cf28b..97d1d35 100644
--- a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_13f8db() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.glsl
index 3bb1ca9..25d147f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_13f8db() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_13f8db() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_13f8db() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.msl
index 7461b5d..730c597 100644
--- a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_13f8db(texture2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_13f8db(texture2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_13f8db(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_13f8db(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_13f8db(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_13f8db(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_13f8db(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_13f8db(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.spvasm
index 6fae136..f0d0db8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_13f8db "textureDimensions_13f8db"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,47 +43,55 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %27 = OpConstantNull %v2uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_13f8db = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %27
+%textureDimensions_13f8db = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %30
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %v2uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %34 = OpLoad %v2uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_13f8db
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_13f8db
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_13f8db
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_13f8db
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_13f8db
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_13f8db
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.wgsl
index ef17fed..44663ef 100644
--- a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_13f8db() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_13f8db();
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl
index baeaac6..eeddc11 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba16sint, write>) -> vec2<u32>
 fn textureDimensions_1417dd() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
index 9b7349f..dfe4130 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1417dd() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
index 9b7349f..dfe4130 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1417dd() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.glsl
index 6b2d3bb..7b85b79 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1417dd() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1417dd() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1417dd() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.msl
index 297b49a..8300973 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_1417dd(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_1417dd(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_1417dd(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_1417dd(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_1417dd(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_1417dd(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_1417dd(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_1417dd(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.spvasm
index c7a3eae..f7a2035 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_1417dd "textureDimensions_1417dd"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_1417dd = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_1417dd = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_1417dd
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_1417dd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_1417dd
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_1417dd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_1417dd
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_1417dd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.wgsl
index 430451d..d4cc637 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_1417dd() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_1417dd();
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl
index 953249a..49fd55f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba32sint, write>) -> vec3<u32>
 fn textureDimensions_15aa17() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
index 06e4e9c..1dacd60 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_15aa17() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
index 06e4e9c..1dacd60 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_15aa17() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.glsl
index da990e4..fbaf29e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_15aa17() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_15aa17() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_15aa17() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.msl
index 147cf4e..48288f6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_15aa17(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_15aa17(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_15aa17(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_15aa17(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_15aa17(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_15aa17(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_15aa17(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_15aa17(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.spvasm
index 4201163..94c7bd8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_15aa17 "textureDimensions_15aa17"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_15aa17 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_15aa17 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_15aa17
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_15aa17
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_15aa17
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_15aa17
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_15aa17
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_15aa17
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.wgsl
index 2f28d1f..151d25a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_15aa17() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_15aa17();
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl
index ff23987..486d183 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_15b577() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.dxc.hlsl
index 5e54511..10c6641 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_15b577() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.fxc.hlsl
index 5e54511..10c6641 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_15b577() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.glsl
index 722528e..09db9e2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_15b577() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_15b577() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_15b577() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.msl
index 5c6a682..4fbfe78 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_15b577(texture2d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_15b577(texture2d<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_15b577(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_15b577(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_15b577(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_15b577(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_15b577(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_15b577(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.spvasm
index cd48eb4..dfcfd7d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_15b577 "textureDimensions_15b577"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %21 = OpConstantNull %int
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_15b577 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %21
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_15b577 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %22 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %22
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_15b577
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_15b577
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_15b577
+%fragment_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_15b577
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_15b577
+%compute_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_15b577
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.wgsl
index 3e9cf65..c0263e4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_15b577() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_15b577();
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl
index 88a2b21..8da75d6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<i32>) -> vec3<u32>
 fn textureDimensions_1a2be7() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
index 091179b..da22afe 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1a2be7() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
index 091179b..da22afe 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1a2be7() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.glsl
index 70c2d4c..62f0f66 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1a2be7() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1a2be7() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1a2be7() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.msl
index 94c6aef..15b42d5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_1a2be7(texture3d<int, access::sample> tint_symbol_1) {
+void textureDimensions_1a2be7(texture3d<int, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureDimensions_1a2be7(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_1a2be7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_1a2be7(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_1a2be7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_1a2be7(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_1a2be7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.spvasm
index 4c04ebf..a973947 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_1a2be7 "textureDimensions_1a2be7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_0 = OpConstant %int 0
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_1a2be7 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v3uint %20 %int_0
-               OpStore %res %17
+%textureDimensions_1a2be7 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %23 %int_0
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_1a2be7
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_1a2be7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_1a2be7
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_1a2be7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_1a2be7
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_1a2be7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.wgsl
index 6a5396a..0121d1e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_1a2be7() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_1a2be7();
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl
index 1423248..10ab7df 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_1bc428() {
   var arg_1 = 1i;
   var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
index 8301d00..2bac266 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1bc428() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
index 8301d00..2bac266 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1bc428() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.glsl
index 3dc4989..1c6b7ea 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1bc428() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1bc428() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_1bc428() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.msl
index f9ca8a3..3fd33c1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_1bc428(texture3d<float, access::sample> tint_symbol_1) {
+void textureDimensions_1bc428(texture3d<float, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   int arg_1 = 1;
   uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureDimensions_1bc428(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_1bc428(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_1bc428(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_1bc428(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_1bc428(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_1bc428(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.spvasm
index df2e7fa..a0866ed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_1bc428 "textureDimensions_1bc428"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,48 +43,56 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v3uint = OpTypeVector %uint 3
+         %25 = OpConstantNull %int
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %28 = OpConstantNull %v3uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_1bc428 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v3uint Function %28
+%textureDimensions_1bc428 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v3uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %v3uint %24 %25
-               OpStore %res %21
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %35 = OpLoad %v3uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_1bc428
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_1bc428
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_1bc428
+%fragment_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_1bc428
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_1bc428
+%compute_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_1bc428
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.wgsl
index 2d75990..ed27abb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_1bc428() {
   var arg_1 = 1i;
   var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_1bc428();
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl
index 270b5ed..2b87244 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_1bd78c() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
index f2e60a2..ce09a3b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1bd78c() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
index f2e60a2..ce09a3b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_1bd78c() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.glsl
index d87d5a6..b53e0dc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1bd78c() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1bd78c() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_1bd78c() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.msl
index e5ac9c2..fac9be9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_1bd78c(texture2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_1bd78c(texture2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_1bd78c(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_1bd78c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_1bd78c(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_1bd78c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_1bd78c(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_1bd78c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.spvasm
index ad4808e4..51953b5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_1bd78c "textureDimensions_1bd78c"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,48 +43,56 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_1bd78c = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_1bd78c = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %21
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_1bd78c
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_1bd78c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_1bd78c
+%fragment_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_1bd78c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_1bd78c
+%compute_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_1bd78c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.wgsl
index 5d9ef3f..4379939 100644
--- a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_1bd78c() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_1bd78c();
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl
index 95d6010..40a18c3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba8unorm, write>) -> vec2<u32>
 fn textureDimensions_224113() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.dxc.hlsl
index 2af1026..09dda04 100644
--- a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_224113() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.fxc.hlsl
index 2af1026..09dda04 100644
--- a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_224113() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.glsl
index 569cec5..ba31e75 100644
--- a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_224113() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_224113() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_224113() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.msl
index a0f1191..494fc83 100644
--- a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_224113(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_224113(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_224113(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_224113(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_224113(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_224113(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_224113(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_224113(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.spvasm
index b9d1190..abe175b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_224113 "textureDimensions_224113"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_224113 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_224113 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_224113
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_224113
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_224113
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_224113
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_224113
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_224113
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.wgsl
index c16b613..a9ae5c4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_224113() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_224113();
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl
index 3ee8952..f8adbd1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_22b5b6() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
index e02e262..751cce3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_22b5b6() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
index e02e262..751cce3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_22b5b6() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.msl
index 38bf28d..af33532 100644
--- a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_22b5b6(texturecube_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_22b5b6(texturecube_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_22b5b6(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_22b5b6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_22b5b6(tint_symbol_4);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_22b5b6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_22b5b6(tint_symbol_5);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_22b5b6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.spvasm
index dcffbd9..964f061 100644
--- a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_22b5b6 "textureDimensions_22b5b6"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,49 +45,57 @@
          %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %21 = OpConstantNull %int
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_22b5b6 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %21
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_22b5b6 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %int_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %int %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %22 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %22
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %int %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_22b5b6
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_22b5b6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_22b5b6
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_22b5b6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_22b5b6
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_22b5b6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.wgsl
index 268acda..30b9dd5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_22b5b6() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_22b5b6();
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl
index feef6f2..618860b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<f32>) -> vec2<u32>
 fn textureDimensions_24db07() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.dxc.hlsl
index d27a502..3c7a779 100644
--- a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_24db07() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.fxc.hlsl
index d27a502..3c7a779 100644
--- a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_24db07() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.glsl
index b48ef53..ffc3690 100644
--- a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_24db07() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_24db07() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_24db07() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.msl
index 1575e42..7e2ded5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_24db07(texture2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_24db07(texture2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_24db07(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_24db07(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_24db07(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_24db07(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_24db07(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_24db07(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.spvasm
index 855ef0b..163ff10 100644
--- a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_24db07 "textureDimensions_24db07"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_24db07 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_24db07 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_24db07
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_24db07
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_24db07
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_24db07
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_24db07
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_24db07
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.wgsl
index 28f4077..9e72532 100644
--- a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_24db07() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_24db07();
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl
index 95cac6e..72f0927 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rg32uint, write>) -> vec2<u32>
 fn textureDimensions_2674d8() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
index b619638..936d0d1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2674d8() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
index b619638..936d0d1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2674d8() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.msl
index b367114..18ce3d7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_2674d8(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_2674d8(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_2674d8(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_2674d8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_2674d8(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_2674d8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_2674d8(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_2674d8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.spvasm
index 3b8b2fe..1cb5bed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_2674d8 "textureDimensions_2674d8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,42 +45,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_2674d8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_2674d8 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_2674d8
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_2674d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_2674d8
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_2674d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_2674d8
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_2674d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.wgsl
index 2ece5a6..01373b9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_2674d8() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_2674d8();
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl
index 56b19de..46df95b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<f32>) -> u32
 fn textureDimensions_26d6bf() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
index 3de8d27..8786629 100644
--- a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_26d6bf() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
index 3de8d27..8786629 100644
--- a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_26d6bf() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.glsl
index fe3f7ba..d1c34e3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_26d6bf() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_26d6bf() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_26d6bf() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.msl
index d8130b4..e77f8e6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_26d6bf(texture1d<float, access::sample> tint_symbol_1) {
+void textureDimensions_26d6bf(texture1d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureDimensions_26d6bf(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_26d6bf(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_26d6bf(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_26d6bf(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_26d6bf(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_26d6bf(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.spvasm
index 47116b8..a6909e8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_26d6bf "textureDimensions_26d6bf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_26d6bf = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %uint %18 %int_0
-               OpStore %res %16
+%textureDimensions_26d6bf = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySizeLod %uint %21 %int_0
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_26d6bf
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_26d6bf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_26d6bf
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_26d6bf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_26d6bf
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_26d6bf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.wgsl
index ba2a96a..7711feb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_26d6bf() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_26d6bf();
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl
index 2cbe988..32caad7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_2e443d() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
index 4df28d4..0df721b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2e443d() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
index 4df28d4..0df721b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2e443d() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.glsl
index aee294a..4991234 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2e443d() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2e443d() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2e443d() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.msl
index 9753cf2..9c5e562 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_2e443d(texture2d<int, access::sample> tint_symbol_1) {
+void textureDimensions_2e443d(texture2d<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureDimensions_2e443d(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_2e443d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_2e443d(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_2e443d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_2e443d(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_2e443d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.spvasm
index 4e4329f..c0566e5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_2e443d "textureDimensions_2e443d"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
-      %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
+      %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+         %25 = OpConstantNull %int
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_2e443d = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_2e443d = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %21
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_2e443d
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_2e443d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_2e443d
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_2e443d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_2e443d
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_2e443d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.wgsl
index 2ed54c0..a714fb7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_2e443d() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_2e443d();
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl
index 8da5c10..a3a78d7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_2fd2a4() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
index f5e25dd..d21d84e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2fd2a4() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
index f5e25dd..d21d84e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_2fd2a4() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.glsl
index d87ced8..43f669a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2fd2a4() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2fd2a4() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_2fd2a4() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.msl
index e088176..7b39587 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_2fd2a4(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_2fd2a4(texture2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_2fd2a4(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_2fd2a4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_2fd2a4(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_2fd2a4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_2fd2a4(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_2fd2a4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.spvasm
index 75d5e5e..1357b3d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_2fd2a4 "textureDimensions_2fd2a4"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,50 +43,58 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_2fd2a4 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_2fd2a4 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %int_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %int %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %21 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %21
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %int %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_2fd2a4
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_2fd2a4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_2fd2a4
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_2fd2a4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_2fd2a4
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_2fd2a4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.wgsl
index 3935303..dcb3f65 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_2fd2a4() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_2fd2a4();
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl
index ac10c7f..393d422 100644
--- a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<r32uint, write>) -> vec3<u32>
 fn textureDimensions_31799c() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.dxc.hlsl
index 35f842f..e3e5922 100644
--- a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_31799c() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.fxc.hlsl
index 35f842f..e3e5922 100644
--- a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_31799c() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.glsl
index f9e44f9..5a96619 100644
--- a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_31799c() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_31799c() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_31799c() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.msl
index 2636a9f..25b88c9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_31799c(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_31799c(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_31799c(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_31799c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_31799c(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_31799c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_31799c(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_31799c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.spvasm
index 95189a1..186b288 100644
--- a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_31799c "textureDimensions_31799c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_31799c = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_31799c = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_31799c
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_31799c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_31799c
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_31799c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_31799c
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_31799c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.wgsl
index 9fdcfa9..5c8505b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_31799c() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_31799c();
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl
index b13043f..3571fc5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_346fee() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.dxc.hlsl
index 6bf97f1..e7f767c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_346fee() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.fxc.hlsl
index 6bf97f1..e7f767c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_346fee() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.msl
index 52f884c..c46c34b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_346fee(texturecube_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_346fee(texturecube_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_346fee(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_346fee(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_346fee(tint_symbol_4);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_346fee(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_346fee(tint_symbol_5);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_346fee(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.spvasm
index 76366c5..0afbf3a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_346fee "textureDimensions_346fee"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,48 +45,56 @@
          %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %29 = OpConstantNull %v2uint
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_346fee = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %29
+%textureDimensions_346fee = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %32
                OpStore %arg_1 %uint_1
-         %25 = OpLoad %11 %arg_0
-         %26 = OpLoad %uint %arg_1
-         %23 = OpImageQuerySizeLod %v3uint %25 %26
-         %21 = OpVectorShuffle %v2uint %23 %23 0 1
-               OpStore %res %21
+         %28 = OpLoad %11 %arg_0
+         %29 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %28 %29
+         %25 = OpVectorShuffle %v2uint %26 %26 0 1
+               OpStore %res %25
+         %35 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %36 = OpLoad %v2uint %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_346fee
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_346fee
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_346fee
+%fragment_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_346fee
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureDimensions_346fee
+%compute_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureDimensions_346fee
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.wgsl
index 49d81d1..f02e3e0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_346fee() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_346fee();
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl
index 23512e5..0220042 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba16uint, write>) -> vec3<u32>
 fn textureDimensions_35a7e5() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
index 89ff223..605aec4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_35a7e5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
index 89ff223..605aec4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_35a7e5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.glsl
index 02d2d30..dbbeaeef 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_35a7e5() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_35a7e5() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_35a7e5() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.msl
index 5e7177a..5b89c7d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_35a7e5(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_35a7e5(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_35a7e5(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_35a7e5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_35a7e5(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_35a7e5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_35a7e5(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_35a7e5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.spvasm
index 9c6fd1b..6eebebf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_35a7e5 "textureDimensions_35a7e5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_35a7e5 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_35a7e5 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_35a7e5
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_35a7e5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_35a7e5
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_35a7e5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_35a7e5
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_35a7e5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.wgsl
index bea8f76..c0733f8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_35a7e5() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_35a7e5();
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl
index b63e75f..1b79473 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rg32uint, write>) -> vec3<u32>
 fn textureDimensions_35ee69() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
index 9880c32..60a836b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_35ee69() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
index 9880c32..60a836b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_35ee69() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.msl
index de21a7c..14b224f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_35ee69(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_35ee69(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_35ee69(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_35ee69(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_35ee69(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_35ee69(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_35ee69(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_35ee69(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.spvasm
index 492a8e3..8fbfc75 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_35ee69 "textureDimensions_35ee69"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_35ee69 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_35ee69 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_35ee69
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_35ee69
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_35ee69
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_35ee69
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_35ee69
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_35ee69
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.wgsl
index 3a1050d..1734c8e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_35ee69() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_35ee69();
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl
index b0ce2cc..fc40cdf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba8sint, write>) -> vec2<u32>
 fn textureDimensions_378a65() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.dxc.hlsl
index 1782677..ae34c64 100644
--- a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_378a65() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.fxc.hlsl
index 1782677..ae34c64 100644
--- a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_378a65() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.glsl
index 54d2060..443adeb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_378a65() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_378a65() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_378a65() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.msl
index 8db7c6e..850ec83 100644
--- a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_378a65(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_378a65(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_378a65(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_378a65(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_378a65(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_378a65(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_378a65(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_378a65(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.spvasm
index e2429ce..f302b75 100644
--- a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_378a65 "textureDimensions_378a65"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_378a65 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_378a65 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_378a65
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_378a65
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_378a65
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_378a65
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_378a65
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_378a65
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.wgsl
index 0400b2f..b40dee3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_378a65() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_378a65();
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl
index 099c025..6c18115 100644
--- a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_382b16() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.dxc.hlsl
index 08a087b..b83ff30 100644
--- a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_382b16() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.fxc.hlsl
index 08a087b..b83ff30 100644
--- a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_382b16() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.glsl
index 9141112..e6cf729 100644
--- a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_382b16() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_382b16() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_382b16() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.msl
index 117e519..9e677b9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_382b16(texturecube<float, access::sample> tint_symbol_1) {
+void textureDimensions_382b16(texturecube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
-  textureDimensions_382b16(tint_symbol_2);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_382b16(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_382b16(tint_symbol_4);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_382b16(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_382b16(tint_symbol_5);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_382b16(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.spvasm
index 7029638..170c6f6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_382b16 "textureDimensions_382b16"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,47 +43,55 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %27 = OpConstantNull %v2uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_382b16 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %27
+%textureDimensions_382b16 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %30
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %v2uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %34 = OpLoad %v2uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_382b16
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_382b16
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_382b16
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_382b16
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_382b16
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_382b16
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.wgsl
index 85183e0..1f7d94d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_382b16() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_382b16();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl
index 2e817b8..da3fd43 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_3963d0() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
index 68a795a..fe36ee8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3963d0() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
index 68a795a..fe36ee8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3963d0() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.msl
index 297bcf7..9c215a5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3963d0(texturecube_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_3963d0(texturecube_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_3963d0(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3963d0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3963d0(tint_symbol_4);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3963d0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3963d0(tint_symbol_5);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3963d0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.spvasm
index 2c7c7e5..1e0086f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3963d0 "textureDimensions_3963d0"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,49 +45,57 @@
          %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3963d0 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %21
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_3963d0 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %uint_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %uint %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %22 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %22
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %uint %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_3963d0
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_3963d0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_3963d0
+%fragment_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_3963d0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_3963d0
+%compute_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_3963d0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.wgsl
index 7fd6e98..e2c25a7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_3963d0() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3963d0();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl
index 941dd1f..aa8f816 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba32float, write>) -> vec3<u32>
 fn textureDimensions_3a5bb1() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
index 634df9f..9c61cb5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3a5bb1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
index 634df9f..9c61cb5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3a5bb1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.glsl
index ca53343..2ee9f6d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_3a5bb1() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_3a5bb1() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_3a5bb1() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.msl
index 0b128b7..cf5d00a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3a5bb1(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_3a5bb1(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_3a5bb1(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_3a5bb1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3a5bb1(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3a5bb1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3a5bb1(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3a5bb1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.spvasm
index c804df1..bc431a6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3a5bb1 "textureDimensions_3a5bb1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3a5bb1 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_3a5bb1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_3a5bb1
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_3a5bb1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_3a5bb1
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_3a5bb1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_3a5bb1
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_3a5bb1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.wgsl
index 16c8913..0542029 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3a5bb1() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3a5bb1();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl
index ad105d4..876943d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba8unorm, write>) -> vec2<u32>
 fn textureDimensions_3a7b69() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
index c967a1f..f0d9399 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3a7b69() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
index c967a1f..f0d9399 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3a7b69() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.glsl
index b9b2a19..6137b7c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3a7b69() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3a7b69() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3a7b69() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.msl
index 113dca5..952bf08 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3a7b69(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_3a7b69(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_3a7b69(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3a7b69(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3a7b69(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3a7b69(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3a7b69(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3a7b69(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.spvasm
index 8dbeda7..ae8c17a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3a7b69 "textureDimensions_3a7b69"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3a7b69 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_3a7b69 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_3a7b69
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_3a7b69
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_3a7b69
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_3a7b69
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_3a7b69
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_3a7b69
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.wgsl
index 7267529..1f59f9f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3a7b69() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3a7b69();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl
index 3b115bd..c999d1b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba8unorm, write>) -> u32
 fn textureDimensions_3af3e7() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
index fd65762..07dc5bf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3af3e7() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
index fd65762..07dc5bf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3af3e7() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.glsl
index 5d059f4..c77a899 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_3af3e7() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_3af3e7() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_3af3e7() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.msl
index 3623ce7..9078302 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3af3e7(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_3af3e7(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_3af3e7(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_3af3e7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3af3e7(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3af3e7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3af3e7(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3af3e7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.spvasm
index 5ab0115..862c830 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3af3e7 "textureDimensions_3af3e7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3af3e7 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_3af3e7 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_3af3e7
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_3af3e7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_3af3e7
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_3af3e7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_3af3e7
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_3af3e7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.wgsl
index 35da220..e499dc2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3af3e7() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3af3e7();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl
index bafaabe..b043233 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_2d) -> vec2<u32>
 fn textureDimensions_3b38f6() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
index 4d33804..d57f3cc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3b38f6() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
index 4d33804..d57f3cc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3b38f6() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.glsl
index 129932f..c7c38ee 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3b38f6() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3b38f6() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3b38f6() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.msl
index 4e768f8..c9baf45 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3b38f6(depth2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_3b38f6(depth2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_3b38f6(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3b38f6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3b38f6(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3b38f6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3b38f6(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3b38f6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.spvasm
index cc00d06..7883a06 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3b38f6 "textureDimensions_3b38f6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3b38f6 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_3b38f6 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_3b38f6
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_3b38f6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_3b38f6
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_3b38f6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_3b38f6
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_3b38f6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.wgsl
index f217d69..11c120d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3b38f6() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3b38f6();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl
index a8563c8..1ed6549a4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba8uint, write>) -> vec2<u32>
 fn textureDimensions_3baab5() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
index 09829f6..3c98fab 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3baab5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
index 09829f6..3c98fab 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3baab5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.glsl
index e5fd931..d2c7609 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3baab5() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3baab5() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3baab5() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.msl
index fabb265..0d775da 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3baab5(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_3baab5(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_3baab5(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3baab5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3baab5(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3baab5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3baab5(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3baab5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.spvasm
index f11c499..36abe71 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3baab5 "textureDimensions_3baab5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3baab5 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_3baab5 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_3baab5
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_3baab5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_3baab5
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_3baab5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_3baab5
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_3baab5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.wgsl
index 35891f4..3cb17ad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3baab5() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3baab5();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl
index 0d184bc..c9838a5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_3c66f0() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
index 317cb94..23c82f1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3c66f0() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
index 317cb94..23c82f1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3c66f0() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.msl
index 8a8d417..0447ab0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3c66f0(texturecube_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_3c66f0(texturecube_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_3c66f0(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3c66f0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3c66f0(tint_symbol_4);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3c66f0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3c66f0(tint_symbol_5);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3c66f0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.spvasm
index 30391be..66895aa 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3c66f0 "textureDimensions_3c66f0"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,49 +45,57 @@
          %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
-      %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
+      %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+         %25 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3c66f0 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_3c66f0 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %int_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %int %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %21 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %21
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %int %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_3c66f0
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_3c66f0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_3c66f0
+%fragment_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_3c66f0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_3c66f0
+%compute_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_3c66f0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.wgsl
index 333b92f..8ca330d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_3c66f0() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3c66f0();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl
index 4762ddd..e738da5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_multisampled_2d<f32>) -> vec2<u32>
 fn textureDimensions_3f3474() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
index 588227e..c760629 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3f3474() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
index 588227e..c760629 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3f3474() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.glsl
index 91d50d3..3fdde2d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3f3474() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3f3474() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3f3474() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.msl
index 1ab3e70..8de6e4d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3f3474(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureDimensions_3f3474(texture2d_ms<float, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureDimensions_3f3474(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3f3474(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3f3474(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3f3474(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3f3474(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3f3474(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.spvasm
index b9f1b47..8c8a1ca 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3f3474 "textureDimensions_3f3474"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,41 +42,49 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3f3474 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_3f3474 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_3f3474
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_3f3474
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_3f3474
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_3f3474
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_3f3474
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_3f3474
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.wgsl
index d1db5f0..f8459c2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_3f3474() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3f3474();
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl
index f62bd78..fbf415a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_3fc3dc() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
index e41a8c2..95d7257 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3fc3dc() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
index e41a8c2..95d7257 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_3fc3dc() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.glsl
index 37caf64..974be2d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3fc3dc() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3fc3dc() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_3fc3dc() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.msl
index e924aaf..aa00e05 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_3fc3dc(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_3fc3dc(texture2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_3fc3dc(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_3fc3dc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_3fc3dc(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_3fc3dc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_3fc3dc(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_3fc3dc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.spvasm
index e412ae9..0034c90 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_3fc3dc "textureDimensions_3fc3dc"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,49 +43,57 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %29 = OpConstantNull %v2uint
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_3fc3dc = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %29
+%textureDimensions_3fc3dc = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %32
                OpStore %arg_1 %uint_1
-         %25 = OpLoad %11 %arg_0
-         %26 = OpLoad %uint %arg_1
-         %23 = OpImageQuerySizeLod %v3uint %25 %26
-         %21 = OpVectorShuffle %v2uint %23 %23 0 1
-               OpStore %res %21
+         %28 = OpLoad %11 %arg_0
+         %29 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %28 %29
+         %25 = OpVectorShuffle %v2uint %26 %26 0 1
+               OpStore %res %25
+         %35 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %36 = OpLoad %v2uint %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_3fc3dc
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_3fc3dc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_3fc3dc
+%fragment_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_3fc3dc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureDimensions_3fc3dc
+%compute_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureDimensions_3fc3dc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.wgsl
index 42e3074..7fd00b7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_3fc3dc() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_3fc3dc();
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl
index 8611ca5..7d3ef2a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba8sint, write>) -> vec3<u32>
 fn textureDimensions_40c671() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.dxc.hlsl
index 74aa4ef..a7b6577 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_40c671() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.fxc.hlsl
index 74aa4ef..a7b6577 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_40c671() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.glsl
index 6494fd0..388ebf9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_40c671() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_40c671() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_40c671() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.msl
index d737668..de2c135 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_40c671(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_40c671(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_40c671(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_40c671(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_40c671(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_40c671(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_40c671(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_40c671(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.spvasm
index c1c8494..86a4c1e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_40c671 "textureDimensions_40c671"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_40c671 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_40c671 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_40c671
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_40c671
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_40c671
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_40c671
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_40c671
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_40c671
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.wgsl
index 3e38a8b..43e9284 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_40c671() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_40c671();
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl
index 4b387f5..b791502 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba16uint, write>) -> vec2<u32>
 fn textureDimensions_40ecf4() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
index 76e4032..92a33d2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_40ecf4() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
index 76e4032..92a33d2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_40ecf4() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.glsl
index 8eab55c..6317e7f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_40ecf4() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_40ecf4() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_40ecf4() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.msl
index 1ee450a..0c8d982 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_40ecf4(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_40ecf4(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_40ecf4(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_40ecf4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_40ecf4(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_40ecf4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_40ecf4(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_40ecf4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.spvasm
index ea8ee52..f81134c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_40ecf4 "textureDimensions_40ecf4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_40ecf4 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_40ecf4 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_40ecf4
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_40ecf4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_40ecf4
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_40ecf4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_40ecf4
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_40ecf4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.wgsl
index 5732ee2..f53f416 100644
--- a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_40ecf4() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_40ecf4();
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl
index cc79e7c..da4d663 100644
--- a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<r32uint, write>) -> vec2<u32>
 fn textureDimensions_41545f() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.dxc.hlsl
index 6352cad..29c7b39 100644
--- a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_41545f() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.fxc.hlsl
index 6352cad..29c7b39 100644
--- a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_41545f() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.glsl
index 542e625..4eb7836 100644
--- a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_41545f() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_41545f() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_41545f() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.msl
index 6d66d30..f4a8ece 100644
--- a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_41545f(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_41545f(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_41545f(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_41545f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_41545f(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_41545f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_41545f(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_41545f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.spvasm
index e5a2d6d..98e2b28 100644
--- a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_41545f "textureDimensions_41545f"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_41545f = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_41545f = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_41545f
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_41545f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_41545f
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_41545f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_41545f
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_41545f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.wgsl
index 119c226..9fff36d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_41545f() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_41545f();
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl
index 42b6803..f18c8b4c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rg32sint, write>) -> vec2<u32>
 fn textureDimensions_439651() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.dxc.hlsl
index 5a450e7..0791df3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_439651() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.fxc.hlsl
index 5a450e7..0791df3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_439651() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.msl
index 6c456ef..e0f663e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_439651(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_439651(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_439651(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_439651(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_439651(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_439651(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_439651(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_439651(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.spvasm
index d5f13da..68957a9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_439651 "textureDimensions_439651"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,41 +45,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_439651 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_439651 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_439651
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_439651
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_439651
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_439651
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_439651
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_439651
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.wgsl
index d99bc45..7711de7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_439651() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_439651();
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl
index ed4441c..8a726c4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<u32>) -> vec2<u32>
 fn textureDimensions_445376() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.dxc.hlsl
index 1c60935..faac13c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_445376() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.fxc.hlsl
index 1c60935..faac13c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_445376() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.glsl
index 9854fcf..3b24b6b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_445376() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_445376() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_445376() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.msl
index de6d82a..959df4d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_445376(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_445376(texture2d_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_445376(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_445376(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_445376(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_445376(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_445376(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_445376(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.spvasm
index f9cf186..2b24cf5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_445376 "textureDimensions_445376"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_445376 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_445376 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_445376
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_445376
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_445376
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_445376
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_445376
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_445376
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.wgsl
index 9b3d28b..f26606e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_445376() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_445376();
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl
index 505488f..d2ec267 100644
--- a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba32uint, write>) -> vec3<u32>
 fn textureDimensions_44b358() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.dxc.hlsl
index 28733d4..15ac4e0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_44b358() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.fxc.hlsl
index 28733d4..15ac4e0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_44b358() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.glsl
index b8140ec..868adcb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_44b358() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_44b358() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_44b358() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.msl
index 3fdd338..ea4c716 100644
--- a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_44b358(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_44b358(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_44b358(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_44b358(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_44b358(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_44b358(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_44b358(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_44b358(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.spvasm
index d3cbbcd..0f50a8e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_44b358 "textureDimensions_44b358"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_44b358 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_44b358 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_44b358
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_44b358
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_44b358
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_44b358
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_44b358
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_44b358
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.wgsl
index de45407..1e9d5da 100644
--- a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_44b358() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_44b358();
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl
index a156207..cfd3e23 100644
--- a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba32uint, write>) -> vec2<u32>
 fn textureDimensions_452fc1() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
index 1a21c49..c8fb5c4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_452fc1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
index 1a21c49..c8fb5c4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_452fc1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.glsl
index 7588f6a..4c6f856 100644
--- a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_452fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_452fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_452fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.msl
index 291394f..5497059 100644
--- a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_452fc1(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureDimensions_452fc1(texture2d_array<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureDimensions_452fc1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_452fc1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_452fc1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_452fc1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_452fc1(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_452fc1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.spvasm
index 4fd3aa9..9f35db0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_452fc1 "textureDimensions_452fc1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_452fc1 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_452fc1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_452fc1
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_452fc1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_452fc1
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_452fc1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_452fc1
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_452fc1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.wgsl
index 5f78af1..a110af1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_452fc1() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_452fc1();
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl
index 4fe62b8..89017b0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<f32>) -> vec2<u32>
 fn textureDimensions_46f0fc() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
index f82b087..01626be 100644
--- a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_46f0fc() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
index f82b087..01626be 100644
--- a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_46f0fc() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.glsl
index 8ca5717..fd530f5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_46f0fc() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_46f0fc() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_46f0fc() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.msl
index d085a9b..30095ed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_46f0fc(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_46f0fc(texture2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_46f0fc(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_46f0fc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_46f0fc(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_46f0fc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_46f0fc(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_46f0fc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.spvasm
index 5847f93..d57b8aa 100644
--- a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_46f0fc "textureDimensions_46f0fc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_46f0fc = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_46f0fc = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_46f0fc
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_46f0fc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_46f0fc
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_46f0fc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_46f0fc
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_46f0fc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.wgsl
index f968df1..2339095 100644
--- a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_46f0fc() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_46f0fc();
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl
index 06d6e02..10ad721 100644
--- a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_49a067() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.dxc.hlsl
index 3e60709..f0dbf8f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_49a067() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.fxc.hlsl
index 3e60709..f0dbf8f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_49a067() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.glsl
index e093e1c..2a19ebd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_49a067() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_49a067() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_49a067() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.msl
index 21fd040..08359d8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_49a067(texturecube<float, access::sample> tint_symbol_1) {
+void textureDimensions_49a067(texturecube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
-  textureDimensions_49a067(tint_symbol_2);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_49a067(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_49a067(tint_symbol_4);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_49a067(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_49a067(tint_symbol_5);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_49a067(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.spvasm
index 40ea0e4..f8cf3e4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_49a067 "textureDimensions_49a067"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,48 +43,56 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_49a067 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_49a067 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %21
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_49a067
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_49a067
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_49a067
+%fragment_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_49a067
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_49a067
+%compute_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_49a067
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.wgsl
index 7ea6a80..d91f7f4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_49a067() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_49a067();
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl
index a11f1c8..349c3d3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rg32float, write>) -> vec2<u32>
 fn textureDimensions_4acec7() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
index fcad56d..892ce52 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4acec7() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
index fcad56d..892ce52 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4acec7() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.msl
index 1647a14..04b59fd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_4acec7(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_4acec7(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_4acec7(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_4acec7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_4acec7(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_4acec7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_4acec7(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_4acec7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.spvasm
index de0e0ab..8b93b99 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_4acec7 "textureDimensions_4acec7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_4acec7 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_4acec7 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_4acec7
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_4acec7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_4acec7
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_4acec7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_4acec7
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_4acec7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.wgsl
index 38343eb..1df8546 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_4acec7() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_4acec7();
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl
index 5dcc74b..2844dad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba8unorm, write>) -> vec3<u32>
 fn textureDimensions_4b26ef() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
index 5e783ce..3259dbf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4b26ef() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
index 5e783ce..3259dbf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4b26ef() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.glsl
index e7491ce..b7b0de1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_4b26ef() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_4b26ef() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_4b26ef() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.msl
index 5efcbfa..d7ba783 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_4b26ef(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_4b26ef(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_4b26ef(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_4b26ef(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_4b26ef(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_4b26ef(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_4b26ef(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_4b26ef(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.spvasm
index ab7781f..849045a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_4b26ef "textureDimensions_4b26ef"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_4b26ef = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_4b26ef = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_4b26ef
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_4b26ef
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_4b26ef
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_4b26ef
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_4b26ef
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_4b26ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.wgsl
index c12b60c..edcea5d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_4b26ef() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_4b26ef();
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl
index 49432db..27e2033 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<u32>) -> vec2<u32>
 fn textureDimensions_4be71b() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
index bf593db..841ffce 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4be71b() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
index bf593db..841ffce 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_4be71b() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.glsl
index 13a1e30..48ba467a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_4be71b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_4be71b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_4be71b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.msl
index 7bbfb11..96a9ea1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_4be71b(texture2d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_4be71b(texture2d<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_4be71b(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_4be71b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_4be71b(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_4be71b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_4be71b(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_4be71b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.spvasm
index 0bbbd21..dbfc315 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_4be71b "textureDimensions_4be71b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_4be71b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %17
+%textureDimensions_4be71b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_4be71b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_4be71b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_4be71b
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_4be71b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_4be71b
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_4be71b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.wgsl
index cea7772..8782231 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_4be71b() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_4be71b();
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl
index 816f05b..22a1cfc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_528c0e() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
index e270588..f89e06d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_528c0e() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
index e270588..f89e06d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_528c0e() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.glsl
index c639e05..68b08b7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_528c0e() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_528c0e() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_528c0e() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.msl
index eae0de8..6abd565 100644
--- a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_528c0e(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_528c0e(texture2d_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_528c0e(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_528c0e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_528c0e(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_528c0e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_528c0e(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_528c0e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.spvasm
index 969ca17..26a7efd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_528c0e "textureDimensions_528c0e"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,48 +44,56 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %29 = OpConstantNull %v2uint
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_528c0e = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %29
+%textureDimensions_528c0e = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %32
                OpStore %arg_1 %uint_1
-         %25 = OpLoad %11 %arg_0
-         %26 = OpLoad %uint %arg_1
-         %23 = OpImageQuerySizeLod %v3uint %25 %26
-         %21 = OpVectorShuffle %v2uint %23 %23 0 1
-               OpStore %res %21
+         %28 = OpLoad %11 %arg_0
+         %29 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %28 %29
+         %25 = OpVectorShuffle %v2uint %26 %26 0 1
+               OpStore %res %25
+         %35 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %36 = OpLoad %v2uint %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_528c0e
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_528c0e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_528c0e
+%fragment_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_528c0e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureDimensions_528c0e
+%compute_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureDimensions_528c0e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.wgsl
index fcc8b8d..4ee81ff 100644
--- a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_528c0e() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_528c0e();
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl
index e3e1557..2e35c54 100644
--- a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba16uint, write>) -> u32
 fn textureDimensions_58a82d() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
index 80b2c98..2ed6397 100644
--- a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_58a82d() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
index 80b2c98..2ed6397 100644
--- a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_58a82d() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.glsl
index 735e74e..18d8f1b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_58a82d() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_58a82d() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_58a82d() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.msl
index 34b38cc..08142b4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_58a82d(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_58a82d(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_58a82d(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_58a82d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_58a82d(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_58a82d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_58a82d(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_58a82d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.spvasm
index cc519c7..5aa4216 100644
--- a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_58a82d "textureDimensions_58a82d"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,39 +45,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_58a82d = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_58a82d = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_58a82d
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_58a82d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_58a82d
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_58a82d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_58a82d
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_58a82d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.wgsl
index f61f64b..89ffb84 100644
--- a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_58a82d() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_58a82d();
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl
index 062e5ad..7748a17 100644
--- a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba16sint, write>) -> vec3<u32>
 fn textureDimensions_591981() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.dxc.hlsl
index 4f3144c..7dfc27c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_591981() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.fxc.hlsl
index 4f3144c..7dfc27c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_591981() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.glsl
index 03a38d7..d9c6003 100644
--- a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_591981() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_591981() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_591981() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.msl
index b80abf1..ff794c9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_591981(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_591981(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_591981(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_591981(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_591981(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_591981(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_591981(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_591981(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.spvasm
index f66c1ef..ad8cddc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_591981 "textureDimensions_591981"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_591981 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_591981 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_591981
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_591981
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_591981
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_591981
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_591981
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_591981
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.wgsl
index 9f1b90b..f54d7e8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_591981() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_591981();
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl
index 25708ba..7f8121d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba16float, write>) -> vec2<u32>
 fn textureDimensions_599ab5() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
index 161321e..40179f0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_599ab5() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
index 161321e..40179f0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_599ab5() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.glsl
index e4e61d5..7f5fe21 100644
--- a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_599ab5() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_599ab5() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_599ab5() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.msl
index 9d36a4b..eed79dd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_599ab5(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_599ab5(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_599ab5(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_599ab5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_599ab5(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_599ab5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_599ab5(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_599ab5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.spvasm
index 6a2e7c1..dd4dfe1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_599ab5 "textureDimensions_599ab5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_599ab5 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_599ab5 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_599ab5
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_599ab5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_599ab5
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_599ab5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_599ab5
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_599ab5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.wgsl
index 0607926..ccc869b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_599ab5() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_599ab5();
diff --git a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl
index 59ef53a..7582049 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<bgra8unorm, write>) -> vec3<u32>
 fn textureDimensions_5b4b10() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.dxc.hlsl
index 0222f8e..5c7a574 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_5b4b10() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.fxc.hlsl
index 0222f8e..5c7a574 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_5b4b10() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.glsl
index a572851..bc304ff 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_5b4b10() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_5b4b10() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_5b4b10() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.msl
index 46f9349..3a3a59e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_5b4b10(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_5b4b10(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_5b4b10(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_5b4b10(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_5b4b10(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_5b4b10(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_5b4b10(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_5b4b10(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.spvasm
index 5b813bd..7c7b98c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_5b4b10 "textureDimensions_5b4b10"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_5b4b10 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_5b4b10 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_5b4b10
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_5b4b10
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_5b4b10
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_5b4b10
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_5b4b10
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_5b4b10
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.wgsl
index 6805bbe..afde0ac 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5b4b10.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_5b4b10() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_5b4b10();
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl
index b89ffbb..b064a8b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<i32>) -> u32
 fn textureDimensions_5df042() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.dxc.hlsl
index 25b206a..f596ae7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_5df042() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.fxc.hlsl
index 25b206a..f596ae7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_5df042() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.glsl
index 95c45a2..53d46d7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_5df042() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_5df042() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_5df042() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.msl
index c3d1fc2..a3deed2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_5df042(texture1d<int, access::sample> tint_symbol_1) {
+void textureDimensions_5df042(texture1d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureDimensions_5df042(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_5df042(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_5df042(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_5df042(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_5df042(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_5df042(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.spvasm
index 7205a05..8681b78 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_5df042 "textureDimensions_5df042"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_5df042 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %uint %19 %int_0
-               OpStore %res %17
+%textureDimensions_5df042 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %uint %22 %int_0
+               OpStore %res %21
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_5df042
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_5df042
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %17
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_5df042
+%fragment_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_5df042
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_5df042
+%compute_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_5df042
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.wgsl
index 8e083a2..f71690f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_5df042() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_5df042();
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl
index f03cde1..f298d62 100644
--- a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<r32sint, write>) -> u32
 fn textureDimensions_607979() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.dxc.hlsl
index 8fbf889..b95cf0f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_607979() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.fxc.hlsl
index 8fbf889..b95cf0f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_607979() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.glsl
index 2033c18..01d6c50 100644
--- a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_607979() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_607979() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_607979() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.msl
index 360b5a3..b0ebee4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_607979(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_607979(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_607979(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_607979(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_607979(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_607979(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_607979(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_607979(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.spvasm
index d8c6402..afb30ec 100644
--- a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_607979 "textureDimensions_607979"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_607979 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_607979 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_607979
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_607979
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_607979
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_607979
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_607979
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_607979
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.wgsl
index d54a65b..86ad89f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_607979() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_607979();
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl
index 7d34ccd..e492cdd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d_array<i32>) -> vec2<u32>
 fn textureDimensions_62cb5a() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
index 9ce8aa4..5804de5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_62cb5a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
index 9ce8aa4..5804de5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_62cb5a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.glsl
index 421af5e..384f794 100644
--- a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_62cb5a() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_62cb5a() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_62cb5a() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.msl
index 8702a25..830f885 100644
--- a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_62cb5a(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_62cb5a(texture2d_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_62cb5a(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_62cb5a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_62cb5a(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_62cb5a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_62cb5a(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_62cb5a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.spvasm
index 622c055..b95e531 100644
--- a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_62cb5a "textureDimensions_62cb5a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,44 +43,52 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_62cb5a = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySizeLod %v3uint %22 %int_0
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_62cb5a = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySizeLod %v3uint %25 %int_0
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_62cb5a
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_62cb5a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_62cb5a
+%fragment_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_62cb5a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_62cb5a
+%compute_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_62cb5a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.wgsl
index 4fd56a7..8280fe3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_62cb5a() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_62cb5a();
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl
index 5264a0c..fab5962 100644
--- a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_64dc74() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
index 2a454c2..c4406ea 100644
--- a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_64dc74() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
index 2a454c2..c4406ea 100644
--- a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_64dc74() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.glsl
index c6d050b..0d7ee0b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_64dc74() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_64dc74() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_64dc74() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.msl
index a8cfc3e..1e63cdd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_64dc74(texturecube<int, access::sample> tint_symbol_1) {
+void textureDimensions_64dc74(texturecube<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
-  textureDimensions_64dc74(tint_symbol_2);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_64dc74(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_64dc74(tint_symbol_4);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_64dc74(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_64dc74(tint_symbol_5);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_64dc74(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.spvasm
index 60b1d3b..54e7273 100644
--- a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_64dc74 "textureDimensions_64dc74"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_64dc74 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %21
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_64dc74 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %uint_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %uint %arg_1
-         %22 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %22
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_64dc74
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_64dc74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_64dc74
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_64dc74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_64dc74
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_64dc74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.wgsl
index 878928c..a1a67b0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_64dc74() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_64dc74();
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl
index 5e964b3..89b01f6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<r32sint, write>) -> vec2<u32>
 fn textureDimensions_674058() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.dxc.hlsl
index 9369bd2..83533a7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_674058() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.fxc.hlsl
index 9369bd2..83533a7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_674058() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.glsl
index 7e3dc84..b48d280 100644
--- a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_674058() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_674058() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_674058() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.msl
index 6c86158..02af1ed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_674058(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_674058(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_674058(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_674058(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_674058(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_674058(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_674058(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_674058(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.spvasm
index b312fbf..6cc571b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_674058 "textureDimensions_674058"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_674058 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_674058 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_674058
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_674058
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_674058
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_674058
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_674058
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_674058
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.wgsl
index 207af65..5000f73 100644
--- a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_674058() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_674058();
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl
index 136d80e..e6c2a2b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_6e6c7a() {
   var arg_1 = 1u;
   var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
index b930c2e..fab56e4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_6e6c7a() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
index b930c2e..fab56e4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_6e6c7a() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.glsl
index 9e5d060..9cc4f3e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_6e6c7a() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_6e6c7a() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_6e6c7a() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.msl
index 6edcc20..e9dafaf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_6e6c7a(texture3d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_6e6c7a(texture3d<uint, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_6e6c7a(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_6e6c7a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_6e6c7a(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_6e6c7a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_6e6c7a(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_6e6c7a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.spvasm
index 7a72a35..ff612a3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_6e6c7a "textureDimensions_6e6c7a"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,46 +44,54 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v3uint = OpTypeVector %uint 3
+         %24 = OpConstantNull %uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %27 = OpConstantNull %v3uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_6e6c7a = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v3uint Function %27
+%textureDimensions_6e6c7a = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v3uint Function %30
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %v3uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %v3uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %34 = OpLoad %v3uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_6e6c7a
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_6e6c7a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_6e6c7a
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_6e6c7a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_6e6c7a
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_6e6c7a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.wgsl
index 4073327..3372527 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_6e6c7a() {
   var arg_1 = 1u;
   var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_6e6c7a();
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl
index d4e1e80..24e5e92 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_6f1b5d() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
index a6a31de..e1b3aa9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_6f1b5d() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
index a6a31de..e1b3aa9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_6f1b5d() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.glsl
index ee9d548..7bc3cfb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_6f1b5d() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_6f1b5d() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_6f1b5d() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.msl
index 9628555..424c21d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_6f1b5d(depth2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_6f1b5d(depth2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_6f1b5d(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_6f1b5d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_6f1b5d(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_6f1b5d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_6f1b5d(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_6f1b5d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.spvasm
index f0ab644..82cbec9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_6f1b5d "textureDimensions_6f1b5d"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,48 +43,56 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_6f1b5d = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_6f1b5d = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %21
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_6f1b5d
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_6f1b5d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_6f1b5d
+%fragment_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_6f1b5d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_6f1b5d
+%compute_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_6f1b5d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.wgsl
index a0fb93d..4a50f82 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_6f1b5d() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_6f1b5d();
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl
index 48176cf..f3983fe 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<r32uint, write>) -> u32
 fn textureDimensions_7228de() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.dxc.hlsl
index 79216e6..3a11a45 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7228de() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.fxc.hlsl
index 79216e6..3a11a45 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7228de() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.glsl
index 196bd3a..0f21a9a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_7228de() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_7228de() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_7228de() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.msl
index d5d9363..bcac19c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_7228de(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_7228de(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_7228de(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_7228de(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_7228de(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_7228de(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_7228de(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_7228de(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.spvasm
index defd7fb..6381839 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_7228de "textureDimensions_7228de"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,39 +45,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_7228de = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_7228de = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_7228de
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_7228de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_7228de
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_7228de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_7228de
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_7228de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.wgsl
index 6f791d8..258d65b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_7228de() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_7228de();
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl
index 336207e..acfe5c3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_756031() {
   var arg_1 = 1i;
   var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.dxc.hlsl
index 9e45538..92409aa 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_756031() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.fxc.hlsl
index 9e45538..92409aa 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_756031() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.glsl
index 02ed7ea..02be4d9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_756031() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_756031() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_756031() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.msl
index c267c67..1ae75d1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_756031(texture3d<int, access::sample> tint_symbol_1) {
+void textureDimensions_756031(texture3d<int, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   int arg_1 = 1;
   uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureDimensions_756031(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_756031(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_756031(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_756031(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_756031(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_756031(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.spvasm
index 38d19dc..af87151 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_756031 "textureDimensions_756031"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
-      %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
+      %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+         %25 = OpConstantNull %int
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %28 = OpConstantNull %v3uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_756031 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v3uint Function %28
+%textureDimensions_756031 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v3uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %v3uint %24 %25
-               OpStore %res %21
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %35 = OpLoad %v3uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_756031
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_756031
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_756031
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_756031
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_756031
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_756031
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.wgsl
index 389c758..7c6c200 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_756031() {
   var arg_1 = 1i;
   var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_756031();
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl
index d06fb96..31e411c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<r32float, write>) -> vec2<u32>
 fn textureDimensions_756304() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.dxc.hlsl
index 70b5dc9..204f352 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_756304() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.fxc.hlsl
index 70b5dc9..204f352 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_756304() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.glsl
index a1d9085..17f9f2f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_756304() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_756304() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_756304() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.msl
index 21be296f..19beb5b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_756304(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_756304(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_756304(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_756304(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_756304(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_756304(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_756304(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_756304(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.spvasm
index 2c2eeb3..5acbfc0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_756304 "textureDimensions_756304"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_756304 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_756304 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_756304
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_756304
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_756304
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_756304
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_756304
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_756304
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.wgsl
index 16fcc5c..b87a0d0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_756304() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_756304();
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl
index a45a3fe..88e6956 100644
--- a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_79d168() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.dxc.hlsl
index 4bbc5c7..018ef08 100644
--- a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_79d168() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.fxc.hlsl
index 4bbc5c7..018ef08 100644
--- a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_79d168() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.glsl
index 34e9119..5ff9472 100644
--- a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_79d168() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_79d168() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_79d168() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.msl
index 08a009b..96ad7ea 100644
--- a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_79d168(depthcube<float, access::sample> tint_symbol_1) {
+void textureDimensions_79d168(depthcube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
-  textureDimensions_79d168(tint_symbol_2);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_79d168(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_79d168(tint_symbol_4);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_79d168(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_79d168(tint_symbol_5);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_79d168(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.spvasm
index 88d67cd3..7e40b8e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_79d168 "textureDimensions_79d168"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,48 +43,56 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_79d168 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_79d168 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %21
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_79d168
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_79d168
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_79d168
+%fragment_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_79d168
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_79d168
+%compute_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_79d168
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.wgsl
index eba133c..9e76ce3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_79d168() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_79d168();
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl
index 30e8a51..3a3cbed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<u32>) -> vec3<u32>
 fn textureDimensions_7a3890() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
index 3a01cb7..c8937c5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7a3890() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
index 3a01cb7..c8937c5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7a3890() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.glsl
index 533a4f8..13a7636 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_7a3890() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_7a3890() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_7a3890() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.msl
index 3118213..46e8389 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_7a3890(texture3d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_7a3890(texture3d<uint, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_7a3890(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_7a3890(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_7a3890(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_7a3890(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_7a3890(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_7a3890(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.spvasm
index 43921a9..3e16f4d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_7a3890 "textureDimensions_7a3890"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_7a3890 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v3uint %19 %int_0
-               OpStore %res %17
+%textureDimensions_7a3890 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_7a3890
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_7a3890
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_7a3890
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_7a3890
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_7a3890
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_7a3890
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.wgsl
index 82213cc..0538678 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_7a3890() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_7a3890();
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl
index 9d1f0b9..d43aee9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<u32>) -> vec2<u32>
 fn textureDimensions_7a9e30() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
index 12d975c..3699610 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7a9e30() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
index 12d975c..3699610 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_7a9e30() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.glsl
index c7e9efa..f972f63 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_7a9e30() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_7a9e30() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_7a9e30() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.msl
index 4456cad..8244dd9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_7a9e30(texturecube<uint, access::sample> tint_symbol_1) {
+void textureDimensions_7a9e30(texturecube<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
-  textureDimensions_7a9e30(tint_symbol_2);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_7a9e30(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_7a9e30(tint_symbol_4);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_7a9e30(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_7a9e30(tint_symbol_5);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_7a9e30(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.spvasm
index b036bf4..c544c20 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_7a9e30 "textureDimensions_7a9e30"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_7a9e30 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %17
+%textureDimensions_7a9e30 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_7a9e30
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_7a9e30
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_7a9e30
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_7a9e30
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_7a9e30
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_7a9e30
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.wgsl
index bd784d3..d29020c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_7a9e30() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_7a9e30();
diff --git a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl
index fbc9301..6e78077 100644
--- a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<bgra8unorm, write>) -> u32
 fn textureDimensions_84f363() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.dxc.hlsl
index 17257f9..9d8e922 100644
--- a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_84f363() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.fxc.hlsl
index 17257f9..9d8e922 100644
--- a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_84f363() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.glsl
index f5d3ecd..d3889a9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_84f363() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_84f363() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_84f363() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.msl
index 86c6e02..c6f246a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_84f363(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_84f363(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_84f363(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_84f363(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_84f363(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_84f363(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_84f363(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_84f363(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.spvasm
index 3252410..0b4c1cd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_84f363 "textureDimensions_84f363"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_84f363 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_84f363 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_84f363
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_84f363
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_84f363
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_84f363
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_84f363
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_84f363
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.wgsl
index 5967fd6..8a3fd51 100644
--- a/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/84f363.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_84f363() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_84f363();
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl
index 2a6540f..02cca02 100644
--- a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba8snorm, write>) -> vec2<u32>
 fn textureDimensions_867ead() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.dxc.hlsl
index c3db085..c2a6d6f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_867ead() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.fxc.hlsl
index c3db085..c2a6d6f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_867ead() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.glsl
index ed270a8..dbeb579 100644
--- a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_867ead() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_867ead() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_867ead() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.msl
index 7985b52..53c9ef9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_867ead(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_867ead(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_867ead(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_867ead(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_867ead(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_867ead(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_867ead(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_867ead(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.spvasm
index d0dac2c..d7f86ed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_867ead "textureDimensions_867ead"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_867ead = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_867ead = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_867ead
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_867ead
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_867ead
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_867ead
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_867ead
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_867ead
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.wgsl
index 50f701a..aa25992 100644
--- a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_867ead() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_867ead();
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl
index c3f7003..28e72b9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<f32>) -> vec2<u32>
 fn textureDimensions_879b73() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.dxc.hlsl
index 8e2f821..31c0232 100644
--- a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_879b73() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.fxc.hlsl
index 8e2f821..31c0232 100644
--- a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_879b73() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.msl
index f452786..99cb052 100644
--- a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_879b73(texturecube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_879b73(texturecube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_879b73(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_879b73(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_879b73(tint_symbol_4);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_879b73(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_879b73(tint_symbol_5);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_879b73(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.spvasm
index f5199b0..f6f7d49 100644
--- a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_879b73 "textureDimensions_879b73"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,45 +43,53 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_879b73 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_879b73 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_879b73
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_879b73
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_879b73
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_879b73
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_879b73
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_879b73
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.wgsl
index 6078916..1f03510 100644
--- a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_879b73() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_879b73();
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl
index 349d4aa..d5e6c67 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rg32float, write>) -> vec2<u32>
 fn textureDimensions_8a35f9() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
index cb72f96..2f33d98 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_8a35f9() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
index cb72f96..2f33d98 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_8a35f9() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.msl
index f3c2d7c..6742474 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_8a35f9(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_8a35f9(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_8a35f9(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_8a35f9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_8a35f9(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_8a35f9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_8a35f9(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_8a35f9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.spvasm
index f3a454b..2175604 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_8a35f9 "textureDimensions_8a35f9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_8a35f9 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_8a35f9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_8a35f9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_8a35f9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_8a35f9
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_8a35f9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_8a35f9
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_8a35f9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.wgsl
index 04585f3..ac32635 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_8a35f9() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_8a35f9();
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl
index e4931ec..c863676 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba32sint, write>) -> u32
 fn textureDimensions_8efd47() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
index 0ec2359..94483c9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_8efd47() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
index 0ec2359..94483c9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_8efd47() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.glsl
index ae6f7eb..2749b281 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_8efd47() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_8efd47() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_8efd47() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.msl
index 1aa9fa8..2db510c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_8efd47(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_8efd47(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_8efd47(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_8efd47(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_8efd47(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_8efd47(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_8efd47(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_8efd47(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.spvasm
index cb6145d..4e710ec 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_8efd47 "textureDimensions_8efd47"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_8efd47 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_8efd47 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_8efd47
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_8efd47
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_8efd47
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_8efd47
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_8efd47
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_8efd47
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.wgsl
index 791a3af..4d79064 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_8efd47() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_8efd47();
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl
index 3a8b15e..828334f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<r32float, write>) -> vec3<u32>
 fn textureDimensions_902179() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.dxc.hlsl
index 1c84269..6b6d788 100644
--- a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_902179() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.fxc.hlsl
index 1c84269..6b6d788 100644
--- a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_902179() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.glsl
index 24eeebf..dd46ad6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_902179() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_902179() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_902179() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.msl
index ff7f11b..5810dfc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_902179(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_902179(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_902179(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_902179(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_902179(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_902179(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_902179(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_902179(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.spvasm
index cdb6d12..431b4dc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_902179 "textureDimensions_902179"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_902179 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_902179 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_902179
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_902179
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_902179
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_902179
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_902179
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_902179
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.wgsl
index 81da1cc..96e9ba7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_902179() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_902179();
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl
index fde73cb..42b5e5b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba16sint, write>) -> vec2<u32>
 fn textureDimensions_90dd74() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
index 6e10196..8837cdc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_90dd74() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
index 6e10196..8837cdc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_90dd74() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.glsl
index 4e0747d..0411303 100644
--- a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_90dd74() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_90dd74() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_90dd74() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.msl
index 8439e12..81147f3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_90dd74(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_90dd74(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_90dd74(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_90dd74(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_90dd74(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_90dd74(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_90dd74(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_90dd74(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.spvasm
index 0fe6302..e5b3923 100644
--- a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_90dd74 "textureDimensions_90dd74"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_90dd74 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_90dd74 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_90dd74
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_90dd74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_90dd74
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_90dd74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_90dd74
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_90dd74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.wgsl
index d5471c2..acb40dd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_90dd74() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_90dd74();
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl
index 1abb76d..30a4fad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_920006() {
   var arg_1 = 1i;
   var res: u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.dxc.hlsl
index 9349790..45bd709 100644
--- a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_920006() {
   int arg_1 = 1;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.fxc.hlsl
index 9349790..45bd709 100644
--- a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_920006() {
   int arg_1 = 1;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.glsl
index c34e4c1..da96de6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_920006() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_920006() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_920006() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.msl
index 3cdcaca..2716c97 100644
--- a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_920006(texture1d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_920006(texture1d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   int arg_1 = 1;
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_920006(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_920006(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_920006(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_920006(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_920006(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_920006(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.spvasm
index 54be5e9..dccc067 100644
--- a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_920006 "textureDimensions_920006"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,46 +45,54 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %21 = OpConstantNull %int
+         %24 = OpConstantNull %int
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_920006 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %21
-        %res = OpVariable %_ptr_Function_uint Function %27
+%textureDimensions_920006 = OpFunction %void None %16
+         %19 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %24
+        %res = OpVariable %_ptr_Function_uint Function %30
                OpStore %arg_1 %int_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %int %arg_1
-         %22 = OpImageQuerySizeLod %uint %23 %24
-               OpStore %res %22
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %int %arg_1
+         %25 = OpImageQuerySizeLod %uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %34 = OpLoad %uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_920006
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_920006
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_920006
+%fragment_main = OpFunction %void None %16
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_920006
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_920006
+%compute_main = OpFunction %void None %16
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_920006
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.wgsl
index 9ba89cf..d64130a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_920006() {
   var arg_1 = 1i;
   var res : u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_920006();
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl
index d4677e2..ef70d53 100644
--- a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba8sint, write>) -> u32
 fn textureDimensions_92552e() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.dxc.hlsl
index 6afab39..9dc17c8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_92552e() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.fxc.hlsl
index 6afab39..9dc17c8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_92552e() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.glsl
index c14a7b6..a5fefdc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_92552e() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_92552e() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_92552e() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.msl
index b291fc2..73e3e9e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_92552e(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_92552e(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_92552e(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_92552e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_92552e(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_92552e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_92552e(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_92552e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.spvasm
index 900be97..a003355 100644
--- a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_92552e "textureDimensions_92552e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_92552e = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_92552e = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_92552e
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_92552e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_92552e
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_92552e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_92552e
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_92552e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.wgsl
index d970314..ee96d82 100644
--- a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_92552e() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_92552e();
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl
index 917ddec..b5c44d2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rg32uint, write>) -> vec2<u32>
 fn textureDimensions_9573f3() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
index 4d8998d..da0578f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9573f3() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
index 4d8998d..da0578f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9573f3() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.msl
index f0fa2a7..fbbfdb4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9573f3(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_9573f3(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_9573f3(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9573f3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9573f3(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9573f3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9573f3(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9573f3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.spvasm
index b1f6cc3..35533d1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9573f3 "textureDimensions_9573f3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9573f3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_9573f3 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_9573f3
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_9573f3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_9573f3
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_9573f3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_9573f3
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_9573f3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.wgsl
index de5167b..db6f380 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9573f3() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9573f3();
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl
index a09022b..088c823 100644
--- a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_1d<u32>) -> u32
 fn textureDimensions_965645() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.dxc.hlsl
index 285b9f8..02f369c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_965645() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.fxc.hlsl
index 285b9f8..02f369c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_965645() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.glsl
index e5540d6..4d0484e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_965645() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_965645() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_965645() {
   uint res = uvec2(textureSize(arg_0_1, 0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.msl
index 6d38430..0a2e55d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_965645(texture1d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_965645(texture1d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_965645(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_965645(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_965645(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_965645(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_965645(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_965645(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.spvasm
index 9e8f9a4..af4716b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_965645 "textureDimensions_965645"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_965645 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %uint %18 %int_0
-               OpStore %res %17
+%textureDimensions_965645 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySizeLod %uint %21 %int_0
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_965645
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_965645
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_965645
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_965645
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_965645
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_965645
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.wgsl
index 45ddf97..c05ae26 100644
--- a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_965645() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_965645();
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl
index 0f82afb..9d70ceb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<i32>) -> vec2<u32>
 fn textureDimensions_98b2d3() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
index 70d774f..23a73ef 100644
--- a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_98b2d3() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
index 70d774f..23a73ef 100644
--- a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_98b2d3() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.msl
index dc4a496..0f9c39b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_98b2d3(texturecube_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_98b2d3(texturecube_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_98b2d3(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_98b2d3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_98b2d3(tint_symbol_4);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_98b2d3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_98b2d3(tint_symbol_5);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_98b2d3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.spvasm
index d511aaa..968a038 100644
--- a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_98b2d3 "textureDimensions_98b2d3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,44 +44,52 @@
          %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_98b2d3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySizeLod %v3uint %22 %int_0
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_98b2d3 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySizeLod %v3uint %25 %int_0
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_98b2d3
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_98b2d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %18
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_98b2d3
+%fragment_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_98b2d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_98b2d3
+%compute_main = OpFunction %void None %18
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_98b2d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.wgsl
index 8609f45..c6ef29b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_98b2d3() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_98b2d3();
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl
index 2963a10..256f5c6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_991ea9() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
index 85bfca1..4d9b561 100644
--- a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_991ea9() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
index 85bfca1..4d9b561 100644
--- a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_991ea9() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.glsl
index b58daaf..ede72f9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_991ea9() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_991ea9() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_991ea9() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.msl
index 59d9a04..e99ef42 100644
--- a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_991ea9(depth2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_991ea9(depth2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_991ea9(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_991ea9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_991ea9(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_991ea9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_991ea9(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_991ea9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.spvasm
index 626c84d..6eec615 100644
--- a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_991ea9 "textureDimensions_991ea9"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,47 +43,55 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %27 = OpConstantNull %v2uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_991ea9 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %27
+%textureDimensions_991ea9 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %30
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %v2uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %34 = OpLoad %v2uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_991ea9
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_991ea9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_991ea9
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_991ea9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_991ea9
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_991ea9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.wgsl
index d86d15c..f8434c8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_991ea9() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_991ea9();
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl
index 25108ad..e4d57da 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<f32>) -> vec2<u32>
 fn textureDimensions_9b223b() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
index 50846b9..010ea15 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9b223b() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
index 50846b9..010ea15 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9b223b() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.glsl
index c748051..1bc995d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9b223b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9b223b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9b223b() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.msl
index ce95387..37f5771 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9b223b(texturecube<float, access::sample> tint_symbol_1) {
+void textureDimensions_9b223b(texturecube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
-  textureDimensions_9b223b(tint_symbol_2);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9b223b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9b223b(tint_symbol_4);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9b223b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9b223b(tint_symbol_5);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9b223b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.spvasm
index b7a28e0..61b083f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9b223b "textureDimensions_9b223b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9b223b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_9b223b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_9b223b
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_9b223b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_9b223b
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_9b223b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_9b223b
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_9b223b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.wgsl
index 72fbba9..c74b7e7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9b223b() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9b223b();
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl
index f172f38..3008fa6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_9baf27() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
index 279596e..1e1adfd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9baf27() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
index 279596e..1e1adfd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9baf27() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.glsl
index 153994d..a27a549 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9baf27() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9baf27() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9baf27() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.msl
index 4b4fbfe..240c665 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9baf27(texturecube<uint, access::sample> tint_symbol_1) {
+void textureDimensions_9baf27(texturecube<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
-  textureDimensions_9baf27(tint_symbol_2);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9baf27(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9baf27(tint_symbol_4);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9baf27(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9baf27(tint_symbol_5);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9baf27(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.spvasm
index 718fea8..2ac8bb4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9baf27 "textureDimensions_9baf27"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,46 +44,54 @@
          %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %27 = OpConstantNull %v2uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9baf27 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %27
+%textureDimensions_9baf27 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %30
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %v2uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %34 = OpLoad %v2uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_9baf27
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_9baf27
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_9baf27
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_9baf27
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_9baf27
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_9baf27
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.wgsl
index f3c81b5..1800a6d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_9baf27() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9baf27();
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl
index 4986938..09711c1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_9c7a00() {
   var arg_1 = 1u;
   var res: u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
index 6ba0f2b..146c744 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9c7a00() {
   uint arg_1 = 1u;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
index 6ba0f2b..146c744 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9c7a00() {
   uint arg_1 = 1u;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.glsl
index c98108c..2368d70 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_9c7a00() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_9c7a00() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_9c7a00() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.msl
index a066b99..a9d09c0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9c7a00(texture1d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_9c7a00(texture1d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_9c7a00(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_9c7a00(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9c7a00(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9c7a00(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9c7a00(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9c7a00(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.spvasm
index 5f27e11..77a30ca 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9c7a00 "textureDimensions_9c7a00"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,43 +45,51 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %23 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9c7a00 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_uint Function %20
+%textureDimensions_9c7a00 = OpFunction %void None %16
+         %19 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %23
+        %res = OpVariable %_ptr_Function_uint Function %23
                OpStore %arg_1 %uint_1
-         %22 = OpLoad %11 %arg_0
-         %23 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %uint %22 %23
-               OpStore %res %21
+         %25 = OpLoad %11 %arg_0
+         %26 = OpLoad %uint %arg_1
+         %24 = OpImageQuerySizeLod %uint %25 %26
+               OpStore %res %24
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_9c7a00
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_9c7a00
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %16
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_9c7a00
+%fragment_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_9c7a00
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_9c7a00
+%compute_main = OpFunction %void None %16
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_9c7a00
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.wgsl
index ee8497f..7d57524 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_9c7a00() {
   var arg_1 = 1u;
   var res : u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9c7a00();
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl
index 505d9a2..6011616 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_9cd4ca() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
index 2d25d71..8df7323 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9cd4ca() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
index 2d25d71..8df7323 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9cd4ca() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.glsl
index 31c447e..409d237 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9cd4ca() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9cd4ca() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9cd4ca() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.msl
index 4b7c457..10b24fe 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9cd4ca(texturecube<uint, access::sample> tint_symbol_1) {
+void textureDimensions_9cd4ca(texturecube<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
-  textureDimensions_9cd4ca(tint_symbol_2);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9cd4ca(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9cd4ca(tint_symbol_4);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9cd4ca(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9cd4ca(tint_symbol_5);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9cd4ca(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.spvasm
index 77e0964..776f53d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9cd4ca "textureDimensions_9cd4ca"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %21 = OpConstantNull %int
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9cd4ca = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %21
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_9cd4ca = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %22 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %22
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_9cd4ca
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_9cd4ca
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_9cd4ca
+%fragment_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_9cd4ca
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_9cd4ca
+%compute_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_9cd4ca
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.wgsl
index 9d80b64..568a73d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_9cd4ca() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9cd4ca();
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl
index 309ffe2..6de0753 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rg32float, write>) -> vec3<u32>
 fn textureDimensions_9cd8ad() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
index 15a1e11..c6ac61a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9cd8ad() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
index 15a1e11..c6ac61a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9cd8ad() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.msl
index 23fcbf6..11a7158 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9cd8ad(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_9cd8ad(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_9cd8ad(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_9cd8ad(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9cd8ad(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9cd8ad(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9cd8ad(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9cd8ad(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.spvasm
index 0155eb4..73218ee 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9cd8ad "textureDimensions_9cd8ad"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9cd8ad = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_9cd8ad = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_9cd8ad
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_9cd8ad
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_9cd8ad
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_9cd8ad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_9cd8ad
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_9cd8ad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.wgsl
index 7ac9caf..42490bf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9cd8ad() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9cd8ad();
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl
index 5e05bba..54400cb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_9e0794() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
index c8a7643..4569201 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9e0794() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
index c8a7643..4569201 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9e0794() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.glsl
index 9c1fbf5..bd93fe9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9e0794() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9e0794() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_9e0794() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.msl
index eb3ef43..74b4480 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9e0794(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_9e0794(texture2d_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_9e0794(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9e0794(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9e0794(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9e0794(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9e0794(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9e0794(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.spvasm
index 2d2189a..ba8abd1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9e0794 "textureDimensions_9e0794"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,49 +44,57 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %21 = OpConstantNull %int
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9e0794 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %21
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_9e0794 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %int_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %int %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %22 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %22
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %int %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_9e0794
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_9e0794
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_9e0794
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_9e0794
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_9e0794
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_9e0794
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.wgsl
index 71827db..ebf2ca8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_9e0794() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9e0794();
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl
index 9f69ac6..e2e194b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_cube_array) -> vec2<u32>
 fn textureDimensions_9fcc3b() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
index 5252d8b..b86e550 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9fcc3b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
index 5252d8b..b86e550 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_9fcc3b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.msl
index ddabf3b..83fc78d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_9fcc3b(depthcube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_9fcc3b(depthcube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_9fcc3b(tint_symbol_2);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_9fcc3b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_9fcc3b(tint_symbol_4);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_9fcc3b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_9fcc3b(tint_symbol_5);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_9fcc3b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.spvasm
index a57305e..e7bb90b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_9fcc3b "textureDimensions_9fcc3b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,45 +43,53 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_9fcc3b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_9fcc3b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_9fcc3b
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_9fcc3b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_9fcc3b
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_9fcc3b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_9fcc3b
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_9fcc3b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.wgsl
index 14dbcf2..bfcab8a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_9fcc3b() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_9fcc3b();
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl
index 76171f5..808028a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube_array<u32>) -> vec2<u32>
 fn textureDimensions_a1598a() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
index ed94e77..1c85709 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a1598a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
index ed94e77..1c85709 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a1598a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.msl
index f8e8256..d32e662 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_a1598a(texturecube_array<uint, access::sample> tint_symbol_1) {
+void textureDimensions_a1598a(texturecube_array<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
-  textureDimensions_a1598a(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_a1598a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_a1598a(tint_symbol_4);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_a1598a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_a1598a(tint_symbol_5);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_a1598a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.spvasm
index a28204c..9aba6f2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_a1598a "textureDimensions_a1598a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,44 +44,52 @@
          %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_a1598a = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %17 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %17
+%textureDimensions_a1598a = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_a1598a
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_a1598a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_a1598a
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_a1598a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_a1598a
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_a1598a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.wgsl
index f6f7047..94245b7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_a1598a() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_a1598a();
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl
index a3e7f10..61048ad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_a2ba5e() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
index 5597e84..6c14592 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a2ba5e() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
index 5597e84..6c14592 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a2ba5e() {
   int arg_1 = 1;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.glsl
index 728ca98..3362a44 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a2ba5e() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a2ba5e() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a2ba5e() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.msl
index 8a4ba3c..48fa657 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_a2ba5e(texturecube<int, access::sample> tint_symbol_1) {
+void textureDimensions_a2ba5e(texturecube<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
-  textureDimensions_a2ba5e(tint_symbol_2);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_a2ba5e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_a2ba5e(tint_symbol_4);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_a2ba5e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_a2ba5e(tint_symbol_5);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_a2ba5e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.spvasm
index 5d4ec7c..3e7549b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_a2ba5e "textureDimensions_a2ba5e"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
-      %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
+      %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+         %25 = OpConstantNull %int
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_a2ba5e = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_a2ba5e = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %21
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_a2ba5e
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_a2ba5e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_a2ba5e
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_a2ba5e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_a2ba5e
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_a2ba5e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.wgsl
index bd6c4ec..8e65fcb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_a2ba5e() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_a2ba5e();
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl
index 0fba30d..995fae3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_a48049() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.dxc.hlsl
index 5f5cc2b..edc6814 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a48049() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.fxc.hlsl
index 5f5cc2b..edc6814 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a48049() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.glsl
index 5c885a3..ecb97b8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a48049() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a48049() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a48049() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.msl
index ee430c6..4e383e6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_a48049(texture2d<int, access::sample> tint_symbol_1) {
+void textureDimensions_a48049(texture2d<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureDimensions_a48049(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_a48049(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_a48049(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_a48049(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_a48049(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_a48049(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.spvasm
index 7fc4948..f26c041 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_a48049 "textureDimensions_a48049"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %28 = OpConstantNull %v2uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_a48049 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %21
-        %res = OpVariable %_ptr_Function_v2uint Function %28
+%textureDimensions_a48049 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %31
                OpStore %arg_1 %uint_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %uint %arg_1
-         %22 = OpImageQuerySizeLod %v2uint %24 %25
-               OpStore %res %22
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v2uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %35 = OpLoad %v2uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_a48049
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_a48049
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_a48049
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_a48049
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_a48049
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_a48049
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.wgsl
index 2600680..7c309cd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_a48049() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_a48049();
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl
index 5628cd5..74d8b78 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_2d_array) -> vec2<u32>
 fn textureDimensions_a4cd56() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
index f8f2b16..085c160 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a4cd56() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
index f8f2b16..085c160 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_a4cd56() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.glsl
index 759cda6..b94c4df 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a4cd56() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a4cd56() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_a4cd56() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.msl
index 9022f6d..8d4b437 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_a4cd56(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_a4cd56(depth2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_a4cd56(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_a4cd56(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_a4cd56(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_a4cd56(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_a4cd56(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_a4cd56(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.spvasm
index d7caf97..5c981bd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_a4cd56 "textureDimensions_a4cd56"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,45 +42,53 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %26 = OpConstantNull %v2uint
-         %27 = OpTypeFunction %v4float
+         %29 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %34 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_a4cd56 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %26
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_a4cd56 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %29
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %32 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %33 = OpLoad %v2uint %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureDimensions_a4cd56
+%vertex_main_inner = OpFunction %v4float None %34
+         %36 = OpLabel
+         %37 = OpFunctionCall %void %textureDimensions_a4cd56
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %40
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_a4cd56
+%fragment_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_a4cd56
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_a4cd56
+%compute_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_a4cd56
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.wgsl
index 50f2c77..e59960e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_a4cd56() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_a4cd56();
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl
index 8b47484..37dc891 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba32sint, write>) -> vec2<u32>
 fn textureDimensions_aa4353() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
index 3d24ddb..dabce86 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_aa4353() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
index 3d24ddb..dabce86 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_aa4353() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.glsl
index 4a25902..9476a5e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_aa4353() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_aa4353() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_aa4353() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.msl
index 7845df7..10c4286 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_aa4353(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_aa4353(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_aa4353(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_aa4353(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_aa4353(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_aa4353(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_aa4353(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_aa4353(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.spvasm
index 3a9900d..950004e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_aa4353 "textureDimensions_aa4353"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_aa4353 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_aa4353 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_aa4353
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_aa4353
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_aa4353
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_aa4353
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_aa4353
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_aa4353
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.wgsl
index 7aa80e1..3d4a4fc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_aa4353() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_aa4353();
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl
index e17af18..e8d064f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_aac604() {
   var arg_1 = 1u;
   var res: u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.dxc.hlsl
index 16df6f4..cfde96e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_aac604() {
   uint arg_1 = 1u;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.fxc.hlsl
index 16df6f4..cfde96e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_aac604() {
   uint arg_1 = 1u;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.glsl
index 042543f..83ed0d3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_aac604() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_aac604() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_aac604() {
   uint arg_1 = 1u;
   uint res = uvec2(textureSize(arg_0_1, int(arg_1))).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.msl
index 4eed4a3..5a169d0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_aac604(texture1d<float, access::sample> tint_symbol_1) {
+void textureDimensions_aac604(texture1d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureDimensions_aac604(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_aac604(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_aac604(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_aac604(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_aac604(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_aac604(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.spvasm
index a609c78..246ec84 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_aac604 "textureDimensions_aac604"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,44 +44,52 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %23 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_aac604 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_uint Function %20
+%textureDimensions_aac604 = OpFunction %void None %16
+         %19 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %23
+        %res = OpVariable %_ptr_Function_uint Function %23
                OpStore %arg_1 %uint_1
-         %22 = OpLoad %11 %arg_0
-         %23 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %uint %22 %23
-               OpStore %res %21
+         %25 = OpLoad %11 %arg_0
+         %26 = OpLoad %uint %arg_1
+         %24 = OpImageQuerySizeLod %uint %25 %26
+               OpStore %res %24
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_aac604
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_aac604
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %16
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_aac604
+%fragment_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_aac604
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_aac604
+%compute_main = OpFunction %void None %16
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_aac604
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.wgsl
index 528fe11..a17627b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_aac604() {
   var arg_1 = 1u;
   var res : u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_aac604();
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl
index 39b6f4a..67f13ee 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba8uint, write>) -> u32
 fn textureDimensions_ad7d3b() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
index c052ebe..09ea033 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ad7d3b() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
index c052ebe..09ea033 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ad7d3b() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.glsl
index c88b88e..069e1c5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ad7d3b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ad7d3b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ad7d3b() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.msl
index 5ebfda2..496ffa5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_ad7d3b(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_ad7d3b(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_ad7d3b(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_ad7d3b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_ad7d3b(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_ad7d3b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_ad7d3b(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_ad7d3b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.spvasm
index f349ad4..971ee8a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_ad7d3b "textureDimensions_ad7d3b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,39 +45,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_ad7d3b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_ad7d3b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_ad7d3b
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_ad7d3b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_ad7d3b
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_ad7d3b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_ad7d3b
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_ad7d3b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.wgsl
index f3d84ab..4e887c3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_ad7d3b() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_ad7d3b();
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl
index ab3e076..715c21f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rg32sint, write>) -> vec2<u32>
 fn textureDimensions_af46ab() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
index 7b91231..5dc5b3c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_af46ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
index 7b91231..5dc5b3c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_af46ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.msl
index bea9ef2..98dd440 100644
--- a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_af46ab(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_af46ab(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_af46ab(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_af46ab(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_af46ab(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_af46ab(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_af46ab(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_af46ab(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.spvasm
index fa916ed..253712e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_af46ab "textureDimensions_af46ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,43 +45,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_af46ab = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_af46ab = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_af46ab
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_af46ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_af46ab
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_af46ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_af46ab
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_af46ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.wgsl
index 33b86af..b01989a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_af46ab() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_af46ab();
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl
index 11a6ddb..15945ed 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_b3ab5e() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
index 7038fc7..15ea455 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b3ab5e() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
index 7038fc7..15ea455 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b3ab5e() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.msl
index 7409bb7..20a6b96 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_b3ab5e(texturecube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_b3ab5e(texturecube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_b3ab5e(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_b3ab5e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_b3ab5e(tint_symbol_4);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_b3ab5e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_b3ab5e(tint_symbol_5);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_b3ab5e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.spvasm
index f3b642e..ca3f4c5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_b3ab5e "textureDimensions_b3ab5e"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,50 +44,58 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_b3ab5e = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_b3ab5e = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %int_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %int %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %21 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %21
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %int %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_b3ab5e
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_b3ab5e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_b3ab5e
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_b3ab5e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_b3ab5e
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_b3ab5e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.wgsl
index d5dd059..ed0e9c3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_b3ab5e() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_b3ab5e();
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl
index 7554aab..3ffe9a6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_b46d97() {
   var arg_1 = 1i;
   var res: u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
index d2120ba..7770b36 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b46d97() {
   int arg_1 = 1;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
index d2120ba..7770b36 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b46d97() {
   int arg_1 = 1;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.glsl
index 74c1b0e..6b59f60 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_b46d97() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_b46d97() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_b46d97() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.msl
index a93ae28..e15df18 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_b46d97(texture1d<int, access::sample> tint_symbol_1) {
+void textureDimensions_b46d97(texture1d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   int arg_1 = 1;
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureDimensions_b46d97(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_b46d97(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_b46d97(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_b46d97(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_b46d97(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_b46d97(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.spvasm
index 0fd4314..87415e5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_b46d97 "textureDimensions_b46d97"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,46 +45,54 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
+         %24 = OpConstantNull %int
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_b46d97 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_uint Function %27
+%textureDimensions_b46d97 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %24
+        %res = OpVariable %_ptr_Function_uint Function %30
                OpStore %arg_1 %int_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %int %arg_1
+         %25 = OpImageQuerySizeLod %uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %34 = OpLoad %uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_b46d97
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_b46d97
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_b46d97
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_b46d97
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_b46d97
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_b46d97
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.wgsl
index 8fa44e6..b623537 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_b46d97() {
   var arg_1 = 1i;
   var res : u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_b46d97();
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl
index 705df0b..f113cfb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rg32float, write>) -> u32
 fn textureDimensions_b51345() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.dxc.hlsl
index 83abb62..fd3b25d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b51345() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.fxc.hlsl
index 83abb62..fd3b25d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_b51345() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.msl
index d1ee550..2fe576c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_b51345(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_b51345(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_b51345(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_b51345(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_b51345(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_b51345(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_b51345(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_b51345(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.spvasm
index ba366c8..8776968 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -16,6 +16,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_b51345 "textureDimensions_b51345"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_b51345 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_b51345 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_b51345
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_b51345
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_b51345
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_b51345
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_b51345
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_b51345
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.wgsl
index 4da1873..7eab351 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_b51345() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_b51345();
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl
index c30f0fa..bf7fca6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_3d<f32>) -> vec3<u32>
 fn textureDimensions_bb95d9() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
index abb88d4..a778a68 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bb95d9() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
index abb88d4..a778a68 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bb95d9() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.glsl
index 2222166..e826968 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_bb95d9() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_bb95d9() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_bb95d9() {
   uvec3 res = uvec3(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.msl
index 7319205..a39c356 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_bb95d9(texture3d<float, access::sample> tint_symbol_1) {
+void textureDimensions_bb95d9(texture3d<float, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureDimensions_bb95d9(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_bb95d9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_bb95d9(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_bb95d9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_bb95d9(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_bb95d9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.spvasm
index 4529549..2f322c4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_bb95d9 "textureDimensions_bb95d9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %24 = OpConstantNull %v3uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_bb95d9 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v3uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_bb95d9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %31 = OpLoad %v3uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_bb95d9
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_bb95d9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_bb95d9
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_bb95d9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_bb95d9
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_bb95d9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.wgsl
index 24fab7a..24f70f1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_bb95d9() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_bb95d9();
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl
index 14e3679..fd60ba9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba8sint, write>) -> vec2<u32>
 fn textureDimensions_bbe285() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
index bc18dde..47573e3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bbe285() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
index bc18dde..47573e3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bbe285() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.glsl
index 2464082..2316be5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_bbe285() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_bbe285() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_bbe285() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.msl
index 35cf418..28efec6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_bbe285(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_bbe285(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_bbe285(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_bbe285(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_bbe285(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_bbe285(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_bbe285(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_bbe285(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.spvasm
index 5613469..104e650 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_bbe285 "textureDimensions_bbe285"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_bbe285 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_bbe285 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_bbe285
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_bbe285
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_bbe285
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_bbe285
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_bbe285
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_bbe285
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.wgsl
index b74acdf..e36a21b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_bbe285() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_bbe285();
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl
index 5ae0349..1e8527c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_bd94c8() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
index e47cbf9..b199e26 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bd94c8() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
index e47cbf9..b199e26 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_bd94c8() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.msl
index 786ddf8..23f52ba 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_bd94c8(depthcube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_bd94c8(depthcube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_bd94c8(tint_symbol_2);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_bd94c8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_bd94c8(tint_symbol_4);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_bd94c8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_bd94c8(tint_symbol_5);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_bd94c8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.spvasm
index eb9b16d..14baf0e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_bd94c8 "textureDimensions_bd94c8"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,49 +44,57 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %29 = OpConstantNull %v2uint
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_bd94c8 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %29
+%textureDimensions_bd94c8 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %32
                OpStore %arg_1 %uint_1
-         %25 = OpLoad %11 %arg_0
-         %26 = OpLoad %uint %arg_1
-         %23 = OpImageQuerySizeLod %v3uint %25 %26
-         %21 = OpVectorShuffle %v2uint %23 %23 0 1
-               OpStore %res %21
+         %28 = OpLoad %11 %arg_0
+         %29 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %28 %29
+         %25 = OpVectorShuffle %v2uint %26 %26 0 1
+               OpStore %res %25
+         %35 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %36 = OpLoad %v2uint %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_bd94c8
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_bd94c8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_bd94c8
+%fragment_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_bd94c8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureDimensions_bd94c8
+%compute_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureDimensions_bd94c8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.wgsl
index c5479d5..3a14b19 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_bd94c8() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_bd94c8();
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl
index 3c783c2..4d21c6c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba8uint, write>) -> vec2<u32>
 fn textureDimensions_c1dbf6() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
index ec06df9..2dfe016 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c1dbf6() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
index ec06df9..2dfe016 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c1dbf6() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.glsl
index 4c2ee10..4acf890 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c1dbf6() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c1dbf6() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c1dbf6() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.msl
index 04722f5..6aaebf5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c1dbf6(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_c1dbf6(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_c1dbf6(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_c1dbf6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c1dbf6(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c1dbf6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c1dbf6(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c1dbf6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.spvasm
index ae9f484..8b74255 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c1dbf6 "textureDimensions_c1dbf6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c1dbf6 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_c1dbf6 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_c1dbf6
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_c1dbf6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_c1dbf6
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_c1dbf6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_c1dbf6
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_c1dbf6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.wgsl
index 590817f..fd010a3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c1dbf6() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c1dbf6();
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl
index 6feb2e2..5556b0e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32>
 fn textureDimensions_c2cdd3() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
index 45db8ba..4ccb110 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c2cdd3() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
index 45db8ba..4ccb110 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c2cdd3() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.glsl
index ef3ef24..3e656b4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c2cdd3() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c2cdd3() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c2cdd3() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.msl
index 53a8299..10160db 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c2cdd3(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureDimensions_c2cdd3(depth2d_ms<float, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureDimensions_c2cdd3(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_c2cdd3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c2cdd3(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c2cdd3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c2cdd3(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c2cdd3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.spvasm
index c107a82..48a456f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c2cdd3 "textureDimensions_c2cdd3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,41 +42,49 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c2cdd3 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_c2cdd3 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_c2cdd3
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_c2cdd3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_c2cdd3
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_c2cdd3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_c2cdd3
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_c2cdd3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.wgsl
index 503bc4d..264ca2c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c2cdd3() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c2cdd3();
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl
index 51445e0..08b532e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba32sint, write>) -> vec2<u32>
 fn textureDimensions_c44fc1() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
index 26b09c0..e1378ab 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c44fc1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
index 26b09c0..e1378ab 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c44fc1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.glsl
index 65da687..b578f04 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c44fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c44fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c44fc1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.msl
index bf13ca8..71e0c37 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c44fc1(texture2d_array<int, access::write> tint_symbol_1) {
+void textureDimensions_c44fc1(texture2d_array<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureDimensions_c44fc1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_c44fc1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c44fc1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c44fc1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c44fc1(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c44fc1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.spvasm
index de28a79..f20713f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c44fc1 "textureDimensions_c44fc1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,43 +44,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %25 = OpConstantNull %v2uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c44fc1 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %25
-         %22 = OpLoad %11 %arg_0
-         %20 = OpImageQuerySize %v3uint %22
-         %17 = OpVectorShuffle %v2uint %20 %20 0 1
-               OpStore %res %17
+%textureDimensions_c44fc1 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %28
+         %25 = OpLoad %11 %arg_0
+         %23 = OpImageQuerySize %v3uint %25
+         %22 = OpVectorShuffle %v2uint %23 %23 0 1
+               OpStore %res %22
+         %31 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %32 = OpLoad %v2uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureDimensions_c44fc1
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureDimensions_c44fc1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %18
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_c44fc1
+%fragment_main = OpFunction %void None %18
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_c44fc1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_c44fc1
+%compute_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_c44fc1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.wgsl
index 3e9f662..6078ed8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c44fc1() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c44fc1();
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl
index 61e4f3b..9dfe105 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_depth_cube) -> vec2<u32>
 fn textureDimensions_c5a36e() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
index 2bfa274..eafd25f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c5a36e() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
index 2bfa274..eafd25f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c5a36e() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.glsl
index 8927ad3..f35d537 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c5a36e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c5a36e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_c5a36e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.msl
index 9d92d1f..80d9aa2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c5a36e(depthcube<float, access::sample> tint_symbol_1) {
+void textureDimensions_c5a36e(depthcube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
-  textureDimensions_c5a36e(tint_symbol_2);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_c5a36e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c5a36e(tint_symbol_4);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c5a36e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c5a36e(tint_symbol_5);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c5a36e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.spvasm
index 0992548..1c34fe9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c5a36e "textureDimensions_c5a36e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,43 +42,51 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c5a36e = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySizeLod %v2uint %19 %int_0
-               OpStore %res %16
+%textureDimensions_c5a36e = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v2uint %22 %int_0
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_c5a36e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_c5a36e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_c5a36e
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_c5a36e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_c5a36e
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_c5a36e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.wgsl
index 1f9256a..570a9bd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_c5a36e() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c5a36e();
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl
index 21836c0..1c1054a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_c871f3() {
   var arg_1 = 1u;
   var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
index 60276c7..92b8cb9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c871f3() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
index 60276c7..92b8cb9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_c871f3() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.glsl
index a3534d6..1d42694 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_c871f3() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_c871f3() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_c871f3() {
   uint arg_1 = 1u;
   uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.msl
index e9dd808..16c8e01 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_c871f3(texture3d<int, access::sample> tint_symbol_1) {
+void textureDimensions_c871f3(texture3d<int, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureDimensions_c871f3(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_c871f3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_c871f3(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_c871f3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_c871f3(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_c871f3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.spvasm
index 94bb170..2668008 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_c871f3 "textureDimensions_c871f3"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-     %v3uint = OpTypeVector %uint 3
+         %25 = OpConstantNull %uint
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %28 = OpConstantNull %v3uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_c871f3 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %21
-        %res = OpVariable %_ptr_Function_v3uint Function %28
+%textureDimensions_c871f3 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_v3uint Function %31
                OpStore %arg_1 %uint_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %uint %arg_1
-         %22 = OpImageQuerySizeLod %v3uint %24 %25
-               OpStore %res %22
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %35 = OpLoad %v3uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_c871f3
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_c871f3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_c871f3
+%fragment_main = OpFunction %void None %18
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_c871f3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_c871f3
+%compute_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_c871f3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.wgsl
index 80c862c..b423864 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_c871f3() {
   var arg_1 = 1u;
   var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_c871f3();
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl
index 0f4624c..41f7e5a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<r32sint, write>) -> vec2<u32>
 fn textureDimensions_cad3b7() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
index b26a056..7f40ae4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cad3b7() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
index b26a056..7f40ae4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cad3b7() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.glsl
index f133039..6963154 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cad3b7() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cad3b7() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cad3b7() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.msl
index 1fcfb3f..2242261 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_cad3b7(texture2d<int, access::write> tint_symbol_1) {
+void textureDimensions_cad3b7(texture2d<int, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
-  textureDimensions_cad3b7(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_cad3b7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_cad3b7(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_cad3b7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_cad3b7(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_cad3b7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.spvasm
index 0f7dfc3..a4eb0f0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_cad3b7 "textureDimensions_cad3b7"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 2D 0 0 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_cad3b7 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %20
-               OpStore %res %17
+%textureDimensions_cad3b7 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v2uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %30 = OpLoad %v2uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_cad3b7
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_cad3b7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_cad3b7
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_cad3b7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_cad3b7
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_cad3b7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.wgsl
index 24b1443..c73c1ca 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_cad3b7() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_cad3b7();
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl
index 391a94c..88b331c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba8snorm, write>) -> vec3<u32>
 fn textureDimensions_cc947b() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
index a29d944..6f83758 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cc947b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
index a29d944..6f83758 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cc947b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.glsl
index 3340606..f3b5c23 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_cc947b() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_cc947b() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_cc947b() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.msl
index 4d1cb5d..f811166 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_cc947b(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_cc947b(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_cc947b(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_cc947b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_cc947b(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_cc947b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_cc947b(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_cc947b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.spvasm
index a51f315..80a4f88 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_cc947b "textureDimensions_cc947b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_cc947b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_cc947b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_cc947b
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_cc947b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_cc947b
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_cc947b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_cc947b
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_cc947b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.wgsl
index c5ca2ec..98d645a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_cc947b() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_cc947b();
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl
index 3fc78f5..6a5e975 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_external) -> vec2<u32>
 fn textureDimensions_cdc6c9() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
index 70c59b9..e85dfad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
@@ -3,11 +3,13 @@
   uint4 ext_tex_params[13];
 };
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cdc6c9() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
index 70c59b9..e85dfad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
@@ -3,11 +3,13 @@
   uint4 ext_tex_params[13];
 };
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cdc6c9() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
index 8747181..b86cb50 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
@@ -46,8 +46,13 @@
 } ext_tex_params;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cdc6c9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -112,8 +117,13 @@
 } ext_tex_params;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cdc6c9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -172,8 +182,13 @@
 } ext_tex_params;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_cdc6c9() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl
index 61a10dc..28949f0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl
@@ -49,33 +49,34 @@
   float3x2 coordTransformationMatrix;
 };
 
-void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1) {
+void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureDimensions_cdc6c9(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_cdc6c9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_cdc6c9(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_cdc6c9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_cdc6c9(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_cdc6c9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm
index 920b2b5..1a0d067 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -37,6 +37,9 @@
                OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
                OpName %ext_tex_params "ext_tex_params"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_cdc6c9 "textureDimensions_cdc6c9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -75,6 +78,10 @@
                OpDecorate %ext_tex_params Binding 2
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -97,42 +104,50 @@
 %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
 %ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %23 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %27 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %34 = OpConstantNull %v2uint
-         %35 = OpTypeFunction %v4float
+         %37 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_cdc6c9 = OpFunction %void None %23
-         %26 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %34
-         %29 = OpLoad %11 %arg_0
-         %27 = OpImageQuerySizeLod %v2uint %29 %int_0
-               OpStore %res %27
+%textureDimensions_cdc6c9 = OpFunction %void None %27
+         %30 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %37
+         %32 = OpLoad %11 %arg_0
+         %31 = OpImageQuerySizeLod %v2uint %32 %int_0
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %41 = OpLoad %v2uint %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_cdc6c9
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_cdc6c9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %23
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %27
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %23
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureDimensions_cdc6c9
+%fragment_main = OpFunction %void None %27
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureDimensions_cdc6c9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %23
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureDimensions_cdc6c9
+%compute_main = OpFunction %void None %27
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureDimensions_cdc6c9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.wgsl
index f4ef228..fddb5e2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_cdc6c9() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_cdc6c9();
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl
index 38c0324..3f148cc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_cf2b50() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
index 97a8eaf..8ae59fb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cf2b50() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
index 97a8eaf..8ae59fb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_cf2b50() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.msl
index 911daf0..aa72617 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_cf2b50(texturecube_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_cf2b50(texturecube_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_cf2b50(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_cf2b50(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_cf2b50(tint_symbol_4);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_cf2b50(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_cf2b50(tint_symbol_5);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_cf2b50(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.spvasm
index db623e9..a8b9101 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_cf2b50 "textureDimensions_cf2b50"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,49 +44,57 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %29 = OpConstantNull %v2uint
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_cf2b50 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %29
+%textureDimensions_cf2b50 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %32
                OpStore %arg_1 %uint_1
-         %25 = OpLoad %11 %arg_0
-         %26 = OpLoad %uint %arg_1
-         %23 = OpImageQuerySizeLod %v3uint %25 %26
-         %21 = OpVectorShuffle %v2uint %23 %23 0 1
-               OpStore %res %21
+         %28 = OpLoad %11 %arg_0
+         %29 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %28 %29
+         %25 = OpVectorShuffle %v2uint %26 %26 0 1
+               OpStore %res %25
+         %35 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %36 = OpLoad %v2uint %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_cf2b50
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_cf2b50
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_cf2b50
+%fragment_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_cf2b50
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureDimensions_cf2b50
+%compute_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureDimensions_cf2b50
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.wgsl
index c277772..681d13a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_cf2b50() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_cf2b50();
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl
index 70e0536..904785e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba16sint, write>) -> u32
 fn textureDimensions_d08a94() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
index 033da1ff..6f219a8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d08a94() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
index 033da1ff..6f219a8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d08a94() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.glsl
index b4a0c70..a876ea7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_d08a94() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_d08a94() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_d08a94() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.msl
index c416401..82f0a35 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d08a94(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_d08a94(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_d08a94(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_d08a94(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d08a94(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d08a94(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d08a94(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d08a94(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.spvasm
index cffbbe5..6093d3d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d08a94 "textureDimensions_d08a94"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,40 +45,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d08a94 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_d08a94 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_d08a94
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_d08a94
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_d08a94
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_d08a94
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_d08a94
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_d08a94
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.wgsl
index 8a49fb8..0cac636 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d08a94() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d08a94();
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl
index c0213af..614a04f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<bgra8unorm, write>) -> vec2<u32>
 fn textureDimensions_d1b882() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.dxc.hlsl
index bbf8691..42884be 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d1b882() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.fxc.hlsl
index bbf8691..42884be 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d1b882() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.glsl
index 98a46253..37a302d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d1b882() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d1b882() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d1b882() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.msl
index 845a283..b1c60ce 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d1b882(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_d1b882(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_d1b882(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_d1b882(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d1b882(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d1b882(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d1b882(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d1b882(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.spvasm
index a2797a9..2bd4feb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d1b882 "textureDimensions_d1b882"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d1b882 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_d1b882 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_d1b882
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_d1b882
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_d1b882
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_d1b882
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_d1b882
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_d1b882
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.wgsl
index aace866..12ace7e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d1b882.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d1b882() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d1b882();
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl
index d13e39d..6163f33 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_d3accd() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
index 6151ec6..1e3c4ee 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d3accd() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
index 6151ec6..1e3c4ee 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d3accd() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.glsl
index 4cff9f3..7b04065 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d3accd() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d3accd() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp samplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d3accd() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.msl
index 8b3caa6..072f4ca 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d3accd(depthcube<float, access::sample> tint_symbol_1) {
+void textureDimensions_d3accd(depthcube<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
-  textureDimensions_d3accd(tint_symbol_2);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_d3accd(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d3accd(tint_symbol_4);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d3accd(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d3accd(tint_symbol_5);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d3accd(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.spvasm
index b2c86ae..0c89a99 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d3accd "textureDimensions_d3accd"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,47 +43,55 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %27 = OpConstantNull %v2uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d3accd = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %27
+%textureDimensions_d3accd = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %30
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %v2uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %34 = OpLoad %v2uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_d3accd
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_d3accd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_d3accd
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_d3accd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_d3accd
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_d3accd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.wgsl
index e52708c..0c02ac3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_d3accd() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d3accd();
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl
index 0188d69..8be364e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba32float, write>) -> vec2<u32>
 fn textureDimensions_d63c28() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
index e004506..2ef3dad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d63c28() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
index e004506..2ef3dad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d63c28() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.glsl
index e4679a4..bbd174e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d63c28() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d63c28() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d63c28() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.msl
index 9afba4a..c224f98 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d63c28(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_d63c28(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_d63c28(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_d63c28(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d63c28(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d63c28(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d63c28(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d63c28(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.spvasm
index 72b6139..b8bafbb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d63c28 "textureDimensions_d63c28"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d63c28 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_d63c28 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_d63c28
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_d63c28
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_d63c28
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_d63c28
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_d63c28
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_d63c28
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.wgsl
index 5e08214..591ab9c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d63c28() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d63c28();
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl
index 291f651..8c5b6c8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba32uint, write>) -> vec2<u32>
 fn textureDimensions_d8ba68() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
index 81ffa6c..da923bb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d8ba68() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
index 81ffa6c..da923bb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d8ba68() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.glsl
index fd4d413..d9d5a8f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d8ba68() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d8ba68() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_d8ba68() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.msl
index 933e158..f2039a8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d8ba68(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_d8ba68(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_d8ba68(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_d8ba68(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d8ba68(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d8ba68(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d8ba68(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d8ba68(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.spvasm
index 9c846eb..afb1900 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d8ba68 "textureDimensions_d8ba68"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d8ba68 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_d8ba68 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_d8ba68
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_d8ba68
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_d8ba68
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_d8ba68
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_d8ba68
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_d8ba68
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.wgsl
index c0908ff..dbd0a97 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d8ba68() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d8ba68();
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl
index 9c7bc22..70694a6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba8uint, write>) -> vec3<u32>
 fn textureDimensions_d8f887() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
index 917113f..c9a5d13 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d8f887() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
index 917113f..c9a5d13 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_d8f887() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.glsl
index c175bda..5c3606f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_d8f887() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_d8f887() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_d8f887() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.msl
index 8210fd2..59e81b7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_d8f887(texture3d<uint, access::write> tint_symbol_1) {
+void textureDimensions_d8f887(texture3d<uint, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
-  textureDimensions_d8f887(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_d8f887(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_d8f887(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_d8f887(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_d8f887(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_d8f887(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.spvasm
index a7f40d6..2ad5ae1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_d8f887 "textureDimensions_d8f887"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_d8f887 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %19
-               OpStore %res %17
+%textureDimensions_d8f887 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_d8f887
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_d8f887
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_d8f887
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_d8f887
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_d8f887
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_d8f887
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.wgsl
index 3b0a6fd..e4b5681 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_d8f887() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_d8f887();
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl
index 72b05e2..bab578b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba32float, write>) -> u32
 fn textureDimensions_da30d2() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
index db53401..e44b491 100644
--- a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_da30d2() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
index db53401..e44b491 100644
--- a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_da30d2() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.glsl
index 4a3d01d..6585696 100644
--- a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_da30d2() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_da30d2() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_da30d2() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.msl
index 46c48ac..038402e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_da30d2(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_da30d2(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_da30d2(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_da30d2(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_da30d2(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_da30d2(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_da30d2(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_da30d2(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.spvasm
index e7b2b01..723c3be 100644
--- a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_da30d2 "textureDimensions_da30d2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_da30d2 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_da30d2 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_da30d2
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_da30d2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_da30d2
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_da30d2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_da30d2
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_da30d2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.wgsl
index fb066ac..1e14937 100644
--- a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_da30d2() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_da30d2();
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl
index 9f76364..5703580 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<r32uint, write>) -> vec2<u32>
 fn textureDimensions_dc83ce() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
index 8f9d770..f68d917 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dc83ce() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
index 8f9d770..f68d917 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dc83ce() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.glsl
index 81558b4..dd892e1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dc83ce() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dc83ce() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dc83ce() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.msl
index f65454f..b1b28d9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_dc83ce(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_dc83ce(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_dc83ce(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_dc83ce(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_dc83ce(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_dc83ce(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_dc83ce(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_dc83ce(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.spvasm
index 77a8eae..0312cb1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_dc83ce "textureDimensions_dc83ce"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_dc83ce = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_dc83ce = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_dc83ce
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_dc83ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_dc83ce
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_dc83ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_dc83ce
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_dc83ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.wgsl
index 696ed4f..1de7869 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_dc83ce() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_dc83ce();
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl
index bdb1c2b..9b91360 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba8snorm, write>) -> vec2<u32>
 fn textureDimensions_dee461() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.dxc.hlsl
index a745fb1..d92e6a4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dee461() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.fxc.hlsl
index a745fb1..d92e6a4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dee461() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.glsl
index d608c49..1ffc53c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dee461() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dee461() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dee461() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.msl
index ed5309b..a454b79 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_dee461(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_dee461(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_dee461(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_dee461(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_dee461(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_dee461(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_dee461(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_dee461(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.spvasm
index 5a31cb4..455ffbb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_dee461 "textureDimensions_dee461"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_dee461 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_dee461 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_dee461
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_dee461
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_dee461
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_dee461
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_dee461
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_dee461
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.wgsl
index 52b68e4..31785c9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_dee461() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_dee461();
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl
index af5ce97..4830c43 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_dfdc32() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
index c46a201..66c0a46 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dfdc32() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
index c46a201..66c0a46 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_dfdc32() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.glsl
index b28c401..26c86d9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dfdc32() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dfdc32() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_dfdc32() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.msl
index 68f883a..46e6dcd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_dfdc32(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_dfdc32(depth2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_dfdc32(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_dfdc32(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_dfdc32(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_dfdc32(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_dfdc32(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_dfdc32(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.spvasm
index 21e5752..0fe4d8a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_dfdc32 "textureDimensions_dfdc32"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,50 +43,58 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_dfdc32 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_dfdc32 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %int_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %int %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %21 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %21
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %int %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_dfdc32
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_dfdc32
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_dfdc32
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_dfdc32
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_dfdc32
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_dfdc32
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.wgsl
index 002671d..8764cdd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_dfdc32() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_dfdc32();
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl
index e09efc0..236b5ba 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rgba8snorm, write>) -> u32
 fn textureDimensions_e122fe() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
index 051139d..d7d15fe 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e122fe() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
index 051139d..d7d15fe 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e122fe() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.glsl
index d4febc0..38d1b36 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_e122fe() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_e122fe() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_e122fe() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.msl
index a069344..05dd1ad 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e122fe(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_e122fe(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_e122fe(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_e122fe(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e122fe(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e122fe(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e122fe(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e122fe(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.spvasm
index a2f8217..b04e33a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e122fe "textureDimensions_e122fe"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e122fe = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_e122fe = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_e122fe
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_e122fe
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_e122fe
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_e122fe
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_e122fe
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_e122fe
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.wgsl
index 7c63426..bc6ffa1 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e122fe() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e122fe();
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl
index 73de72d..4ace821 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_e18a8b() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
index 1b76416..eefe24b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e18a8b() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
index 1b76416..eefe24b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e18a8b() {
   uint arg_1 = 1u;
   int3 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.glsl
index df802d0..4db6acd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e18a8b() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e18a8b() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e18a8b() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.msl
index cdc85a9..100e21b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e18a8b(texture2d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_e18a8b(texture2d<uint, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_e18a8b(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_e18a8b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e18a8b(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e18a8b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e18a8b(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e18a8b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.spvasm
index 3ec4b43..3b9fc73 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e18a8b "textureDimensions_e18a8b"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,46 +44,54 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %27 = OpConstantNull %v2uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e18a8b = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %27
+%textureDimensions_e18a8b = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %30
                OpStore %arg_1 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %21 = OpImageQuerySizeLod %v2uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %25 = OpImageQuerySizeLod %v2uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %34 = OpLoad %v2uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_e18a8b
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_e18a8b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %17
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_e18a8b
+%fragment_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_e18a8b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_e18a8b
+%compute_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_e18a8b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.wgsl
index 8b28152..471562b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_e18a8b() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e18a8b();
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl
index 551b92b..c65273b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_multisampled_2d<u32>) -> vec2<u32>
 fn textureDimensions_e4bfd2() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
index a3ba5e9..f7a2d79 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e4bfd2() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
index a3ba5e9..f7a2d79 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e4bfd2() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.glsl
index 7e8bd57..5bfee51 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4bfd2() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4bfd2() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4bfd2() {
   uvec2 res = uvec2(textureSize(arg_0_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.msl
index a80135e..5221d3f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e4bfd2(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureDimensions_e4bfd2(texture2d_ms<uint, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureDimensions_e4bfd2(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_e4bfd2(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e4bfd2(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e4bfd2(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e4bfd2(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e4bfd2(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.spvasm
index 8f34ad1..0ea8c85 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e4bfd2 "textureDimensions_e4bfd2"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e4bfd2 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_e4bfd2 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_e4bfd2
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_e4bfd2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_e4bfd2
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_e4bfd2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_e4bfd2
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_e4bfd2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.wgsl
index 5d5b8bc..8e7e5ef 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e4bfd2() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e4bfd2();
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl
index 03dceb1..1ae9bb6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_e4e310() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
index f694447..8a7385b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e4e310() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
index f694447..8a7385b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e4e310() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.glsl
index e2cfab4..3d1842c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4e310() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4e310() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e4e310() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.msl
index 18ffda4..5c2fb08 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e4e310(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_e4e310(texture2d_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_e4e310(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_e4e310(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e4e310(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e4e310(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e4e310(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e4e310(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.spvasm
index e4aa06a..a7dd321 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e4e310 "textureDimensions_e4e310"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,49 +44,57 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %25 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e4e310 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %21
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_e4e310 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %uint_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %uint %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %22 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %22
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %uint %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_e4e310
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_e4e310
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_e4e310
+%fragment_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_e4e310
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_e4e310
+%compute_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_e4e310
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.wgsl
index 7c23846..1faadef 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_e4e310() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e4e310();
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl
index eaae710..47a6cff 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_e5a203() {
   var arg_1 = 1i;
   var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
index 4609b60..236032d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e5a203() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
index 4609b60..236032d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e5a203() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint3 res = tint_tmp.xyz;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.glsl
index 237a6c8..a092734 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_e5a203() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_e5a203() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_e5a203() {
   int arg_1 = 1;
   uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.msl
index 22cfb73..79a8e3e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e5a203(texture3d<uint, access::sample> tint_symbol_1) {
+void textureDimensions_e5a203(texture3d<uint, access::sample> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   int arg_1 = 1;
   uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureDimensions_e5a203(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_e5a203(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e5a203(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e5a203(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e5a203(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e5a203(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.spvasm
index 382c8e0..2f24dd9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e5a203 "textureDimensions_e5a203"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %21 = OpConstantNull %int
-     %v3uint = OpTypeVector %uint 3
+         %25 = OpConstantNull %int
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %28 = OpConstantNull %v3uint
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e5a203 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %21
-        %res = OpVariable %_ptr_Function_v3uint Function %28
+%textureDimensions_e5a203 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v3uint Function %31
                OpStore %arg_1 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %22 = OpImageQuerySizeLod %v3uint %24 %25
-               OpStore %res %22
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %27 %28
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %35 = OpLoad %v3uint %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_e5a203
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_e5a203
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureDimensions_e5a203
+%fragment_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureDimensions_e5a203
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureDimensions_e5a203
+%compute_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureDimensions_e5a203
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.wgsl
index 0343a14..c22c2c2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_e5a203() {
   var arg_1 = 1i;
   var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e5a203();
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl
index e60e2db..06a624f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rg32sint, write>) -> vec3<u32>
 fn textureDimensions_e738f4() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
index 32c9a19..8838504 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e738f4() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
index 32c9a19..8838504 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e738f4() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.msl
index 4f00a61..0bd7f39 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e738f4(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_e738f4(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_e738f4(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_e738f4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e738f4(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e738f4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e738f4(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e738f4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.spvasm
index f47fb82..2c62d26 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e738f4 "textureDimensions_e738f4"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,41 +45,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e738f4 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_e738f4 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_e738f4
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_e738f4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_e738f4
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_e738f4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_e738f4
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_e738f4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.wgsl
index d6b582c..e3fc8d3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e738f4() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e738f4();
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl
index e5025f0..1ed7571 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba16uint, write>) -> vec2<u32>
 fn textureDimensions_e99308() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.dxc.hlsl
index 2085764..7e11ef7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e99308() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.fxc.hlsl
index 2085764..7e11ef7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_e99308() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.glsl
index 51d74f1..a9726ab 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e99308() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e99308() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_e99308() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.msl
index e74a4e7..9a21c05 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_e99308(texture2d<uint, access::write> tint_symbol_1) {
+void textureDimensions_e99308(texture2d<uint, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
-  textureDimensions_e99308(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_e99308(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_e99308(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_e99308(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_e99308(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_e99308(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.spvasm
index 212b7e2..2406512 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_e99308 "textureDimensions_e99308"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_e99308 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v2uint %19
-               OpStore %res %17
+%textureDimensions_e99308 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_e99308
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_e99308
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_e99308
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_e99308
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_e99308
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_e99308
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.wgsl
index b3346dc..14d0af3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_e99308() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_e99308();
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl
index ec3f376..e80a2ea 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<r32float, write>) -> u32
 fn textureDimensions_ea066c() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
index 5e0b777..d637b21 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ea066c() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
index 5e0b777..d637b21 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ea066c() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.glsl
index ea156b2..5547462 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ea066c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ea066c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_ea066c() {
   uint res = uvec2(imageSize(arg_0)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.msl
index 9da6c0d..e763dc2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_ea066c(texture1d<float, access::write> tint_symbol_1) {
+void textureDimensions_ea066c(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
-  textureDimensions_ea066c(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_ea066c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_ea066c(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_ea066c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_ea066c(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_ea066c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.spvasm
index 7644858..de79c1d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_ea066c "textureDimensions_ea066c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_ea066c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %uint %18
-               OpStore %res %16
+%textureDimensions_ea066c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_ea066c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_ea066c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_ea066c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_ea066c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_ea066c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_ea066c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.wgsl
index dd5fb14..e0a8258 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_ea066c() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_ea066c();
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl
index ffb3521..ff116c2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rg32uint, write>) -> u32
 fn textureDimensions_ea25bc() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
index 11fbba9..e24f03a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ea25bc() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
index 11fbba9..e24f03a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ea25bc() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.msl
index 884b655..3a33ce8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_ea25bc(texture1d<uint, access::write> tint_symbol_1) {
+void textureDimensions_ea25bc(texture1d<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
-  textureDimensions_ea25bc(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_ea25bc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_ea25bc(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_ea25bc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_ea25bc(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_ea25bc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.spvasm
index 04dabbf..79c856c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -16,6 +16,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_ea25bc "textureDimensions_ea25bc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -39,39 +46,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_ea25bc = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %18
-               OpStore %res %17
+%textureDimensions_ea25bc = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySize %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureDimensions_ea25bc
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureDimensions_ea25bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureDimensions_ea25bc
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureDimensions_ea25bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_ea25bc
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_ea25bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.wgsl
index 0c96ea0..37a6a55 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_ea25bc() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_ea25bc();
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl
index b8c7fbc..8b2cacd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_eafe19() {
   var arg_1 = 1u;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
index 16f8cae..9c460ba 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_eafe19() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
index 16f8cae..9c460ba 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_eafe19() {
   uint arg_1 = 1u;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.glsl
index 986faec..0a02a51 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eafe19() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eafe19() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eafe19() {
   uint arg_1 = 1u;
   uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.msl
index 3d8648c..f4f6fac 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_eafe19(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureDimensions_eafe19(depth2d_array<float, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureDimensions_eafe19(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_eafe19(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_eafe19(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_eafe19(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_eafe19(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_eafe19(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.spvasm
index 8bb393e..6cc8309 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_eafe19 "textureDimensions_eafe19"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,49 +43,57 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+     %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v2uint = OpTypeVector %uint 2
+         %24 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %29 = OpConstantNull %v2uint
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_eafe19 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %29
+%textureDimensions_eafe19 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v2uint Function %32
                OpStore %arg_1 %uint_1
-         %25 = OpLoad %11 %arg_0
-         %26 = OpLoad %uint %arg_1
-         %23 = OpImageQuerySizeLod %v3uint %25 %26
-         %21 = OpVectorShuffle %v2uint %23 %23 0 1
-               OpStore %res %21
+         %28 = OpLoad %11 %arg_0
+         %29 = OpLoad %uint %arg_1
+         %26 = OpImageQuerySizeLod %v3uint %28 %29
+         %25 = OpVectorShuffle %v2uint %26 %26 0 1
+               OpStore %res %25
+         %35 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %36 = OpLoad %v2uint %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_eafe19
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_eafe19
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureDimensions_eafe19
+%fragment_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureDimensions_eafe19
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureDimensions_eafe19
+%compute_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureDimensions_eafe19
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.wgsl
index bbf6cfe..a5854e6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_eafe19() {
   var arg_1 = 1u;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_eafe19();
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl
index 05adc5b..7d9c45b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d_array<rgba16float, write>) -> vec2<u32>
 fn textureDimensions_eb03b1() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
index cbab187..18c0859 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_eb03b1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
index cbab187..18c0859 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_eb03b1() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.glsl
index dfc6512..b26825c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eb03b1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eb03b1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_eb03b1() {
   uvec2 res = uvec2(imageSize(arg_0).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.msl
index 4cfae71..886467f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_eb03b1(texture2d_array<float, access::write> tint_symbol_1) {
+void textureDimensions_eb03b1(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureDimensions_eb03b1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_eb03b1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_eb03b1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_eb03b1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_eb03b1(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_eb03b1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.spvasm
index 1685567..4bfa443 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_eb03b1 "textureDimensions_eb03b1"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_eb03b1 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %16 = OpVectorShuffle %v2uint %19 %19 0 1
-               OpStore %res %16
+%textureDimensions_eb03b1 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpVectorShuffle %v2uint %22 %22 0 1
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_eb03b1
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_eb03b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_eb03b1
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_eb03b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_eb03b1
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_eb03b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.wgsl
index 3eefe24..732d9bc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_eb03b1() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_eb03b1();
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl
index 8dec9e5..95abb27 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<r32sint, write>) -> vec3<u32>
 fn textureDimensions_ef2e58() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
index 574ab12..89d7a1e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ef2e58() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
index 574ab12..89d7a1e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_ef2e58() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.glsl
index 15d4aaf..1ff0462 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_ef2e58() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_ef2e58() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_ef2e58() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.msl
index d52234e..09677c6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_ef2e58(texture3d<int, access::write> tint_symbol_1) {
+void textureDimensions_ef2e58(texture3d<int, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
-  textureDimensions_ef2e58(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_ef2e58(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_ef2e58(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_ef2e58(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_ef2e58(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_ef2e58(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.spvasm
index 70ed829..e69946b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_ef2e58 "textureDimensions_ef2e58"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %int 3D 0 0 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_ef2e58 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %v3uint %20
-               OpStore %res %17
+%textureDimensions_ef2e58 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %23
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %30 = OpLoad %v3uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureDimensions_ef2e58
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureDimensions_ef2e58
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %18
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_ef2e58
+%fragment_main = OpFunction %void None %18
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_ef2e58
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureDimensions_ef2e58
+%compute_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureDimensions_ef2e58
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.wgsl
index 0a1bbc4..a7b24c8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_ef2e58() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_ef2e58();
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl
index bb7fd53..6efb997 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_f17acd() {
   var arg_1 = 1i;
   var res: u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
index 8c9b4c2..4f50e6c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f17acd() {
   int arg_1 = 1;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
index 8c9b4c2..4f50e6c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f17acd() {
   int arg_1 = 1;
   int2 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.glsl
index edf4bb1..acb7c4d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_f17acd() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_f17acd() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureDimensions_f17acd() {
   int arg_1 = 1;
   uint res = uvec2(textureSize(arg_0_1, arg_1)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.msl
index f0c2ec8..5e0a76a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f17acd(texture1d<float, access::sample> tint_symbol_1) {
+void textureDimensions_f17acd(texture1d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   int arg_1 = 1;
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureDimensions_f17acd(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_f17acd(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f17acd(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f17acd(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f17acd(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f17acd(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.spvasm
index f8f5b8b..ac7c54d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f17acd "textureDimensions_f17acd"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,47 +44,55 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+       %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-       %uint = OpTypeInt 32 0
+         %24 = OpConstantNull %int
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-         %28 = OpTypeFunction %v4float
+         %30 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f17acd = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_uint Function %27
+%textureDimensions_f17acd = OpFunction %void None %16
+         %19 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %24
+        %res = OpVariable %_ptr_Function_uint Function %30
                OpStore %arg_1 %int_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %int %arg_1
-         %21 = OpImageQuerySizeLod %uint %23 %24
-               OpStore %res %21
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %int %arg_1
+         %25 = OpImageQuerySizeLod %uint %26 %27
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %34 = OpLoad %uint %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureDimensions_f17acd
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureDimensions_f17acd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_f17acd
+%fragment_main = OpFunction %void None %16
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_f17acd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_f17acd
+%compute_main = OpFunction %void None %16
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_f17acd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.wgsl
index 45a3b74..7bfcc17 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_f17acd() {
   var arg_1 = 1i;
   var res : u32 = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f17acd();
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl
index 25f67e4..d778c45 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_1d<rg32sint, write>) -> u32
 fn textureDimensions_f264a3() {
   var res: u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
index bed8fd8..dff7fb5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f264a3() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
index bed8fd8..dff7fb5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture1D<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f264a3() {
   int tint_tmp;
   arg_0.GetDimensions(tint_tmp);
   uint res = tint_tmp;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.msl
index 5feaa3c7..66395ba 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f264a3(texture1d<int, access::write> tint_symbol_1) {
+void textureDimensions_f264a3(texture1d<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_width(0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
-  textureDimensions_f264a3(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureDimensions_f264a3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f264a3(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f264a3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f264a3(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f264a3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.spvasm
index b148981..d21be41 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Image1D
@@ -16,6 +16,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f264a3 "textureDimensions_f264a3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -39,40 +46,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f264a3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySize %uint %19
-               OpStore %res %17
+%textureDimensions_f264a3 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_f264a3
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_f264a3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_f264a3
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_f264a3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_f264a3
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_f264a3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.wgsl
index 06c76194..efdfa1a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f264a3() {
   var res : u32 = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f264a3();
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl
index 8c973e9..bb126c6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_3d<rgba16float, write>) -> vec3<u32>
 fn textureDimensions_f3a2ac() {
   var res: vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
index 13201fc..8090856 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f3a2ac() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
index 13201fc..8090856 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f3a2ac() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint3 res = tint_tmp;
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.glsl
index 3d3366f..1b19e45 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_f3a2ac() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_f3a2ac() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec3 inner;
+} prevent_dce;
+
 void textureDimensions_f3a2ac() {
   uvec3 res = uvec3(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.msl
index 1550808..ddf78bf 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f3a2ac(texture3d<float, access::write> tint_symbol_1) {
+void textureDimensions_f3a2ac(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
   uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+  *(tint_symbol_2) = packed_uint3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
-  textureDimensions_f3a2ac(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+  textureDimensions_f3a2ac(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f3a2ac(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f3a2ac(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f3a2ac(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f3a2ac(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.spvasm
index 17304eb..6fd2002 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f3a2ac "textureDimensions_f3a2ac"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v3uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f3a2ac = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v3uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v3uint %19
-               OpStore %res %16
+%textureDimensions_f3a2ac = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v3uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+         %29 = OpLoad %v3uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_f3a2ac
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_f3a2ac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_f3a2ac
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_f3a2ac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_f3a2ac
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_f3a2ac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.wgsl
index 4173903..f0ff0e5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f3a2ac() {
   var res : vec3<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f3a2ac();
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl
index 7ea7cbb..72632d9 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<rgba32float, write>) -> vec2<u32>
 fn textureDimensions_f4e469() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
index ae5bd7a..361588c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f4e469() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
index ae5bd7a..361588c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f4e469() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.glsl
index 07ed54b..6b6261f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f4e469() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f4e469() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f4e469() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.msl
index 9fba981..2e79cec 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f4e469(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_f4e469(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_f4e469(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_f4e469(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f4e469(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f4e469(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f4e469(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f4e469(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.spvasm
index dbf3eb3..e5009f6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f4e469 "textureDimensions_f4e469"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f4e469 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_f4e469 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_f4e469
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_f4e469
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_f4e469
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_f4e469
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_f4e469
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_f4e469
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.wgsl
index fb9261d..c1d15a0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f4e469() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f4e469();
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl
index 8c49681..695ed87 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_cube<i32>) -> vec2<u32>
 fn textureDimensions_f626b3() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
index 9c15fdd..a428815 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f626b3() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
index 9c15fdd..a428815 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f626b3() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.glsl
index 9e55087..c4ade33 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f626b3() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f626b3() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isamplerCube arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f626b3() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.msl
index 3c7807b..fd4a2d3 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f626b3(texturecube<int, access::sample> tint_symbol_1) {
+void textureDimensions_f626b3(texturecube<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
-  textureDimensions_f626b3(tint_symbol_2);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_f626b3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f626b3(tint_symbol_4);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f626b3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f626b3(tint_symbol_5);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f626b3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.spvasm
index cb0bca3..cc01fdd 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f626b3 "textureDimensions_f626b3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f626b3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %20 %int_0
-               OpStore %res %17
+%textureDimensions_f626b3 = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v2uint %23 %int_0
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_f626b3
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_f626b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_f626b3
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_f626b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_f626b3
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_f626b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.wgsl
index 25acd3f..b0a3fae 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f626b3() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f626b3();
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl
index a80d3ec..6a025d7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_2d<i32>) -> vec2<u32>
 fn textureDimensions_f8522e() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
index c6710be..67b1a26 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f8522e() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
index c6710be..67b1a26 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_f8522e() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.glsl
index ae80518..a5532bc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f8522e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f8522e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_f8522e() {
   uvec2 res = uvec2(textureSize(arg_0_1, 0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.msl
index 8a65be1..30cefbb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_f8522e(texture2d<int, access::sample> tint_symbol_1) {
+void textureDimensions_f8522e(texture2d<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureDimensions_f8522e(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_f8522e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_f8522e(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_f8522e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_f8522e(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_f8522e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.spvasm
index f912b4a..b7c21ee 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_f8522e "textureDimensions_f8522e"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
       %int_0 = OpConstant %int 0
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %24 = OpConstantNull %v2uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_f8522e = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %24
-         %20 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySizeLod %v2uint %20 %int_0
-               OpStore %res %17
+%textureDimensions_f8522e = OpFunction %void None %18
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %27
+         %23 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v2uint %23 %int_0
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %31 = OpLoad %v2uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureDimensions_f8522e
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureDimensions_f8522e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %18
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureDimensions_f8522e
+%fragment_main = OpFunction %void None %18
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureDimensions_f8522e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureDimensions_f8522e
+%compute_main = OpFunction %void None %18
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureDimensions_f8522e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.wgsl
index a9491d4..bc0a02f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_f8522e() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_f8522e();
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl
index 3094b6a..62f5cf0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl
@@ -25,7 +25,9 @@
 // fn textureDimensions(texture: texture_storage_2d<bgra8unorm, write>) -> vec2<u32>
 fn textureDimensions_fbb15a() {
   var res: vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.dxc.hlsl
index 4de727e..afc4457 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_fbb15a() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.fxc.hlsl
index 4de727e..afc4457 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_fbb15a() {
   int2 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
   uint2 res = tint_tmp;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.glsl
index 5eeec24..611c55a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fbb15a() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fbb15a() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fbb15a() {
   uvec2 res = uvec2(imageSize(arg_0));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.msl
index ae23db0..1767300 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_fbb15a(texture2d<float, access::write> tint_symbol_1) {
+void textureDimensions_fbb15a(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
   uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
-  textureDimensions_fbb15a(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_fbb15a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_fbb15a(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_fbb15a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_fbb15a(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_fbb15a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.spvasm
index 3715140..c642386 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_fbb15a "textureDimensions_fbb15a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,41 +43,49 @@
          %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_fbb15a = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_v2uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySize %v2uint %19
-               OpStore %res %16
+%textureDimensions_fbb15a = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_v2uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v2uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %29 = OpLoad %v2uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureDimensions_fbb15a
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureDimensions_fbb15a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureDimensions_fbb15a
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureDimensions_fbb15a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureDimensions_fbb15a
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureDimensions_fbb15a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.wgsl
index 36b0d9e..038ae07 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fbb15a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureDimensions_fbb15a() {
   var res : vec2<u32> = textureDimensions(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_fbb15a();
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl
index 2359d78..33c4384 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl
@@ -26,7 +26,9 @@
 fn textureDimensions_fdf6e9() {
   var arg_1 = 1i;
   var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
index aa96c91..dc5ad94 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_fdf6e9() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
index aa96c91..dc5ad94 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureDimensions_fdf6e9() {
   int arg_1 = 1;
   int4 tint_tmp;
   arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint2 res = tint_tmp.xy;
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.glsl
index c2c98fc..bcf1e6c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fdf6e9() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fdf6e9() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec2 inner;
+} prevent_dce;
+
 void textureDimensions_fdf6e9() {
   int arg_1 = 1;
   uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.msl
index 849b694..bea8965 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureDimensions_fdf6e9(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureDimensions_fdf6e9(texture2d_array<int, access::sample> tint_symbol_1, device uint2* const tint_symbol_2) {
   int arg_1 = 1;
   uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureDimensions_fdf6e9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint2* const tint_symbol_4) {
+  textureDimensions_fdf6e9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureDimensions_fdf6e9(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+  textureDimensions_fdf6e9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureDimensions_fdf6e9(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+  textureDimensions_fdf6e9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.spvasm
index de44015..9135df8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureDimensions_fdf6e9 "textureDimensions_fdf6e9"
                OpName %arg_1 "arg_1"
                OpName %res "res"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,49 +44,57 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
-      %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %18 = OpTypeFunction %void
+      %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+         %25 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %30 = OpConstantNull %v2uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v2uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureDimensions_fdf6e9 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v2uint Function %30
+%textureDimensions_fdf6e9 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v2uint Function %33
                OpStore %arg_1 %int_1
-         %26 = OpLoad %11 %arg_0
-         %27 = OpLoad %int %arg_1
-         %24 = OpImageQuerySizeLod %v3uint %26 %27
-         %21 = OpVectorShuffle %v2uint %24 %24 0 1
-               OpStore %res %21
+         %29 = OpLoad %11 %arg_0
+         %30 = OpLoad %int %arg_1
+         %27 = OpImageQuerySizeLod %v3uint %29 %30
+         %26 = OpVectorShuffle %v2uint %27 %27 0 1
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+         %37 = OpLoad %v2uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureDimensions_fdf6e9
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureDimensions_fdf6e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %18
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureDimensions_fdf6e9
+%fragment_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureDimensions_fdf6e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureDimensions_fdf6e9
+%compute_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureDimensions_fdf6e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.wgsl
index 9138c00..6a277db 100644
--- a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureDimensions_fdf6e9() {
   var arg_1 = 1i;
   var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureDimensions_fdf6e9();
diff --git a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl
index cf83de4..70794bd 100644
--- a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1u;
   var arg_3 = vec3<f32>(1.f);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.dxc.hlsl
index d60956f..3c59a38 100644
--- a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_0166ec() {
   float3 arg_3 = (1.0f).xxx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.fxc.hlsl
index d60956f..3c59a38 100644
--- a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_0166ec() {
   float3 arg_3 = (1.0f).xxx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.glsl
index ec7e934..f9047d1 100644
--- a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_0166ec() {
   vec3 arg_3 = vec3(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_0166ec() {
   vec3 arg_3 = vec3(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_0166ec() {
   vec3 arg_3 = vec3(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.msl
index fee24ff..1d93084 100644
--- a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_0166ec(texturecube<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_0166ec(texturecube<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_0166ec(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_0166ec(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_0166ec(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_0166ec(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_0166ec(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_0166ec(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.spvasm
index 23ec392..6ce3771 100644
--- a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_0166ec "textureGather_0166ec"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
-      %v4int = OpTypeVector %int 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v3float
+         %33 = OpTypeSampledImage %11
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %37 = OpConstantNull %v4int
-         %38 = OpTypeFunction %v4float
-%textureGather_0166ec = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %37
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_3
-         %26 = OpImageGather %v4int %31 %32 %uint_1
-               OpStore %res %26
+         %40 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %45 = OpTypeFunction %v4float
+%textureGather_0166ec = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %40
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_3
+         %30 = OpImageGather %v4int %34 %35 %uint_1
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %44 = OpLoad %v4int %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_0166ec
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_0166ec
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %20
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_0166ec
+%fragment_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_0166ec
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_0166ec
+%compute_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_0166ec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.wgsl
index d268bb8..1b5ca88 100644
--- a/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/0166ec.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1u;
   var arg_3 = vec3<f32>(1.0f);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_0166ec();
diff --git a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl
index fa77c24..309ab1a 100644
--- a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.dxc.hlsl
index 4afd573..6109ce4 100644
--- a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_04fa78() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.fxc.hlsl
index 4afd573..6109ce4 100644
--- a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_04fa78() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.msl
index 3deccdb..d149271 100644
--- a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_04fa78(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_04fa78(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   uint arg_4 = 1u;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_04fa78(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_04fa78(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_04fa78(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_04fa78(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_04fa78(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_04fa78(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.spvasm
index 746c891..08b6dc4 100644
--- a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_04fa78 "textureGather_04fa78"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,62 +51,70 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
+         %29 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %46 = OpConstantNull %v4int
-         %47 = OpTypeFunction %v4float
-%textureGather_04fa78 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %46
-               OpStore %arg_3 %22
+         %49 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %54 = OpTypeFunction %v4float
+%textureGather_04fa78 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %49
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %uint %arg_4
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %31 = OpImageGather %v4int %36 %43 %uint_1
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %uint %arg_4
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %35 = OpImageGather %v4int %39 %46 %uint_1
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %53 = OpLoad %v4int %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_04fa78
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_04fa78
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_04fa78
+%fragment_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_04fa78
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_04fa78
+%compute_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_04fa78
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.wgsl
index 39758e3..639e22b 100644
--- a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_04fa78();
diff --git a/test/tint/builtins/gen/var/textureGather/10c554.wgsl b/test/tint/builtins/gen/var/textureGather/10c554.wgsl
index 05dff14..4d1fed8 100644
--- a/test/tint/builtins/gen/var/textureGather/10c554.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/10c554.wgsl
@@ -27,7 +27,9 @@
 fn textureGather_10c554() {
   var arg_2 = vec3<f32>(1.f);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.dxc.hlsl
index 1e4265c..48cabcc 100644
--- a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_10c554() {
   float3 arg_2 = (1.0f).xxx;
   float4 res = arg_0.Gather(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.fxc.hlsl
index 1e4265c..48cabcc 100644
--- a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_10c554() {
   float3 arg_2 = (1.0f).xxx;
   float4 res = arg_0.Gather(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.glsl
index 2a84b78..186cfe0 100644
--- a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_10c554() {
   vec3 arg_2 = vec3(1.0f);
   vec4 res = textureGather(arg_0_arg_1, arg_2, 0.0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_10c554() {
   vec3 arg_2 = vec3(1.0f);
   vec4 res = textureGather(arg_0_arg_1, arg_2, 0.0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_10c554() {
   vec3 arg_2 = vec3(1.0f);
   vec4 res = textureGather(arg_0_arg_1, arg_2, 0.0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.msl
index 5c6e114..5fbe750 100644
--- a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_10c554(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_10c554(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_10c554(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_10c554(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_10c554(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_10c554(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_10c554(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_10c554(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.spvasm
index ccd308b..4361823 100644
--- a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_10c554 "textureGather_10c554"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v3float
+         %31 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpTypeFunction %v4float
-%textureGather_10c554 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureGather_10c554 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
-         %26 = OpLoad %14 %arg_1
-         %27 = OpLoad %11 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v3float %arg_2
-         %25 = OpImageGather %v4float %29 %30 %int_0
-               OpStore %res %25
+               OpStore %arg_2 %24
+         %29 = OpLoad %14 %arg_1
+         %30 = OpLoad %11 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v3float %arg_2
+         %28 = OpImageGather %v4float %32 %33 %int_0
+               OpStore %res %28
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGather_10c554
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGather_10c554
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_10c554
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_10c554
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_10c554
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_10c554
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.wgsl
index ae368d7..8e3b653 100644
--- a/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/10c554.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureGather_10c554() {
   var arg_2 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_10c554();
diff --git a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl
index fb0c520..7512c54 100644
--- a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1u;
   var arg_3 = vec3<f32>(1.f);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.dxc.hlsl
index 1c983e7..4b58f3e 100644
--- a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_11b2db() {
   float3 arg_3 = (1.0f).xxx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.fxc.hlsl
index 1c983e7..4b58f3e 100644
--- a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_11b2db() {
   float3 arg_3 = (1.0f).xxx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.glsl
index 317ebf1..afde8a5 100644
--- a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_11b2db() {
   vec3 arg_3 = vec3(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_11b2db() {
   vec3 arg_3 = vec3(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_11b2db() {
   vec3 arg_3 = vec3(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.msl
index 7f10956..0e0e99d 100644
--- a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_11b2db(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_11b2db(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_11b2db(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_11b2db(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_11b2db(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_11b2db(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_11b2db(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_11b2db(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.spvasm
index a59ac56..ca1fff0 100644
--- a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_11b2db "textureGather_11b2db"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v3float
+         %31 = OpTypeSampledImage %11
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpTypeFunction %v4float
-%textureGather_11b2db = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %42 = OpTypeFunction %v4float
+%textureGather_11b2db = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
-         %26 = OpLoad %14 %arg_2
-         %27 = OpLoad %11 %arg_1
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v3float %arg_3
-         %25 = OpImageGather %v4float %29 %30 %uint_1
-               OpStore %res %25
+               OpStore %arg_3 %24
+         %29 = OpLoad %14 %arg_2
+         %30 = OpLoad %11 %arg_1
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v3float %arg_3
+         %28 = OpImageGather %v4float %32 %33 %uint_1
+               OpStore %res %28
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %41 = OpLoad %v4float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGather_11b2db
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureGather_11b2db
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_11b2db
+%fragment_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_11b2db
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_11b2db
+%compute_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_11b2db
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.wgsl
index 08e6fb4..930c2c5 100644
--- a/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/11b2db.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1u;
   var arg_3 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_11b2db();
diff --git a/test/tint/builtins/gen/var/textureGather/17baac.wgsl b/test/tint/builtins/gen/var/textureGather/17baac.wgsl
index 14e25b3..1f04a48 100644
--- a/test/tint/builtins/gen/var/textureGather/17baac.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/17baac.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.dxc.hlsl
index 72fd55e..a031443 100644
--- a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_17baac() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.fxc.hlsl
index 72fd55e..a031443 100644
--- a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_17baac() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.glsl
index 4887711..a5180b1 100644
--- a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_17baac() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_17baac() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_17baac() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.msl
index 615bad2..4747f6e 100644
--- a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_17baac(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_17baac(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_17baac(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_17baac(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_17baac(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_17baac(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_17baac(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_17baac(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.spvasm
index 0fbb131..9a04ca1 100644
--- a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_17baac "textureGather_17baac"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,62 +49,70 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %46 = OpTypeFunction %v4float
-%textureGather_17baac = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %53 = OpTypeFunction %v4float
+%textureGather_17baac = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %uint_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %uint %arg_4
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_1
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %uint %arg_4
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_1
+               OpStore %res %33
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_17baac
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_17baac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_17baac
+%fragment_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_17baac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_17baac
+%compute_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_17baac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.wgsl
index 9f0f4d8..bb735dc 100644
--- a/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/17baac.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_17baac();
diff --git a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl
index a705c58..0f5a82b 100644
--- a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.dxc.hlsl
index 0fb129e..1222d6d 100644
--- a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_1bf0ab() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.fxc.hlsl
index 0fb129e..1222d6d 100644
--- a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_1bf0ab() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.glsl
index 4e5727e..f505a88 100644
--- a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_1bf0ab() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_1bf0ab() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_1bf0ab() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.msl
index 7d8e52e..a07813c 100644
--- a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_1bf0ab(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_1bf0ab(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_1bf0ab(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_1bf0ab(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_1bf0ab(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_1bf0ab(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_1bf0ab(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_1bf0ab(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.spvasm
index 58681a8..783e219 100644
--- a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_1bf0ab "textureGather_1bf0ab"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,61 +50,69 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %45 = OpConstantNull %v4uint
-         %46 = OpTypeFunction %v4float
-%textureGather_1bf0ab = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
-        %res = OpVariable %_ptr_Function_v4uint Function %45
-               OpStore %arg_3 %22
+         %48 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %53 = OpTypeFunction %v4float
+%textureGather_1bf0ab = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %33
+        %res = OpVariable %_ptr_Function_v4uint Function %48
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %37 = OpLoad %v2float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %41 = OpLoad %uint %arg_4
-         %40 = OpConvertUToF %float %41
-         %42 = OpCompositeConstruct %v3float %38 %39 %40
-         %30 = OpImageGather %v4uint %35 %42 %uint_1
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %40 = OpLoad %v2float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %44 = OpLoad %uint %arg_4
+         %43 = OpConvertUToF %float %44
+         %45 = OpCompositeConstruct %v3float %41 %42 %43
+         %34 = OpImageGather %v4uint %38 %45 %uint_1
+               OpStore %res %34
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %52 = OpLoad %v4uint %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_1bf0ab
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_1bf0ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_1bf0ab
+%fragment_main = OpFunction %void None %20
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_1bf0ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_1bf0ab
+%compute_main = OpFunction %void None %20
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_1bf0ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.wgsl
index d9a878d..0e99409 100644
--- a/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/1bf0ab.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_1bf0ab();
diff --git a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl
index 1b44370..fbd573f 100644
--- a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   const arg_3 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.dxc.hlsl
index e305a42..79a6c12 100644
--- a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,13 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_1f7f6b() {
   float2 arg_2 = (1.0f).xx;
   float4 res = arg_0.Gather(arg_1, arg_2, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -32,3 +36,40 @@
   textureGather_1f7f6b();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.fxc.hlsl
index e305a42..69322f3 100644
--- a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_1f7f6b() {
   float2 arg_2 = (1.0f).xx;
   float4 res = arg_0.Gather(arg_1, arg_2, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.glsl
index ecf2cdb..20515d0 100644
--- a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_1f7f6b() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_0_arg_1, arg_2, 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_1f7f6b() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_0_arg_1, arg_2, 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_1f7f6b() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_0_arg_1, arg_2, 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.msl
index ebfd105..1d91983 100644
--- a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_1f7f6b(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_1f7f6b(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_1f7f6b(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_1f7f6b(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_1f7f6b(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_1f7f6b(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_1f7f6b(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_1f7f6b(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.spvasm
index a591867..b37ff53 100644
--- a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_1f7f6b "textureGather_1f7f6b"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,53 +48,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v2float
+         %31 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %35 = OpConstantComposite %v2int %int_1 %int_1
+         %38 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
-%textureGather_1f7f6b = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %46 = OpTypeFunction %v4float
+%textureGather_1f7f6b = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
-         %26 = OpLoad %14 %arg_1
-         %27 = OpLoad %11 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v2float %arg_2
-         %25 = OpImageGather %v4float %29 %30 %int_0 ConstOffset %35
-               OpStore %res %25
+               OpStore %arg_2 %24
+         %29 = OpLoad %14 %arg_1
+         %30 = OpLoad %11 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v2float %arg_2
+         %28 = OpImageGather %v4float %32 %33 %int_0 ConstOffset %38
+               OpStore %res %28
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_1f7f6b
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_1f7f6b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_1f7f6b
+%fragment_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_1f7f6b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_1f7f6b
+%compute_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_1f7f6b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.wgsl
index a44f565..e3298b6 100644
--- a/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/1f7f6b.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   const arg_3 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_1f7f6b();
diff --git a/test/tint/builtins/gen/var/textureGather/22e930.wgsl b/test/tint/builtins/gen/var/textureGather/22e930.wgsl
index 507c665..3cf8066 100644
--- a/test/tint/builtins/gen/var/textureGather/22e930.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/22e930.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.dxc.hlsl
index 945645e..cbe1069 100644
--- a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_22e930() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.fxc.hlsl
index 945645e..cbe1069 100644
--- a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_22e930() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.glsl
index 618b4d8..0dfc33b 100644
--- a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_22e930() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_22e930() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_22e930() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.msl
index f24c163..8a81e47 100644
--- a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_22e930(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_22e930(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_22e930(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_22e930(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_22e930(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_22e930(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_22e930(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_22e930(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.spvasm
index 80bd120..b874cc6 100644
--- a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_22e930 "textureGather_22e930"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,60 +49,69 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %44 = OpTypeFunction %v4float
-%textureGather_22e930 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %52 = OpTypeFunction %v4float
+%textureGather_22e930 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %int_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %int %arg_4
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_1
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %int %arg_4
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_1
+               OpStore %res %33
+         %50 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %51 = OpLoad %v4float %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_22e930
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_22e930
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_22e930
+%fragment_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGather_22e930
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_22e930
+%compute_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_22e930
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.wgsl
index e35eec4..6d4fb8e 100644
--- a/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/22e930.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_22e930();
diff --git a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl
index 2e4fcc6..5c63bf8 100644
--- a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.dxc.hlsl
index 51aa04d..f7d827d 100644
--- a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_238ec4() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_238ec4();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.fxc.hlsl
index 51aa04d..536cc0e 100644
--- a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_238ec4() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.glsl
index e7fb956..e34db15 100644
--- a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_238ec4() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_238ec4() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_238ec4() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.msl
index 51590a7..68ad7d1 100644
--- a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_238ec4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_238ec4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_238ec4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_238ec4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_238ec4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_238ec4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_238ec4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_238ec4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.spvasm
index 6eca3ae..dd387d8 100644
--- a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_238ec4 "textureGather_238ec4"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,64 +49,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %45 = OpConstantComposite %v2int %int_1 %int_1
+         %48 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %48 = OpTypeFunction %v4float
-%textureGather_238ec4 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureGather_238ec4 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %uint_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %uint %arg_4
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %uint_1 ConstOffset %45
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %uint %arg_4
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %uint_1 ConstOffset %48
+               OpStore %res %33
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_238ec4
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_238ec4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_238ec4
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_238ec4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_238ec4
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_238ec4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.wgsl
index bc1135b..7bc9715 100644
--- a/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/238ec4.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_238ec4();
diff --git a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl
index d6a5989..87034cd 100644
--- a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.dxc.hlsl
index 832e6ef..97d5d8d 100644
--- a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_24b0bd() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.fxc.hlsl
index 832e6ef..97d5d8d 100644
--- a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_24b0bd() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.glsl
index a1159f2..087a39e 100644
--- a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_24b0bd() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_24b0bd() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_24b0bd() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.msl
index 831c736..eb513ef 100644
--- a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_24b0bd(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_24b0bd(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_24b0bd(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_24b0bd(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_24b0bd(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_24b0bd(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_24b0bd(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_24b0bd(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.spvasm
index 98ce9c6..20af37c 100644
--- a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_24b0bd "textureGather_24b0bd"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,62 +49,70 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %46 = OpTypeFunction %v4float
-%textureGather_24b0bd = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %53 = OpTypeFunction %v4float
+%textureGather_24b0bd = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %int_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %int %arg_4
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %uint_1
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %int %arg_4
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %uint_1
+               OpStore %res %33
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_24b0bd
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_24b0bd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_24b0bd
+%fragment_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_24b0bd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_24b0bd
+%compute_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_24b0bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.wgsl
index 84b2988..fe94f49 100644
--- a/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/24b0bd.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_24b0bd();
diff --git a/test/tint/builtins/gen/var/textureGather/269250.wgsl b/test/tint/builtins/gen/var/textureGather/269250.wgsl
index ffaca0e..df759e6 100644
--- a/test/tint/builtins/gen/var/textureGather/269250.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/269250.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.dxc.hlsl
index fc18377..a790242 100644
--- a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_269250() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.fxc.hlsl
index fc18377..a790242 100644
--- a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_269250() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.glsl
index bf6833a..8243acd 100644
--- a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_269250() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_269250() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_269250() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.msl
index 6c96964..c511b61 100644
--- a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_269250(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_269250(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_269250(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_269250(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_269250(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_269250(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_269250(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_269250(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.spvasm
index 030eb45..a25a8cb 100644
--- a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_269250 "textureGather_269250"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,62 +50,70 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %46 = OpConstantNull %v4int
-         %47 = OpTypeFunction %v4float
-%textureGather_269250 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %46
-               OpStore %arg_3 %22
+         %49 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %54 = OpTypeFunction %v4float
+%textureGather_269250 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %49
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_3
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_4
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %31 = OpImageGather %v4int %36 %43 %uint_1
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_3
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_4
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %35 = OpImageGather %v4int %39 %46 %uint_1
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %53 = OpLoad %v4int %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_269250
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_269250
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_269250
+%fragment_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_269250
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_269250
+%compute_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_269250
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.wgsl
index c6d0fba..ebb30e3 100644
--- a/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/269250.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_269250();
diff --git a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl
index 13c07d5..24d652c 100644
--- a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1u;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.dxc.hlsl
index 14b7917..589cc80 100644
--- a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2a4f40() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float4 res = arg_0.Gather(arg_1, float3(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.fxc.hlsl
index 14b7917..589cc80 100644
--- a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2a4f40() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float4 res = arg_0.Gather(arg_1, float3(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.glsl
index 347d5d8..ff5fe8a 100644
--- a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2a4f40() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2a4f40() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2a4f40() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.msl
index 2dab350..832c3ca 100644
--- a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_2a4f40(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_2a4f40(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2, arg_3);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_2a4f40(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_2a4f40(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_2a4f40(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_2a4f40(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_2a4f40(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_2a4f40(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.spvasm
index fcbc8b3..99b38bf 100644
--- a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_2a4f40 "textureGather_2a4f40"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,62 +49,70 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %46 = OpTypeFunction %v4float
-%textureGather_2a4f40 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %53 = OpTypeFunction %v4float
+%textureGather_2a4f40 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-         %31 = OpLoad %14 %arg_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_2
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %uint %arg_3
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_0
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_1
+         %35 = OpLoad %11 %arg_0
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_2
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %uint %arg_3
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_0
+               OpStore %res %33
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_2a4f40
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_2a4f40
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_2a4f40
+%fragment_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_2a4f40
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_2a4f40
+%compute_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_2a4f40
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.wgsl
index e86a396..be6d9da 100644
--- a/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/2a4f40.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1u;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_2a4f40();
diff --git a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl
index c423d01..ee55f4a 100644
--- a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.dxc.hlsl
index 9f48ff9..576af4b 100644
--- a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2cc066() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.fxc.hlsl
index 9f48ff9..576af4b 100644
--- a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2cc066() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.glsl
index 416f378..c91bd08 100644
--- a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_2cc066() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_2cc066() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_2cc066() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.msl
index 0d34a69..ee29d61 100644
--- a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_2cc066(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_2cc066(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_2cc066(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_2cc066(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_2cc066(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_2cc066(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_2cc066(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_2cc066(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.spvasm
index cbc4abe..fc48bc0 100644
--- a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_2cc066 "textureGather_2cc066"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,62 +50,70 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %46 = OpConstantNull %v4uint
-         %47 = OpTypeFunction %v4float
-%textureGather_2cc066 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %46
-               OpStore %arg_3 %22
+         %49 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %54 = OpTypeFunction %v4float
+%textureGather_2cc066 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %49
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_3
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_4
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %31 = OpImageGather %v4uint %36 %43 %int_1
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_3
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_4
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %35 = OpImageGather %v4uint %39 %46 %int_1
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %53 = OpLoad %v4uint %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_2cc066
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_2cc066
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_2cc066
+%fragment_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_2cc066
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_2cc066
+%compute_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_2cc066
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.wgsl
index 456b2e8..3180d9e 100644
--- a/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/2cc066.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_2cc066();
diff --git a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl
index eef9c5a..2d4c4d7 100644
--- a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl
@@ -27,7 +27,9 @@
 fn textureGather_2e0ed5() {
   var arg_2 = vec2<f32>(1.f);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.dxc.hlsl
index 2697be0..62c3ef0 100644
--- a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2e0ed5() {
   float2 arg_2 = (1.0f).xx;
   float4 res = arg_0.Gather(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.fxc.hlsl
index 2697be0..62c3ef0 100644
--- a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_2e0ed5() {
   float2 arg_2 = (1.0f).xx;
   float4 res = arg_0.Gather(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.glsl
index 87da032..f68eb1b 100644
--- a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2e0ed5() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureGather(arg_0_arg_1, arg_2, 0.0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2e0ed5() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureGather(arg_0_arg_1, arg_2, 0.0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_2e0ed5() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureGather(arg_0_arg_1, arg_2, 0.0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.msl
index dc3340b..70e8457 100644
--- a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_2e0ed5(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_2e0ed5(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_2e0ed5(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_2e0ed5(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_2e0ed5(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_2e0ed5(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_2e0ed5(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_2e0ed5(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.spvasm
index 77916f4..3350682 100644
--- a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_2e0ed5 "textureGather_2e0ed5"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v2float
+         %31 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpTypeFunction %v4float
-%textureGather_2e0ed5 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureGather_2e0ed5 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
-         %26 = OpLoad %14 %arg_1
-         %27 = OpLoad %11 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v2float %arg_2
-         %25 = OpImageGather %v4float %29 %30 %int_0
-               OpStore %res %25
+               OpStore %arg_2 %24
+         %29 = OpLoad %14 %arg_1
+         %30 = OpLoad %11 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v2float %arg_2
+         %28 = OpImageGather %v4float %32 %33 %int_0
+               OpStore %res %28
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGather_2e0ed5
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGather_2e0ed5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_2e0ed5
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_2e0ed5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_2e0ed5
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_2e0ed5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.wgsl
index 989f3b1..f3746d7 100644
--- a/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/2e0ed5.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureGather_2e0ed5() {
   var arg_2 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_2e0ed5();
diff --git a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl
index 467daed..f677489 100644
--- a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1i;
   var arg_3 = vec3<f32>(1.f);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.dxc.hlsl
index d7e7106..8b60ee7 100644
--- a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_32c4e8() {
   float3 arg_3 = (1.0f).xxx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.fxc.hlsl
index d7e7106..8b60ee7 100644
--- a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_32c4e8() {
   float3 arg_3 = (1.0f).xxx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.glsl
index 65a395e..9ddf0cd 100644
--- a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_32c4e8() {
   vec3 arg_3 = vec3(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_32c4e8() {
   vec3 arg_3 = vec3(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp samplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_32c4e8() {
   vec3 arg_3 = vec3(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.msl
index 384b43d..05103e5 100644
--- a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_32c4e8(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_32c4e8(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_32c4e8(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_32c4e8(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_32c4e8(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_32c4e8(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_32c4e8(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_32c4e8(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.spvasm
index 0679310..1050859 100644
--- a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_32c4e8 "textureGather_32c4e8"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v3float
+         %31 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpTypeFunction %v4float
-%textureGather_32c4e8 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureGather_32c4e8 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
-         %26 = OpLoad %14 %arg_2
-         %27 = OpLoad %11 %arg_1
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v3float %arg_3
-         %25 = OpImageGather %v4float %29 %30 %int_1
-               OpStore %res %25
+               OpStore %arg_3 %24
+         %29 = OpLoad %14 %arg_2
+         %30 = OpLoad %11 %arg_1
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v3float %arg_3
+         %28 = OpImageGather %v4float %32 %33 %int_1
+               OpStore %res %28
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGather_32c4e8
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGather_32c4e8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_32c4e8
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_32c4e8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_32c4e8
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_32c4e8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.wgsl
index 94a628c..c3f9cdb 100644
--- a/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/32c4e8.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1i;
   var arg_3 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_32c4e8();
diff --git a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl
index 9ca8ec5..881b80b 100644
--- a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1i;
   var arg_3 = vec3<f32>(1.f);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.dxc.hlsl
index eaf9419..246f571 100644
--- a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_3b32cc() {
   float3 arg_3 = (1.0f).xxx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.fxc.hlsl
index eaf9419..246f571 100644
--- a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_3b32cc() {
   float3 arg_3 = (1.0f).xxx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.glsl
index 29a4970..e7a712f 100644
--- a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_3b32cc() {
   vec3 arg_3 = vec3(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_3b32cc() {
   vec3 arg_3 = vec3(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_3b32cc() {
   vec3 arg_3 = vec3(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.msl
index e50181c..40c1948 100644
--- a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_3b32cc(texturecube<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_3b32cc(texturecube<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_3b32cc(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_3b32cc(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_3b32cc(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_3b32cc(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_3b32cc(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_3b32cc(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.spvasm
index 98c22b4..f2a6087 100644
--- a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_3b32cc "textureGather_3b32cc"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
-     %v4uint = OpTypeVector %uint 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v3float
+         %33 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %37 = OpConstantNull %v4uint
-         %38 = OpTypeFunction %v4float
-%textureGather_3b32cc = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %37
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_3
-         %26 = OpImageGather %v4uint %31 %32 %int_1
-               OpStore %res %26
+         %40 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %45 = OpTypeFunction %v4float
+%textureGather_3b32cc = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %40
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_3
+         %30 = OpImageGather %v4uint %34 %35 %int_1
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %44 = OpLoad %v4uint %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_3b32cc
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_3b32cc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %20
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_3b32cc
+%fragment_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_3b32cc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_3b32cc
+%compute_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_3b32cc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.wgsl
index 8a0e075..01e7d54 100644
--- a/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/3b32cc.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1i;
   var arg_3 = vec3<f32>(1.0f);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_3b32cc();
diff --git a/test/tint/builtins/gen/var/textureGather/43025d.wgsl b/test/tint/builtins/gen/var/textureGather/43025d.wgsl
index 1eac371..c9aded6 100644
--- a/test/tint/builtins/gen/var/textureGather/43025d.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/43025d.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1i;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.dxc.hlsl
index 1284613..176a37e 100644
--- a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_43025d() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float4 res = arg_0.Gather(arg_1, float4(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.fxc.hlsl
index 1284613..176a37e 100644
--- a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_43025d() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float4 res = arg_0.Gather(arg_1, float4(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.msl
index a5c8616..4e7e595 100644
--- a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_43025d(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_43025d(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2, arg_3);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_43025d(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_43025d(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_43025d(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_43025d(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_43025d(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_43025d(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.spvasm
index 3e8b0a4..28ed366 100644
--- a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_43025d "textureGather_43025d"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,61 +50,70 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %45 = OpTypeFunction %v4float
-%textureGather_43025d = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %53 = OpTypeFunction %v4float
+%textureGather_43025d = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-         %31 = OpLoad %14 %arg_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpSampledImage %33 %32 %31
-         %35 = OpLoad %v3float %arg_2
-         %36 = OpCompositeExtract %float %35 0
-         %37 = OpCompositeExtract %float %35 1
-         %38 = OpCompositeExtract %float %35 2
-         %40 = OpLoad %int %arg_3
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_0
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_1
+         %35 = OpLoad %11 %arg_0
+         %37 = OpSampledImage %36 %35 %34
+         %38 = OpLoad %v3float %arg_2
+         %39 = OpCompositeExtract %float %38 0
+         %40 = OpCompositeExtract %float %38 1
+         %41 = OpCompositeExtract %float %38 2
+         %43 = OpLoad %int %arg_3
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v4float %39 %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_0
+               OpStore %res %33
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_43025d
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_43025d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGather_43025d
+%fragment_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_43025d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_43025d
+%compute_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_43025d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.wgsl
index b693dd2..c613946 100644
--- a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1i;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_43025d();
diff --git a/test/tint/builtins/gen/var/textureGather/445793.wgsl b/test/tint/builtins/gen/var/textureGather/445793.wgsl
index 92c5d40..d896059 100644
--- a/test/tint/builtins/gen/var/textureGather/445793.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/445793.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.dxc.hlsl
index 38175e3..1bf9505 100644
--- a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_445793() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.fxc.hlsl
index 38175e3..1bf9505 100644
--- a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_445793() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.glsl
index 6b372ac..2185e4b 100644
--- a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_445793() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_445793() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_445793() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.msl
index a3d869a..83d0c2d 100644
--- a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_445793(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_445793(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_445793(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_445793(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_445793(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_445793(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_445793(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_445793(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.spvasm
index 6b025b8..71cba11 100644
--- a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_445793 "textureGather_445793"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,63 +50,71 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %47 = OpConstantNull %v4int
-         %48 = OpTypeFunction %v4float
-%textureGather_445793 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
-        %res = OpVariable %_ptr_Function_v4int Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %55 = OpTypeFunction %v4float
+%textureGather_445793 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %33
+        %res = OpVariable %_ptr_Function_v4int Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %37 = OpLoad %v2float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %41 = OpLoad %int %arg_4
-         %40 = OpConvertSToF %float %41
-         %42 = OpCompositeConstruct %v3float %38 %39 %40
-         %30 = OpImageGather %v4int %35 %42 %uint_1
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %40 = OpLoad %v2float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %44 = OpLoad %int %arg_4
+         %43 = OpConvertSToF %float %44
+         %45 = OpCompositeConstruct %v3float %41 %42 %43
+         %34 = OpImageGather %v4int %38 %45 %uint_1
+               OpStore %res %34
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %54 = OpLoad %v4int %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_445793
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_445793
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_445793
+%fragment_main = OpFunction %void None %20
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_445793
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_445793
+%compute_main = OpFunction %void None %20
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_445793
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.wgsl
index 7ddaed0..f3b5b44 100644
--- a/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/445793.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_445793();
diff --git a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl
index b5a1bd2..7c787fd 100644
--- a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   const arg_4 = vec2<i32>(1i);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.dxc.hlsl
index 97cef51..9c9e4b1 100644
--- a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.dxc.hlsl
@@ -1,9 +1,13 @@
+SKIP: FAILED
+
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_49b07f() {
   float2 arg_3 = (1.0f).xx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -32,3 +36,40 @@
   textureGather_49b07f();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.fxc.hlsl
index 97cef51..a59468b 100644
--- a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_49b07f() {
   float2 arg_3 = (1.0f).xx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.glsl
index f16d38b..1456aec 100644
--- a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_49b07f() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_49b07f() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_49b07f() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.msl
index 554eaa6..228c650 100644
--- a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_49b07f(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_49b07f(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_49b07f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_49b07f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_49b07f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_49b07f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_49b07f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_49b07f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.spvasm
index 7558727..bae6fca 100644
--- a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_49b07f "textureGather_49b07f"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,54 +49,62 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
-     %v4uint = OpTypeVector %uint 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %36 = OpConstantComposite %v2int %int_1 %int_1
+         %39 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %39 = OpConstantNull %v4uint
-         %40 = OpTypeFunction %v4float
-%textureGather_49b07f = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %39
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_3
-         %26 = OpImageGather %v4uint %31 %32 %int_1 ConstOffset %36
-               OpStore %res %26
+         %42 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %47 = OpTypeFunction %v4float
+%textureGather_49b07f = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %42
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_3
+         %30 = OpImageGather %v4uint %34 %35 %int_1 ConstOffset %39
+               OpStore %res %30
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %46 = OpLoad %v4uint %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGather_49b07f
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_49b07f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_49b07f
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_49b07f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_49b07f
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_49b07f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.wgsl
index 8704bc1..f2518a1 100644
--- a/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/49b07f.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   const arg_4 = vec2<i32>(1i);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_49b07f();
diff --git a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl
index 9f76bb5..346e894 100644
--- a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.dxc.hlsl
index 5011165..5dacf55 100644
--- a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_4b8103() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_4b8103();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.fxc.hlsl
index 5011165..acfab87 100644
--- a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_4b8103() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.glsl
index 1edafe5..e7c6380 100644
--- a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_4b8103() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_4b8103() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_4b8103() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.msl
index ebc75ff..fcb7503 100644
--- a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_4b8103(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_4b8103(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_4b8103(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_4b8103(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_4b8103(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_4b8103(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_4b8103(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_4b8103(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.spvasm
index 31b230e..86fe6a1 100644
--- a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_4b8103 "textureGather_4b8103"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,62 +49,71 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %43 = OpConstantComposite %v2int %int_1 %int_1
+         %46 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %46 = OpTypeFunction %v4float
-%textureGather_4b8103 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %54 = OpTypeFunction %v4float
+%textureGather_4b8103 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %int_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %int %arg_4
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_1 ConstOffset %43
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %int %arg_4
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_1 ConstOffset %46
+               OpStore %res %33
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %53 = OpLoad %v4float %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_4b8103
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_4b8103
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_4b8103
+%fragment_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_4b8103
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_4b8103
+%compute_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_4b8103
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.wgsl
index 2e80b1a..1d6a8d9 100644
--- a/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/4b8103.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_4b8103();
diff --git a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl
index b9ca9f7..587c7e2 100644
--- a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.dxc.hlsl
index 4a2c242..fc13de0 100644
--- a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_4e8ac5() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.fxc.hlsl
index 4a2c242..fc13de0 100644
--- a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_4e8ac5() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.glsl
index eaecf15..313a123 100644
--- a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_4e8ac5() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_4e8ac5() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_4e8ac5() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.msl
index bf7d3ab..0dfb263 100644
--- a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_4e8ac5(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_4e8ac5(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_4e8ac5(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_4e8ac5(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_4e8ac5(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_4e8ac5(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_4e8ac5(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_4e8ac5(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.spvasm
index 4748563..3a75c70 100644
--- a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_4e8ac5 "textureGather_4e8ac5"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,63 +50,71 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %47 = OpConstantNull %v4int
-         %48 = OpTypeFunction %v4float
-%textureGather_4e8ac5 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %55 = OpTypeFunction %v4float
+%textureGather_4e8ac5 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_3
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_4
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %31 = OpImageGather %v4int %36 %43 %int_1
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_3
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_4
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %35 = OpImageGather %v4int %39 %46 %int_1
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %54 = OpLoad %v4int %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_4e8ac5
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_4e8ac5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_4e8ac5
+%fragment_main = OpFunction %void None %20
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_4e8ac5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_4e8ac5
+%compute_main = OpFunction %void None %20
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_4e8ac5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.wgsl
index 742d85e..ea14686 100644
--- a/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/4e8ac5.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_4e8ac5();
diff --git a/test/tint/builtins/gen/var/textureGather/5266da.wgsl b/test/tint/builtins/gen/var/textureGather/5266da.wgsl
index 70b0b57..ba4e9c8 100644
--- a/test/tint/builtins/gen/var/textureGather/5266da.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/5266da.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1i;
   var arg_3 = vec2<f32>(1.f);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.dxc.hlsl
index a7dba3d..8f601ad 100644
--- a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5266da() {
   float2 arg_3 = (1.0f).xx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.fxc.hlsl
index a7dba3d..8f601ad 100644
--- a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5266da() {
   float2 arg_3 = (1.0f).xx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.glsl
index 4aa9d51..9447779 100644
--- a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_5266da() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_5266da() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_5266da() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.msl
index 71f3134..22bf0b8 100644
--- a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_5266da(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_5266da(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_5266da(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_5266da(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_5266da(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_5266da(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_5266da(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_5266da(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.spvasm
index 3281e7b..9831375 100644
--- a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_5266da "textureGather_5266da"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,59 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v2float
+         %31 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpTypeFunction %v4float
-%textureGather_5266da = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %43 = OpTypeFunction %v4float
+%textureGather_5266da = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
-         %26 = OpLoad %14 %arg_2
-         %27 = OpLoad %11 %arg_1
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v2float %arg_3
-         %25 = OpImageGather %v4float %29 %30 %int_1
-               OpStore %res %25
+               OpStore %arg_3 %24
+         %29 = OpLoad %14 %arg_2
+         %30 = OpLoad %11 %arg_1
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v2float %arg_3
+         %28 = OpImageGather %v4float %32 %33 %int_1
+               OpStore %res %28
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %42 = OpLoad %v4float %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGather_5266da
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureGather_5266da
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %18
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_5266da
+%fragment_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureGather_5266da
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_5266da
+%compute_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_5266da
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.wgsl
index 5d30699..e20c695 100644
--- a/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/5266da.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1i;
   var arg_3 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_5266da();
diff --git a/test/tint/builtins/gen/var/textureGather/59372a.wgsl b/test/tint/builtins/gen/var/textureGather/59372a.wgsl
index ea37944..eba8151 100644
--- a/test/tint/builtins/gen/var/textureGather/59372a.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/59372a.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.dxc.hlsl
index 1843c50..7a18a0a 100644
--- a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_59372a() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_59372a();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.fxc.hlsl
index 1843c50..14b9ab4 100644
--- a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_59372a() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.glsl
index a0cd1ad..ef49fee 100644
--- a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_59372a() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_59372a() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_59372a() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.msl
index ac817ac..92a3259 100644
--- a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_59372a(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_59372a(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_59372a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_59372a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_59372a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_59372a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_59372a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_59372a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.spvasm
index 502415e..ba95d2f 100644
--- a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_59372a "textureGather_59372a"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,64 +49,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %45 = OpConstantComposite %v2int %int_1 %int_1
+         %48 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %48 = OpTypeFunction %v4float
-%textureGather_59372a = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureGather_59372a = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %uint_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %uint %arg_4
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_1 ConstOffset %45
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %uint %arg_4
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_1 ConstOffset %48
+               OpStore %res %33
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_59372a
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_59372a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_59372a
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_59372a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_59372a
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_59372a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.wgsl
index ffe7a1b..1c245ad 100644
--- a/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/59372a.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_59372a();
diff --git a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl
index f1b04a0..3f9cb7b 100644
--- a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1i;
   var arg_3 = vec3<f32>(1.f);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.dxc.hlsl
index f6d0388..0feb72c 100644
--- a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5ba85f() {
   float3 arg_3 = (1.0f).xxx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.fxc.hlsl
index f6d0388..0feb72c 100644
--- a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5ba85f() {
   float3 arg_3 = (1.0f).xxx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.glsl
index 936cbd1..36a4f92 100644
--- a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_5ba85f() {
   vec3 arg_3 = vec3(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_5ba85f() {
   vec3 arg_3 = vec3(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp isamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_5ba85f() {
   vec3 arg_3 = vec3(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.msl
index 1918822..f31ec9f 100644
--- a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_5ba85f(texturecube<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_5ba85f(texturecube<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_5ba85f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_5ba85f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_5ba85f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_5ba85f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_5ba85f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_5ba85f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.spvasm
index 6ad4fe9..b4743c5 100644
--- a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_5ba85f "textureGather_5ba85f"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,51 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
-      %v4int = OpTypeVector %int 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v3float
+         %33 = OpTypeSampledImage %11
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %36 = OpConstantNull %v4int
-         %37 = OpTypeFunction %v4float
-%textureGather_5ba85f = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %36
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_3
-         %26 = OpImageGather %v4int %31 %32 %int_1
-               OpStore %res %26
+         %39 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %45 = OpTypeFunction %v4float
+%textureGather_5ba85f = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %39
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_3
+         %30 = OpImageGather %v4int %34 %35 %int_1
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %44 = OpLoad %v4int %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_5ba85f
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_5ba85f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %20
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_5ba85f
+%fragment_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_5ba85f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_5ba85f
+%compute_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_5ba85f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.wgsl
index bd36329..bf08316 100644
--- a/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/5ba85f.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1i;
   var arg_3 = vec3<f32>(1.0f);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_5ba85f();
diff --git a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl
index ab1dd80..2d0fffd 100644
--- a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1i;
   var arg_3 = vec2<f32>(1.f);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.dxc.hlsl
index 4027ec0..51f7bae 100644
--- a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5bd491() {
   float2 arg_3 = (1.0f).xx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.fxc.hlsl
index 4027ec0..51f7bae 100644
--- a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_5bd491() {
   float2 arg_3 = (1.0f).xx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.glsl
index 8b8939d..a7fb50e 100644
--- a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_5bd491() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_5bd491() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_5bd491() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.msl
index ba70f35..542ca22 100644
--- a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_5bd491(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_5bd491(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_5bd491(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_5bd491(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_5bd491(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_5bd491(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_5bd491(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_5bd491(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.spvasm
index 93c18ed..47d9b07 100644
--- a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_5bd491 "textureGather_5bd491"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
-     %v4uint = OpTypeVector %uint 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %37 = OpConstantNull %v4uint
-         %38 = OpTypeFunction %v4float
-%textureGather_5bd491 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %37
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_3
-         %26 = OpImageGather %v4uint %31 %32 %int_1
-               OpStore %res %26
+         %40 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %45 = OpTypeFunction %v4float
+%textureGather_5bd491 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %40
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_3
+         %30 = OpImageGather %v4uint %34 %35 %int_1
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %44 = OpLoad %v4uint %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_5bd491
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_5bd491
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %20
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_5bd491
+%fragment_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_5bd491
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_5bd491
+%compute_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_5bd491
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.wgsl
index 64bee25..087be49 100644
--- a/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/5bd491.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1i;
   var arg_3 = vec2<f32>(1.0f);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_5bd491();
diff --git a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl
index 93046b9..e97e01a 100644
--- a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.dxc.hlsl
index 483b16f..b5d8de5 100644
--- a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_6b7b74() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_6b7b74();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.fxc.hlsl
index 483b16f..ad2db0b 100644
--- a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_6b7b74() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.glsl
index cc2e9b5..c701d98 100644
--- a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_6b7b74() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_6b7b74() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_6b7b74() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.msl
index 584583c..04cfdd3 100644
--- a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_6b7b74(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_6b7b74(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_6b7b74(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_6b7b74(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_6b7b74(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_6b7b74(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_6b7b74(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_6b7b74(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.spvasm
index 6794f05..db8191a 100644
--- a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_6b7b74 "textureGather_6b7b74"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,65 +50,73 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %49 = OpConstantNull %v4uint
-         %50 = OpTypeFunction %v4float
-%textureGather_6b7b74 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
-        %res = OpVariable %_ptr_Function_v4uint Function %49
-               OpStore %arg_3 %22
+         %52 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %57 = OpTypeFunction %v4float
+%textureGather_6b7b74 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %33
+        %res = OpVariable %_ptr_Function_v4uint Function %52
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %37 = OpLoad %v2float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %41 = OpLoad %uint %arg_4
-         %40 = OpConvertUToF %float %41
-         %42 = OpCompositeConstruct %v3float %38 %39 %40
-         %30 = OpImageGather %v4uint %35 %42 %uint_1 ConstOffset %46
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %40 = OpLoad %v2float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %44 = OpLoad %uint %arg_4
+         %43 = OpConvertUToF %float %44
+         %45 = OpCompositeConstruct %v3float %41 %42 %43
+         %34 = OpImageGather %v4uint %38 %45 %uint_1 ConstOffset %49
+               OpStore %res %34
+         %55 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %56 = OpLoad %v4uint %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_6b7b74
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_6b7b74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %56
+%vertex_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_6b7b74
+%fragment_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_6b7b74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %61 = OpLabel
-         %62 = OpFunctionCall %void %textureGather_6b7b74
+%compute_main = OpFunction %void None %20
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureGather_6b7b74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.wgsl
index ab4d5c8..c27f288 100644
--- a/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/6b7b74.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_6b7b74();
diff --git a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl
index 0459084..c5bafea 100644
--- a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.dxc.hlsl
index 4861cca..0bd2f19 100644
--- a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_751f8a() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.fxc.hlsl
index 4861cca..0bd2f19 100644
--- a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_751f8a() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.msl
index 8e00dce..ded3ec3 100644
--- a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_751f8a(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_751f8a(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   int arg_4 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_751f8a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_751f8a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_751f8a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_751f8a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_751f8a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_751f8a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.spvasm
index 9792c25..05a2f9b 100644
--- a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_751f8a "textureGather_751f8a"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,60 +50,69 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %44 = OpTypeFunction %v4float
-%textureGather_751f8a = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %52 = OpTypeFunction %v4float
+%textureGather_751f8a = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %int_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %35 = OpLoad %v3float %arg_3
-         %36 = OpCompositeExtract %float %35 0
-         %37 = OpCompositeExtract %float %35 1
-         %38 = OpCompositeExtract %float %35 2
-         %40 = OpLoad %int %arg_4
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_1
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %38 = OpLoad %v3float %arg_3
+         %39 = OpCompositeExtract %float %38 0
+         %40 = OpCompositeExtract %float %38 1
+         %41 = OpCompositeExtract %float %38 2
+         %43 = OpLoad %int %arg_4
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v4float %39 %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_1
+               OpStore %res %33
+         %50 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %51 = OpLoad %v4float %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_751f8a
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_751f8a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_751f8a
+%fragment_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGather_751f8a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_751f8a
+%compute_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_751f8a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.wgsl
index 827faaf..3f064a9 100644
--- a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_751f8a();
diff --git a/test/tint/builtins/gen/var/textureGather/788010.wgsl b/test/tint/builtins/gen/var/textureGather/788010.wgsl
index 77f5724..fcd7076 100644
--- a/test/tint/builtins/gen/var/textureGather/788010.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/788010.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.dxc.hlsl
index 098bc2a..052a2f6 100644
--- a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_788010() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.fxc.hlsl
index 098bc2a..052a2f6 100644
--- a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_788010() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.msl
index 5968236..3f5743e 100644
--- a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_788010(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_788010(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   uint arg_4 = 1u;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_788010(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_788010(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_788010(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_788010(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_788010(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_788010(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.spvasm
index d4b6a12..336a6b6 100644
--- a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_788010 "textureGather_788010"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,63 +51,71 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
+         %29 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %47 = OpConstantNull %v4int
-         %48 = OpTypeFunction %v4float
-%textureGather_788010 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %55 = OpTypeFunction %v4float
+%textureGather_788010 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %uint %arg_4
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %31 = OpImageGather %v4int %36 %43 %int_1
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %uint %arg_4
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %35 = OpImageGather %v4int %39 %46 %int_1
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %54 = OpLoad %v4int %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_788010
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_788010
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_788010
+%fragment_main = OpFunction %void None %20
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_788010
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_788010
+%compute_main = OpFunction %void None %20
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_788010
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.wgsl
index 52ad4c6..f7bff5b 100644
--- a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_788010();
diff --git a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl
index 4e18be0..ae99ba9 100644
--- a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   const arg_4 = vec2<i32>(1i);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.dxc.hlsl
index ffe464d..acfca70 100644
--- a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.dxc.hlsl
@@ -1,9 +1,13 @@
+SKIP: FAILED
+
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_7c3828() {
   float2 arg_3 = (1.0f).xx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -32,3 +36,40 @@
   textureGather_7c3828();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.fxc.hlsl
index ffe464d..b083184e 100644
--- a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_7c3828() {
   float2 arg_3 = (1.0f).xx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.glsl
index c1d56be..a909815 100644
--- a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_7c3828() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_7c3828() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_7c3828() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.msl
index 9c4e568..d130b24 100644
--- a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_7c3828(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_7c3828(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_7c3828(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_7c3828(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_7c3828(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_7c3828(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_7c3828(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_7c3828(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.spvasm
index b704f03..0180d1f 100644
--- a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_7c3828 "textureGather_7c3828"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,53 +49,62 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
-      %v4int = OpTypeVector %int 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %35 = OpConstantComposite %v2int %int_1 %int_1
+         %38 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %38 = OpConstantNull %v4int
-         %39 = OpTypeFunction %v4float
-%textureGather_7c3828 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %38
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_3
-         %26 = OpImageGather %v4int %31 %32 %int_1 ConstOffset %35
-               OpStore %res %26
+         %41 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %47 = OpTypeFunction %v4float
+%textureGather_7c3828 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %41
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_3
+         %30 = OpImageGather %v4int %34 %35 %int_1 ConstOffset %38
+               OpStore %res %30
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %46 = OpLoad %v4int %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_7c3828
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureGather_7c3828
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_7c3828
+%fragment_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_7c3828
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_7c3828
+%compute_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_7c3828
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.wgsl
index f5e18b3..5e2bd50 100644
--- a/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/7c3828.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   const arg_4 = vec2<i32>(1i);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_7c3828();
diff --git a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl
index 816965a..333848c 100644
--- a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1u;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.dxc.hlsl
index 54411be..27969f8 100644
--- a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_7dd226() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float4 res = arg_0.Gather(arg_1, float4(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.fxc.hlsl
index 54411be..27969f8 100644
--- a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_7dd226() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float4 res = arg_0.Gather(arg_1, float4(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.msl
index c0b2d12..186bcc5 100644
--- a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_7dd226(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_7dd226(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2, arg_3);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_7dd226(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_7dd226(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_7dd226(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_7dd226(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_7dd226(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_7dd226(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.spvasm
index d10d883..83f91c3 100644
--- a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_7dd226 "textureGather_7dd226"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,62 +50,70 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %46 = OpTypeFunction %v4float
-%textureGather_7dd226 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %53 = OpTypeFunction %v4float
+%textureGather_7dd226 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-         %31 = OpLoad %14 %arg_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpSampledImage %33 %32 %31
-         %35 = OpLoad %v3float %arg_2
-         %36 = OpCompositeExtract %float %35 0
-         %37 = OpCompositeExtract %float %35 1
-         %38 = OpCompositeExtract %float %35 2
-         %40 = OpLoad %uint %arg_3
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_0
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_1
+         %35 = OpLoad %11 %arg_0
+         %37 = OpSampledImage %36 %35 %34
+         %38 = OpLoad %v3float %arg_2
+         %39 = OpCompositeExtract %float %38 0
+         %40 = OpCompositeExtract %float %38 1
+         %41 = OpCompositeExtract %float %38 2
+         %43 = OpLoad %uint %arg_3
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v4float %39 %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_0
+               OpStore %res %33
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_7dd226
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_7dd226
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_7dd226
+%fragment_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_7dd226
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_7dd226
+%compute_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_7dd226
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.wgsl
index 1b1c20d..3649f42 100644
--- a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1u;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_7dd226();
diff --git a/test/tint/builtins/gen/var/textureGather/829357.wgsl b/test/tint/builtins/gen/var/textureGather/829357.wgsl
index dabcb5b..9b6e73f 100644
--- a/test/tint/builtins/gen/var/textureGather/829357.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/829357.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.dxc.hlsl
index 88ad7f2..85f1aba 100644
--- a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_829357() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.fxc.hlsl
index 88ad7f2..85f1aba 100644
--- a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_829357() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.msl
index 655411d..5c8df81 100644
--- a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_829357(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_829357(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   uint arg_4 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_829357(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_829357(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_829357(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_829357(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_829357(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_829357(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.spvasm
index ef7e6f1..4d7c898 100644
--- a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_829357 "textureGather_829357"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,62 +50,70 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %46 = OpTypeFunction %v4float
-%textureGather_829357 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %53 = OpTypeFunction %v4float
+%textureGather_829357 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %uint_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %35 = OpLoad %v3float %arg_3
-         %36 = OpCompositeExtract %float %35 0
-         %37 = OpCompositeExtract %float %35 1
-         %38 = OpCompositeExtract %float %35 2
-         %40 = OpLoad %uint %arg_4
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_1
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %38 = OpLoad %v3float %arg_3
+         %39 = OpCompositeExtract %float %38 0
+         %40 = OpCompositeExtract %float %38 1
+         %41 = OpCompositeExtract %float %38 2
+         %43 = OpLoad %uint %arg_4
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v4float %39 %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_1
+               OpStore %res %33
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_829357
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_829357
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_829357
+%fragment_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_829357
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_829357
+%compute_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_829357
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.wgsl
index bd4c6ca..d0b85ab 100644
--- a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_829357();
diff --git a/test/tint/builtins/gen/var/textureGather/831549.wgsl b/test/tint/builtins/gen/var/textureGather/831549.wgsl
index 28ca6b3..1b71fa7 100644
--- a/test/tint/builtins/gen/var/textureGather/831549.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/831549.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.dxc.hlsl
index 2e103a4..45bd83c 100644
--- a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_831549() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_831549();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.fxc.hlsl
index 2e103a4..2eeef5e 100644
--- a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_831549() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.glsl
index b10b9e1..961393d 100644
--- a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_831549() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_831549() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_831549() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   vec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.msl
index d2fade6..0f02129 100644
--- a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_831549(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_831549(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_831549(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_831549(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_831549(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_831549(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_831549(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_831549(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.spvasm
index 50095f7..3220a83 100644
--- a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_831549 "textureGather_831549"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,64 +49,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
-         %45 = OpConstantComposite %v2int %int_1 %int_1
+         %48 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %48 = OpTypeFunction %v4float
-%textureGather_831549 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureGather_831549 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %int_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %int %arg_4
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %uint_1 ConstOffset %45
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %int %arg_4
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %uint_1 ConstOffset %48
+               OpStore %res %33
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_831549
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_831549
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_831549
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_831549
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_831549
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_831549
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.wgsl
index 030f293..f1511aa 100644
--- a/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/831549.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_831549();
diff --git a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl
index 2008876..50803ef 100644
--- a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.dxc.hlsl
index 422ee44..6d2422e 100644
--- a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8578bc() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.fxc.hlsl
index 422ee44..6d2422e 100644
--- a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8578bc() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.msl
index ec01ea8..fe1e489 100644
--- a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_8578bc(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_8578bc(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   uint arg_4 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_8578bc(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_8578bc(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_8578bc(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_8578bc(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_8578bc(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_8578bc(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.spvasm
index b762315..41c636a6 100644
--- a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_8578bc "textureGather_8578bc"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,60 +50,68 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %44 = OpTypeFunction %v4float
-%textureGather_8578bc = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %51 = OpTypeFunction %v4float
+%textureGather_8578bc = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %uint_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %35 = OpLoad %v3float %arg_3
-         %36 = OpCompositeExtract %float %35 0
-         %37 = OpCompositeExtract %float %35 1
-         %38 = OpCompositeExtract %float %35 2
-         %40 = OpLoad %uint %arg_4
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %uint_1
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %38 = OpLoad %v3float %arg_3
+         %39 = OpCompositeExtract %float %38 0
+         %40 = OpCompositeExtract %float %38 1
+         %41 = OpCompositeExtract %float %38 2
+         %43 = OpLoad %uint %arg_4
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v4float %39 %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %uint_1
+               OpStore %res %33
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %50 = OpLoad %v4float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_8578bc
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_8578bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_8578bc
+%fragment_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_8578bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_8578bc
+%compute_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_8578bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.wgsl
index 069acaf..c074afb 100644
--- a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_8578bc();
diff --git a/test/tint/builtins/gen/var/textureGather/89680f.wgsl b/test/tint/builtins/gen/var/textureGather/89680f.wgsl
index 494bd1b..bd2d4d7 100644
--- a/test/tint/builtins/gen/var/textureGather/89680f.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/89680f.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1u;
   var arg_3 = vec3<f32>(1.f);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.dxc.hlsl
index c3e709a..b202776 100644
--- a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_89680f() {
   float3 arg_3 = (1.0f).xxx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.fxc.hlsl
index c3e709a..b202776 100644
--- a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_89680f() {
   float3 arg_3 = (1.0f).xxx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.glsl
index 67bb598..a37300f 100644
--- a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_89680f() {
   vec3 arg_3 = vec3(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_89680f() {
   vec3 arg_3 = vec3(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp usamplerCube arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_89680f() {
   vec3 arg_3 = vec3(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.msl
index 3668516..2144e3c 100644
--- a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_89680f(texturecube<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_89680f(texturecube<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_89680f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_89680f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_89680f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_89680f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_89680f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_89680f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.spvasm
index 8b47c7d..5280076 100644
--- a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_89680f "textureGather_89680f"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,51 +49,59 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
-     %v4uint = OpTypeVector %uint 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v3float
+         %33 = OpTypeSampledImage %11
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %36 = OpConstantNull %v4uint
-         %37 = OpTypeFunction %v4float
-%textureGather_89680f = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %36
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_3
-         %26 = OpImageGather %v4uint %31 %32 %uint_1
-               OpStore %res %26
+         %39 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %44 = OpTypeFunction %v4float
+%textureGather_89680f = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %39
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_3
+         %30 = OpImageGather %v4uint %34 %35 %uint_1
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %43 = OpLoad %v4uint %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_89680f
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGather_89680f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_89680f
+%fragment_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_89680f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_89680f
+%compute_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_89680f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.wgsl
index 63c1ad0..616b114 100644
--- a/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/89680f.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1u;
   var arg_3 = vec3<f32>(1.0f);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_89680f();
diff --git a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl
index 32c4e98..2a8fd6a 100644
--- a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.dxc.hlsl
index c0256e6..29ac428 100644
--- a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8b754c() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.fxc.hlsl
index c0256e6..29ac428 100644
--- a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8b754c() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.glsl
index 19a3f9f..e3d1439 100644
--- a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_8b754c() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_8b754c() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_8b754c() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.msl
index 9ac6634..e5613ae 100644
--- a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_8b754c(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_8b754c(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_8b754c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_8b754c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_8b754c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_8b754c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_8b754c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_8b754c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.spvasm
index 2ffe76a..395346a 100644
--- a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_8b754c "textureGather_8b754c"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,61 +50,70 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %45 = OpConstantNull %v4int
-         %46 = OpTypeFunction %v4float
-%textureGather_8b754c = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
-        %res = OpVariable %_ptr_Function_v4int Function %45
-               OpStore %arg_3 %22
+         %48 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %54 = OpTypeFunction %v4float
+%textureGather_8b754c = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %33
+        %res = OpVariable %_ptr_Function_v4int Function %48
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %37 = OpLoad %v2float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %41 = OpLoad %int %arg_4
-         %40 = OpConvertSToF %float %41
-         %42 = OpCompositeConstruct %v3float %38 %39 %40
-         %30 = OpImageGather %v4int %35 %42 %int_1
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %40 = OpLoad %v2float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %44 = OpLoad %int %arg_4
+         %43 = OpConvertSToF %float %44
+         %45 = OpCompositeConstruct %v3float %41 %42 %43
+         %34 = OpImageGather %v4int %38 %45 %int_1
+               OpStore %res %34
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %53 = OpLoad %v4int %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_8b754c
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_8b754c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_8b754c
+%fragment_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_8b754c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_8b754c
+%compute_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_8b754c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.wgsl
index a997540..e422522 100644
--- a/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/8b754c.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_8b754c();
diff --git a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl
index e78eabd..a8c3843 100644
--- a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1u;
   var arg_3 = vec2<f32>(1.f);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.dxc.hlsl
index 3e180aa..676bfbb 100644
--- a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8fae00() {
   float2 arg_3 = (1.0f).xx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.fxc.hlsl
index 3e180aa..676bfbb 100644
--- a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_8fae00() {
   float2 arg_3 = (1.0f).xx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.glsl
index 199a442..33dae70 100644
--- a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_8fae00() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_8fae00() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_8fae00() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.msl
index 21e063a..225c1bb 100644
--- a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_8fae00(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_8fae00(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_8fae00(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_8fae00(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_8fae00(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_8fae00(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_8fae00(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_8fae00(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.spvasm
index 90e3391..890bb88 100644
--- a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_8fae00 "textureGather_8fae00"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,51 +49,59 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
-     %v4uint = OpTypeVector %uint 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %36 = OpConstantNull %v4uint
-         %37 = OpTypeFunction %v4float
-%textureGather_8fae00 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %36
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_3
-         %26 = OpImageGather %v4uint %31 %32 %uint_1
-               OpStore %res %26
+         %39 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %44 = OpTypeFunction %v4float
+%textureGather_8fae00 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %39
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_3
+         %30 = OpImageGather %v4uint %34 %35 %uint_1
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %43 = OpLoad %v4uint %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_8fae00
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGather_8fae00
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %20
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_8fae00
+%fragment_main = OpFunction %void None %20
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGather_8fae00
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_8fae00
+%compute_main = OpFunction %void None %20
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_8fae00
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.wgsl
index f661061..4832130 100644
--- a/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/8fae00.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1u;
   var arg_3 = vec2<f32>(1.0f);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_8fae00();
diff --git a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl
index 9eed5cb..9bb22de 100644
--- a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.dxc.hlsl
index e90476d..62eae1a 100644
--- a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_92ea47() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.fxc.hlsl
index e90476d..62eae1a 100644
--- a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_92ea47() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.glsl
index fa764dd..2ce2083 100644
--- a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_92ea47() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_92ea47() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_92ea47() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.msl
index 17a6210..7d9f38e 100644
--- a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_92ea47(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_92ea47(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_92ea47(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_92ea47(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_92ea47(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_92ea47(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_92ea47(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_92ea47(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.spvasm
index 72535f4..29137bd 100644
--- a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_92ea47 "textureGather_92ea47"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,63 +50,71 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %47 = OpConstantNull %v4uint
-         %48 = OpTypeFunction %v4float
-%textureGather_92ea47 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %55 = OpTypeFunction %v4float
+%textureGather_92ea47 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_3
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_4
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %31 = OpImageGather %v4uint %36 %43 %uint_1
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_3
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_4
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %35 = OpImageGather %v4uint %39 %46 %uint_1
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %54 = OpLoad %v4uint %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_92ea47
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_92ea47
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_92ea47
+%fragment_main = OpFunction %void None %20
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_92ea47
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_92ea47
+%compute_main = OpFunction %void None %20
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_92ea47
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.wgsl
index 435dfab..5341531 100644
--- a/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/92ea47.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_92ea47();
diff --git a/test/tint/builtins/gen/var/textureGather/986700.wgsl b/test/tint/builtins/gen/var/textureGather/986700.wgsl
index 7e468be..2c38fbc 100644
--- a/test/tint/builtins/gen/var/textureGather/986700.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/986700.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   const arg_4 = vec2<i32>(1i);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.dxc.hlsl
index ec8491d..2d3e165 100644
--- a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.dxc.hlsl
@@ -1,9 +1,13 @@
+SKIP: FAILED
+
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_986700() {
   float2 arg_3 = (1.0f).xx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -32,3 +36,40 @@
   textureGather_986700();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.fxc.hlsl
index ec8491d..6b1dea7 100644
--- a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_986700() {
   float2 arg_3 = (1.0f).xx;
   uint4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.glsl
index b305559..6525533 100644
--- a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_986700() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_986700() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp usampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_986700() {
   vec2 arg_3 = vec2(1.0f);
   uvec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.msl
index 0b9c5e1..a47f7c1 100644
--- a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_986700(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_986700(texture2d<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_986700(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_986700(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_986700(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_986700(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_986700(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_986700(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.spvasm
index a2f647e..a24b16a 100644
--- a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_986700 "textureGather_986700"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,55 +49,63 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
-     %v4uint = OpTypeVector %uint 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %40 = OpConstantNull %v4uint
-         %41 = OpTypeFunction %v4float
-%textureGather_986700 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %40
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_3
-         %26 = OpImageGather %v4uint %31 %32 %uint_1 ConstOffset %37
-               OpStore %res %26
+         %43 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %48 = OpTypeFunction %v4float
+%textureGather_986700 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %43
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_3
+         %30 = OpImageGather %v4uint %34 %35 %uint_1 ConstOffset %40
+               OpStore %res %30
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %47 = OpLoad %v4uint %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_986700
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_986700
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_986700
+%fragment_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_986700
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_986700
+%compute_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_986700
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.wgsl
index f9aa332..4e5ea71 100644
--- a/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/986700.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   const arg_4 = vec2<i32>(1i);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_986700();
diff --git a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl
index a2209d5..e880bd7 100644
--- a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1i;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.dxc.hlsl
index 5d3990e..9a3fb99 100644
--- a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_9a6358() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float4 res = arg_0.Gather(arg_1, float3(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.fxc.hlsl
index 5d3990e..9a3fb99 100644
--- a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_9a6358() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float4 res = arg_0.Gather(arg_1, float3(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.glsl
index 1f7d85f..e545a56 100644
--- a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_9a6358() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_9a6358() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_9a6358() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.msl
index 82bd613..89388df 100644
--- a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_9a6358(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_9a6358(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2, arg_3);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_9a6358(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_9a6358(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_9a6358(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_9a6358(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_9a6358(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_9a6358(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.spvasm
index fac5ae5..04ba13c 100644
--- a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_9a6358 "textureGather_9a6358"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,61 +49,70 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %int_0 = OpConstant %int 0
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %45 = OpTypeFunction %v4float
-%textureGather_9a6358 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %53 = OpTypeFunction %v4float
+%textureGather_9a6358 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-         %31 = OpLoad %14 %arg_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_2
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %int %arg_3
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_0
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_1
+         %35 = OpLoad %11 %arg_0
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_2
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %int %arg_3
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_0
+               OpStore %res %33
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_9a6358
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_9a6358
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGather_9a6358
+%fragment_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_9a6358
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_9a6358
+%compute_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_9a6358
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.wgsl
index 934aa85..8f6a811 100644
--- a/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/9a6358.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1i;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_9a6358();
diff --git a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl
index 2d5a787..6073024 100644
--- a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.dxc.hlsl
index 4c172c5..3933c08 100644
--- a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_9ab41e() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_9ab41e();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.fxc.hlsl
index 4c172c5..0ba29de 100644
--- a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_9ab41e() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.glsl
index 6035dda..8dc448a 100644
--- a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_9ab41e() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_9ab41e() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_9ab41e() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.msl
index cf0143c..aa3c69c 100644
--- a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_9ab41e(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_9ab41e(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_9ab41e(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_9ab41e(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_9ab41e(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_9ab41e(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_9ab41e(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_9ab41e(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.spvasm
index 5bd290e..531093a 100644
--- a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_9ab41e "textureGather_9ab41e"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,65 +50,73 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %49 = OpConstantNull %v4int
-         %50 = OpTypeFunction %v4float
-%textureGather_9ab41e = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
-        %res = OpVariable %_ptr_Function_v4int Function %49
-               OpStore %arg_3 %22
+         %52 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %57 = OpTypeFunction %v4float
+%textureGather_9ab41e = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %33
+        %res = OpVariable %_ptr_Function_v4int Function %52
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %37 = OpLoad %v2float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %41 = OpLoad %int %arg_4
-         %40 = OpConvertSToF %float %41
-         %42 = OpCompositeConstruct %v3float %38 %39 %40
-         %30 = OpImageGather %v4int %35 %42 %uint_1 ConstOffset %46
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %40 = OpLoad %v2float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %44 = OpLoad %int %arg_4
+         %43 = OpConvertSToF %float %44
+         %45 = OpCompositeConstruct %v3float %41 %42 %43
+         %34 = OpImageGather %v4int %38 %45 %uint_1 ConstOffset %49
+               OpStore %res %34
+         %55 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %56 = OpLoad %v4int %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_9ab41e
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_9ab41e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %56
+%vertex_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_9ab41e
+%fragment_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_9ab41e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %61 = OpLabel
-         %62 = OpFunctionCall %void %textureGather_9ab41e
+%compute_main = OpFunction %void None %20
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureGather_9ab41e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.wgsl
index 5dba028..81b4a1c 100644
--- a/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/9ab41e.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_9ab41e();
diff --git a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl
index 62f713b..c72f331 100644
--- a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.dxc.hlsl
index d55d5b2..93d89b9 100644
--- a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_a0372b() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.fxc.hlsl
index d55d5b2..93d89b9 100644
--- a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_a0372b() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.glsl
index 937464c..a9b2156 100644
--- a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_a0372b() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_a0372b() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_a0372b() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.msl
index 6b012ed..178d941 100644
--- a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_a0372b(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_a0372b(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_a0372b(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_a0372b(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_a0372b(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_a0372b(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_a0372b(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_a0372b(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.spvasm
index 36d6547..a53b1a0 100644
--- a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_a0372b "textureGather_a0372b"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,63 +50,71 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %47 = OpConstantNull %v4uint
-         %48 = OpTypeFunction %v4float
-%textureGather_a0372b = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
-        %res = OpVariable %_ptr_Function_v4uint Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %55 = OpTypeFunction %v4float
+%textureGather_a0372b = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %33
+        %res = OpVariable %_ptr_Function_v4uint Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %37 = OpLoad %v2float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %41 = OpLoad %uint %arg_4
-         %40 = OpConvertUToF %float %41
-         %42 = OpCompositeConstruct %v3float %38 %39 %40
-         %30 = OpImageGather %v4uint %35 %42 %int_1
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %40 = OpLoad %v2float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %44 = OpLoad %uint %arg_4
+         %43 = OpConvertUToF %float %44
+         %45 = OpCompositeConstruct %v3float %41 %42 %43
+         %34 = OpImageGather %v4uint %38 %45 %int_1
+               OpStore %res %34
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %54 = OpLoad %v4uint %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_a0372b
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_a0372b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_a0372b
+%fragment_main = OpFunction %void None %20
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_a0372b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_a0372b
+%compute_main = OpFunction %void None %20
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_a0372b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.wgsl
index e4b97a2..a5ea3fa 100644
--- a/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/a0372b.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_a0372b();
diff --git a/test/tint/builtins/gen/var/textureGather/a68027.wgsl b/test/tint/builtins/gen/var/textureGather/a68027.wgsl
index d18ba4f..a7e4b16 100644
--- a/test/tint/builtins/gen/var/textureGather/a68027.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/a68027.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.dxc.hlsl
index d716bd5..e073c68 100644
--- a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_a68027() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float4 res = arg_0.Gather(arg_1, float3(arg_2, float(arg_3)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_a68027();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.fxc.hlsl
index d716bd5..1c26794 100644
--- a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_a68027() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float4 res = arg_0.Gather(arg_1, float3(arg_2, float(arg_3)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.glsl
index 685e54f..69ab184 100644
--- a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_a68027() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_a68027() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_a68027() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.msl
index 1e36abd..ee9df2a 100644
--- a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_a68027(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_a68027(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2, arg_3, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_a68027(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_a68027(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_a68027(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_a68027(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_a68027(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_a68027(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.spvasm
index 6fe0fae..9ee0027 100644
--- a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 62
+; Bound: 69
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_a68027 "textureGather_a68027"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,65 +49,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %49 = OpTypeFunction %v4float
-%textureGather_a68027 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %56 = OpTypeFunction %v4float
+%textureGather_a68027 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-         %31 = OpLoad %14 %arg_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_2
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %uint %arg_3
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_0 ConstOffset %46
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_1
+         %35 = OpLoad %11 %arg_0
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_2
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %uint %arg_3
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_0 ConstOffset %49
+               OpStore %res %33
+         %54 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %55 = OpLoad %v4float %res
+               OpStore %54 %55
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %49
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_a68027
+%vertex_main_inner = OpFunction %v4float None %56
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_a68027
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %55
+%vertex_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %62
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_a68027
+%fragment_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_a68027
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureGather_a68027
+%compute_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureGather_a68027
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.wgsl
index 7806795..6c6ce28 100644
--- a/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/a68027.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_a68027();
diff --git a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl
index 4e511c9..35311af 100644
--- a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.dxc.hlsl
index c9ad432..456f2fe 100644
--- a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_aaf6bd() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.fxc.hlsl
index c9ad432..456f2fe 100644
--- a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_aaf6bd() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.msl
index 4a1771a..df52cd2 100644
--- a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_aaf6bd(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_aaf6bd(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   int arg_4 = 1;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_aaf6bd(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_aaf6bd(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_aaf6bd(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_aaf6bd(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_aaf6bd(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_aaf6bd(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.spvasm
index b02612c..7c782c4 100644
--- a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_aaf6bd "textureGather_aaf6bd"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,63 +51,71 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
+         %29 = OpConstantNull %v3float
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %47 = OpConstantNull %v4int
-         %48 = OpTypeFunction %v4float
-%textureGather_aaf6bd = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
-        %res = OpVariable %_ptr_Function_v4int Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %55 = OpTypeFunction %v4float
+%textureGather_aaf6bd = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %33
+        %res = OpVariable %_ptr_Function_v4int Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v3float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %39 = OpCompositeExtract %float %36 2
-         %41 = OpLoad %int %arg_4
-         %40 = OpConvertSToF %float %41
-         %42 = OpCompositeConstruct %v4float %37 %38 %39 %40
-         %30 = OpImageGather %v4int %35 %42 %uint_1
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v3float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %42 = OpCompositeExtract %float %39 2
+         %44 = OpLoad %int %arg_4
+         %43 = OpConvertSToF %float %44
+         %45 = OpCompositeConstruct %v4float %40 %41 %42 %43
+         %34 = OpImageGather %v4int %38 %45 %uint_1
+               OpStore %res %34
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %54 = OpLoad %v4int %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_aaf6bd
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_aaf6bd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_aaf6bd
+%fragment_main = OpFunction %void None %20
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_aaf6bd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_aaf6bd
+%compute_main = OpFunction %void None %20
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_aaf6bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.wgsl
index 7515732..63de0a6 100644
--- a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_aaf6bd();
diff --git a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl
index 0a0d4e0..dfca304 100644
--- a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.dxc.hlsl
index 004bf3e..d88c97a 100644
--- a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,13 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_af55b3() {
   float2 arg_3 = (1.0f).xx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -32,3 +36,40 @@
   textureGather_af55b3();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.fxc.hlsl
index 004bf3e..0d77524 100644
--- a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_af55b3() {
   float2 arg_3 = (1.0f).xx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.glsl
index f487bf8..49d493e 100644
--- a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_af55b3() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_af55b3() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_af55b3() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.msl
index c60b757..eb22c1f 100644
--- a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_af55b3(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_af55b3(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_af55b3(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_af55b3(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_af55b3(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_af55b3(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_af55b3(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_af55b3(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.spvasm
index 1cf4833..499b62d 100644
--- a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_af55b3 "textureGather_af55b3"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,52 +48,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v2float
+         %31 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %34 = OpConstantComposite %v2int %int_1 %int_1
+         %37 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %37 = OpTypeFunction %v4float
-%textureGather_af55b3 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureGather_af55b3 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
-         %26 = OpLoad %14 %arg_2
-         %27 = OpLoad %11 %arg_1
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v2float %arg_3
-         %25 = OpImageGather %v4float %29 %30 %int_1 ConstOffset %34
-               OpStore %res %25
+               OpStore %arg_3 %24
+         %29 = OpLoad %14 %arg_2
+         %30 = OpLoad %11 %arg_1
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v2float %arg_3
+         %28 = OpImageGather %v4float %32 %33 %int_1 ConstOffset %37
+               OpStore %res %28
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_af55b3
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_af55b3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_af55b3
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_af55b3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_af55b3
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_af55b3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.wgsl
index ece4d49..883f224 100644
--- a/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/af55b3.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_af55b3();
diff --git a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl
index 4cdc946..f8679bf 100644
--- a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1i;
   var arg_3 = vec2<f32>(1.f);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.dxc.hlsl
index bf01188..f7c2cf7 100644
--- a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_bb3ac5() {
   float2 arg_3 = (1.0f).xx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.fxc.hlsl
index bf01188..f7c2cf7 100644
--- a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_bb3ac5() {
   float2 arg_3 = (1.0f).xx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.glsl
index eac794a..349a35d 100644
--- a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bb3ac5() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bb3ac5() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bb3ac5() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.msl
index 4fc6aef..0843d9e 100644
--- a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_bb3ac5(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_bb3ac5(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_bb3ac5(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_bb3ac5(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_bb3ac5(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_bb3ac5(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_bb3ac5(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_bb3ac5(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.spvasm
index a9d8e0d..4d5621c 100644
--- a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_bb3ac5 "textureGather_bb3ac5"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,51 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
-      %v4int = OpTypeVector %int 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %36 = OpConstantNull %v4int
-         %37 = OpTypeFunction %v4float
-%textureGather_bb3ac5 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %36
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_3
-         %26 = OpImageGather %v4int %31 %32 %int_1
-               OpStore %res %26
+         %39 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %45 = OpTypeFunction %v4float
+%textureGather_bb3ac5 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %39
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_3
+         %30 = OpImageGather %v4int %34 %35 %int_1
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %44 = OpLoad %v4int %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureGather_bb3ac5
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_bb3ac5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %20
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureGather_bb3ac5
+%fragment_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_bb3ac5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_bb3ac5
+%compute_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_bb3ac5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.wgsl
index 790a316..e10caac 100644
--- a/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/bb3ac5.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1i;
   var arg_3 = vec2<f32>(1.0f);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_bb3ac5();
diff --git a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl
index c401a2d..5aaca5c 100644
--- a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.dxc.hlsl
index cc7da20..1660122 100644
--- a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_bd33b6() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_bd33b6();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.fxc.hlsl
index cc7da20..a361ed7 100644
--- a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_bd33b6() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.glsl
index e8a0d0f..6e577bb 100644
--- a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bd33b6() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bd33b6() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_bd33b6() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.msl
index becd9cb..7f73e2a 100644
--- a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_bd33b6(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_bd33b6(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_bd33b6(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_bd33b6(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_bd33b6(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_bd33b6(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_bd33b6(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_bd33b6(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.spvasm
index 985c152..4121c44 100644
--- a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_bd33b6 "textureGather_bd33b6"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,65 +50,73 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %49 = OpConstantNull %v4int
-         %50 = OpTypeFunction %v4float
-%textureGather_bd33b6 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %49
-               OpStore %arg_3 %22
+         %52 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %57 = OpTypeFunction %v4float
+%textureGather_bd33b6 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %52
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_3
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_4
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %31 = OpImageGather %v4int %36 %43 %int_1 ConstOffset %46
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_3
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_4
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %35 = OpImageGather %v4int %39 %46 %int_1 ConstOffset %49
+               OpStore %res %35
+         %55 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %56 = OpLoad %v4int %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_bd33b6
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_bd33b6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %56
+%vertex_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_bd33b6
+%fragment_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_bd33b6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %61 = OpLabel
-         %62 = OpFunctionCall %void %textureGather_bd33b6
+%compute_main = OpFunction %void None %20
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureGather_bd33b6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.wgsl
index 9e313ac..0015f19 100644
--- a/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/bd33b6.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_bd33b6();
diff --git a/test/tint/builtins/gen/var/textureGather/be276f.wgsl b/test/tint/builtins/gen/var/textureGather/be276f.wgsl
index c370be7..15ab0eb 100644
--- a/test/tint/builtins/gen/var/textureGather/be276f.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/be276f.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.dxc.hlsl
index a14fbfd..c8953cf 100644
--- a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_be276f() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.fxc.hlsl
index a14fbfd..c8953cf 100644
--- a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_be276f() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.msl
index 0642518..73f5ca3 100644
--- a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_be276f(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_be276f(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   uint arg_4 = 1u;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_be276f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_be276f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_be276f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_be276f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_be276f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_be276f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.spvasm
index e16c672..9da8fa7 100644
--- a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_be276f "textureGather_be276f"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,63 +51,71 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
+         %29 = OpConstantNull %v3float
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %47 = OpConstantNull %v4uint
-         %48 = OpTypeFunction %v4float
-%textureGather_be276f = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
-        %res = OpVariable %_ptr_Function_v4uint Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %55 = OpTypeFunction %v4float
+%textureGather_be276f = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %33
+        %res = OpVariable %_ptr_Function_v4uint Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v3float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %39 = OpCompositeExtract %float %36 2
-         %41 = OpLoad %uint %arg_4
-         %40 = OpConvertUToF %float %41
-         %42 = OpCompositeConstruct %v4float %37 %38 %39 %40
-         %30 = OpImageGather %v4uint %35 %42 %int_1
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v3float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %42 = OpCompositeExtract %float %39 2
+         %44 = OpLoad %uint %arg_4
+         %43 = OpConvertUToF %float %44
+         %45 = OpCompositeConstruct %v4float %40 %41 %42 %43
+         %34 = OpImageGather %v4uint %38 %45 %int_1
+               OpStore %res %34
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %54 = OpLoad %v4uint %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_be276f
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_be276f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_be276f
+%fragment_main = OpFunction %void None %20
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_be276f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_be276f
+%compute_main = OpFunction %void None %20
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_be276f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.wgsl
index 91f83dd..f10da2d 100644
--- a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_be276f();
diff --git a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl
index 4c2d2b2..c1afbe63 100644
--- a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.dxc.hlsl
index 74d182b..eef6a17 100644
--- a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_c0640c() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.fxc.hlsl
index 74d182b..eef6a17 100644
--- a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_c0640c() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.msl
index 4514dbc..ce8899e 100644
--- a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_c0640c(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_c0640c(texturecube_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   int arg_4 = 1;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_c0640c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_c0640c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_c0640c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_c0640c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_c0640c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_c0640c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.spvasm
index a404b03..c983b28 100644
--- a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_c0640c "textureGather_c0640c"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,61 +51,70 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
+         %29 = OpConstantNull %v3float
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %45 = OpConstantNull %v4int
-         %46 = OpTypeFunction %v4float
-%textureGather_c0640c = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
-        %res = OpVariable %_ptr_Function_v4int Function %45
-               OpStore %arg_3 %22
+         %48 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %54 = OpTypeFunction %v4float
+%textureGather_c0640c = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %33
+        %res = OpVariable %_ptr_Function_v4int Function %48
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v3float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %39 = OpCompositeExtract %float %36 2
-         %41 = OpLoad %int %arg_4
-         %40 = OpConvertSToF %float %41
-         %42 = OpCompositeConstruct %v4float %37 %38 %39 %40
-         %30 = OpImageGather %v4int %35 %42 %int_1
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v3float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %42 = OpCompositeExtract %float %39 2
+         %44 = OpLoad %int %arg_4
+         %43 = OpConvertSToF %float %44
+         %45 = OpCompositeConstruct %v4float %40 %41 %42 %43
+         %34 = OpImageGather %v4int %38 %45 %int_1
+               OpStore %res %34
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %53 = OpLoad %v4int %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_c0640c
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_c0640c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_c0640c
+%fragment_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_c0640c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_c0640c
+%compute_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_c0640c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.wgsl
index 3372a4d..2b8aafe 100644
--- a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_c0640c();
diff --git a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl
index 4a66e72..16e0805 100644
--- a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1u;
   var arg_3 = vec2<f32>(1.f);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.dxc.hlsl
index 48f27de..be3e1b7 100644
--- a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ccadde() {
   float2 arg_3 = (1.0f).xx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.fxc.hlsl
index 48f27de..be3e1b7 100644
--- a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ccadde() {
   float2 arg_3 = (1.0f).xx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.glsl
index d2d56a9..30bcddf 100644
--- a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_ccadde() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_ccadde() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_ccadde() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.msl
index 6b81fe0..8a772af 100644
--- a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_ccadde(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_ccadde(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_ccadde(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_ccadde(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_ccadde(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_ccadde(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_ccadde(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_ccadde(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.spvasm
index 55ebe0d..ad7cd7c 100644
--- a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 51
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_ccadde "textureGather_ccadde"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,60 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
-      %v4int = OpTypeVector %int 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %37 = OpConstantNull %v4int
-         %38 = OpTypeFunction %v4float
-%textureGather_ccadde = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %37
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_3
-         %26 = OpImageGather %v4int %31 %32 %uint_1
-               OpStore %res %26
+         %40 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %45 = OpTypeFunction %v4float
+%textureGather_ccadde = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %40
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_3
+         %30 = OpImageGather %v4int %34 %35 %uint_1
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %44 = OpLoad %v4int %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureGather_ccadde
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureGather_ccadde
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %20
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_ccadde
+%fragment_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_ccadde
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_ccadde
+%compute_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_ccadde
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.wgsl
index 509edb3..5930703 100644
--- a/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/ccadde.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1u;
   var arg_3 = vec2<f32>(1.0f);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_ccadde();
diff --git a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl
index e2d08b2..14ba3d9 100644
--- a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.dxc.hlsl
index 4ab074d..5f23a16 100644
--- a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ce5578() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_ce5578();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.fxc.hlsl
index 4ab074d..12f79d6 100644
--- a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ce5578() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.glsl
index 360f4fb..3374754 100644
--- a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_ce5578() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_ce5578() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_ce5578() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.msl
index b2f8c74..b580d5a 100644
--- a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_ce5578(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_ce5578(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_ce5578(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_ce5578(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_ce5578(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_ce5578(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_ce5578(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_ce5578(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.spvasm
index 4bfdca5..09670be 100644
--- a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_ce5578 "textureGather_ce5578"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,65 +50,73 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %49 = OpConstantNull %v4uint
-         %50 = OpTypeFunction %v4float
-%textureGather_ce5578 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
-        %res = OpVariable %_ptr_Function_v4uint Function %49
-               OpStore %arg_3 %22
+         %52 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %57 = OpTypeFunction %v4float
+%textureGather_ce5578 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %33
+        %res = OpVariable %_ptr_Function_v4uint Function %52
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %37 = OpLoad %v2float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %41 = OpLoad %uint %arg_4
-         %40 = OpConvertUToF %float %41
-         %42 = OpCompositeConstruct %v3float %38 %39 %40
-         %30 = OpImageGather %v4uint %35 %42 %int_1 ConstOffset %46
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %40 = OpLoad %v2float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %44 = OpLoad %uint %arg_4
+         %43 = OpConvertUToF %float %44
+         %45 = OpCompositeConstruct %v3float %41 %42 %43
+         %34 = OpImageGather %v4uint %38 %45 %int_1 ConstOffset %49
+               OpStore %res %34
+         %55 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %56 = OpLoad %v4uint %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_ce5578
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_ce5578
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %56
+%vertex_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_ce5578
+%fragment_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_ce5578
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %61 = OpLabel
-         %62 = OpFunctionCall %void %textureGather_ce5578
+%compute_main = OpFunction %void None %20
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureGather_ce5578
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.wgsl
index 27f3c1c..3c144f3 100644
--- a/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/ce5578.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_ce5578();
diff --git a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl
index 4c0baaf..df6544f 100644
--- a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.dxc.hlsl
index 59c08dc..0197ddf 100644
--- a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_cf9112() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_cf9112();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.fxc.hlsl
index 59c08dc..6c8cdf3 100644
--- a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_cf9112() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.glsl
index 71a71e0..114bf34 100644
--- a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_cf9112() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_cf9112() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_cf9112() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.msl
index 36494a4..7755717 100644
--- a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_cf9112(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_cf9112(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_cf9112(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_cf9112(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_cf9112(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_cf9112(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_cf9112(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_cf9112(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.spvasm
index 488b0e1..7d4cdec 100644
--- a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_cf9112 "textureGather_cf9112"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,65 +50,73 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %49 = OpConstantNull %v4int
-         %50 = OpTypeFunction %v4float
-%textureGather_cf9112 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %49
-               OpStore %arg_3 %22
+         %52 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %57 = OpTypeFunction %v4float
+%textureGather_cf9112 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %52
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_3
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_4
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %31 = OpImageGather %v4int %36 %43 %uint_1 ConstOffset %46
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_3
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_4
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %35 = OpImageGather %v4int %39 %46 %uint_1 ConstOffset %49
+               OpStore %res %35
+         %55 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %56 = OpLoad %v4int %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_cf9112
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_cf9112
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %56
+%vertex_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_cf9112
+%fragment_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_cf9112
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %61 = OpLabel
-         %62 = OpFunctionCall %void %textureGather_cf9112
+%compute_main = OpFunction %void None %20
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureGather_cf9112
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.wgsl
index 2991409..5237c59 100644
--- a/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/cf9112.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_cf9112();
diff --git a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl
index 305f819..49e3240 100644
--- a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.dxc.hlsl
index f7f3833..c80da5f 100644
--- a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d1f187() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_d1f187();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.fxc.hlsl
index f7f3833..41e2d27 100644
--- a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d1f187() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.glsl
index 2631480..8acc02a 100644
--- a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_d1f187() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_d1f187() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_d1f187() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.msl
index 29eda44..595d83b 100644
--- a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d1f187(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d1f187(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d1f187(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_d1f187(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d1f187(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d1f187(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d1f187(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d1f187(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.spvasm
index fece5f4..79ec3c1 100644
--- a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 62
+; Bound: 69
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d1f187 "textureGather_d1f187"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,64 +50,72 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %45 = OpConstantComposite %v2int %int_1 %int_1
+         %48 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %48 = OpConstantNull %v4uint
-         %49 = OpTypeFunction %v4float
-%textureGather_d1f187 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %48
-               OpStore %arg_3 %22
+         %51 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %56 = OpTypeFunction %v4float
+%textureGather_d1f187 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %51
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_3
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_4
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %31 = OpImageGather %v4uint %36 %43 %int_1 ConstOffset %45
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_3
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_4
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %35 = OpImageGather %v4uint %39 %46 %int_1 ConstOffset %48
+               OpStore %res %35
+         %54 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %55 = OpLoad %v4uint %res
+               OpStore %54 %55
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %49
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGather_d1f187
+%vertex_main_inner = OpFunction %v4float None %56
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_d1f187
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %54 = OpLabel
-         %55 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %55
+%vertex_main = OpFunction %void None %20
+         %61 = OpLabel
+         %62 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %62
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_d1f187
+%fragment_main = OpFunction %void None %20
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_d1f187
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureGather_d1f187
+%compute_main = OpFunction %void None %20
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureGather_d1f187
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.wgsl
index f005403..26ea090 100644
--- a/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d1f187.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d1f187();
diff --git a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl
index bd6a182..ca6f8f0 100644
--- a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.dxc.hlsl
index 1790e9e..96f279b 100644
--- a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d4b5c6() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.fxc.hlsl
index 1790e9e..96f279b 100644
--- a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d4b5c6() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.msl
index 110ba98..981be4e 100644
--- a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d4b5c6(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d4b5c6(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   int arg_4 = 1;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d4b5c6(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_d4b5c6(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d4b5c6(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d4b5c6(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d4b5c6(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d4b5c6(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.spvasm
index 2e65d3a..95c4acb 100644
--- a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d4b5c6 "textureGather_d4b5c6"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,63 +51,71 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
+         %29 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %47 = OpConstantNull %v4uint
-         %48 = OpTypeFunction %v4float
-%textureGather_d4b5c6 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %55 = OpTypeFunction %v4float
+%textureGather_d4b5c6 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %int %arg_4
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %31 = OpImageGather %v4uint %36 %43 %uint_1
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %int %arg_4
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %35 = OpImageGather %v4uint %39 %46 %uint_1
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %54 = OpLoad %v4uint %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_d4b5c6
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_d4b5c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_d4b5c6
+%fragment_main = OpFunction %void None %20
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_d4b5c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_d4b5c6
+%compute_main = OpFunction %void None %20
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_d4b5c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.wgsl
index 573afe7..2fc4fe3 100644
--- a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d4b5c6();
diff --git a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl
index 667dc52..d3d52b0 100644
--- a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.dxc.hlsl
index 7075df4..c6e0052 100644
--- a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,13 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d6507c() {
   float2 arg_3 = (1.0f).xx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -32,3 +36,40 @@
   textureGather_d6507c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.fxc.hlsl
index 7075df4..0b686b3 100644
--- a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d6507c() {
   float2 arg_3 = (1.0f).xx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.glsl
index 4226409..bbefe2f 100644
--- a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d6507c() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d6507c() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d6507c() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.msl
index c9b6de0..675a119 100644
--- a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d6507c(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d6507c(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d6507c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_d6507c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d6507c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d6507c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d6507c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d6507c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.spvasm
index f73987d..534b0b7 100644
--- a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d6507c "textureGather_d6507c"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,54 +48,62 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v2float
+         %31 = OpTypeSampledImage %11
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %36 = OpConstantComposite %v2int %int_1 %int_1
+         %39 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %39 = OpTypeFunction %v4float
-%textureGather_d6507c = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %46 = OpTypeFunction %v4float
+%textureGather_d6507c = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
-         %26 = OpLoad %14 %arg_2
-         %27 = OpLoad %11 %arg_1
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v2float %arg_3
-         %25 = OpImageGather %v4float %29 %30 %uint_1 ConstOffset %36
-               OpStore %res %25
+               OpStore %arg_3 %24
+         %29 = OpLoad %14 %arg_2
+         %30 = OpLoad %11 %arg_1
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v2float %arg_3
+         %28 = OpImageGather %v4float %32 %33 %uint_1 ConstOffset %39
+               OpStore %res %28
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureGather_d6507c
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureGather_d6507c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %18
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGather_d6507c
+%fragment_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureGather_d6507c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_d6507c
+%compute_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_d6507c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.wgsl
index 392cf96..372277e 100644
--- a/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d6507c.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d6507c();
diff --git a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl
index 0908c1f..8c60b10 100644
--- a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl
@@ -28,7 +28,9 @@
   const arg_0 = 1u;
   var arg_3 = vec2<f32>(1.f);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.dxc.hlsl
index 9160d0b..5bc7c98 100644
--- a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d8e958() {
   float2 arg_3 = (1.0f).xx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.fxc.hlsl
index 9160d0b..5bc7c98 100644
--- a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d8e958() {
   float2 arg_3 = (1.0f).xx;
   float4 res = arg_1.GatherGreen(arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.glsl
index 1cfc5db..f5473aa 100644
--- a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d8e958() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d8e958() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp sampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d8e958() {
   vec2 arg_3 = vec2(1.0f);
   vec4 res = textureGather(arg_1_arg_2, arg_3, int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.msl
index 463582b..791af05 100644
--- a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d8e958(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d8e958(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d8e958(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_d8e958(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d8e958(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d8e958(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d8e958(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d8e958(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.spvasm
index 0e48fa2..e0ebc5c 100644
--- a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d8e958 "textureGather_d8e958"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,50 +48,58 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %28 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v2float
+         %31 = OpTypeSampledImage %11
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpTypeFunction %v4float
-%textureGather_d8e958 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %42 = OpTypeFunction %v4float
+%textureGather_d8e958 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
-         %26 = OpLoad %14 %arg_2
-         %27 = OpLoad %11 %arg_1
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v2float %arg_3
-         %25 = OpImageGather %v4float %29 %30 %uint_1
-               OpStore %res %25
+               OpStore %arg_3 %24
+         %29 = OpLoad %14 %arg_2
+         %30 = OpLoad %11 %arg_1
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v2float %arg_3
+         %28 = OpImageGather %v4float %32 %33 %uint_1
+               OpStore %res %28
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %41 = OpLoad %v4float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureGather_d8e958
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureGather_d8e958
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %18
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_d8e958
+%fragment_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_d8e958
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_d8e958
+%compute_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_d8e958
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.wgsl
index 7abc15a..8b66f02 100644
--- a/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d8e958.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   const arg_0 = 1u;
   var arg_3 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d8e958();
diff --git a/test/tint/builtins/gen/var/textureGather/d90605.wgsl b/test/tint/builtins/gen/var/textureGather/d90605.wgsl
index 4aed3ac..a1b3608 100644
--- a/test/tint/builtins/gen/var/textureGather/d90605.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d90605.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.dxc.hlsl
index 2ea2c41..c497cba 100644
--- a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d90605() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float4 res = arg_0.Gather(arg_1, float3(arg_2, float(arg_3)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_d90605();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGather.f32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.fxc.hlsl
index 2ea2c41..375b2dd 100644
--- a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d90605() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float4 res = arg_0.Gather(arg_1, float3(arg_2, float(arg_3)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.glsl
index f83b545..42f3587 100644
--- a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d90605() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d90605() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_d90605() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), 0.0, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.msl
index e27f2f7..4da6338 100644
--- a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d90605(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d90605(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_2, arg_3, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d90605(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_d90605(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d90605(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d90605(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d90605(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d90605(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.spvasm
index 9867556..8d249cb 100644
--- a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d90605 "textureGather_d90605"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,63 +49,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %int_0 = OpConstant %int 0
       %v2int = OpTypeVector %int 2
-         %44 = OpConstantComposite %v2int %int_1 %int_1
+         %47 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureGather_d90605 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureGather_d90605 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-         %31 = OpLoad %14 %arg_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_2
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %int %arg_3
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %int_0 ConstOffset %44
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_1
+         %35 = OpLoad %11 %arg_0
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_2
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %int %arg_3
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %int_0 ConstOffset %47
+               OpStore %res %33
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_d90605
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGather_d90605
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_d90605
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGather_d90605
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_d90605
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGather_d90605
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.wgsl
index a24fe40..e06708b 100644
--- a/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d90605.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d90605();
diff --git a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl
index c1c9e72..6a8763b 100644
--- a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.dxc.hlsl
index 68e7ca4..dfb0be0 100644
--- a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d98d59() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.fxc.hlsl
index 68e7ca4..dfb0be0 100644
--- a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_d98d59() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   float4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.msl
index 4d7e894..a973280 100644
--- a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_d98d59(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_d98d59(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   int arg_4 = 1;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_d98d59(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_d98d59(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_d98d59(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_d98d59(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_d98d59(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_d98d59(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.spvasm
index d2be53c..665619d 100644
--- a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_d98d59 "textureGather_d98d59"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,62 +50,70 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %36 = OpTypeSampledImage %11
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %46 = OpTypeFunction %v4float
-%textureGather_d98d59 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %53 = OpTypeFunction %v4float
+%textureGather_d98d59 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %int_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %35 = OpLoad %v3float %arg_3
-         %36 = OpCompositeExtract %float %35 0
-         %37 = OpCompositeExtract %float %35 1
-         %38 = OpCompositeExtract %float %35 2
-         %40 = OpLoad %int %arg_4
-         %39 = OpConvertSToF %float %40
-         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %uint_1
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %38 = OpLoad %v3float %arg_3
+         %39 = OpCompositeExtract %float %38 0
+         %40 = OpCompositeExtract %float %38 1
+         %41 = OpCompositeExtract %float %38 2
+         %43 = OpLoad %int %arg_4
+         %42 = OpConvertSToF %float %43
+         %44 = OpCompositeConstruct %v4float %39 %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %uint_1
+               OpStore %res %33
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_d98d59
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_d98d59
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %18
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_d98d59
+%fragment_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_d98d59
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_d98d59
+%compute_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_d98d59
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.wgsl
index fb91e26..dea9de1 100644
--- a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_d98d59();
diff --git a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl
index 365b22f..380cdd0 100644
--- a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   const arg_4 = vec2<i32>(1i);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.dxc.hlsl
index 3c686c6..7637d43 100644
--- a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.dxc.hlsl
@@ -1,9 +1,13 @@
+SKIP: FAILED
+
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_dc6661() {
   float2 arg_3 = (1.0f).xx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -32,3 +36,40 @@
   textureGather_dc6661();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.fxc.hlsl
index 3c686c6..7332d9c 100644
--- a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_dc6661() {
   float2 arg_3 = (1.0f).xx;
   int4 res = arg_1.GatherGreen(arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.glsl
index 4c66cb9..ea16dff 100644
--- a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.glsl
@@ -2,9 +2,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_dc6661() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,9 +30,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_dc6661() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -42,9 +52,14 @@
 
 uniform highp isampler2D arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_dc6661() {
   vec2 arg_3 = vec2(1.0f);
   ivec4 res = textureGatherOffset(arg_1_arg_2, arg_3, ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.msl
index 08dd959..b7c0f25 100644
--- a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_dc6661(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_dc6661(texture2d<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_dc6661(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_dc6661(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_dc6661(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_dc6661(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_dc6661(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_dc6661(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.spvasm
index 0f57540..530a2a6 100644
--- a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_dc6661 "textureGather_dc6661"
                OpName %arg_3 "arg_3"
                OpName %res "res"
@@ -27,6 +30,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,55 +49,63 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
-      %v4int = OpTypeVector %int 4
-         %30 = OpTypeSampledImage %11
+         %29 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %40 = OpConstantNull %v4int
-         %41 = OpTypeFunction %v4float
-%textureGather_dc6661 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %40
-               OpStore %arg_3 %22
-         %28 = OpLoad %15 %arg_2
-         %29 = OpLoad %11 %arg_1
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_3
-         %26 = OpImageGather %v4int %31 %32 %uint_1 ConstOffset %37
-               OpStore %res %26
+         %43 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %48 = OpTypeFunction %v4float
+%textureGather_dc6661 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %43
+               OpStore %arg_3 %26
+         %31 = OpLoad %15 %arg_2
+         %32 = OpLoad %11 %arg_1
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_3
+         %30 = OpImageGather %v4int %34 %35 %uint_1 ConstOffset %40
+               OpStore %res %30
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %47 = OpLoad %v4int %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureGather_dc6661
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGather_dc6661
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %20
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_dc6661
+%fragment_main = OpFunction %void None %20
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_dc6661
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_dc6661
+%compute_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_dc6661
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.wgsl
index 8e2e84e..28592b4 100644
--- a/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/dc6661.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   const arg_4 = vec2<i32>(1i);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_dc6661();
diff --git a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl
index 7b40592..98ad70e 100644
--- a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.dxc.hlsl
index a3242e3..2ffa6fc 100644
--- a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e2acac() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.fxc.hlsl
index a3242e3..2ffa6fc 100644
--- a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e2acac() {
   float3 arg_3 = (1.0f).xxx;
   uint arg_4 = 1u;
   uint4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.msl
index 4044a85..95a0962 100644
--- a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_e2acac(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_e2acac(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   uint arg_4 = 1u;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_e2acac(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_e2acac(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_e2acac(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_e2acac(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_e2acac(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_e2acac(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.spvasm
index 6650551..eb07f72 100644
--- a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_e2acac "textureGather_e2acac"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,61 +51,69 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
+         %29 = OpConstantNull %v3float
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %45 = OpConstantNull %v4uint
-         %46 = OpTypeFunction %v4float
-%textureGather_e2acac = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
-        %res = OpVariable %_ptr_Function_v4uint Function %45
-               OpStore %arg_3 %22
+         %48 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %53 = OpTypeFunction %v4float
+%textureGather_e2acac = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+      %arg_4 = OpVariable %_ptr_Function_uint Function %33
+        %res = OpVariable %_ptr_Function_v4uint Function %48
+               OpStore %arg_3 %26
                OpStore %arg_4 %uint_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v3float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %39 = OpCompositeExtract %float %36 2
-         %41 = OpLoad %uint %arg_4
-         %40 = OpConvertUToF %float %41
-         %42 = OpCompositeConstruct %v4float %37 %38 %39 %40
-         %30 = OpImageGather %v4uint %35 %42 %uint_1
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v3float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %42 = OpCompositeExtract %float %39 2
+         %44 = OpLoad %uint %arg_4
+         %43 = OpConvertUToF %float %44
+         %45 = OpCompositeConstruct %v4float %40 %41 %42 %43
+         %34 = OpImageGather %v4uint %38 %45 %uint_1
+               OpStore %res %34
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %52 = OpLoad %v4uint %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %46
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGather_e2acac
+%vertex_main_inner = OpFunction %v4float None %53
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGather_e2acac
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %51 = OpLabel
-         %52 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %52
+%vertex_main = OpFunction %void None %20
+         %58 = OpLabel
+         %59 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %59
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureGather_e2acac
+%fragment_main = OpFunction %void None %20
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureGather_e2acac
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGather_e2acac
+%compute_main = OpFunction %void None %20
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_e2acac
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.wgsl
index bf9657f..1904713 100644
--- a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_e2acac();
diff --git a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl
index 145f621..72ffca8 100644
--- a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.dxc.hlsl
index 7d57cba..515b143 100644
--- a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e3165f() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_e3165f();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.fxc.hlsl
index 7d57cba..5639dbf 100644
--- a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e3165f() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.glsl
index e96d0ae..b44b9f0 100644
--- a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_e3165f() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_e3165f() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp usampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureGather_e3165f() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   uvec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.msl
index 6891bef..af2783a 100644
--- a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_e3165f(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_e3165f(texture2d_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_e3165f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_e3165f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_e3165f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_e3165f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_e3165f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_e3165f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.spvasm
index 7dd439e..e353508 100644
--- a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_e3165f "textureGather_e3165f"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,65 +50,73 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
      %uint_1 = OpConstant %uint 1
       %v2int = OpTypeVector %int 2
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %49 = OpConstantNull %v4uint
-         %50 = OpTypeFunction %v4float
-%textureGather_e3165f = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %49
-               OpStore %arg_3 %22
+         %52 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %57 = OpTypeFunction %v4float
+%textureGather_e3165f = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %52
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_3
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_4
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %31 = OpImageGather %v4uint %36 %43 %uint_1 ConstOffset %46
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_3
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_4
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %35 = OpImageGather %v4uint %39 %46 %uint_1 ConstOffset %49
+               OpStore %res %35
+         %55 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %56 = OpLoad %v4uint %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_e3165f
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_e3165f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %56
+%vertex_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_e3165f
+%fragment_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_e3165f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %61 = OpLabel
-         %62 = OpFunctionCall %void %textureGather_e3165f
+%compute_main = OpFunction %void None %20
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureGather_e3165f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.wgsl
index 2cd2864..da10bd7 100644
--- a/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/e3165f.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_e3165f();
diff --git a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl
index c7f277d..f62abf4 100644
--- a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.dxc.hlsl
index 0604af7..fc1cc0e 100644
--- a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e9d390() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGather_e9d390();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.i32 @dx.op.textureGather.i32(i32 73, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 1)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.fxc.hlsl
index 0604af7..344703c 100644
--- a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_e9d390() {
   float2 arg_3 = (1.0f).xx;
   int arg_4 = 1;
   int4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.glsl
index 9c122b8..4ff414a 100644
--- a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_e9d390() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_e9d390() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp isampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureGather_e9d390() {
   vec2 arg_3 = vec2(1.0f);
   int arg_4 = 1;
   ivec4 res = textureGatherOffset(arg_1_arg_2, vec3(arg_3, float(arg_4)), ivec2(1), 1);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.msl
index 28ce256..0472295 100644
--- a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_e9d390(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_e9d390(texture2d_array<int, access::sample> tint_symbol_1, sampler tint_symbol_2, device int4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   int arg_4 = 1;
   int4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(1), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_e9d390(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_4, sampler tint_symbol_5, device int4* const tint_symbol_6) {
+  textureGather_e9d390(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device int4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_e9d390(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device int4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_e9d390(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_e9d390(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device int4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_e9d390(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.spvasm
index 0092cc8..92930c3 100644
--- a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 69
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_e9d390 "textureGather_e9d390"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,63 +50,72 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v2float %float_1 %float_1
+         %26 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %25 = OpConstantNull %v2float
+         %29 = OpConstantNull %v2float
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
-         %34 = OpTypeSampledImage %11
+         %33 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %44 = OpConstantComposite %v2int %int_1 %int_1
+         %47 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %47 = OpConstantNull %v4int
-         %48 = OpTypeFunction %v4float
-%textureGather_e9d390 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
-        %res = OpVariable %_ptr_Function_v4int Function %47
-               OpStore %arg_3 %22
+         %50 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %56 = OpTypeFunction %v4float
+%textureGather_e9d390 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %33
+        %res = OpVariable %_ptr_Function_v4int Function %50
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %32 = OpLoad %15 %arg_2
-         %33 = OpLoad %11 %arg_1
-         %35 = OpSampledImage %34 %33 %32
-         %37 = OpLoad %v2float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %41 = OpLoad %int %arg_4
-         %40 = OpConvertSToF %float %41
-         %42 = OpCompositeConstruct %v3float %38 %39 %40
-         %30 = OpImageGather %v4int %35 %42 %int_1 ConstOffset %44
-               OpStore %res %30
+         %35 = OpLoad %15 %arg_2
+         %36 = OpLoad %11 %arg_1
+         %38 = OpSampledImage %37 %36 %35
+         %40 = OpLoad %v2float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %44 = OpLoad %int %arg_4
+         %43 = OpConvertSToF %float %44
+         %45 = OpCompositeConstruct %v3float %41 %42 %43
+         %34 = OpImageGather %v4int %38 %45 %int_1 ConstOffset %47
+               OpStore %res %34
+         %54 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %55 = OpLoad %v4int %res
+               OpStore %54 %55
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureGather_e9d390
+%vertex_main_inner = OpFunction %v4float None %56
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureGather_e9d390
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %20
+         %61 = OpLabel
+         %62 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %62
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureGather_e9d390
+%fragment_main = OpFunction %void None %20
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureGather_e9d390
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGather_e9d390
+%compute_main = OpFunction %void None %20
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureGather_e9d390
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.wgsl
index 1f1750b..8020165 100644
--- a/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/e9d390.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<i32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_e9d390();
diff --git a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl
index 5e60b91..61e2c6f 100644
--- a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = 1u;
   var res: vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.dxc.hlsl
index a9e5e58..55c69a2 100644
--- a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ea8eb4() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.fxc.hlsl
index a9e5e58..55c69a2 100644
--- a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_ea8eb4() {
   float2 arg_3 = (1.0f).xx;
   uint arg_4 = 1u;
   float4 res = arg_1.GatherGreen(arg_2, float3(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.glsl
index 5a389b9..6c25408 100644
--- a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_ea8eb4() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_ea8eb4() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DArray arg_1_arg_2;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGather_ea8eb4() {
   vec2 arg_3 = vec2(1.0f);
   uint arg_4 = 1u;
   vec4 res = textureGather(arg_1_arg_2, vec3(arg_3, float(arg_4)), int(1u));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.msl
index 5e246ec..e372f06 100644
--- a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_ea8eb4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_ea8eb4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_3 = float2(1.0f);
   uint arg_4 = 1u;
   float4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, int2(0), component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_ea8eb4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGather_ea8eb4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_ea8eb4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_ea8eb4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_ea8eb4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_ea8eb4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.spvasm
index 1b348a4..61d74f0 100644
--- a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_ea8eb4 "textureGather_ea8eb4"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -28,6 +31,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,60 +49,68 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_2 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %33 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %36 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %44 = OpTypeFunction %v4float
-%textureGather_ea8eb4 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %51 = OpTypeFunction %v4float
+%textureGather_ea8eb4 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_3 %21
+               OpStore %arg_3 %24
                OpStore %arg_4 %uint_1
-         %31 = OpLoad %14 %arg_2
-         %32 = OpLoad %11 %arg_1
-         %34 = OpSampledImage %33 %32 %31
-         %36 = OpLoad %v2float %arg_3
-         %37 = OpCompositeExtract %float %36 0
-         %38 = OpCompositeExtract %float %36 1
-         %40 = OpLoad %uint %arg_4
-         %39 = OpConvertUToF %float %40
-         %41 = OpCompositeConstruct %v3float %37 %38 %39
-         %30 = OpImageGather %v4float %34 %41 %uint_1
-               OpStore %res %30
+         %34 = OpLoad %14 %arg_2
+         %35 = OpLoad %11 %arg_1
+         %37 = OpSampledImage %36 %35 %34
+         %39 = OpLoad %v2float %arg_3
+         %40 = OpCompositeExtract %float %39 0
+         %41 = OpCompositeExtract %float %39 1
+         %43 = OpLoad %uint %arg_4
+         %42 = OpConvertUToF %float %43
+         %44 = OpCompositeConstruct %v3float %40 %41 %42
+         %33 = OpImageGather %v4float %37 %44 %uint_1
+               OpStore %res %33
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %50 = OpLoad %v4float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureGather_ea8eb4
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureGather_ea8eb4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureGather_ea8eb4
+%fragment_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGather_ea8eb4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_ea8eb4
+%compute_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_ea8eb4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.wgsl
index 63fe006..be351c7 100644
--- a/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/ea8eb4.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = 1u;
   var res : vec4<f32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_ea8eb4();
diff --git a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl
index 4d6a8b4..c99a11c 100644
--- a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = 1i;
   var res: vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.dxc.hlsl
index 358b397..04f0414 100644
--- a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_f2c6e3() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.fxc.hlsl
index 358b397..04f0414 100644
--- a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<uint4> arg_1 : register(t1, space1);
 SamplerState arg_2 : register(s2, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGather_f2c6e3() {
   float3 arg_3 = (1.0f).xxx;
   int arg_4 = 1;
   uint4 res = arg_1.GatherGreen(arg_2, float4(arg_3, float(arg_4)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.msl
index b356eb9..7ee2034 100644
--- a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGather_f2c6e3(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGather_f2c6e3(texturecube_array<uint, access::sample> tint_symbol_1, sampler tint_symbol_2, device uint4* const tint_symbol_3) {
   float3 arg_3 = float3(1.0f);
   int arg_4 = 1;
   uint4 res = tint_symbol_1.gather(tint_symbol_2, arg_3, arg_4, component::y);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGather_f2c6e3(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_4, sampler tint_symbol_5, device uint4* const tint_symbol_6) {
+  textureGather_f2c6e3(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device uint4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGather_f2c6e3(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device uint4* tint_symbol_12 [[buffer(0)]]) {
+  textureGather_f2c6e3(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGather_f2c6e3(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device uint4* tint_symbol_15 [[buffer(0)]]) {
+  textureGather_f2c6e3(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.spvasm
index 36837a2..0d3bd56 100644
--- a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGather_f2c6e3 "textureGather_f2c6e3"
                OpName %arg_3 "arg_3"
                OpName %arg_4 "arg_4"
@@ -29,6 +32,10 @@
                OpDecorate %arg_1 Binding 1
                OpDecorate %arg_2 DescriptorSet 1
                OpDecorate %arg_2 Binding 2
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,62 +51,70 @@
          %15 = OpTypeSampler
 %_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
       %arg_2 = OpVariable %_ptr_UniformConstant_15 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %16 = OpTypeFunction %void
+         %20 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %22 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %26 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %25 = OpConstantNull %v3float
+         %29 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
-         %35 = OpTypeSampledImage %11
+         %34 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %46 = OpConstantNull %v4uint
-         %47 = OpTypeFunction %v4float
-%textureGather_f2c6e3 = OpFunction %void None %16
-         %19 = OpLabel
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %25
-      %arg_4 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %46
-               OpStore %arg_3 %22
+         %49 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %54 = OpTypeFunction %v4float
+%textureGather_f2c6e3 = OpFunction %void None %20
+         %23 = OpLabel
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %29
+      %arg_4 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %49
+               OpStore %arg_3 %26
                OpStore %arg_4 %int_1
-         %33 = OpLoad %15 %arg_2
-         %34 = OpLoad %11 %arg_1
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_3
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %int %arg_4
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %31 = OpImageGather %v4uint %36 %43 %int_1
-               OpStore %res %31
+         %36 = OpLoad %15 %arg_2
+         %37 = OpLoad %11 %arg_1
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_3
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %int %arg_4
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %35 = OpImageGather %v4uint %39 %46 %int_1
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %53 = OpLoad %v4uint %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGather_f2c6e3
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGather_f2c6e3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %16
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %20
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %16
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGather_f2c6e3
+%fragment_main = OpFunction %void None %20
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGather_f2c6e3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGather_f2c6e3
+%compute_main = OpFunction %void None %20
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGather_f2c6e3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.wgsl
index 3005c80..5a0c24f 100644
--- a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = 1i;
   var res : vec4<u32> = textureGather(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGather_f2c6e3();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl
index e0d3b6e..a77c10e 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.dxc.hlsl
index ee5d38a..445424a 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_144a9a() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureGatherCompare_144a9a();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.fxc.hlsl
index ee5d38a..e6901aa 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_144a9a() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.glsl
index 5920e0e..5b36ee0 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_144a9a() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_144a9a() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_144a9a() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.msl
index 6e0c82f..4ab81c1 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_144a9a(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_144a9a(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3, arg_4, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_144a9a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_144a9a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_144a9a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_144a9a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_144a9a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_144a9a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.spvasm
index c027f94..bccfd03 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 64
+; Bound: 71
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_144a9a "textureGatherCompare_144a9a"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,68 +50,76 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %48 = OpConstantComposite %v2int %int_1 %int_1
+         %51 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %51 = OpTypeFunction %v4float
-%textureGatherCompare_144a9a = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %58 = OpTypeFunction %v4float
+%textureGatherCompare_144a9a = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageDrefGather %v4float %36 %43 %44 ConstOffset %48
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageDrefGather %v4float %39 %46 %47 ConstOffset %51
+               OpStore %res %35
+         %56 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %57 = OpLoad %v4float %res
+               OpStore %56 %57
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %51
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureGatherCompare_144a9a
+%vertex_main_inner = OpFunction %v4float None %58
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureGatherCompare_144a9a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %57
+%vertex_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %64
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureGatherCompare_144a9a
+%fragment_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGatherCompare_144a9a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %62 = OpLabel
-         %63 = OpFunctionCall %void %textureGatherCompare_144a9a
+%compute_main = OpFunction %void None %18
+         %69 = OpLabel
+         %70 = OpFunctionCall %void %textureGatherCompare_144a9a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.wgsl
index bff46b7..f8b9020 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/144a9a.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_144a9a();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl
index c021e00..c2f160c 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1.f;
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.dxc.hlsl
index 775595e..43a9102 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_182fd4() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.fxc.hlsl
index 775595e..43a9102 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_182fd4() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.glsl
index 7d7d856..540dce6 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_182fd4() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_182fd4() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_182fd4() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.msl
index 34f3a8c..82d6141 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_182fd4(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_182fd4(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_182fd4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_182fd4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_182fd4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_182fd4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_182fd4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_182fd4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.spvasm
index e276158..69396f2 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_182fd4 "textureGatherCompare_182fd4"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGatherCompare_182fd4 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureGatherCompare_182fd4 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageDrefGather %v4float %31 %32 %33
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageDrefGather %v4float %34 %35 %36
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGatherCompare_182fd4
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGatherCompare_182fd4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGatherCompare_182fd4
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGatherCompare_182fd4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGatherCompare_182fd4
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGatherCompare_182fd4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.wgsl
index e810f09..1e0b10c 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/182fd4.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_182fd4();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl
index 7ca38fb..b971b67 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.dxc.hlsl
index fb2cc17..47b29a4 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_2e409c() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.fxc.hlsl
index fb2cc17..47b29a4 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_2e409c() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.msl
index 7f17941..b1f7e10 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_2e409c(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_2e409c(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3, arg_4);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_2e409c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_2e409c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_2e409c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_2e409c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_2e409c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_2e409c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.spvasm
index c937e06..a8fe475 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_2e409c "textureGatherCompare_2e409c"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,64 +51,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureGatherCompare_2e409c = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %54 = OpTypeFunction %v4float
+%textureGatherCompare_2e409c = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageDrefGather %v4float %36 %43 %44
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageDrefGather %v4float %39 %46 %47
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %53 = OpLoad %v4float %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGatherCompare_2e409c
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGatherCompare_2e409c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGatherCompare_2e409c
+%fragment_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGatherCompare_2e409c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGatherCompare_2e409c
+%compute_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGatherCompare_2e409c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.wgsl
index 1534917..d92ad41 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_2e409c();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl
index 58b2f55..a555f99 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1.f;
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.dxc.hlsl
index 46845ac..a9b0c37 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_313add() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureGatherCompare_313add();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.fxc.hlsl
index 46845ac..6bc17a6 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_313add() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.glsl
index fc17439..f997ae2 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_313add() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, arg_2, arg_3, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_313add() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, arg_2, arg_3, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_313add() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, arg_2, arg_3, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.msl
index 461ee05..a1712f3 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_313add(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_313add(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_313add(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_313add(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_313add(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_313add(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_313add(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_313add(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.spvasm
index 2584713..59c3ace 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_313add "textureGatherCompare_313add"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,56 +49,65 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureGatherCompare_313add = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %48 = OpTypeFunction %v4float
+%textureGatherCompare_313add = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageDrefGather %v4float %31 %32 %33 ConstOffset %37
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageDrefGather %v4float %34 %35 %36 ConstOffset %40
+               OpStore %res %30
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %47 = OpLoad %v4float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureGatherCompare_313add
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureGatherCompare_313add
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureGatherCompare_313add
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGatherCompare_313add
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGatherCompare_313add
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGatherCompare_313add
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.wgsl
index 9b3cb2c..c595939 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/313add.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1.0f;
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_313add();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl
index fc82524..bad8a6b 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.dxc.hlsl
index 76afffa..908472f 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_60d2d1() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.fxc.hlsl
index 76afffa..908472f 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_60d2d1() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.msl
index ee19149..41b4e1a 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_60d2d1(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_60d2d1(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3, arg_4);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_60d2d1(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_60d2d1(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_60d2d1(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_60d2d1(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_60d2d1(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_60d2d1(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.spvasm
index 2320452..565fc82 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_60d2d1 "textureGatherCompare_60d2d1"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,64 +51,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureGatherCompare_60d2d1 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureGatherCompare_60d2d1 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageDrefGather %v4float %36 %43 %44
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageDrefGather %v4float %39 %46 %47
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGatherCompare_60d2d1
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGatherCompare_60d2d1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGatherCompare_60d2d1
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGatherCompare_60d2d1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGatherCompare_60d2d1
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGatherCompare_60d2d1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.wgsl
index 3937d85..5ada09b 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_60d2d1();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl
index 5802254..ec0e4c5 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1.f;
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.dxc.hlsl
index d136dca..e2e3031 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_6d9352() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.fxc.hlsl
index d136dca..e2e3031 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_6d9352() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.glsl
index 94b92bb..330a410 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_6d9352() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_6d9352() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_6d9352() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.msl
index 2dc296d..938afcf 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_6d9352(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_6d9352(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_6d9352(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_6d9352(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_6d9352(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_6d9352(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_6d9352(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_6d9352(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.spvasm
index eaab3ee..39a7322 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_6d9352 "textureGatherCompare_6d9352"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureGatherCompare_6d9352 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureGatherCompare_6d9352 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageDrefGather %v4float %31 %32 %33
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageDrefGather %v4float %34 %35 %36
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureGatherCompare_6d9352
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureGatherCompare_6d9352
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureGatherCompare_6d9352
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureGatherCompare_6d9352
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureGatherCompare_6d9352
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureGatherCompare_6d9352
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.wgsl
index e7aff07..f8b56bb 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/6d9352.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_6d9352();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl
index 60450e1..3bdc9ac 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.dxc.hlsl
index 827c246..4a48f20 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_783e65() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.fxc.hlsl
index 827c246..4a48f20 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_783e65() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.glsl
index a137b93..4161270 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_783e65() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_783e65() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_783e65() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.msl
index 5d7179d..60c8828 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_783e65(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_783e65(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3, arg_4);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_783e65(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_783e65(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_783e65(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_783e65(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_783e65(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_783e65(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.spvasm
index 9d93082..e38ad07 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_783e65 "textureGatherCompare_783e65"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,64 +50,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureGatherCompare_783e65 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureGatherCompare_783e65 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageDrefGather %v4float %36 %43 %44
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageDrefGather %v4float %39 %46 %47
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGatherCompare_783e65
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureGatherCompare_783e65
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGatherCompare_783e65
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureGatherCompare_783e65
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGatherCompare_783e65
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureGatherCompare_783e65
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.wgsl
index cbb0d13..a3f17ac 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/783e65.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_783e65();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl
index 03eef71..32b192a 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.dxc.hlsl
index a4ffc04..efd034d 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_b5bc43() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.fxc.hlsl
index a4ffc04..efd034d 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_b5bc43() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.glsl
index ecc3638..a760aa8 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_b5bc43() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_b5bc43() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_b5bc43() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureGather(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.msl
index 31fc042..4d78d5b 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_b5bc43(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_b5bc43(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3, arg_4);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_b5bc43(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_b5bc43(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_b5bc43(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_b5bc43(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_b5bc43(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_b5bc43(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.spvasm
index e67de9f..3846206 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_b5bc43 "textureGatherCompare_b5bc43"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,64 +50,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureGatherCompare_b5bc43 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %54 = OpTypeFunction %v4float
+%textureGatherCompare_b5bc43 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageDrefGather %v4float %36 %43 %44
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageDrefGather %v4float %39 %46 %47
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %53 = OpLoad %v4float %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureGatherCompare_b5bc43
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureGatherCompare_b5bc43
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureGatherCompare_b5bc43
+%fragment_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureGatherCompare_b5bc43
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureGatherCompare_b5bc43
+%compute_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGatherCompare_b5bc43
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.wgsl
index 7740030..d18259c 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/b5bc43.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_b5bc43();
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl
index f742acd..2b4fc23 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.dxc.hlsl
index f4905b5..738656b 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_f585cc() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureGatherCompare_f585cc();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.textureGatherCmp.f32(i32 74, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 0, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.fxc.hlsl
index f4905b5..98ed571 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureGatherCompare_f585cc() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.GatherCmp(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.glsl
index 38f91d2..0da1ef0 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_f585cc() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_f585cc() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureGatherCompare_f585cc() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureGatherOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.msl
index adfe72c..bb7293d 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureGatherCompare_f585cc(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureGatherCompare_f585cc(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.gather_compare(tint_symbol_2, arg_2, arg_3, arg_4, int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureGatherCompare_f585cc(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureGatherCompare_f585cc(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureGatherCompare_f585cc(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureGatherCompare_f585cc(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureGatherCompare_f585cc(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureGatherCompare_f585cc(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.spvasm
index 498b0fe..db8eae5 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 62
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureGatherCompare_f585cc "textureGatherCompare_f585cc"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,66 +50,75 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %49 = OpTypeFunction %v4float
-%textureGatherCompare_f585cc = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %57 = OpTypeFunction %v4float
+%textureGatherCompare_f585cc = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageDrefGather %v4float %36 %43 %44 ConstOffset %46
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageDrefGather %v4float %39 %46 %47 ConstOffset %49
+               OpStore %res %35
+         %55 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %56 = OpLoad %v4float %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %49
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureGatherCompare_f585cc
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureGatherCompare_f585cc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %55
+%vertex_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureGatherCompare_f585cc
+%fragment_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureGatherCompare_f585cc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureGatherCompare_f585cc
+%compute_main = OpFunction %void None %18
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureGatherCompare_f585cc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.wgsl
index e495b0f..f39a59a 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/f585cc.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureGatherCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureGatherCompare_f585cc();
diff --git a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl
index d8febef..4d94000 100644
--- a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.dxc.hlsl
index f661e8d..42dcd9f 100644
--- a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_019da0() {
   int3 arg_1 = (1).xxx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(int4(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.fxc.hlsl
index f661e8d..42dcd9f 100644
--- a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_019da0() {
   int3 arg_1 = (1).xxx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(int4(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.glsl
index 62b9a35..2cc56ad 100644
--- a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_019da0() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_019da0() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_019da0() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.msl
index 78ea10c..2235acb 100644
--- a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_019da0(texture3d<float, access::sample> tint_symbol_1) {
+void textureLoad_019da0(texture3d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int3 arg_1 = int3(1);
   uint arg_2 = 1u;
   float4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureLoad_019da0(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_019da0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_019da0(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_019da0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_019da0(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_019da0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.spvasm
index 3c9fcae..dacddbc 100644
--- a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_019da0 "textureLoad_019da0"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,54 +43,62 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %22 = OpConstantNull %v3int
+         %25 = OpConstantNull %v3int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_019da0 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
+%textureLoad_019da0 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v3int %arg_1
-         %31 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4float %29 %30 Lod %31
-               OpStore %res %28
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v3int %arg_1
+         %34 = OpLoad %uint %arg_2
+         %31 = OpImageFetch %v4float %32 %33 Lod %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_019da0
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_019da0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_019da0
+%fragment_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_019da0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_019da0
+%compute_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_019da0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.wgsl
index d4653f6..640757f 100644
--- a/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/019da0.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_019da0();
diff --git a/test/tint/builtins/gen/var/textureLoad/026217.wgsl b/test/tint/builtins/gen/var/textureLoad/026217.wgsl
index 74edd08..7665308 100644
--- a/test/tint/builtins/gen/var/textureLoad/026217.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/026217.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.dxc.hlsl
index e8a34dd..9c8e201 100644
--- a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_026217() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   uint4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.fxc.hlsl
index e8a34dd..9c8e201 100644
--- a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_026217() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   uint4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.glsl
index 57801df..280e45d 100644
--- a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_026217() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_026217() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_026217() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.msl
index 68fe376..6f436d1 100644
--- a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_026217(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_026217(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_026217(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_026217(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_026217(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_026217(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_026217(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_026217(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.spvasm
index 9e98066..c3e63ab 100644
--- a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_026217 "textureLoad_026217"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,64 +45,72 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %26 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %29 = OpConstantNull %uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %34 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %43 = OpConstantNull %v4uint
-         %44 = OpTypeFunction %v4float
+         %46 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_026217 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-      %arg_3 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %43
-               OpStore %arg_1 %19
+%textureLoad_026217 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %29
+      %arg_3 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %46
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %int_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2uint %arg_1
-         %36 = OpCompositeExtract %uint %35 0
-         %37 = OpCompositeExtract %uint %35 1
-         %38 = OpLoad %uint %arg_2
-         %39 = OpCompositeConstruct %v3uint %36 %37 %38
-         %40 = OpLoad %int %arg_3
-         %31 = OpImageFetch %v4uint %33 %39 Lod %40
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2uint %arg_1
+         %39 = OpCompositeExtract %uint %38 0
+         %40 = OpCompositeExtract %uint %38 1
+         %41 = OpLoad %uint %arg_2
+         %42 = OpCompositeConstruct %v3uint %39 %40 %41
+         %43 = OpLoad %int %arg_3
+         %35 = OpImageFetch %v4uint %36 %42 Lod %43
+               OpStore %res %35
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %50 = OpLoad %v4uint %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_026217
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_026217
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %17
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_026217
+%fragment_main = OpFunction %void None %17
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_026217
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureLoad_026217
+%compute_main = OpFunction %void None %17
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureLoad_026217
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.wgsl
index b117b2d..9b403f4 100644
--- a/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/026217.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_026217();
diff --git a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl
index dc1160e..fd4b5ee 100644
--- a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.dxc.hlsl
index fec8d4f..8be9188 100644
--- a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_04b911() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), arg_3)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.fxc.hlsl
index fec8d4f..8be9188 100644
--- a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_04b911() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), arg_3)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.glsl
index 4427e30..8c2ef9f 100644
--- a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_04b911() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_04b911() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_04b911() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.msl
index 12f55f7d..77310f0 100644
--- a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_04b911(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_04b911(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_04b911(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_04b911(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_04b911(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_04b911(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_04b911(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_04b911(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.spvasm
index fc8d6f5..7c5d755 100644
--- a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_04b911 "textureLoad_04b911"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,65 +44,73 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
+         %33 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %44 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_04b911 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-      %arg_3 = OpVariable %_ptr_Function_uint Function %30
+%textureLoad_04b911 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+      %arg_3 = OpVariable %_ptr_Function_uint Function %33
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
                OpStore %arg_3 %uint_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2uint %arg_1
-         %36 = OpCompositeExtract %uint %35 0
-         %37 = OpCompositeExtract %uint %35 1
-         %39 = OpLoad %int %arg_2
-         %38 = OpBitcast %uint %39
-         %40 = OpCompositeConstruct %v3uint %36 %37 %38
-         %41 = OpLoad %uint %arg_3
-         %32 = OpImageFetch %v4float %33 %40 Lod %41
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2uint %arg_1
+         %39 = OpCompositeExtract %uint %38 0
+         %40 = OpCompositeExtract %uint %38 1
+         %42 = OpLoad %int %arg_2
+         %41 = OpBitcast %uint %42
+         %43 = OpCompositeConstruct %v3uint %39 %40 %41
+         %44 = OpLoad %uint %arg_3
+         %35 = OpImageFetch %v4float %36 %43 Lod %44
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %49 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %50 = OpLoad %float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_04b911
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_04b911
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %15
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_04b911
+%fragment_main = OpFunction %void None %15
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_04b911
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureLoad_04b911
+%compute_main = OpFunction %void None %15
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureLoad_04b911
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.wgsl
index bdff948..df5b1e4 100644
--- a/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/04b911.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_04b911();
diff --git a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl
index 1500697..7037d6f 100644
--- a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.dxc.hlsl
index 7746f30..95a4485 100644
--- a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_0cb698() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(uint2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.fxc.hlsl
index 7746f30..95a4485 100644
--- a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_0cb698() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(uint2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.glsl
index d06dd55..e9ea555 100644
--- a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_0cb698() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_0cb698() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_0cb698() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.msl
index b2bd1b9..9e91379 100644
--- a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_0cb698(texture1d<int, access::sample> tint_symbol_1) {
+void textureLoad_0cb698(texture1d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   int4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureLoad_0cb698(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_0cb698(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_0cb698(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_0cb698(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_0cb698(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_0cb698(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.spvasm
index d824044..26ea93a 100644
--- a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_0cb698 "textureLoad_0cb698"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,50 +45,58 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %25 = OpConstantNull %uint
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %30 = OpConstantNull %v4int
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_0cb698 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %21
-      %arg_2 = OpVariable %_ptr_Function_uint Function %21
-        %res = OpVariable %_ptr_Function_v4int Function %30
+%textureLoad_0cb698 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_v4int Function %33
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %25 = OpLoad %11 %arg_0
-         %26 = OpLoad %uint %arg_1
-         %27 = OpLoad %uint %arg_2
-         %23 = OpImageFetch %v4int %25 %26 Lod %27
-               OpStore %res %23
+         %28 = OpLoad %11 %arg_0
+         %29 = OpLoad %uint %arg_1
+         %30 = OpLoad %uint %arg_2
+         %27 = OpImageFetch %v4int %28 %29 Lod %30
+               OpStore %res %27
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %37 = OpLoad %v4int %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_0cb698
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_0cb698
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_0cb698
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_0cb698
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_0cb698
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_0cb698
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.wgsl
index 97cffac..fd1e642 100644
--- a/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/0cb698.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_0cb698();
diff --git a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl
index e1d7101..5297807 100644
--- a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.dxc.hlsl
index cd11245..f1a7e13 100644
--- a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1373dc() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   float4 res = arg_0.Load(uint2(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.fxc.hlsl
index cd11245..f1a7e13 100644
--- a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1373dc() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   float4 res = arg_0.Load(uint2(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.glsl
index ece13e4..800cb84 100644
--- a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1373dc() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1373dc() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1373dc() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.msl
index f6ca82f..9867543 100644
--- a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1373dc(texture1d<float, access::sample> tint_symbol_1) {
+void textureLoad_1373dc(texture1d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint arg_1 = 1u;
   int arg_2 = 1;
   float4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureLoad_1373dc(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_1373dc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1373dc(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1373dc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1373dc(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1373dc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.spvasm
index a51498f..35d6a21 100644
--- a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1373dc "textureLoad_1373dc"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,52 +44,60 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
+         %23 = OpConstantNull %uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1373dc = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
+%textureLoad_1373dc = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %23
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %int_1
-         %27 = OpLoad %11 %arg_0
-         %28 = OpLoad %uint %arg_1
-         %29 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4float %27 %28 Lod %29
-               OpStore %res %26
+         %30 = OpLoad %11 %arg_0
+         %31 = OpLoad %uint %arg_1
+         %32 = OpLoad %int %arg_2
+         %29 = OpImageFetch %v4float %30 %31 Lod %32
+               OpStore %res %29
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_1373dc
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_1373dc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_1373dc
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_1373dc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_1373dc
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_1373dc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.wgsl
index 38958ca..94d1565 100644
--- a/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1373dc.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1u;
   var arg_2 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1373dc();
diff --git a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl
index 2f1e52a..6e0e8e8 100644
--- a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.dxc.hlsl
index abc8e57..b9b3f16 100644
--- a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_168dc8() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   int4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.fxc.hlsl
index abc8e57..b9b3f16 100644
--- a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_168dc8() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   int4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.glsl
index cca08c5..09820b1 100644
--- a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_168dc8() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_168dc8() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_168dc8() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.msl
index b157f12..62f68ec 100644
--- a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_168dc8(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_168dc8(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_168dc8(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_168dc8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_168dc8(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_168dc8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_168dc8(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_168dc8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.spvasm
index fd2efd2..0c94b4e 100644
--- a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_168dc8 "textureLoad_168dc8"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,63 +45,71 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
+         %27 = OpConstantNull %v2uint
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %31 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %42 = OpConstantNull %v4int
-         %43 = OpTypeFunction %v4float
+         %45 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_168dc8 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-      %arg_3 = OpVariable %_ptr_Function_int Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %42
-               OpStore %arg_1 %20
+%textureLoad_168dc8 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+      %arg_3 = OpVariable %_ptr_Function_int Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %45
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
                OpStore %arg_3 %int_1
-         %31 = OpLoad %11 %arg_0
-         %33 = OpLoad %v2uint %arg_1
-         %34 = OpCompositeExtract %uint %33 0
-         %35 = OpCompositeExtract %uint %33 1
-         %37 = OpLoad %int %arg_2
-         %36 = OpBitcast %uint %37
-         %38 = OpCompositeConstruct %v3uint %34 %35 %36
-         %39 = OpLoad %int %arg_3
-         %29 = OpImageFetch %v4int %31 %38 Lod %39
-               OpStore %res %29
+         %34 = OpLoad %11 %arg_0
+         %36 = OpLoad %v2uint %arg_1
+         %37 = OpCompositeExtract %uint %36 0
+         %38 = OpCompositeExtract %uint %36 1
+         %40 = OpLoad %int %arg_2
+         %39 = OpBitcast %uint %40
+         %41 = OpCompositeConstruct %v3uint %37 %38 %39
+         %42 = OpLoad %int %arg_3
+         %33 = OpImageFetch %v4int %34 %41 Lod %42
+               OpStore %res %33
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %49 = OpLoad %v4int %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_168dc8
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_168dc8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_168dc8
+%fragment_main = OpFunction %void None %17
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_168dc8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureLoad_168dc8
+%compute_main = OpFunction %void None %17
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureLoad_168dc8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.wgsl
index ccd9e51..7cd2092 100644
--- a/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/168dc8.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_168dc8();
diff --git a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl
index 3614c35..bfffedf 100644
--- a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.dxc.hlsl
index 6482ac0..9783c1d 100644
--- a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_19cf87() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   float res = arg_0.Load(int3(arg_1, arg_2)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.fxc.hlsl
index 6482ac0..9783c1d 100644
--- a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_19cf87() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   float res = arg_0.Load(int3(arg_1, arg_2)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.glsl
index d202d31..72321cd 100644
--- a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_19cf87() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, arg_1, arg_2).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_19cf87() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, arg_1, arg_2).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_19cf87() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, arg_1, arg_2).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.msl
index 72e24bb..7b64c2b 100644
--- a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_19cf87(depth2d<float, access::sample> tint_symbol_1) {
+void textureLoad_19cf87(depth2d<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureLoad_19cf87(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_19cf87(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_19cf87(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_19cf87(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_19cf87(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_19cf87(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.spvasm
index cd11687..1cd0a9d 100644
--- a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_19cf87 "textureLoad_19cf87"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,53 +43,62 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_19cf87 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
+%textureLoad_19cf87 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v2int %arg_1
-         %30 = OpLoad %int %arg_2
-         %27 = OpImageFetch %v4float %28 %29 Lod %30
-         %26 = OpCompositeExtract %float %27 0
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v2int %arg_1
+         %33 = OpLoad %int %arg_2
+         %30 = OpImageFetch %v4float %31 %32 Lod %33
+         %29 = OpCompositeExtract %float %30 0
+               OpStore %res %29
+         %39 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %40 = OpLoad %float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_19cf87
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_19cf87
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_19cf87
+%fragment_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_19cf87
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_19cf87
+%compute_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_19cf87
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.wgsl
index 203dfc5..e3198fe 100644
--- a/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/19cf87.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_19cf87();
diff --git a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl
index dff77c1..d6d665d 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.dxc.hlsl
index ce8e545..a1ec50a 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1b051f() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.fxc.hlsl
index ce8e545..a1ec50a 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1b051f() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.glsl
index 6072777..7fdc337 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b051f() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b051f() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b051f() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.msl
index c61f6ff..f7d3a35 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1b051f(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_1b051f(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_1b051f(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_1b051f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1b051f(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1b051f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1b051f(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1b051f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.spvasm
index 9dce9cd..17c5669 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1b051f "textureLoad_1b051f"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,63 +45,71 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %23 = OpConstantNull %v2int
+         %27 = OpConstantNull %v2int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %31 = OpConstantNull %uint
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %42 = OpConstantNull %v4uint
-         %43 = OpTypeFunction %v4float
+         %45 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1b051f = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-      %arg_3 = OpVariable %_ptr_Function_uint Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %42
-               OpStore %arg_1 %20
+%textureLoad_1b051f = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+      %arg_3 = OpVariable %_ptr_Function_uint Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %45
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %31 = OpLoad %11 %arg_0
-         %33 = OpLoad %v2int %arg_1
-         %34 = OpCompositeExtract %int %33 0
-         %35 = OpCompositeExtract %int %33 1
-         %37 = OpLoad %uint %arg_2
-         %36 = OpBitcast %int %37
-         %38 = OpCompositeConstruct %v3int %34 %35 %36
-         %39 = OpLoad %uint %arg_3
-         %29 = OpImageFetch %v4uint %31 %38 Lod %39
-               OpStore %res %29
+         %34 = OpLoad %11 %arg_0
+         %36 = OpLoad %v2int %arg_1
+         %37 = OpCompositeExtract %int %36 0
+         %38 = OpCompositeExtract %int %36 1
+         %40 = OpLoad %uint %arg_2
+         %39 = OpBitcast %int %40
+         %41 = OpCompositeConstruct %v3int %37 %38 %39
+         %42 = OpLoad %uint %arg_3
+         %33 = OpImageFetch %v4uint %34 %41 Lod %42
+               OpStore %res %33
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %49 = OpLoad %v4uint %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_1b051f
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_1b051f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_1b051f
+%fragment_main = OpFunction %void None %17
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_1b051f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureLoad_1b051f
+%compute_main = OpFunction %void None %17
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureLoad_1b051f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.wgsl
index c941b74..082878b 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b051f.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1b051f();
diff --git a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl
index 89c3718..8915ccc 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1i;
   var arg_2 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.dxc.hlsl
index ddca586..47867e6 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1b8588() {
   int arg_1 = 1;
   int arg_2 = 1;
   uint4 res = arg_0.Load(int2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.fxc.hlsl
index ddca586..47867e6 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1b8588() {
   int arg_1 = 1;
   int arg_2 = 1;
   uint4 res = arg_0.Load(int2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.glsl
index 60b3de0..9cbd32c 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b8588() {
   int arg_1 = 1;
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b8588() {
   int arg_1 = 1;
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1b8588() {
   int arg_1 = 1;
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.msl
index 422511e..d4423d9 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1b8588(texture1d<uint, access::sample> tint_symbol_1) {
+void textureLoad_1b8588(texture1d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int arg_1 = 1;
   int arg_2 = 1;
   uint4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureLoad_1b8588(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_1b8588(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1b8588(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1b8588(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1b8588(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1b8588(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.spvasm
index 6e2c58c..a436c56 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1b8588 "textureLoad_1b8588"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,50 +45,58 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %21 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %25 = OpConstantNull %int
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %30 = OpConstantNull %v4uint
-         %31 = OpTypeFunction %v4float
+         %33 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1b8588 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %21
-      %arg_2 = OpVariable %_ptr_Function_int Function %21
-        %res = OpVariable %_ptr_Function_v4uint Function %30
+%textureLoad_1b8588 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_v4uint Function %33
                OpStore %arg_1 %int_1
                OpStore %arg_2 %int_1
-         %25 = OpLoad %11 %arg_0
-         %26 = OpLoad %int %arg_1
-         %27 = OpLoad %int %arg_2
-         %23 = OpImageFetch %v4uint %25 %26 Lod %27
-               OpStore %res %23
+         %28 = OpLoad %11 %arg_0
+         %29 = OpLoad %int %arg_1
+         %30 = OpLoad %int %arg_2
+         %27 = OpImageFetch %v4uint %28 %29 Lod %30
+               OpStore %res %27
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %37 = OpLoad %v4uint %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureLoad_1b8588
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_1b8588
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %37
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_1b8588
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_1b8588
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_1b8588
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_1b8588
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.wgsl
index 15380cf..7a150ac 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1i;
   var arg_2 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1b8588();
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl
index 7c1e957..f32f419 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl
@@ -26,7 +26,9 @@
 fn textureLoad_1bfdfb() {
   var arg_1 = vec2<u32>(1u);
   var res: vec4<f32> = textureLoad(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
index 4b7b50e..b87f80b 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
@@ -91,9 +91,12 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureLoad_1bfdfb() {
   uint2 arg_1 = (1u).xx;
   float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
index 4b7b50e..b87f80b 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
@@ -91,9 +91,12 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureLoad_1bfdfb() {
   uint2 arg_1 = (1u).xx;
   float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
index d38b454..fc212c8 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
@@ -74,9 +74,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1bfdfb() {
   uvec2 arg_1 = uvec2(1u);
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -169,9 +174,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1bfdfb() {
   uvec2 arg_1 = uvec2(1u);
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -258,9 +268,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1bfdfb() {
   uvec2 arg_1 = uvec2(1u);
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
index 97af0a7..8d2b9d2 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
@@ -95,34 +95,35 @@
   return float4(color, 1.0f);
 }
 
-void textureLoad_1bfdfb(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_3) {
+void textureLoad_1bfdfb(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_3, device float4* const tint_symbol_4) {
   uint2 arg_1 = uint2(1u);
   float4 res = textureLoadExternal(tint_symbol_1, tint_symbol_2, arg_1, tint_unpack_vec3_in_composite_1(*(tint_symbol_3)));
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, texture2d<float, access::sample> tint_symbol_5, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_6) {
-  textureLoad_1bfdfb(tint_symbol_4, tint_symbol_5, tint_symbol_6);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_7, device float4* const tint_symbol_8) {
+  textureLoad_1bfdfb(tint_symbol_5, tint_symbol_6, tint_symbol_7, tint_symbol_8);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], texture2d<float, access::sample> tint_symbol_8 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_9 [[buffer(2)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], texture2d<float, access::sample> tint_symbol_10 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_11 [[buffer(2)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], texture2d<float, access::sample> tint_symbol_11 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_12 [[buffer(2)]]) {
-  textureLoad_1bfdfb(tint_symbol_10, tint_symbol_11, tint_symbol_12);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_15 [[buffer(2)]], device float4* tint_symbol_16 [[buffer(0)]]) {
+  textureLoad_1bfdfb(tint_symbol_13, tint_symbol_14, tint_symbol_15, tint_symbol_16);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_15 [[buffer(2)]]) {
-  textureLoad_1bfdfb(tint_symbol_13, tint_symbol_14, tint_symbol_15);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_17 [[texture(0)]], texture2d<float, access::sample> tint_symbol_18 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_19 [[buffer(2)]], device float4* tint_symbol_20 [[buffer(0)]]) {
+  textureLoad_1bfdfb(tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
index 0da3af8..c8196ff 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 161
+; Bound: 167
 ; Schema: 0
                OpCapability Shader
-         %29 = OpExtInstImport "GLSL.std.450"
+         %32 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,6 +37,9 @@
                OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
                OpName %ext_tex_params "ext_tex_params"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %gammaCorrection "gammaCorrection"
                OpName %v "v"
                OpName %params "params"
@@ -95,6 +98,10 @@
                OpDecorate %ext_tex_params Binding 2
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
                OpMemberDecorate %ExternalTextureParams 0 Offset 0
                OpMemberDecorate %ExternalTextureParams 1 Offset 4
                OpMemberDecorate %ExternalTextureParams 2 Offset 16
@@ -130,172 +137,179 @@
 %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
 %ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-         %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %26 = OpTypeFunction %v3float %v3float %GammaTransferParams
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %43 = OpConstantNull %v3float
+         %46 = OpConstantNull %v3float
      %v2uint = OpTypeVector %uint 2
 %mat3v2float = OpTypeMatrix %v2float 3
 %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat3v2float
-         %63 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams
+         %66 = OpTypeFunction %v4float %11 %11 %v2uint %ExternalTextureParams
      %uint_1 = OpConstant %uint 1
-         %74 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %77 = OpConstantComposite %v2uint %uint_1 %uint_1
         %int = OpTypeInt 32 1
-         %84 = OpConstantNull %int
+         %87 = OpConstantNull %int
     %float_1 = OpConstant %float 1
-         %97 = OpConstantNull %uint
-        %115 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
+        %100 = OpConstantNull %uint
+        %118 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
        %void = OpTypeVoid
-        %130 = OpTypeFunction %void
+        %133 = OpTypeFunction %void
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-        %136 = OpConstantNull %v2uint
+        %139 = OpConstantNull %v2uint
      %uint_0 = OpConstant %uint 0
 %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-        %148 = OpTypeFunction %v4float
-%gammaCorrection = OpFunction %v3float None %23
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+        %154 = OpTypeFunction %v4float
+%gammaCorrection = OpFunction %v3float None %26
           %v = OpFunctionParameter %v3float
      %params = OpFunctionParameter %GammaTransferParams
-         %27 = OpLabel
-         %41 = OpVariable %_ptr_Function_v3float Function %43
-         %53 = OpVariable %_ptr_Function_v3float Function %43
-         %59 = OpVariable %_ptr_Function_v3float Function %43
-         %28 = OpExtInst %v3float %29 FAbs %v
-         %30 = OpCompositeExtract %float %params 4
-         %31 = OpCompositeConstruct %v3float %30 %30 %30
-         %32 = OpFOrdLessThan %v3bool %28 %31
-         %35 = OpExtInst %v3float %29 FSign %v
-         %36 = OpCompositeExtract %float %params 3
-         %37 = OpExtInst %v3float %29 FAbs %v
-         %38 = OpVectorTimesScalar %v3float %37 %36
-         %39 = OpCompositeExtract %float %params 6
-         %44 = OpCompositeConstruct %v3float %39 %39 %39
-         %40 = OpFAdd %v3float %38 %44
-         %45 = OpFMul %v3float %35 %40
-         %46 = OpExtInst %v3float %29 FSign %v
-         %48 = OpCompositeExtract %float %params 1
-         %49 = OpExtInst %v3float %29 FAbs %v
-         %50 = OpVectorTimesScalar %v3float %49 %48
-         %51 = OpCompositeExtract %float %params 2
-         %54 = OpCompositeConstruct %v3float %51 %51 %51
-         %52 = OpFAdd %v3float %50 %54
-         %55 = OpCompositeExtract %float %params 0
-         %56 = OpCompositeConstruct %v3float %55 %55 %55
-         %47 = OpExtInst %v3float %29 Pow %52 %56
-         %57 = OpCompositeExtract %float %params 5
-         %60 = OpCompositeConstruct %v3float %57 %57 %57
-         %58 = OpFAdd %v3float %47 %60
-         %61 = OpFMul %v3float %46 %58
-         %62 = OpSelect %v3float %32 %45 %61
-               OpReturnValue %62
+         %30 = OpLabel
+         %44 = OpVariable %_ptr_Function_v3float Function %46
+         %56 = OpVariable %_ptr_Function_v3float Function %46
+         %62 = OpVariable %_ptr_Function_v3float Function %46
+         %31 = OpExtInst %v3float %32 FAbs %v
+         %33 = OpCompositeExtract %float %params 4
+         %34 = OpCompositeConstruct %v3float %33 %33 %33
+         %35 = OpFOrdLessThan %v3bool %31 %34
+         %38 = OpExtInst %v3float %32 FSign %v
+         %39 = OpCompositeExtract %float %params 3
+         %40 = OpExtInst %v3float %32 FAbs %v
+         %41 = OpVectorTimesScalar %v3float %40 %39
+         %42 = OpCompositeExtract %float %params 6
+         %47 = OpCompositeConstruct %v3float %42 %42 %42
+         %43 = OpFAdd %v3float %41 %47
+         %48 = OpFMul %v3float %38 %43
+         %49 = OpExtInst %v3float %32 FSign %v
+         %51 = OpCompositeExtract %float %params 1
+         %52 = OpExtInst %v3float %32 FAbs %v
+         %53 = OpVectorTimesScalar %v3float %52 %51
+         %54 = OpCompositeExtract %float %params 2
+         %57 = OpCompositeConstruct %v3float %54 %54 %54
+         %55 = OpFAdd %v3float %53 %57
+         %58 = OpCompositeExtract %float %params 0
+         %59 = OpCompositeConstruct %v3float %58 %58 %58
+         %50 = OpExtInst %v3float %32 Pow %55 %59
+         %60 = OpCompositeExtract %float %params 5
+         %63 = OpCompositeConstruct %v3float %60 %60 %60
+         %61 = OpFAdd %v3float %50 %63
+         %64 = OpFMul %v3float %49 %61
+         %65 = OpSelect %v3float %35 %48 %64
+               OpReturnValue %65
                OpFunctionEnd
-%textureLoadExternal = OpFunction %v4float None %63
+%textureLoadExternal = OpFunction %v4float None %66
      %plane0 = OpFunctionParameter %11
      %plane1 = OpFunctionParameter %11
       %coord = OpFunctionParameter %v2uint
    %params_0 = OpFunctionParameter %ExternalTextureParams
-         %72 = OpLabel
-      %color = OpVariable %_ptr_Function_v3float Function %43
-         %75 = OpShiftRightLogical %v2uint %coord %74
-         %77 = OpCompositeExtract %uint %params_0 0
-         %78 = OpIEqual %bool %77 %uint_1
-               OpSelectionMerge %79 None
-               OpBranchConditional %78 %80 %81
-         %80 = OpLabel
-         %82 = OpImageFetch %v4float %plane0 %coord Lod %84
-         %85 = OpVectorShuffle %v3float %82 %82 0 1 2
-               OpStore %color %85
-               OpBranch %79
-         %81 = OpLabel
-         %86 = OpImageFetch %v4float %plane0 %coord Lod %84
-         %87 = OpCompositeExtract %float %86 0
-         %88 = OpImageFetch %v4float %plane1 %75 Lod %84
-         %89 = OpVectorShuffle %v2float %88 %88 0 1
+         %75 = OpLabel
+      %color = OpVariable %_ptr_Function_v3float Function %46
+         %78 = OpShiftRightLogical %v2uint %coord %77
+         %80 = OpCompositeExtract %uint %params_0 0
+         %81 = OpIEqual %bool %80 %uint_1
+               OpSelectionMerge %82 None
+               OpBranchConditional %81 %83 %84
+         %83 = OpLabel
+         %85 = OpImageFetch %v4float %plane0 %coord Lod %87
+         %88 = OpVectorShuffle %v3float %85 %85 0 1 2
+               OpStore %color %88
+               OpBranch %82
+         %84 = OpLabel
+         %89 = OpImageFetch %v4float %plane0 %coord Lod %87
          %90 = OpCompositeExtract %float %89 0
-         %91 = OpCompositeExtract %float %89 1
-         %93 = OpCompositeConstruct %v4float %87 %90 %91 %float_1
-         %94 = OpCompositeExtract %mat3v4float %params_0 2
-         %95 = OpVectorTimesMatrix %v3float %93 %94
-               OpStore %color %95
-               OpBranch %79
-         %79 = OpLabel
-         %96 = OpCompositeExtract %uint %params_0 1
-         %98 = OpIEqual %bool %96 %97
-               OpSelectionMerge %99 None
-               OpBranchConditional %98 %100 %99
-        %100 = OpLabel
-        %102 = OpLoad %v3float %color
-        %103 = OpCompositeExtract %GammaTransferParams %params_0 3
-        %101 = OpFunctionCall %v3float %gammaCorrection %102 %103
-               OpStore %color %101
-        %104 = OpCompositeExtract %mat3v3float %params_0 5
+         %91 = OpImageFetch %v4float %plane1 %78 Lod %87
+         %92 = OpVectorShuffle %v2float %91 %91 0 1
+         %93 = OpCompositeExtract %float %92 0
+         %94 = OpCompositeExtract %float %92 1
+         %96 = OpCompositeConstruct %v4float %90 %93 %94 %float_1
+         %97 = OpCompositeExtract %mat3v4float %params_0 2
+         %98 = OpVectorTimesMatrix %v3float %96 %97
+               OpStore %color %98
+               OpBranch %82
+         %82 = OpLabel
+         %99 = OpCompositeExtract %uint %params_0 1
+        %101 = OpIEqual %bool %99 %100
+               OpSelectionMerge %102 None
+               OpBranchConditional %101 %103 %102
+        %103 = OpLabel
         %105 = OpLoad %v3float %color
-        %106 = OpMatrixTimesVector %v3float %104 %105
-               OpStore %color %106
+        %106 = OpCompositeExtract %GammaTransferParams %params_0 3
+        %104 = OpFunctionCall %v3float %gammaCorrection %105 %106
+               OpStore %color %104
+        %107 = OpCompositeExtract %mat3v3float %params_0 5
         %108 = OpLoad %v3float %color
-        %109 = OpCompositeExtract %GammaTransferParams %params_0 4
-        %107 = OpFunctionCall %v3float %gammaCorrection %108 %109
-               OpStore %color %107
-               OpBranch %99
-         %99 = OpLabel
-        %110 = OpLoad %v3float %color
-        %111 = OpCompositeExtract %float %110 0
-        %112 = OpCompositeExtract %float %110 1
-        %113 = OpCompositeExtract %float %110 2
-        %114 = OpCompositeConstruct %v4float %111 %112 %113 %float_1
-               OpReturnValue %114
+        %109 = OpMatrixTimesVector %v3float %107 %108
+               OpStore %color %109
+        %111 = OpLoad %v3float %color
+        %112 = OpCompositeExtract %GammaTransferParams %params_0 4
+        %110 = OpFunctionCall %v3float %gammaCorrection %111 %112
+               OpStore %color %110
+               OpBranch %102
+        %102 = OpLabel
+        %113 = OpLoad %v3float %color
+        %114 = OpCompositeExtract %float %113 0
+        %115 = OpCompositeExtract %float %113 1
+        %116 = OpCompositeExtract %float %113 2
+        %117 = OpCompositeConstruct %v4float %114 %115 %116 %float_1
+               OpReturnValue %117
                OpFunctionEnd
-%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %115
+%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %118
         %val = OpFunctionParameter %ExternalTextureParams_std140
-        %118 = OpLabel
-        %119 = OpCompositeExtract %uint %val 0
-        %120 = OpCompositeExtract %uint %val 1
-        %121 = OpCompositeExtract %mat3v4float %val 2
-        %122 = OpCompositeExtract %GammaTransferParams %val 3
-        %123 = OpCompositeExtract %GammaTransferParams %val 4
-        %124 = OpCompositeExtract %mat3v3float %val 5
-        %125 = OpCompositeExtract %v2float %val 6
-        %126 = OpCompositeExtract %v2float %val 7
-        %127 = OpCompositeExtract %v2float %val 8
-        %128 = OpCompositeConstruct %mat3v2float %125 %126 %127
-        %129 = OpCompositeConstruct %ExternalTextureParams %119 %120 %121 %122 %123 %124 %128
-               OpReturnValue %129
+        %121 = OpLabel
+        %122 = OpCompositeExtract %uint %val 0
+        %123 = OpCompositeExtract %uint %val 1
+        %124 = OpCompositeExtract %mat3v4float %val 2
+        %125 = OpCompositeExtract %GammaTransferParams %val 3
+        %126 = OpCompositeExtract %GammaTransferParams %val 4
+        %127 = OpCompositeExtract %mat3v3float %val 5
+        %128 = OpCompositeExtract %v2float %val 6
+        %129 = OpCompositeExtract %v2float %val 7
+        %130 = OpCompositeExtract %v2float %val 8
+        %131 = OpCompositeConstruct %mat3v2float %128 %129 %130
+        %132 = OpCompositeConstruct %ExternalTextureParams %122 %123 %124 %125 %126 %127 %131
+               OpReturnValue %132
                OpFunctionEnd
-%textureLoad_1bfdfb = OpFunction %void None %130
-        %133 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %136
+%textureLoad_1bfdfb = OpFunction %void None %133
+        %136 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %139
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %74
-        %138 = OpLoad %11 %arg_0
-        %139 = OpLoad %11 %ext_tex_plane_1
-        %140 = OpLoad %v2uint %arg_1
-        %144 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
-        %145 = OpLoad %ExternalTextureParams_std140 %144
-        %141 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %145
-        %137 = OpFunctionCall %v4float %textureLoadExternal %138 %139 %140 %141
-               OpStore %res %137
+               OpStore %arg_1 %77
+        %141 = OpLoad %11 %arg_0
+        %142 = OpLoad %11 %ext_tex_plane_1
+        %143 = OpLoad %v2uint %arg_1
+        %147 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
+        %148 = OpLoad %ExternalTextureParams_std140 %147
+        %144 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %148
+        %140 = OpFunctionCall %v4float %textureLoadExternal %141 %142 %143 %144
+               OpStore %res %140
+        %152 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+        %153 = OpLoad %v4float %res
+               OpStore %152 %153
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %148
-        %150 = OpLabel
-        %151 = OpFunctionCall %void %textureLoad_1bfdfb
+%vertex_main_inner = OpFunction %v4float None %154
+        %156 = OpLabel
+        %157 = OpFunctionCall %void %textureLoad_1bfdfb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %130
-        %153 = OpLabel
-        %154 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %154
+%vertex_main = OpFunction %void None %133
+        %159 = OpLabel
+        %160 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %160
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %130
-        %156 = OpLabel
-        %157 = OpFunctionCall %void %textureLoad_1bfdfb
+%fragment_main = OpFunction %void None %133
+        %162 = OpLabel
+        %163 = OpFunctionCall %void %textureLoad_1bfdfb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %130
-        %159 = OpLabel
-        %160 = OpFunctionCall %void %textureLoad_1bfdfb
+%compute_main = OpFunction %void None %133
+        %165 = OpLabel
+        %166 = OpFunctionCall %void %textureLoad_1bfdfb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.wgsl
index 9e3fd90..2eea97a 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureLoad_1bfdfb() {
   var arg_1 = vec2<u32>(1u);
   var res : vec4<f32> = textureLoad(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1bfdfb();
diff --git a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl
index 550618f..8a7f546 100644
--- a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.dxc.hlsl
index 332dd71..394a5ec 100644
--- a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1c562a() {
   uint3 arg_1 = (1u).xxx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(uint4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.fxc.hlsl
index 332dd71..394a5ec 100644
--- a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1c562a() {
   uint3 arg_1 = (1u).xxx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(uint4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.glsl
index c028bc9..0c7eafa 100644
--- a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1c562a() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1c562a() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_1c562a() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.msl
index f00e162..f804719 100644
--- a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1c562a(texture3d<uint, access::sample> tint_symbol_1) {
+void textureLoad_1c562a(texture3d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint3 arg_1 = uint3(1u);
   uint arg_2 = 1u;
   uint4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureLoad_1c562a(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_1c562a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1c562a(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1c562a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1c562a(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1c562a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.spvasm
index afcdd7f..2cd5ff3 100644
--- a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1c562a "textureLoad_1c562a"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,53 +44,61 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %23 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
+         %26 = OpConstantNull %v3uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %29 = OpConstantNull %uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %33 = OpConstantNull %v4uint
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1c562a = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %33
-               OpStore %arg_1 %19
+%textureLoad_1c562a = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %36
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v3uint %arg_1
-         %30 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4uint %28 %29 Lod %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v3uint %arg_1
+         %33 = OpLoad %uint %arg_2
+         %30 = OpImageFetch %v4uint %31 %32 Lod %33
+               OpStore %res %30
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %40 = OpLoad %v4uint %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_1c562a
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_1c562a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_1c562a
+%fragment_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_1c562a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_1c562a
+%compute_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_1c562a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.wgsl
index 376ef18..545a1cb 100644
--- a/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1c562a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1c562a();
diff --git a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl
index 8bdaca3..850e720 100644
--- a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.dxc.hlsl
index 7bd7b08..e198cd3 100644
--- a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1f2016() {
   int3 arg_1 = (1).xxx;
   int arg_2 = 1;
   float4 res = arg_0.Load(int4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.fxc.hlsl
index 7bd7b08..e198cd3 100644
--- a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_1f2016() {
   int3 arg_1 = (1).xxx;
   int arg_2 = 1;
   float4 res = arg_0.Load(int4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.glsl
index d9d2ec2..440f1f0 100644
--- a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1f2016() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1f2016() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_1f2016() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.msl
index 77871f5..8605882 100644
--- a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_1f2016(texture3d<float, access::sample> tint_symbol_1) {
+void textureLoad_1f2016(texture3d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int3 arg_1 = int3(1);
   int arg_2 = 1;
   float4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureLoad_1f2016(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_1f2016(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_1f2016(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_1f2016(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_1f2016(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_1f2016(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.spvasm
index e23cbd2..e5f9a89 100644
--- a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_1f2016 "textureLoad_1f2016"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,52 +43,61 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %22 = OpConstantNull %v3int
+         %25 = OpConstantNull %v3int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_1f2016 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
+%textureLoad_1f2016 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %27 = OpLoad %11 %arg_0
-         %28 = OpLoad %v3int %arg_1
-         %29 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4float %27 %28 Lod %29
-               OpStore %res %26
+         %30 = OpLoad %11 %arg_0
+         %31 = OpLoad %v3int %arg_1
+         %32 = OpLoad %int %arg_2
+         %29 = OpImageFetch %v4float %30 %31 Lod %32
+               OpStore %res %29
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_1f2016
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_1f2016
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_1f2016
+%fragment_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_1f2016
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_1f2016
+%compute_main = OpFunction %void None %15
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_1f2016
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.wgsl
index 75c7236..4c689dd 100644
--- a/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/1f2016.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_1f2016();
diff --git a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl
index 8009c57..3611480 100644
--- a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.dxc.hlsl
index 43c73cc..0b54a80 100644
--- a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_216c37() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   uint4 res = arg_0.Load(uint2(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.fxc.hlsl
index 43c73cc..0b54a80 100644
--- a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_216c37() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   uint4 res = arg_0.Load(uint2(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.glsl
index 95ad423..b274e16 100644
--- a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_216c37() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_216c37() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_216c37() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.msl
index 46e953b..6a45572 100644
--- a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_216c37(texture1d<uint, access::sample> tint_symbol_1) {
+void textureLoad_216c37(texture1d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint arg_1 = 1u;
   int arg_2 = 1;
   uint4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureLoad_216c37(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_216c37(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_216c37(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_216c37(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_216c37(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_216c37(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.spvasm
index b77b304..63174d5 100644
--- a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_216c37 "textureLoad_216c37"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,53 +45,61 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
+         %24 = OpConstantNull %uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %29 = OpConstantNull %int
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %33 = OpConstantNull %v4uint
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_216c37 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %33
+%textureLoad_216c37 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+      %arg_2 = OpVariable %_ptr_Function_int Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %36
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %int_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %uint %arg_1
-         %30 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4uint %28 %29 Lod %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %uint %arg_1
+         %33 = OpLoad %int %arg_2
+         %30 = OpImageFetch %v4uint %31 %32 Lod %33
+               OpStore %res %30
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %40 = OpLoad %v4uint %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_216c37
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_216c37
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_216c37
+%fragment_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_216c37
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_216c37
+%compute_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_216c37
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.wgsl
index 17c79d1..28b421f 100644
--- a/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/216c37.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1u;
   var arg_2 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_216c37();
diff --git a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl
index 3ef6188..3bdf848 100644
--- a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.dxc.hlsl
index e640c93..f793ca0 100644
--- a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_21d1c4() {
   uint3 arg_1 = (1u).xxx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(uint4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.fxc.hlsl
index e640c93..f793ca0 100644
--- a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_21d1c4() {
   uint3 arg_1 = (1u).xxx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(uint4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.glsl
index 68354e2..3323fd1 100644
--- a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_21d1c4() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_21d1c4() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_21d1c4() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.msl
index c9d0473..70f835f 100644
--- a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_21d1c4(texture3d<float, access::sample> tint_symbol_1) {
+void textureLoad_21d1c4(texture3d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint3 arg_1 = uint3(1u);
   uint arg_2 = 1u;
   float4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureLoad_21d1c4(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_21d1c4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_21d1c4(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_21d1c4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_21d1c4(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_21d1c4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.spvasm
index 1f7c324..297a50b 100644
--- a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_21d1c4 "textureLoad_21d1c4"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,52 +43,60 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %22 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
+         %25 = OpConstantNull %v3uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_21d1c4 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
+%textureLoad_21d1c4 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %27 = OpLoad %11 %arg_0
-         %28 = OpLoad %v3uint %arg_1
-         %29 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4float %27 %28 Lod %29
-               OpStore %res %26
+         %30 = OpLoad %11 %arg_0
+         %31 = OpLoad %v3uint %arg_1
+         %32 = OpLoad %uint %arg_2
+         %29 = OpImageFetch %v4float %30 %31 Lod %32
+               OpStore %res %29
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_21d1c4
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_21d1c4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_21d1c4
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_21d1c4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_21d1c4
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_21d1c4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.wgsl
index 5bcf246..93f381a 100644
--- a/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/21d1c4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_21d1c4();
diff --git a/test/tint/builtins/gen/var/textureLoad/223246.wgsl b/test/tint/builtins/gen/var/textureLoad/223246.wgsl
index 2cb9d28..168a41f 100644
--- a/test/tint/builtins/gen/var/textureLoad/223246.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/223246.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.dxc.hlsl
index 91694ca..52c1d22 100644
--- a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_223246() {
   uint3 arg_1 = (1u).xxx;
   int arg_2 = 1;
   int4 res = arg_0.Load(uint4(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.fxc.hlsl
index 91694ca..52c1d22 100644
--- a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_223246() {
   uint3 arg_1 = (1u).xxx;
   int arg_2 = 1;
   int4 res = arg_0.Load(uint4(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.glsl
index 364d598..fb6abd4 100644
--- a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_223246() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_223246() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_223246() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.msl
index cd54745..a6df78b 100644
--- a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_223246(texture3d<int, access::sample> tint_symbol_1) {
+void textureLoad_223246(texture3d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint3 arg_1 = uint3(1u);
   int arg_2 = 1;
   int4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureLoad_223246(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_223246(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_223246(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_223246(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_223246(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_223246(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.spvasm
index 2d7fb32..8396d2c 100644
--- a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_223246 "textureLoad_223246"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %24 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
+         %27 = OpConstantNull %v3uint
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %31 = OpConstantNull %int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %35 = OpConstantNull %v4int
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_223246 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %35
-               OpStore %arg_1 %20
+%textureLoad_223246 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %38
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v3uint %arg_1
-         %32 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4int %30 %31 Lod %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v3uint %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpImageFetch %v4int %33 %34 Lod %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %42 = OpLoad %v4int %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_223246
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_223246
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_223246
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_223246
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_223246
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_223246
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.wgsl
index 646ea84..458906b 100644
--- a/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/223246.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_223246();
diff --git a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl
index 70494bc..8d3c299 100644
--- a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.dxc.hlsl
index 2f03a64..82d8f1f 100644
--- a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2363be() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   int4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.fxc.hlsl
index 2f03a64..82d8f1f 100644
--- a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2363be() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   int4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.glsl
index 1251723..5f991d1 100644
--- a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_2363be() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_2363be() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_2363be() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.msl
index 2a955c5..9a78453 100644
--- a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_2363be(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_2363be(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_2363be(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_2363be(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_2363be(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_2363be(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_2363be(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_2363be(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.spvasm
index ee273d8..dff5fd3 100644
--- a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_2363be "textureLoad_2363be"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,65 +45,73 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
+         %27 = OpConstantNull %v2uint
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %31 = OpConstantNull %int
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %34 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %44 = OpConstantNull %v4int
-         %45 = OpTypeFunction %v4float
+         %47 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %52 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_2363be = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-      %arg_3 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %44
-               OpStore %arg_1 %20
+%textureLoad_2363be = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+      %arg_3 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %47
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
                OpStore %arg_3 %uint_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2uint %arg_1
-         %36 = OpCompositeExtract %uint %35 0
-         %37 = OpCompositeExtract %uint %35 1
-         %39 = OpLoad %int %arg_2
-         %38 = OpBitcast %uint %39
-         %40 = OpCompositeConstruct %v3uint %36 %37 %38
-         %41 = OpLoad %uint %arg_3
-         %31 = OpImageFetch %v4int %33 %40 Lod %41
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2uint %arg_1
+         %39 = OpCompositeExtract %uint %38 0
+         %40 = OpCompositeExtract %uint %38 1
+         %42 = OpLoad %int %arg_2
+         %41 = OpBitcast %uint %42
+         %43 = OpCompositeConstruct %v3uint %39 %40 %41
+         %44 = OpLoad %uint %arg_3
+         %35 = OpImageFetch %v4int %36 %43 Lod %44
+               OpStore %res %35
+         %50 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %51 = OpLoad %v4int %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_2363be
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_2363be
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %17
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureLoad_2363be
+%fragment_main = OpFunction %void None %17
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureLoad_2363be
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureLoad_2363be
+%compute_main = OpFunction %void None %17
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureLoad_2363be
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.wgsl
index 3a453a7..dec0720 100644
--- a/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/2363be.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_2363be();
diff --git a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl
index 2365ade..bee4bdf 100644
--- a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.dxc.hlsl
index b92c9e2..1e45964 100644
--- a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2d479c() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(int3(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.fxc.hlsl
index b92c9e2..1e45964 100644
--- a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2d479c() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(int3(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.glsl
index c8adc02..75f3f2e 100644
--- a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2d479c() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2d479c() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2d479c() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.msl
index c55a8c2..0db01d5 100644
--- a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_2d479c(texture2d<float, access::sample> tint_symbol_1) {
+void textureLoad_2d479c(texture2d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureLoad_2d479c(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_2d479c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_2d479c(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_2d479c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_2d479c(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_2d479c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.spvasm
index 998c827..880ec31 100644
--- a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_2d479c "textureLoad_2d479c"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,54 +43,62 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_2d479c = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
+%textureLoad_2d479c = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2int %arg_1
-         %31 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4float %29 %30 Lod %31
-               OpStore %res %28
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2int %arg_1
+         %34 = OpLoad %uint %arg_2
+         %31 = OpImageFetch %v4float %32 %33 Lod %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_2d479c
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_2d479c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_2d479c
+%fragment_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_2d479c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_2d479c
+%compute_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_2d479c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.wgsl
index d29f519..50cd179 100644
--- a/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/2d479c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_2d479c();
diff --git a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl
index 27f61c6..af73d05 100644
--- a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.dxc.hlsl
index fa848d3..3d94673 100644
--- a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2e09aa() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.fxc.hlsl
index fa848d3..3d94673 100644
--- a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_2e09aa() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.glsl
index 237f311..a2d98f7 100644
--- a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2e09aa() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2e09aa() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_2e09aa() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.msl
index b7cc5d0..529c00d 100644
--- a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_2e09aa(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_2e09aa(texture2d_ms<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_2e09aa(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_2e09aa(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_2e09aa(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_2e09aa(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_2e09aa(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_2e09aa(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.spvasm
index 58dcfbb..3abea26 100644
--- a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_2e09aa "textureLoad_2e09aa"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,52 +43,60 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_2e09aa = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
+%textureLoad_2e09aa = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %27 = OpLoad %11 %arg_0
-         %28 = OpLoad %v2uint %arg_1
-         %29 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4float %27 %28 Sample %29
-               OpStore %res %26
+         %30 = OpLoad %11 %arg_0
+         %31 = OpLoad %v2uint %arg_1
+         %32 = OpLoad %uint %arg_2
+         %29 = OpImageFetch %v4float %30 %31 Sample %32
+               OpStore %res %29
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_2e09aa
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_2e09aa
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_2e09aa
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_2e09aa
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_2e09aa
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_2e09aa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.wgsl
index 2a0781b..3bdccebb 100644
--- a/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/2e09aa.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_2e09aa();
diff --git a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl
index 526039a..d83b7f0 100644
--- a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.dxc.hlsl
index ee90bc4..4cd278d 100644
--- a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_38f8ab() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.fxc.hlsl
index ee90bc4..4cd278d 100644
--- a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_38f8ab() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.glsl
index 4499324..bd5ba81 100644
--- a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_38f8ab() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_38f8ab() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_38f8ab() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.msl
index 6749f45..226732a 100644
--- a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_38f8ab(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureLoad_38f8ab(texture2d_ms<int, access::read> tint_symbol_1, device int4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureLoad_38f8ab(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_38f8ab(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_38f8ab(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_38f8ab(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_38f8ab(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_38f8ab(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.spvasm
index 7c8c28a..4825202 100644
--- a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_38f8ab "textureLoad_38f8ab"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %23 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %26 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %31 = OpConstantNull %uint
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %35 = OpConstantNull %v4int
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_38f8ab = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %35
-               OpStore %arg_1 %19
+%textureLoad_38f8ab = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %38
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2int %arg_1
-         %32 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4int %30 %31 Sample %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2int %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpImageFetch %v4int %33 %34 Sample %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %42 = OpLoad %v4int %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_38f8ab
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_38f8ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_38f8ab
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_38f8ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_38f8ab
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_38f8ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.wgsl
index 33fdb48..b27b60d 100644
--- a/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/38f8ab.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_38f8ab();
diff --git a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl
index 212e8f0..cc09cac 100644
--- a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.dxc.hlsl
index 5fbc79d..84025a5 100644
--- a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3c96e8() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.fxc.hlsl
index 5fbc79d..84025a5 100644
--- a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3c96e8() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.glsl
index 764dd98..4adc61d 100644
--- a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3c96e8() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3c96e8() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3c96e8() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.msl
index 61f0a95..314ae1d 100644
--- a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_3c96e8(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_3c96e8(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_3c96e8(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_3c96e8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_3c96e8(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_3c96e8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_3c96e8(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_3c96e8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.spvasm
index 5729843..46afa36 100644
--- a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_3c96e8 "textureLoad_3c96e8"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,62 +44,70 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %41 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %48 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_3c96e8 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-      %arg_3 = OpVariable %_ptr_Function_uint Function %27
+%textureLoad_3c96e8 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+      %arg_3 = OpVariable %_ptr_Function_uint Function %30
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %32 = OpLoad %v2int %arg_1
-         %33 = OpCompositeExtract %int %32 0
-         %34 = OpCompositeExtract %int %32 1
-         %36 = OpLoad %uint %arg_2
-         %35 = OpBitcast %int %36
-         %37 = OpCompositeConstruct %v3int %33 %34 %35
-         %38 = OpLoad %uint %arg_3
-         %29 = OpImageFetch %v4float %30 %37 Lod %38
-               OpStore %res %29
+         %33 = OpLoad %11 %arg_0
+         %35 = OpLoad %v2int %arg_1
+         %36 = OpCompositeExtract %int %35 0
+         %37 = OpCompositeExtract %int %35 1
+         %39 = OpLoad %uint %arg_2
+         %38 = OpBitcast %int %39
+         %40 = OpCompositeConstruct %v3int %36 %37 %38
+         %41 = OpLoad %uint %arg_3
+         %32 = OpImageFetch %v4float %33 %40 Lod %41
+               OpStore %res %32
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %47 = OpLoad %v4float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_3c96e8
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_3c96e8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureLoad_3c96e8
+%fragment_main = OpFunction %void None %15
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureLoad_3c96e8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_3c96e8
+%compute_main = OpFunction %void None %15
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_3c96e8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.wgsl
index 989fcd1..7b75f72 100644
--- a/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/3c96e8.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_3c96e8();
diff --git a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl
index a334be3..5fdeed7 100644
--- a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl
index 0bcbf5d..84bd137 100644
--- a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3d3fd1() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   int4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl
index 0bcbf5d..84bd137 100644
--- a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3d3fd1() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   int4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.glsl
index d6c9668..779e778 100644
--- a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_3d3fd1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_3d3fd1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_3d3fd1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.msl
index a8b111d..2505848 100644
--- a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_3d3fd1(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_3d3fd1(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_3d3fd1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_3d3fd1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_3d3fd1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_3d3fd1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_3d3fd1(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_3d3fd1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.spvasm
index bead114..12dd828 100644
--- a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_3d3fd1 "textureLoad_3d3fd1"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,64 +45,72 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
+         %27 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %26 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %34 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %43 = OpConstantNull %v4int
-         %44 = OpTypeFunction %v4float
+         %46 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_3d3fd1 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %26
-      %arg_3 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %43
-               OpStore %arg_1 %20
+%textureLoad_3d3fd1 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+      %arg_3 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %46
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %int_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2uint %arg_1
-         %36 = OpCompositeExtract %uint %35 0
-         %37 = OpCompositeExtract %uint %35 1
-         %38 = OpLoad %uint %arg_2
-         %39 = OpCompositeConstruct %v3uint %36 %37 %38
-         %40 = OpLoad %int %arg_3
-         %31 = OpImageFetch %v4int %33 %39 Lod %40
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2uint %arg_1
+         %39 = OpCompositeExtract %uint %38 0
+         %40 = OpCompositeExtract %uint %38 1
+         %41 = OpLoad %uint %arg_2
+         %42 = OpCompositeConstruct %v3uint %39 %40 %41
+         %43 = OpLoad %int %arg_3
+         %35 = OpImageFetch %v4int %36 %42 Lod %43
+               OpStore %res %35
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %50 = OpLoad %v4int %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_3d3fd1
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_3d3fd1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %17
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_3d3fd1
+%fragment_main = OpFunction %void None %17
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_3d3fd1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureLoad_3d3fd1
+%compute_main = OpFunction %void None %17
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureLoad_3d3fd1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.wgsl
index cb5a986..03d1b92 100644
--- a/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/3d3fd1.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_3d3fd1();
diff --git a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl
index dbc3d53..69224f6 100644
--- a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1i;
   var arg_2 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.dxc.hlsl
index 97aa71c..558bf56 100644
--- a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3da3ed() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(int2(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.fxc.hlsl
index 97aa71c..558bf56 100644
--- a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_3da3ed() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(int2(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.glsl
index 960b84e..ea4d956 100644
--- a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3da3ed() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3da3ed() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_3da3ed() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.msl
index 9cb46bb..cf143c9 100644
--- a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_3da3ed(texture1d<float, access::sample> tint_symbol_1) {
+void textureLoad_3da3ed(texture1d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int arg_1 = 1;
   uint arg_2 = 1u;
   float4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureLoad_3da3ed(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_3da3ed(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_3da3ed(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_3da3ed(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_3da3ed(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_3da3ed(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.spvasm
index ff35dbc..a56e65e 100644
--- a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_3da3ed "textureLoad_3da3ed"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,52 +44,60 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
+         %23 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_3da3ed = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
+%textureLoad_3da3ed = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %23
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %arg_1 %int_1
                OpStore %arg_2 %uint_1
-         %27 = OpLoad %11 %arg_0
-         %28 = OpLoad %int %arg_1
-         %29 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4float %27 %28 Lod %29
-               OpStore %res %26
+         %30 = OpLoad %11 %arg_0
+         %31 = OpLoad %int %arg_1
+         %32 = OpLoad %uint %arg_2
+         %29 = OpImageFetch %v4float %30 %31 Lod %32
+               OpStore %res %29
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_3da3ed
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_3da3ed
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_3da3ed
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_3da3ed
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_3da3ed
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_3da3ed
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.wgsl
index 909a768..029ca2a 100644
--- a/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/3da3ed.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1i;
   var arg_2 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_3da3ed();
diff --git a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl
index b143637..6b59480 100644
--- a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.dxc.hlsl
index 4a20f15..53eccb0 100644
--- a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_439e2a() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   float4 res = arg_0.Load(uint3(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.fxc.hlsl
index 4a20f15..53eccb0 100644
--- a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_439e2a() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   float4 res = arg_0.Load(uint3(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.glsl
index 43a6e79..fe862ce 100644
--- a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_439e2a() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_439e2a() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_439e2a() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.msl
index cb28c38..98c947e 100644
--- a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_439e2a(texture2d<float, access::sample> tint_symbol_1) {
+void textureLoad_439e2a(texture2d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureLoad_439e2a(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_439e2a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_439e2a(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_439e2a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_439e2a(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_439e2a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.spvasm
index 0244e8f..1390b4c 100644
--- a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_439e2a "textureLoad_439e2a"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,54 +43,62 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_439e2a = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
+%textureLoad_439e2a = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2uint %arg_1
-         %31 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4float %29 %30 Lod %31
-               OpStore %res %28
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2uint %arg_1
+         %34 = OpLoad %int %arg_2
+         %31 = OpImageFetch %v4float %32 %33 Lod %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_439e2a
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_439e2a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_439e2a
+%fragment_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_439e2a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_439e2a
+%compute_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_439e2a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.wgsl
index 49c8ef6..c95e547 100644
--- a/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/439e2a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_439e2a();
diff --git a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl
index ecd9e2d..62e8fdb 100644
--- a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.dxc.hlsl
index a304c23..2ecac03 100644
--- a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_46a93f() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   float4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.fxc.hlsl
index a304c23..2ecac03 100644
--- a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_46a93f() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   float4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.glsl
index 6679489..32865c7 100644
--- a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_46a93f() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_46a93f() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_46a93f() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.msl
index 71ac80d..ee075b2 100644
--- a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_46a93f(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_46a93f(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_46a93f(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_46a93f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_46a93f(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_46a93f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_46a93f(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_46a93f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.spvasm
index c227fb8..e4834d1 100644
--- a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_46a93f "textureLoad_46a93f"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,64 +44,72 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
+         %33 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %43 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_46a93f = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-      %arg_3 = OpVariable %_ptr_Function_uint Function %30
+%textureLoad_46a93f = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+      %arg_3 = OpVariable %_ptr_Function_uint Function %33
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
                OpStore %arg_3 %uint_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpLoad %v2uint %arg_1
-         %35 = OpCompositeExtract %uint %34 0
-         %36 = OpCompositeExtract %uint %34 1
-         %38 = OpLoad %int %arg_2
-         %37 = OpBitcast %uint %38
-         %39 = OpCompositeConstruct %v3uint %35 %36 %37
-         %40 = OpLoad %uint %arg_3
-         %31 = OpImageFetch %v4float %32 %39 Lod %40
-               OpStore %res %31
+         %35 = OpLoad %11 %arg_0
+         %37 = OpLoad %v2uint %arg_1
+         %38 = OpCompositeExtract %uint %37 0
+         %39 = OpCompositeExtract %uint %37 1
+         %41 = OpLoad %int %arg_2
+         %40 = OpBitcast %uint %41
+         %42 = OpCompositeConstruct %v3uint %38 %39 %40
+         %43 = OpLoad %uint %arg_3
+         %34 = OpImageFetch %v4float %35 %42 Lod %43
+               OpStore %res %34
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %49 = OpLoad %v4float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_46a93f
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_46a93f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %15
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_46a93f
+%fragment_main = OpFunction %void None %15
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_46a93f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureLoad_46a93f
+%compute_main = OpFunction %void None %15
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureLoad_46a93f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.wgsl
index 5397895..60b3cf4 100644
--- a/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/46a93f.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_46a93f();
diff --git a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl
index 031a744..3271107 100644
--- a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.dxc.hlsl
index 47f141f..0ec091f 100644
--- a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_47e818() {
   uint3 arg_1 = (1u).xxx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(uint4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.fxc.hlsl
index 47f141f..0ec091f 100644
--- a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_47e818() {
   uint3 arg_1 = (1u).xxx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(uint4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.glsl
index fc24559..e39c1cb 100644
--- a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_47e818() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_47e818() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_47e818() {
   uvec3 arg_1 = uvec3(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.msl
index 56a4c7f..50524e5 100644
--- a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_47e818(texture3d<int, access::sample> tint_symbol_1) {
+void textureLoad_47e818(texture3d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint3 arg_1 = uint3(1u);
   uint arg_2 = 1u;
   int4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureLoad_47e818(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_47e818(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_47e818(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_47e818(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_47e818(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_47e818(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.spvasm
index 4e54df7..2a4dbe4 100644
--- a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_47e818 "textureLoad_47e818"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,54 +44,62 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %24 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %23 = OpConstantNull %v3uint
+         %27 = OpConstantNull %v3uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %26 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %30 = OpConstantNull %uint
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %34 = OpConstantNull %v4int
-         %35 = OpTypeFunction %v4float
+         %37 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_47e818 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %26
-        %res = OpVariable %_ptr_Function_v4int Function %34
-               OpStore %arg_1 %20
+%textureLoad_47e818 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+        %res = OpVariable %_ptr_Function_v4int Function %37
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v3uint %arg_1
-         %31 = OpLoad %uint %arg_2
-         %27 = OpImageFetch %v4int %29 %30 Lod %31
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v3uint %arg_1
+         %34 = OpLoad %uint %arg_2
+         %31 = OpImageFetch %v4int %32 %33 Lod %34
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %41 = OpLoad %v4int %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_47e818
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_47e818
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_47e818
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_47e818
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_47e818
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_47e818
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.wgsl
index a12e28a..2e4b101 100644
--- a/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/47e818.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_47e818();
diff --git a/test/tint/builtins/gen/var/textureLoad/484344.wgsl b/test/tint/builtins/gen/var/textureLoad/484344.wgsl
index 552b7df..b6fdb07 100644
--- a/test/tint/builtins/gen/var/textureLoad/484344.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/484344.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.dxc.hlsl
index f3fe7c7..28810f5 100644
--- a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_484344() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   float4 res = arg_0.Load(int3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.fxc.hlsl
index f3fe7c7..28810f5 100644
--- a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_484344() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   float4 res = arg_0.Load(int3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.glsl
index 81960e3..0e2c1fa 100644
--- a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_484344() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_484344() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_484344() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.msl
index 6697cc8..5f83460 100644
--- a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_484344(texture2d<float, access::sample> tint_symbol_1) {
+void textureLoad_484344(texture2d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureLoad_484344(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_484344(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_484344(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_484344(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_484344(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_484344(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.spvasm
index 19acab1..d5aa47d 100644
--- a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_484344 "textureLoad_484344"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,52 +43,61 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_484344 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
+%textureLoad_484344 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %27 = OpLoad %11 %arg_0
-         %28 = OpLoad %v2int %arg_1
-         %29 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4float %27 %28 Lod %29
-               OpStore %res %26
+         %30 = OpLoad %11 %arg_0
+         %31 = OpLoad %v2int %arg_1
+         %32 = OpLoad %int %arg_2
+         %29 = OpImageFetch %v4float %30 %31 Lod %32
+               OpStore %res %29
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_484344
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_484344
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_484344
+%fragment_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_484344
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_484344
+%compute_main = OpFunction %void None %15
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_484344
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.wgsl
index 7cf5e98..890dd94 100644
--- a/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/484344.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_484344();
diff --git a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl
index feebbc1..a3a60a2 100644
--- a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.dxc.hlsl
index 675a966..824b749 100644
--- a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_49f76f() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.fxc.hlsl
index 675a966..824b749 100644
--- a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_49f76f() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.glsl
index 2da3218..ee70945 100644
--- a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_49f76f() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_49f76f() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_49f76f() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.msl
index d02c066..04e85be 100644
--- a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_49f76f(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureLoad_49f76f(texture2d_ms<uint, access::read> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureLoad_49f76f(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_49f76f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_49f76f(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_49f76f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_49f76f(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_49f76f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.spvasm
index fce5a33..63c4377 100644
--- a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_49f76f "textureLoad_49f76f"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,53 +44,61 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %26 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %29 = OpConstantNull %uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %33 = OpConstantNull %v4uint
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_49f76f = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %33
-               OpStore %arg_1 %19
+%textureLoad_49f76f = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %36
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v2uint %arg_1
-         %30 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4uint %28 %29 Sample %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v2uint %arg_1
+         %33 = OpLoad %uint %arg_2
+         %30 = OpImageFetch %v4uint %31 %32 Sample %33
+               OpStore %res %30
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %40 = OpLoad %v4uint %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_49f76f
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_49f76f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_49f76f
+%fragment_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_49f76f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_49f76f
+%compute_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_49f76f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.wgsl
index 44b947f..ae58366 100644
--- a/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/49f76f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_49f76f();
diff --git a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl
index 19e2c4c..d811610 100644
--- a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.dxc.hlsl
index fa29f2f..5177f1b 100644
--- a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4acb64() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   float4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.fxc.hlsl
index fa29f2f..5177f1b 100644
--- a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4acb64() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   float4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.glsl
index 01aa8a1..dd3b754 100644
--- a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_4acb64() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_4acb64() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_4acb64() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.msl
index 35052ec..9c596f9 100644
--- a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_4acb64(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_4acb64(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_4acb64(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_4acb64(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_4acb64(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_4acb64(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_4acb64(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_4acb64(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.spvasm
index 0c418eb..2d436ad 100644
--- a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_4acb64 "textureLoad_4acb64"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,64 +44,72 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
+         %33 = OpConstantNull %int
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %43 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_4acb64 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-      %arg_3 = OpVariable %_ptr_Function_int Function %30
+%textureLoad_4acb64 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+      %arg_3 = OpVariable %_ptr_Function_int Function %33
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %int_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpLoad %v2int %arg_1
-         %35 = OpCompositeExtract %int %34 0
-         %36 = OpCompositeExtract %int %34 1
-         %38 = OpLoad %uint %arg_2
-         %37 = OpBitcast %int %38
-         %39 = OpCompositeConstruct %v3int %35 %36 %37
-         %40 = OpLoad %int %arg_3
-         %31 = OpImageFetch %v4float %32 %39 Lod %40
-               OpStore %res %31
+         %35 = OpLoad %11 %arg_0
+         %37 = OpLoad %v2int %arg_1
+         %38 = OpCompositeExtract %int %37 0
+         %39 = OpCompositeExtract %int %37 1
+         %41 = OpLoad %uint %arg_2
+         %40 = OpBitcast %int %41
+         %42 = OpCompositeConstruct %v3int %38 %39 %40
+         %43 = OpLoad %int %arg_3
+         %34 = OpImageFetch %v4float %35 %42 Lod %43
+               OpStore %res %34
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %49 = OpLoad %v4float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_4acb64
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_4acb64
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %15
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_4acb64
+%fragment_main = OpFunction %void None %15
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_4acb64
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureLoad_4acb64
+%compute_main = OpFunction %void None %15
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureLoad_4acb64
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.wgsl
index a959800..98d421a 100644
--- a/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/4acb64.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_4acb64();
diff --git a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl
index 80fa3b6..66a8f56 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.dxc.hlsl
index b5c150a..7afeb17 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4c423f() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   int4 res = arg_0.Load(uint2(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.fxc.hlsl
index b5c150a..7afeb17 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4c423f() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   int4 res = arg_0.Load(uint2(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.glsl
index c3a4847..68ff2de 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4c423f() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4c423f() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4c423f() {
   uint arg_1 = 1u;
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.msl
index 8368fd1..154aab3 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_4c423f(texture1d<int, access::sample> tint_symbol_1) {
+void textureLoad_4c423f(texture1d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint arg_1 = 1u;
   int arg_2 = 1;
   int4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureLoad_4c423f(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_4c423f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_4c423f(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_4c423f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_4c423f(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_4c423f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.spvasm
index 4de5b1b..e26fd4f 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_4c423f "textureLoad_4c423f"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,53 +45,61 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
+         %25 = OpConstantNull %uint
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %29 = OpConstantNull %int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %33 = OpConstantNull %v4int
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_4c423f = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %21
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %33
+%textureLoad_4c423f = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %36
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %int_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %uint %arg_1
-         %30 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4int %28 %29 Lod %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %uint %arg_1
+         %33 = OpLoad %int %arg_2
+         %30 = OpImageFetch %v4int %31 %32 Lod %33
+               OpStore %res %30
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %40 = OpLoad %v4int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_4c423f
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_4c423f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_4c423f
+%fragment_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_4c423f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_4c423f
+%compute_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_4c423f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.wgsl
index cea4de3..3e23bd9 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/4c423f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1u;
   var arg_2 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_4c423f();
diff --git a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl
index fe98496..9469ce3 100644
--- a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.dxc.hlsl
index b38c843..4be2280 100644
--- a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4db25c() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   float res = arg_0.Load(uint3(arg_1, uint(0)), arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.fxc.hlsl
index b38c843..4be2280 100644
--- a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4db25c() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   float res = arg_0.Load(uint3(arg_1, uint(0)), arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.glsl
index 831ec04..59d8085 100644
--- a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_4db25c() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_4db25c() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_4db25c() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.msl
index 5bb1794..70d95c3 100644
--- a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_4db25c(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_4db25c(depth2d_ms<float, access::read> tint_symbol_1, device float* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_4db25c(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_4db25c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_4db25c(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_4db25c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_4db25c(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_4db25c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.spvasm
index 9894a92..b4b1a80 100644
--- a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_4db25c "textureLoad_4db25c"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,53 +43,61 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_4db25c = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
+%textureLoad_4db25c = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v2uint %arg_1
-         %30 = OpLoad %uint %arg_2
-         %27 = OpImageFetch %v4float %28 %29 Sample %30
-         %26 = OpCompositeExtract %float %27 0
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v2uint %arg_1
+         %33 = OpLoad %uint %arg_2
+         %30 = OpImageFetch %v4float %31 %32 Sample %33
+         %29 = OpCompositeExtract %float %30 0
+               OpStore %res %29
+         %38 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %39 = OpLoad %float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_4db25c
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_4db25c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_4db25c
+%fragment_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_4db25c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_4db25c
+%compute_main = OpFunction %void None %15
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_4db25c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.wgsl
index 5148d2c..0991201 100644
--- a/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/4db25c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_4db25c();
diff --git a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl
index d07e878..1f71aeb 100644
--- a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.dxc.hlsl
index 4388cd3..29d1275 100644
--- a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4fd803() {
   int3 arg_1 = (1).xxx;
   int arg_2 = 1;
   int4 res = arg_0.Load(int4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.fxc.hlsl
index 4388cd3..29d1275 100644
--- a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_4fd803() {
   int3 arg_1 = (1).xxx;
   int arg_2 = 1;
   int4 res = arg_0.Load(int4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.glsl
index 363fa48..d475ffc 100644
--- a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4fd803() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4fd803() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_4fd803() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.msl
index c659fd7..fdbc0e4 100644
--- a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_4fd803(texture3d<int, access::sample> tint_symbol_1) {
+void textureLoad_4fd803(texture3d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int3 arg_1 = int3(1);
   int arg_2 = 1;
   int4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureLoad_4fd803(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_4fd803(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_4fd803(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_4fd803(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_4fd803(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_4fd803(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.spvasm
index 53ff43f..6687f47 100644
--- a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_4fd803 "textureLoad_4fd803"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,53 +44,62 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %22 = OpConstantNull %v3int
+         %26 = OpConstantNull %v3int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %29 = OpConstantNull %int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %33 = OpConstantNull %v4int
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_4fd803 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %33
-               OpStore %arg_1 %19
+%textureLoad_4fd803 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %36
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v3int %arg_1
-         %30 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4int %28 %29 Lod %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v3int %arg_1
+         %33 = OpLoad %int %arg_2
+         %30 = OpImageFetch %v4int %31 %32 Lod %33
+               OpStore %res %30
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %41 = OpLoad %v4int %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_4fd803
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_4fd803
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_4fd803
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_4fd803
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_4fd803
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_4fd803
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.wgsl
index 028a4e9..82fc8f2 100644
--- a/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/4fd803.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_4fd803();
diff --git a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl
index 988e28f..eef1cf2 100644
--- a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.dxc.hlsl
index 684cb98..0d2d3b6 100644
--- a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_53e142() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   uint4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.fxc.hlsl
index 684cb98..0d2d3b6 100644
--- a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_53e142() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   uint4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.glsl
index 76d9c91..f3a6be8 100644
--- a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_53e142() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_53e142() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_53e142() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.msl
index a026705..ff21116 100644
--- a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_53e142(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_53e142(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_53e142(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_53e142(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_53e142(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_53e142(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_53e142(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_53e142(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.spvasm
index bea8836..3aae36c 100644
--- a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_53e142 "textureLoad_53e142"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,63 +45,71 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %26 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %31 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %42 = OpConstantNull %v4uint
-         %43 = OpTypeFunction %v4float
+         %45 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_53e142 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-      %arg_3 = OpVariable %_ptr_Function_int Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %42
-               OpStore %arg_1 %19
+%textureLoad_53e142 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+      %arg_3 = OpVariable %_ptr_Function_int Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %45
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
                OpStore %arg_3 %int_1
-         %31 = OpLoad %11 %arg_0
-         %33 = OpLoad %v2uint %arg_1
-         %34 = OpCompositeExtract %uint %33 0
-         %35 = OpCompositeExtract %uint %33 1
-         %37 = OpLoad %int %arg_2
-         %36 = OpBitcast %uint %37
-         %38 = OpCompositeConstruct %v3uint %34 %35 %36
-         %39 = OpLoad %int %arg_3
-         %29 = OpImageFetch %v4uint %31 %38 Lod %39
-               OpStore %res %29
+         %34 = OpLoad %11 %arg_0
+         %36 = OpLoad %v2uint %arg_1
+         %37 = OpCompositeExtract %uint %36 0
+         %38 = OpCompositeExtract %uint %36 1
+         %40 = OpLoad %int %arg_2
+         %39 = OpBitcast %uint %40
+         %41 = OpCompositeConstruct %v3uint %37 %38 %39
+         %42 = OpLoad %int %arg_3
+         %33 = OpImageFetch %v4uint %34 %41 Lod %42
+               OpStore %res %33
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %49 = OpLoad %v4uint %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_53e142
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_53e142
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_53e142
+%fragment_main = OpFunction %void None %17
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_53e142
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureLoad_53e142
+%compute_main = OpFunction %void None %17
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureLoad_53e142
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.wgsl
index fd73d38..be52004 100644
--- a/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/53e142.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_53e142();
diff --git a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl
index abb95bd..1355d30 100644
--- a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.dxc.hlsl
index 6ab0fca..523ce35 100644
--- a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_54a59b() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   float4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.fxc.hlsl
index 6ab0fca..523ce35 100644
--- a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_54a59b() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   float4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.glsl
index 2d2fad5..d62677e 100644
--- a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_54a59b() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_54a59b() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_54a59b() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.msl
index 1319af9..9a8b973 100644
--- a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_54a59b(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_54a59b(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_54a59b(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_54a59b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_54a59b(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_54a59b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_54a59b(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_54a59b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.spvasm
index 6596d31..dace1a8 100644
--- a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_54a59b "textureLoad_54a59b"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,62 +44,70 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %41 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %48 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_54a59b = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-      %arg_3 = OpVariable %_ptr_Function_int Function %27
+%textureLoad_54a59b = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+      %arg_3 = OpVariable %_ptr_Function_int Function %30
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
                OpStore %arg_3 %int_1
-         %30 = OpLoad %11 %arg_0
-         %32 = OpLoad %v2uint %arg_1
-         %33 = OpCompositeExtract %uint %32 0
-         %34 = OpCompositeExtract %uint %32 1
-         %36 = OpLoad %int %arg_2
-         %35 = OpBitcast %uint %36
-         %37 = OpCompositeConstruct %v3uint %33 %34 %35
-         %38 = OpLoad %int %arg_3
-         %29 = OpImageFetch %v4float %30 %37 Lod %38
-               OpStore %res %29
+         %33 = OpLoad %11 %arg_0
+         %35 = OpLoad %v2uint %arg_1
+         %36 = OpCompositeExtract %uint %35 0
+         %37 = OpCompositeExtract %uint %35 1
+         %39 = OpLoad %int %arg_2
+         %38 = OpBitcast %uint %39
+         %40 = OpCompositeConstruct %v3uint %36 %37 %38
+         %41 = OpLoad %int %arg_3
+         %32 = OpImageFetch %v4float %33 %40 Lod %41
+               OpStore %res %32
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %47 = OpLoad %v4float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_54a59b
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_54a59b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureLoad_54a59b
+%fragment_main = OpFunction %void None %15
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureLoad_54a59b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_54a59b
+%compute_main = OpFunction %void None %15
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_54a59b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.wgsl
index ae4ba00..a4663db 100644
--- a/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/54a59b.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_54a59b();
diff --git a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl
index 02264cc..847fab3 100644
--- a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1i;
   var arg_2 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.dxc.hlsl
index e4524e8..6a0e55d 100644
--- a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_5a2f9d() {
   int arg_1 = 1;
   int arg_2 = 1;
   int4 res = arg_0.Load(int2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.fxc.hlsl
index e4524e8..6a0e55d 100644
--- a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_5a2f9d() {
   int arg_1 = 1;
   int arg_2 = 1;
   int4 res = arg_0.Load(int2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.glsl
index afa321e..e6bbe1a 100644
--- a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_5a2f9d() {
   int arg_1 = 1;
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_5a2f9d() {
   int arg_1 = 1;
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_5a2f9d() {
   int arg_1 = 1;
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.msl
index 6064527..e719e42 100644
--- a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_5a2f9d(texture1d<int, access::sample> tint_symbol_1) {
+void textureLoad_5a2f9d(texture1d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int arg_1 = 1;
   int arg_2 = 1;
   int4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureLoad_5a2f9d(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_5a2f9d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_5a2f9d(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_5a2f9d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_5a2f9d(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_5a2f9d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.spvasm
index e7c25eb..b72bd21 100644
--- a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_5a2f9d "textureLoad_5a2f9d"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,49 +45,58 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %24 = OpConstantNull %int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %29 = OpConstantNull %v4int
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %38 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_5a2f9d = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-      %arg_2 = OpVariable %_ptr_Function_int Function %20
-        %res = OpVariable %_ptr_Function_v4int Function %29
+%textureLoad_5a2f9d = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %24
+      %arg_2 = OpVariable %_ptr_Function_int Function %24
+        %res = OpVariable %_ptr_Function_v4int Function %32
                OpStore %arg_1 %int_1
                OpStore %arg_2 %int_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %int %arg_1
-         %26 = OpLoad %int %arg_2
-         %22 = OpImageFetch %v4int %24 %25 Lod %26
-               OpStore %res %22
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %int %arg_1
+         %29 = OpLoad %int %arg_2
+         %26 = OpImageFetch %v4int %27 %28 Lod %29
+               OpStore %res %26
+         %36 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %37 = OpLoad %v4int %res
+               OpStore %36 %37
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureLoad_5a2f9d
+%vertex_main_inner = OpFunction %v4float None %38
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureLoad_5a2f9d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %43 = OpLabel
+         %44 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %44
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_5a2f9d
+%fragment_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_5a2f9d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_5a2f9d
+%compute_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_5a2f9d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.wgsl
index 8de3448..a46d6cb 100644
--- a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1i;
   var arg_2 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_5a2f9d();
diff --git a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl
index c3d80b7..390ba40 100644
--- a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.dxc.hlsl
index b6fbbac..a00c371 100644
--- a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6154d4() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(int3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.fxc.hlsl
index b6fbbac..a00c371 100644
--- a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6154d4() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(int3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.glsl
index bab8886..3b91982 100644
--- a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6154d4() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6154d4() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6154d4() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.msl
index c3721ca..8dead51 100644
--- a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6154d4(texture2d<uint, access::sample> tint_symbol_1) {
+void textureLoad_6154d4(texture2d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureLoad_6154d4(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_6154d4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6154d4(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6154d4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6154d4(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6154d4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.spvasm
index 7f24091..08067d5 100644
--- a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6154d4 "textureLoad_6154d4"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,54 +44,62 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %23 = OpConstantNull %v2int
+         %27 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %26 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %30 = OpConstantNull %int
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %34 = OpConstantNull %v4uint
-         %35 = OpTypeFunction %v4float
+         %37 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6154d4 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %26
-        %res = OpVariable %_ptr_Function_v4uint Function %34
-               OpStore %arg_1 %20
+%textureLoad_6154d4 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+        %res = OpVariable %_ptr_Function_v4uint Function %37
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2int %arg_1
-         %31 = OpLoad %int %arg_2
-         %27 = OpImageFetch %v4uint %29 %30 Lod %31
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2int %arg_1
+         %34 = OpLoad %int %arg_2
+         %31 = OpImageFetch %v4uint %32 %33 Lod %34
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %41 = OpLoad %v4uint %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_6154d4
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_6154d4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_6154d4
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_6154d4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_6154d4
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_6154d4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.wgsl
index e970a81..1151da8 100644
--- a/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6154d4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6154d4();
diff --git a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl
index 6f3c159..7ce97a4 100644
--- a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.dxc.hlsl
index f7ddcb2..87bac4c 100644
--- a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6273b1() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   float res = arg_0.Load(int3(arg_1, 0), arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.fxc.hlsl
index f7ddcb2..87bac4c 100644
--- a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6273b1() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   float res = arg_0.Load(int3(arg_1, 0), arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.glsl
index 7a7419c..05d767f 100644
--- a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6273b1() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, arg_1, arg_2).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6273b1() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, arg_1, arg_2).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6273b1() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, arg_1, arg_2).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.msl
index d6b255c..04e4469 100644
--- a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6273b1(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_6273b1(depth2d_ms<float, access::read> tint_symbol_1, device float* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_6273b1(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_6273b1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6273b1(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6273b1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6273b1(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6273b1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.spvasm
index a08e42a..ac4b839 100644
--- a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6273b1 "textureLoad_6273b1"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,53 +43,62 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6273b1 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
+%textureLoad_6273b1 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v2int %arg_1
-         %30 = OpLoad %int %arg_2
-         %27 = OpImageFetch %v4float %28 %29 Sample %30
-         %26 = OpCompositeExtract %float %27 0
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v2int %arg_1
+         %33 = OpLoad %int %arg_2
+         %30 = OpImageFetch %v4float %31 %32 Sample %33
+         %29 = OpCompositeExtract %float %30 0
+               OpStore %res %29
+         %39 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %40 = OpLoad %float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_6273b1
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_6273b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_6273b1
+%fragment_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_6273b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_6273b1
+%compute_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_6273b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.wgsl
index 7cada9a..7a04536 100644
--- a/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6273b1.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6273b1();
diff --git a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl
index 7d26000..a363fa9 100644
--- a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1i;
   var arg_2 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.dxc.hlsl
index 3e2fc86..9ee0e65 100644
--- a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_62d1de() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(int2(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.fxc.hlsl
index 3e2fc86..9ee0e65 100644
--- a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_62d1de() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(int2(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.glsl
index 0322ef7..5743672 100644
--- a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_62d1de() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_62d1de() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_62d1de() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.msl
index f9ba804..2c9f842 100644
--- a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_62d1de(texture1d<int, access::sample> tint_symbol_1) {
+void textureLoad_62d1de(texture1d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int arg_1 = 1;
   uint arg_2 = 1u;
   int4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureLoad_62d1de(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_62d1de(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_62d1de(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_62d1de(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_62d1de(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_62d1de(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.spvasm
index 0621eea..b6fc4c0 100644
--- a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_62d1de "textureLoad_62d1de"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,53 +45,61 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
+         %24 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %29 = OpConstantNull %uint
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %33 = OpConstantNull %v4int
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_62d1de = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %33
+%textureLoad_62d1de = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %24
+      %arg_2 = OpVariable %_ptr_Function_uint Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %36
                OpStore %arg_1 %int_1
                OpStore %arg_2 %uint_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %int %arg_1
-         %30 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4int %28 %29 Lod %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %int %arg_1
+         %33 = OpLoad %uint %arg_2
+         %30 = OpImageFetch %v4int %31 %32 Lod %33
+               OpStore %res %30
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %40 = OpLoad %v4int %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_62d1de
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_62d1de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_62d1de
+%fragment_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_62d1de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_62d1de
+%compute_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_62d1de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.wgsl
index 743651f..7b3a6b6 100644
--- a/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/62d1de.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1i;
   var arg_2 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_62d1de();
diff --git a/test/tint/builtins/gen/var/textureLoad/639962.wgsl b/test/tint/builtins/gen/var/textureLoad/639962.wgsl
index 3d14ad5..b34ede7 100644
--- a/test/tint/builtins/gen/var/textureLoad/639962.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/639962.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.dxc.hlsl
index ed58f3f..4f0d22e 100644
--- a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_639962() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.fxc.hlsl
index ed58f3f..4f0d22e 100644
--- a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_639962() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.glsl
index f5f8da9..e2d401b 100644
--- a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_639962() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_639962() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_639962() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.msl
index c3adfe6..35c7d48 100644
--- a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_639962(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureLoad_639962(texture2d_ms<int, access::read> tint_symbol_1, device int4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureLoad_639962(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_639962(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_639962(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_639962(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_639962(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_639962(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.spvasm
index 7057d88..68d383b 100644
--- a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_639962 "textureLoad_639962"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,54 +44,62 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
+         %27 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %26 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %30 = OpConstantNull %uint
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %34 = OpConstantNull %v4int
-         %35 = OpTypeFunction %v4float
+         %37 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_639962 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %26
-        %res = OpVariable %_ptr_Function_v4int Function %34
-               OpStore %arg_1 %20
+%textureLoad_639962 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+        %res = OpVariable %_ptr_Function_v4int Function %37
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2uint %arg_1
-         %31 = OpLoad %uint %arg_2
-         %27 = OpImageFetch %v4int %29 %30 Sample %31
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2uint %arg_1
+         %34 = OpLoad %uint %arg_2
+         %31 = OpImageFetch %v4int %32 %33 Sample %34
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %41 = OpLoad %v4int %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_639962
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_639962
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_639962
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_639962
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_639962
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_639962
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.wgsl
index c02be59..84eac55 100644
--- a/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/639962.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_639962();
diff --git a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl
index 88e3094..09bec9d 100644
--- a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.dxc.hlsl
index be46590..f42c018 100644
--- a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_656d76() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   uint4 res = arg_0.Load(int4(int3(arg_1, arg_2), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.fxc.hlsl
index be46590..f42c018 100644
--- a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_656d76() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   uint4 res = arg_0.Load(int4(int3(arg_1, arg_2), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.glsl
index c22ae85..1c28d88 100644
--- a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_656d76() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_656d76() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_656d76() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.msl
index 5565e44..09edf47 100644
--- a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_656d76(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_656d76(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_656d76(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_656d76(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_656d76(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_656d76(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_656d76(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_656d76(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.spvasm
index 112215f..2b38c11 100644
--- a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_656d76 "textureLoad_656d76"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,64 +45,72 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %23 = OpConstantNull %v2int
+         %27 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %26 = OpConstantNull %int
+         %30 = OpConstantNull %int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %34 = OpConstantNull %uint
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %43 = OpConstantNull %v4uint
-         %44 = OpTypeFunction %v4float
+         %46 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_656d76 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %26
-      %arg_3 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %43
-               OpStore %arg_1 %20
+%textureLoad_656d76 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+      %arg_3 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %46
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
                OpStore %arg_3 %uint_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2int %arg_1
-         %36 = OpCompositeExtract %int %35 0
-         %37 = OpCompositeExtract %int %35 1
-         %38 = OpLoad %int %arg_2
-         %39 = OpCompositeConstruct %v3int %36 %37 %38
-         %40 = OpLoad %uint %arg_3
-         %31 = OpImageFetch %v4uint %33 %39 Lod %40
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2int %arg_1
+         %39 = OpCompositeExtract %int %38 0
+         %40 = OpCompositeExtract %int %38 1
+         %41 = OpLoad %int %arg_2
+         %42 = OpCompositeConstruct %v3int %39 %40 %41
+         %43 = OpLoad %uint %arg_3
+         %35 = OpImageFetch %v4uint %36 %42 Lod %43
+               OpStore %res %35
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %50 = OpLoad %v4uint %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_656d76
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_656d76
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %17
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_656d76
+%fragment_main = OpFunction %void None %17
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_656d76
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureLoad_656d76
+%compute_main = OpFunction %void None %17
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureLoad_656d76
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.wgsl
index 9452773..c946149 100644
--- a/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/656d76.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_656d76();
diff --git a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl
index cddd126..87808a1 100644
--- a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.dxc.hlsl
index 663ca3a..7f0b7c8 100644
--- a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_66be47() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = arg_0.Load(int4(int3(arg_1, int(arg_2)), int(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.fxc.hlsl
index 663ca3a..7f0b7c8 100644
--- a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_66be47() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = arg_0.Load(int4(int3(arg_1, int(arg_2)), int(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.glsl
index 191f682..f331694 100644
--- a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_66be47() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_66be47() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_66be47() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.msl
index 8fefeea..d357626 100644
--- a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_66be47(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_66be47(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_66be47(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_66be47(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_66be47(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_66be47(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_66be47(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_66be47(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.spvasm
index 5a3d224..7a59b54 100644
--- a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_66be47 "textureLoad_66be47"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,63 +44,71 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
       %v3int = OpTypeVector %int 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %42 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_66be47 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-      %arg_3 = OpVariable %_ptr_Function_uint Function %27
+%textureLoad_66be47 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+      %arg_3 = OpVariable %_ptr_Function_uint Function %30
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %31 = OpLoad %11 %arg_0
-         %33 = OpLoad %v2int %arg_1
-         %34 = OpCompositeExtract %int %33 0
-         %35 = OpCompositeExtract %int %33 1
-         %37 = OpLoad %uint %arg_2
-         %36 = OpBitcast %int %37
-         %38 = OpCompositeConstruct %v3int %34 %35 %36
-         %39 = OpLoad %uint %arg_3
-         %30 = OpImageFetch %v4float %31 %38 Lod %39
-         %29 = OpCompositeExtract %float %30 0
-               OpStore %res %29
+         %34 = OpLoad %11 %arg_0
+         %36 = OpLoad %v2int %arg_1
+         %37 = OpCompositeExtract %int %36 0
+         %38 = OpCompositeExtract %int %36 1
+         %40 = OpLoad %uint %arg_2
+         %39 = OpBitcast %int %40
+         %41 = OpCompositeConstruct %v3int %37 %38 %39
+         %42 = OpLoad %uint %arg_3
+         %33 = OpImageFetch %v4float %34 %41 Lod %42
+         %32 = OpCompositeExtract %float %33 0
+               OpStore %res %32
+         %47 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %48 = OpLoad %float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_66be47
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_66be47
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureLoad_66be47
+%fragment_main = OpFunction %void None %15
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureLoad_66be47
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureLoad_66be47
+%compute_main = OpFunction %void None %15
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureLoad_66be47
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.wgsl
index 01a2ec9..4defa8f 100644
--- a/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/66be47.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_66be47();
diff --git a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl
index 51a4254..986cc34 100644
--- a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.dxc.hlsl
index 86b8281..36218e6 100644
--- a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6925bc() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   float res = arg_0.Load(int3(arg_1, 0), arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.fxc.hlsl
index 86b8281..36218e6 100644
--- a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6925bc() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   float res = arg_0.Load(int3(arg_1, 0), arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.glsl
index baf9efff..a58a814 100644
--- a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6925bc() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, arg_1, int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6925bc() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, arg_1, int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_6925bc() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, arg_1, int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.msl
index 739dc4a..532aafc 100644
--- a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6925bc(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_6925bc(depth2d_ms<float, access::read> tint_symbol_1, device float* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_6925bc(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_6925bc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6925bc(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6925bc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6925bc(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6925bc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.spvasm
index dcf7546..702556f 100644
--- a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6925bc "textureLoad_6925bc"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,63 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6925bc = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
+%textureLoad_6925bc = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2int %arg_1
-         %32 = OpLoad %uint %arg_2
-         %29 = OpImageFetch %v4float %30 %31 Sample %32
-         %28 = OpCompositeExtract %float %29 0
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2int %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpImageFetch %v4float %33 %34 Sample %35
+         %31 = OpCompositeExtract %float %32 0
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %41 = OpLoad %float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_6925bc
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_6925bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_6925bc
+%fragment_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_6925bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_6925bc
+%compute_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_6925bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.wgsl
index d399100..8bf4bc9 100644
--- a/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6925bc.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6925bc();
diff --git a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl
index 6e99e75..3d4cbeb 100644
--- a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1i;
   var arg_2 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.dxc.hlsl
index 65a6988..6cdee56 100644
--- a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6b77d4() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(int2(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.fxc.hlsl
index 65a6988..6cdee56 100644
--- a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6b77d4() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(int2(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.glsl
index 5aac53f..726add9 100644
--- a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6b77d4() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6b77d4() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6b77d4() {
   int arg_1 = 1;
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.msl
index 115258a..8cebdde 100644
--- a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6b77d4(texture1d<uint, access::sample> tint_symbol_1) {
+void textureLoad_6b77d4(texture1d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int arg_1 = 1;
   uint arg_2 = 1u;
   uint4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureLoad_6b77d4(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_6b77d4(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6b77d4(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6b77d4(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6b77d4(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6b77d4(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.spvasm
index 44efbaa..4e71f06 100644
--- a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6b77d4 "textureLoad_6b77d4"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,53 +45,61 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %21 = OpConstantNull %int
+         %25 = OpConstantNull %int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %29 = OpConstantNull %uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %33 = OpConstantNull %v4uint
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6b77d4 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %21
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %33
+%textureLoad_6b77d4 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %36
                OpStore %arg_1 %int_1
                OpStore %arg_2 %uint_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %int %arg_1
-         %30 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4uint %28 %29 Lod %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %int %arg_1
+         %33 = OpLoad %uint %arg_2
+         %30 = OpImageFetch %v4uint %31 %32 Lod %33
+               OpStore %res %30
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %40 = OpLoad %v4uint %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_6b77d4
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_6b77d4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_6b77d4
+%fragment_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_6b77d4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_6b77d4
+%compute_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_6b77d4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.wgsl
index a038f632a..94a369b 100644
--- a/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6b77d4.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1i;
   var arg_2 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6b77d4();
diff --git a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl
index 892cd17..00e2229 100644
--- a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl
index e35052f..58fab13 100644
--- a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6bf4b7() {
   int3 arg_1 = (1).xxx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(int4(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl
index e35052f..58fab13 100644
--- a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6bf4b7() {
   int3 arg_1 = (1).xxx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(int4(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.glsl
index 240d3b6..bbd72eb 100644
--- a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6bf4b7() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6bf4b7() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_6bf4b7() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.msl
index e46344f..9f7a799 100644
--- a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6bf4b7(texture3d<uint, access::sample> tint_symbol_1) {
+void textureLoad_6bf4b7(texture3d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int3 arg_1 = int3(1);
   uint arg_2 = 1u;
   uint4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureLoad_6bf4b7(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_6bf4b7(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6bf4b7(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6bf4b7(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6bf4b7(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6bf4b7(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.spvasm
index f390c9e..407153c 100644
--- a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6bf4b7 "textureLoad_6bf4b7"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %24 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %23 = OpConstantNull %v3int
+         %27 = OpConstantNull %v3int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %31 = OpConstantNull %uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %35 = OpConstantNull %v4uint
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6bf4b7 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %35
-               OpStore %arg_1 %20
+%textureLoad_6bf4b7 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %38
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v3int %arg_1
-         %32 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4uint %30 %31 Lod %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v3int %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpImageFetch %v4uint %33 %34 Lod %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_6bf4b7
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_6bf4b7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_6bf4b7
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_6bf4b7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_6bf4b7
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_6bf4b7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.wgsl
index 697bc95..42226c7 100644
--- a/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6bf4b7.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6bf4b7();
diff --git a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl
index eeee23a..af5ac0a 100644
--- a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.dxc.hlsl
index cf3f78b..64ab4b2 100644
--- a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6d376a() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(uint2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.fxc.hlsl
index cf3f78b..64ab4b2 100644
--- a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_6d376a() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(uint2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.glsl
index 95ba92e..485a6ef 100644
--- a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_6d376a() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_6d376a() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_6d376a() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.msl
index c42b2ec..e8adcc9 100644
--- a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_6d376a(texture1d<float, access::sample> tint_symbol_1) {
+void textureLoad_6d376a(texture1d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   float4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureLoad_6d376a(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_6d376a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_6d376a(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_6d376a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_6d376a(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_6d376a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.spvasm
index a5bed9d..2056958 100644
--- a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_6d376a "textureLoad_6d376a"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,48 +44,56 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
+         %23 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %28 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %35 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_6d376a = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-      %arg_2 = OpVariable %_ptr_Function_uint Function %20
+%textureLoad_6d376a = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %23
+      %arg_2 = OpVariable %_ptr_Function_uint Function %23
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %uint %arg_1
-         %25 = OpLoad %uint %arg_2
-         %22 = OpImageFetch %v4float %23 %24 Lod %25
-               OpStore %res %22
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %uint %arg_1
+         %28 = OpLoad %uint %arg_2
+         %25 = OpImageFetch %v4float %26 %27 Lod %28
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %34 = OpLoad %v4float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_6d376a
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureLoad_6d376a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %15
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_6d376a
+%fragment_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_6d376a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_6d376a
+%compute_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_6d376a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.wgsl
index a485a5d..1d474d5 100644
--- a/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/6d376a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_6d376a();
diff --git a/test/tint/builtins/gen/var/textureLoad/714471.wgsl b/test/tint/builtins/gen/var/textureLoad/714471.wgsl
index 18510fd..d1fa193 100644
--- a/test/tint/builtins/gen/var/textureLoad/714471.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/714471.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.dxc.hlsl
index 17f1e85..76e0d68 100644
--- a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_714471() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(uint3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.fxc.hlsl
index 17f1e85..76e0d68 100644
--- a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_714471() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(uint3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.glsl
index ecf3485..0785173 100644
--- a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_714471() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_714471() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_714471() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.msl
index 73e4327..1152508 100644
--- a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_714471(texture2d<int, access::sample> tint_symbol_1) {
+void textureLoad_714471(texture2d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureLoad_714471(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_714471(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_714471(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_714471(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_714471(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_714471(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.spvasm
index f42c3b4..7af3d76 100644
--- a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_714471 "textureLoad_714471"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,54 +44,62 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
+         %27 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %26 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %30 = OpConstantNull %uint
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %34 = OpConstantNull %v4int
-         %35 = OpTypeFunction %v4float
+         %37 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_714471 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %26
-        %res = OpVariable %_ptr_Function_v4int Function %34
-               OpStore %arg_1 %20
+%textureLoad_714471 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+        %res = OpVariable %_ptr_Function_v4int Function %37
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2uint %arg_1
-         %31 = OpLoad %uint %arg_2
-         %27 = OpImageFetch %v4int %29 %30 Lod %31
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2uint %arg_1
+         %34 = OpLoad %uint %arg_2
+         %31 = OpImageFetch %v4int %32 %33 Lod %34
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %41 = OpLoad %v4int %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_714471
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_714471
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_714471
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_714471
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_714471
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_714471
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.wgsl
index 327caa3..7fc7d12 100644
--- a/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/714471.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_714471();
diff --git a/test/tint/builtins/gen/var/textureLoad/789045.wgsl b/test/tint/builtins/gen/var/textureLoad/789045.wgsl
index d0bdcc2..e6a4c25 100644
--- a/test/tint/builtins/gen/var/textureLoad/789045.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/789045.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.dxc.hlsl
index eac78bd..b3398b8 100644
--- a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_789045() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   float4 res = arg_0.Load(int4(int3(arg_1, arg_2), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.fxc.hlsl
index eac78bd..b3398b8 100644
--- a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_789045() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   float4 res = arg_0.Load(int4(int3(arg_1, arg_2), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.glsl
index baf4b50..1e53c4a 100644
--- a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_789045() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_789045() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_789045() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.msl
index 0d93156..9673498 100644
--- a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_789045(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_789045(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_789045(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_789045(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_789045(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_789045(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_789045(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_789045(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.spvasm
index aca45c0..1517efc 100644
--- a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_789045 "textureLoad_789045"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,63 +44,71 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
+         %33 = OpConstantNull %uint
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %42 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_789045 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-      %arg_3 = OpVariable %_ptr_Function_uint Function %30
+%textureLoad_789045 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
+      %arg_3 = OpVariable %_ptr_Function_uint Function %33
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
                OpStore %arg_3 %uint_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpLoad %v2int %arg_1
-         %35 = OpCompositeExtract %int %34 0
-         %36 = OpCompositeExtract %int %34 1
-         %37 = OpLoad %int %arg_2
-         %38 = OpCompositeConstruct %v3int %35 %36 %37
-         %39 = OpLoad %uint %arg_3
-         %31 = OpImageFetch %v4float %32 %38 Lod %39
-               OpStore %res %31
+         %35 = OpLoad %11 %arg_0
+         %37 = OpLoad %v2int %arg_1
+         %38 = OpCompositeExtract %int %37 0
+         %39 = OpCompositeExtract %int %37 1
+         %40 = OpLoad %int %arg_2
+         %41 = OpCompositeConstruct %v3int %38 %39 %40
+         %42 = OpLoad %uint %arg_3
+         %34 = OpImageFetch %v4float %35 %41 Lod %42
+               OpStore %res %34
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %48 = OpLoad %v4float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_789045
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_789045
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureLoad_789045
+%fragment_main = OpFunction %void None %15
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureLoad_789045
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureLoad_789045
+%compute_main = OpFunction %void None %15
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureLoad_789045
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.wgsl
index 865b428..96523ee 100644
--- a/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/789045.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_789045();
diff --git a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl
index 37a5c29..3f016dd 100644
--- a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.dxc.hlsl
index 5532fe6..9f402d3 100644
--- a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_79e697() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   int4 res = arg_0.Load(int4(int3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.fxc.hlsl
index 5532fe6..9f402d3 100644
--- a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_79e697() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   int4 res = arg_0.Load(int4(int3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.glsl
index 2392cd7..91e448b 100644
--- a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_79e697() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_79e697() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_79e697() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.msl
index dd36d93..672f83a 100644
--- a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_79e697(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_79e697(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_79e697(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_79e697(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_79e697(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_79e697(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_79e697(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_79e697(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.spvasm
index 9d9cb9e..d18ed54 100644
--- a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_79e697 "textureLoad_79e697"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,60 +45,69 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %23 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %26 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %29 = OpConstantNull %int
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %39 = OpConstantNull %v4int
-         %40 = OpTypeFunction %v4float
+         %42 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %48 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_79e697 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-      %arg_3 = OpVariable %_ptr_Function_int Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %39
-               OpStore %arg_1 %19
+%textureLoad_79e697 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %29
+      %arg_3 = OpVariable %_ptr_Function_int Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %42
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
                OpStore %arg_3 %int_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2int %arg_1
-         %32 = OpCompositeExtract %int %31 0
-         %33 = OpCompositeExtract %int %31 1
-         %34 = OpLoad %int %arg_2
-         %35 = OpCompositeConstruct %v3int %32 %33 %34
-         %36 = OpLoad %int %arg_3
-         %27 = OpImageFetch %v4int %29 %35 Lod %36
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2int %arg_1
+         %35 = OpCompositeExtract %int %34 0
+         %36 = OpCompositeExtract %int %34 1
+         %37 = OpLoad %int %arg_2
+         %38 = OpCompositeConstruct %v3int %35 %36 %37
+         %39 = OpLoad %int %arg_3
+         %31 = OpImageFetch %v4int %32 %38 Lod %39
+               OpStore %res %31
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %47 = OpLoad %v4int %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_79e697
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_79e697
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureLoad_79e697
+%fragment_main = OpFunction %void None %17
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureLoad_79e697
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_79e697
+%compute_main = OpFunction %void None %17
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_79e697
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.wgsl
index bdb2708..19f7a8f 100644
--- a/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/79e697.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_79e697();
diff --git a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl
index c1d6e7e..59270e7 100644
--- a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.dxc.hlsl
index 0ebf675..302a45c 100644
--- a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7ab4df() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   uint4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.fxc.hlsl
index 0ebf675..302a45c 100644
--- a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7ab4df() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   uint4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.glsl
index 04a6f05..4df80f4 100644
--- a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7ab4df() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7ab4df() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7ab4df() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.msl
index 2c10622..310462b 100644
--- a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7ab4df(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_7ab4df(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_7ab4df(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_7ab4df(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7ab4df(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7ab4df(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7ab4df(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7ab4df(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.spvasm
index a753d7a..146f10f 100644
--- a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7ab4df "textureLoad_7ab4df"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,65 +45,73 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %23 = OpConstantNull %v2int
+         %27 = OpConstantNull %v2int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %31 = OpConstantNull %uint
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %34 = OpConstantNull %int
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %44 = OpConstantNull %v4uint
-         %45 = OpTypeFunction %v4float
+         %47 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %52 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7ab4df = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-      %arg_3 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %44
-               OpStore %arg_1 %20
+%textureLoad_7ab4df = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+      %arg_3 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %47
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %int_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2int %arg_1
-         %36 = OpCompositeExtract %int %35 0
-         %37 = OpCompositeExtract %int %35 1
-         %39 = OpLoad %uint %arg_2
-         %38 = OpBitcast %int %39
-         %40 = OpCompositeConstruct %v3int %36 %37 %38
-         %41 = OpLoad %int %arg_3
-         %31 = OpImageFetch %v4uint %33 %40 Lod %41
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2int %arg_1
+         %39 = OpCompositeExtract %int %38 0
+         %40 = OpCompositeExtract %int %38 1
+         %42 = OpLoad %uint %arg_2
+         %41 = OpBitcast %int %42
+         %43 = OpCompositeConstruct %v3int %39 %40 %41
+         %44 = OpLoad %int %arg_3
+         %35 = OpImageFetch %v4uint %36 %43 Lod %44
+               OpStore %res %35
+         %50 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %51 = OpLoad %v4uint %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_7ab4df
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_7ab4df
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %17
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureLoad_7ab4df
+%fragment_main = OpFunction %void None %17
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureLoad_7ab4df
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureLoad_7ab4df
+%compute_main = OpFunction %void None %17
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureLoad_7ab4df
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.wgsl
index a11042c..9c3b1c5 100644
--- a/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7ab4df.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7ab4df();
diff --git a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl
index a3ef4db..1407d49 100644
--- a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.dxc.hlsl
index 7c6acb6..86b22f6 100644
--- a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7b63e0() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = arg_0.Load(uint4(uint3(arg_1, arg_2), arg_3)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.fxc.hlsl
index 7c6acb6..86b22f6 100644
--- a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7b63e0() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = arg_0.Load(uint4(uint3(arg_1, arg_2), arg_3)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.glsl
index c9a432b..b0dba93 100644
--- a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7b63e0() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7b63e0() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7b63e0() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.msl
index dc75d16..2c1569c 100644
--- a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7b63e0(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_7b63e0(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_7b63e0(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_7b63e0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7b63e0(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7b63e0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7b63e0(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7b63e0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.spvasm
index 2409080..55c6fa9 100644
--- a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7b63e0 "textureLoad_7b63e0"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,60 +44,68 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %39 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %46 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7b63e0 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-      %arg_3 = OpVariable %_ptr_Function_uint Function %25
+%textureLoad_7b63e0 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
+      %arg_3 = OpVariable %_ptr_Function_uint Function %28
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2uint %arg_1
-         %32 = OpCompositeExtract %uint %31 0
-         %33 = OpCompositeExtract %uint %31 1
-         %34 = OpLoad %uint %arg_2
-         %35 = OpCompositeConstruct %v3uint %32 %33 %34
-         %36 = OpLoad %uint %arg_3
-         %28 = OpImageFetch %v4float %29 %35 Lod %36
-         %27 = OpCompositeExtract %float %28 0
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2uint %arg_1
+         %35 = OpCompositeExtract %uint %34 0
+         %36 = OpCompositeExtract %uint %34 1
+         %37 = OpLoad %uint %arg_2
+         %38 = OpCompositeConstruct %v3uint %35 %36 %37
+         %39 = OpLoad %uint %arg_3
+         %31 = OpImageFetch %v4float %32 %38 Lod %39
+         %30 = OpCompositeExtract %float %31 0
+               OpStore %res %30
+         %44 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %45 = OpLoad %float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_7b63e0
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_7b63e0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_7b63e0
+%fragment_main = OpFunction %void None %15
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_7b63e0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureLoad_7b63e0
+%compute_main = OpFunction %void None %15
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureLoad_7b63e0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.wgsl
index c888b5a..31fe0bc 100644
--- a/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7b63e0.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7b63e0();
diff --git a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl
index 4c32497..d090ceb 100644
--- a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.dxc.hlsl
index 31352a9..f39b84a 100644
--- a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7bee94() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.fxc.hlsl
index 31352a9..f39b84a 100644
--- a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7bee94() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.glsl
index 424a6ef..22a3a68 100644
--- a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_7bee94() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_7bee94() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_7bee94() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.msl
index 0f5165f..9db83af 100644
--- a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7bee94(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureLoad_7bee94(texture2d_ms<int, access::read> tint_symbol_1, device int4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureLoad_7bee94(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_7bee94(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7bee94(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7bee94(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7bee94(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7bee94(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.spvasm
index 3018fee..4a507ed 100644
--- a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7bee94 "textureLoad_7bee94"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
+         %27 = OpConstantNull %v2uint
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %31 = OpConstantNull %int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %35 = OpConstantNull %v4int
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7bee94 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %35
-               OpStore %arg_1 %20
+%textureLoad_7bee94 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %38
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2uint %arg_1
-         %32 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4int %30 %31 Sample %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2uint %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpImageFetch %v4int %33 %34 Sample %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %42 = OpLoad %v4int %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_7bee94
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_7bee94
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_7bee94
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_7bee94
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_7bee94
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_7bee94
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.wgsl
index ef3b813..0c40113 100644
--- a/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7bee94.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7bee94();
diff --git a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl
index c2ea7d2..4acef1c 100644
--- a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.dxc.hlsl
index d017a03..3eb1e5a 100644
--- a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7c90e5() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   uint4 res = arg_0.Load(int4(int3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.fxc.hlsl
index d017a03..3eb1e5a 100644
--- a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7c90e5() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   uint4 res = arg_0.Load(int4(int3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.glsl
index cbc50b7..adeee42 100644
--- a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7c90e5() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7c90e5() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_7c90e5() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.msl
index 126dc80..89ac32d 100644
--- a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7c90e5(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_7c90e5(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_7c90e5(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_7c90e5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7c90e5(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7c90e5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7c90e5(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7c90e5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.spvasm
index 73dae19..ee0319f 100644
--- a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7c90e5 "textureLoad_7c90e5"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,61 +45,69 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %23 = OpConstantNull %v2int
+         %27 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %26 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %30 = OpConstantNull %int
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %40 = OpConstantNull %v4uint
-         %41 = OpTypeFunction %v4float
+         %43 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %48 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7c90e5 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %26
-      %arg_3 = OpVariable %_ptr_Function_int Function %26
-        %res = OpVariable %_ptr_Function_v4uint Function %40
-               OpStore %arg_1 %20
+%textureLoad_7c90e5 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+      %arg_3 = OpVariable %_ptr_Function_int Function %30
+        %res = OpVariable %_ptr_Function_v4uint Function %43
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
                OpStore %arg_3 %int_1
-         %30 = OpLoad %11 %arg_0
-         %32 = OpLoad %v2int %arg_1
-         %33 = OpCompositeExtract %int %32 0
-         %34 = OpCompositeExtract %int %32 1
-         %35 = OpLoad %int %arg_2
-         %36 = OpCompositeConstruct %v3int %33 %34 %35
-         %37 = OpLoad %int %arg_3
-         %28 = OpImageFetch %v4uint %30 %36 Lod %37
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %35 = OpLoad %v2int %arg_1
+         %36 = OpCompositeExtract %int %35 0
+         %37 = OpCompositeExtract %int %35 1
+         %38 = OpLoad %int %arg_2
+         %39 = OpCompositeConstruct %v3int %36 %37 %38
+         %40 = OpLoad %int %arg_3
+         %32 = OpImageFetch %v4uint %33 %39 Lod %40
+               OpStore %res %32
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %47 = OpLoad %v4uint %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_7c90e5
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_7c90e5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureLoad_7c90e5
+%fragment_main = OpFunction %void None %17
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureLoad_7c90e5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_7c90e5
+%compute_main = OpFunction %void None %17
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_7c90e5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.wgsl
index e4c7106..2ca177a 100644
--- a/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7c90e5.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7c90e5();
diff --git a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl
index 7d7c93a..89d3c5f 100644
--- a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.dxc.hlsl
index 3fbe2bb..dc009ac 100644
--- a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7fd822() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   float res = arg_0.Load(uint3(arg_1, uint(arg_2))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.fxc.hlsl
index 3fbe2bb..dc009ac 100644
--- a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_7fd822() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   float res = arg_0.Load(uint3(arg_1, uint(arg_2))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.glsl
index 0b1843c..2b5dbdd 100644
--- a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7fd822() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, ivec2(arg_1), arg_2).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7fd822() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, ivec2(arg_1), arg_2).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_7fd822() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, ivec2(arg_1), arg_2).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.msl
index 7b23746..bb1b571 100644
--- a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_7fd822(depth2d<float, access::sample> tint_symbol_1) {
+void textureLoad_7fd822(depth2d<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureLoad_7fd822(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_7fd822(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_7fd822(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_7fd822(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_7fd822(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_7fd822(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.spvasm
index ded61b9..96c4cf4 100644
--- a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_7fd822 "textureLoad_7fd822"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,63 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_7fd822 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
+%textureLoad_7fd822 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2uint %arg_1
-         %32 = OpLoad %int %arg_2
-         %29 = OpImageFetch %v4float %30 %31 Lod %32
-         %28 = OpCompositeExtract %float %29 0
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2uint %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpImageFetch %v4float %33 %34 Lod %35
+         %31 = OpCompositeExtract %float %32 0
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %41 = OpLoad %float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_7fd822
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_7fd822
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_7fd822
+%fragment_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_7fd822
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_7fd822
+%compute_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_7fd822
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.wgsl
index 64bd80e..c86ffdd 100644
--- a/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/7fd822.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_7fd822();
diff --git a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl
index 06a7555..b05a3a6 100644
--- a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1i;
   var arg_2 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.dxc.hlsl
index f2f1d94..c5aca35 100644
--- a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_81c381() {
   int arg_1 = 1;
   int arg_2 = 1;
   float4 res = arg_0.Load(int2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.fxc.hlsl
index f2f1d94..c5aca35 100644
--- a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_81c381() {
   int arg_1 = 1;
   int arg_2 = 1;
   float4 res = arg_0.Load(int2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.glsl
index daffdcb..6a73863 100644
--- a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_81c381() {
   int arg_1 = 1;
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_81c381() {
   int arg_1 = 1;
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_81c381() {
   int arg_1 = 1;
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1, 0), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.msl
index a0047fe..c240368 100644
--- a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_81c381(texture1d<float, access::sample> tint_symbol_1) {
+void textureLoad_81c381(texture1d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int arg_1 = 1;
   int arg_2 = 1;
   float4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureLoad_81c381(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_81c381(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_81c381(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_81c381(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_81c381(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_81c381(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.spvasm
index 4d847d2..e15726e 100644
--- a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_81c381 "textureLoad_81c381"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,48 +44,57 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %20 = OpConstantNull %int
+         %23 = OpConstantNull %int
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %28 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %36 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_81c381 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_int Function %20
-      %arg_2 = OpVariable %_ptr_Function_int Function %20
+%textureLoad_81c381 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_int Function %23
+      %arg_2 = OpVariable %_ptr_Function_int Function %23
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %arg_1 %int_1
                OpStore %arg_2 %int_1
-         %23 = OpLoad %11 %arg_0
-         %24 = OpLoad %int %arg_1
-         %25 = OpLoad %int %arg_2
-         %22 = OpImageFetch %v4float %23 %24 Lod %25
-               OpStore %res %22
+         %26 = OpLoad %11 %arg_0
+         %27 = OpLoad %int %arg_1
+         %28 = OpLoad %int %arg_2
+         %25 = OpImageFetch %v4float %26 %27 Lod %28
+               OpStore %res %25
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureLoad_81c381
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureLoad_81c381
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %15
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_81c381
+%fragment_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_81c381
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_81c381
+%compute_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_81c381
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.wgsl
index 6af49e3..b5194b1 100644
--- a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1i;
   var arg_2 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_81c381();
diff --git a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl
index b9a6c49..0332c40 100644
--- a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.dxc.hlsl
index ddbcaca..2abc480 100644
--- a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_84dee1() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(uint3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.fxc.hlsl
index ddbcaca..2abc480 100644
--- a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_84dee1() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(uint3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.glsl
index 0cf1692..4fad2599c 100644
--- a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_84dee1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_84dee1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_84dee1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.msl
index c2a83c6..88b94b6 100644
--- a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_84dee1(texture2d<float, access::sample> tint_symbol_1) {
+void textureLoad_84dee1(texture2d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureLoad_84dee1(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_84dee1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_84dee1(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_84dee1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_84dee1(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_84dee1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.spvasm
index 8126b56..871e945 100644
--- a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_84dee1 "textureLoad_84dee1"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,52 +43,60 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %39 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_84dee1 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
+%textureLoad_84dee1 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %27 = OpLoad %11 %arg_0
-         %28 = OpLoad %v2uint %arg_1
-         %29 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4float %27 %28 Lod %29
-               OpStore %res %26
+         %30 = OpLoad %11 %arg_0
+         %31 = OpLoad %v2uint %arg_1
+         %32 = OpLoad %uint %arg_2
+         %29 = OpImageFetch %v4float %30 %31 Lod %32
+               OpStore %res %29
+         %37 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %38 = OpLoad %v4float %res
+               OpStore %37 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_84dee1
+%vertex_main_inner = OpFunction %v4float None %39
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureLoad_84dee1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %44 = OpLabel
+         %45 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %45
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_84dee1
+%fragment_main = OpFunction %void None %15
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_84dee1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_84dee1
+%compute_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_84dee1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.wgsl
index 20c09d3..b2acda8 100644
--- a/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/84dee1.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_84dee1();
diff --git a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl
index 9bcc0f9..8e84594 100644
--- a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.dxc.hlsl
index a8eedff..921586f 100644
--- a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_8527b1() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.fxc.hlsl
index a8eedff..921586f 100644
--- a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_8527b1() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.glsl
index 3a7abdc..e08fff2 100644
--- a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_8527b1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_8527b1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_8527b1() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.msl
index b8f246d..b3a8227 100644
--- a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_8527b1(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_8527b1(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_8527b1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_8527b1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_8527b1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_8527b1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_8527b1(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_8527b1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.spvasm
index 7894494..cf8abf4 100644
--- a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_8527b1 "textureLoad_8527b1"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,60 +45,68 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %26 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %29 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %39 = OpConstantNull %v4uint
-         %40 = OpTypeFunction %v4float
+         %42 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %47 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_8527b1 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-      %arg_3 = OpVariable %_ptr_Function_uint Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %39
-               OpStore %arg_1 %19
+%textureLoad_8527b1 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %29
+      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %42
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2uint %arg_1
-         %32 = OpCompositeExtract %uint %31 0
-         %33 = OpCompositeExtract %uint %31 1
-         %34 = OpLoad %uint %arg_2
-         %35 = OpCompositeConstruct %v3uint %32 %33 %34
-         %36 = OpLoad %uint %arg_3
-         %27 = OpImageFetch %v4uint %29 %35 Lod %36
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2uint %arg_1
+         %35 = OpCompositeExtract %uint %34 0
+         %36 = OpCompositeExtract %uint %34 1
+         %37 = OpLoad %uint %arg_2
+         %38 = OpCompositeConstruct %v3uint %35 %36 %37
+         %39 = OpLoad %uint %arg_3
+         %31 = OpImageFetch %v4uint %32 %38 Lod %39
+               OpStore %res %31
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %46 = OpLoad %v4uint %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_8527b1
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_8527b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureLoad_8527b1
+%fragment_main = OpFunction %void None %17
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureLoad_8527b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_8527b1
+%compute_main = OpFunction %void None %17
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_8527b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.wgsl
index 68a89fe..a6eabfb 100644
--- a/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/8527b1.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_8527b1();
diff --git a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl
index 703671b..c364e41 100644
--- a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.dxc.hlsl
index e2e2ecc..75a7a7b 100644
--- a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_87be85() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   float4 res = arg_0.Load(int4(int3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.fxc.hlsl
index e2e2ecc..75a7a7b 100644
--- a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_87be85() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   float4 res = arg_0.Load(int4(int3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.glsl
index 46621b3..08f6f21 100644
--- a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_87be85() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_87be85() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_87be85() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.msl
index 5c043b9..75d9360 100644
--- a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_87be85(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_87be85(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_87be85(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_87be85(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_87be85(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_87be85(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_87be85(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_87be85(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.spvasm
index fa7cb5c..60876f5 100644
--- a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 60
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_87be85 "textureLoad_87be85"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,59 +44,68 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %46 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_87be85 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-      %arg_3 = OpVariable %_ptr_Function_int Function %25
+%textureLoad_87be85 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
+      %arg_3 = OpVariable %_ptr_Function_int Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
                OpStore %arg_3 %int_1
-         %28 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2int %arg_1
-         %31 = OpCompositeExtract %int %30 0
-         %32 = OpCompositeExtract %int %30 1
-         %33 = OpLoad %int %arg_2
-         %34 = OpCompositeConstruct %v3int %31 %32 %33
-         %35 = OpLoad %int %arg_3
-         %27 = OpImageFetch %v4float %28 %34 Lod %35
-               OpStore %res %27
+         %31 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2int %arg_1
+         %34 = OpCompositeExtract %int %33 0
+         %35 = OpCompositeExtract %int %33 1
+         %36 = OpLoad %int %arg_2
+         %37 = OpCompositeConstruct %v3int %34 %35 %36
+         %38 = OpLoad %int %arg_3
+         %30 = OpImageFetch %v4float %31 %37 Lod %38
+               OpStore %res %30
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_87be85
+%vertex_main_inner = OpFunction %v4float None %46
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureLoad_87be85
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %52
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_87be85
+%fragment_main = OpFunction %void None %15
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_87be85
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureLoad_87be85
+%compute_main = OpFunction %void None %15
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureLoad_87be85
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.wgsl
index 79c6137..5c62d45 100644
--- a/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/87be85.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_87be85();
diff --git a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl
index d2e7b87..2c99cb3 100644
--- a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.dxc.hlsl
index e943ee4..f2834fa 100644
--- a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_897cf3() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(uint3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.fxc.hlsl
index e943ee4..f2834fa 100644
--- a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_897cf3() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(uint3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.glsl
index 603face..59d0fb9 100644
--- a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_897cf3() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_897cf3() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_897cf3() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.msl
index 4ebbf9b..2648b5f 100644
--- a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_897cf3(texture2d<uint, access::sample> tint_symbol_1) {
+void textureLoad_897cf3(texture2d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureLoad_897cf3(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_897cf3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_897cf3(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_897cf3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_897cf3(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_897cf3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.spvasm
index b62cf69..a7e4f3e 100644
--- a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_897cf3 "textureLoad_897cf3"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,53 +44,61 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %26 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %29 = OpConstantNull %uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %33 = OpConstantNull %v4uint
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_897cf3 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-        %res = OpVariable %_ptr_Function_v4uint Function %33
-               OpStore %arg_1 %19
+%textureLoad_897cf3 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %29
+        %res = OpVariable %_ptr_Function_v4uint Function %36
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v2uint %arg_1
-         %30 = OpLoad %uint %arg_2
-         %26 = OpImageFetch %v4uint %28 %29 Lod %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v2uint %arg_1
+         %33 = OpLoad %uint %arg_2
+         %30 = OpImageFetch %v4uint %31 %32 Lod %33
+               OpStore %res %30
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %40 = OpLoad %v4uint %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_897cf3
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_897cf3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_897cf3
+%fragment_main = OpFunction %void None %17
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_897cf3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_897cf3
+%compute_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_897cf3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.wgsl
index 5739639..e3f1de3 100644
--- a/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/897cf3.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_897cf3();
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl
index 4fd4ae8..8f15183 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl
@@ -26,7 +26,9 @@
 fn textureLoad_8acf41() {
   var arg_1 = vec2<i32>(1i);
   var res: vec4<f32> = textureLoad(arg_0, arg_1);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl
index eaf70d6..4d121ee 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl
@@ -91,9 +91,12 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureLoad_8acf41() {
   int2 arg_1 = (1).xx;
   float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl
index eaf70d6..4d121ee 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl
@@ -91,9 +91,12 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureLoad_8acf41() {
   int2 arg_1 = (1).xx;
   float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
index fd0f0b4..41ee7e5 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
@@ -74,9 +74,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_8acf41() {
   ivec2 arg_1 = ivec2(1);
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -169,9 +174,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_8acf41() {
   ivec2 arg_1 = ivec2(1);
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -258,9 +268,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_8acf41() {
   ivec2 arg_1 = ivec2(1);
   vec4 res = textureLoadExternal(arg_0_1, ext_tex_plane_1_1, arg_1, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
index 5fae152..1fd84bd 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
@@ -95,34 +95,35 @@
   return float4(color, 1.0f);
 }
 
-void textureLoad_8acf41(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_3) {
+void textureLoad_8acf41(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_3, device float4* const tint_symbol_4) {
   int2 arg_1 = int2(1);
   float4 res = textureLoadExternal(tint_symbol_1, tint_symbol_2, arg_1, tint_unpack_vec3_in_composite_1(*(tint_symbol_3)));
+  *(tint_symbol_4) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, texture2d<float, access::sample> tint_symbol_5, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_6) {
-  textureLoad_8acf41(tint_symbol_4, tint_symbol_5, tint_symbol_6);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_7, device float4* const tint_symbol_8) {
+  textureLoad_8acf41(tint_symbol_5, tint_symbol_6, tint_symbol_7, tint_symbol_8);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], texture2d<float, access::sample> tint_symbol_8 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_9 [[buffer(2)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], texture2d<float, access::sample> tint_symbol_10 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_11 [[buffer(2)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], texture2d<float, access::sample> tint_symbol_11 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_12 [[buffer(2)]]) {
-  textureLoad_8acf41(tint_symbol_10, tint_symbol_11, tint_symbol_12);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_15 [[buffer(2)]], device float4* tint_symbol_16 [[buffer(0)]]) {
+  textureLoad_8acf41(tint_symbol_13, tint_symbol_14, tint_symbol_15, tint_symbol_16);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_15 [[buffer(2)]]) {
-  textureLoad_8acf41(tint_symbol_13, tint_symbol_14, tint_symbol_15);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_17 [[texture(0)]], texture2d<float, access::sample> tint_symbol_18 [[texture(1)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_19 [[buffer(2)]], device float4* tint_symbol_20 [[buffer(0)]]) {
+  textureLoad_8acf41(tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
index c15aa87..ef7e7ed 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 164
+; Bound: 170
 ; Schema: 0
                OpCapability Shader
-         %29 = OpExtInstImport "GLSL.std.450"
+         %32 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,6 +37,9 @@
                OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
                OpName %ext_tex_params "ext_tex_params"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %gammaCorrection "gammaCorrection"
                OpName %v "v"
                OpName %params "params"
@@ -95,6 +98,10 @@
                OpDecorate %ext_tex_params Binding 2
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
                OpMemberDecorate %ExternalTextureParams 0 Offset 0
                OpMemberDecorate %ExternalTextureParams 1 Offset 4
                OpMemberDecorate %ExternalTextureParams 2 Offset 16
@@ -130,175 +137,182 @@
 %_ptr_Uniform_ext_tex_params_block_std140 = OpTypePointer Uniform %ext_tex_params_block_std140
 %ext_tex_params = OpVariable %_ptr_Uniform_ext_tex_params_block_std140 Uniform
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-         %23 = OpTypeFunction %v3float %v3float %GammaTransferParams
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %26 = OpTypeFunction %v3float %v3float %GammaTransferParams
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %43 = OpConstantNull %v3float
+         %46 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
 %mat3v2float = OpTypeMatrix %v2float 3
 %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat3v2float
-         %63 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams
+         %66 = OpTypeFunction %v4float %11 %11 %v2int %ExternalTextureParams
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %76 = OpConstantComposite %v2uint %uint_1 %uint_1
-         %85 = OpConstantNull %int
+         %79 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %88 = OpConstantNull %int
     %float_1 = OpConstant %float 1
-         %98 = OpConstantNull %uint
-        %116 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
+        %101 = OpConstantNull %uint
+        %119 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
        %void = OpTypeVoid
-        %131 = OpTypeFunction %void
+        %134 = OpTypeFunction %void
       %int_1 = OpConstant %int 1
-        %136 = OpConstantComposite %v2int %int_1 %int_1
+        %139 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-        %139 = OpConstantNull %v2int
+        %142 = OpConstantNull %v2int
      %uint_0 = OpConstant %uint 0
 %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-        %151 = OpTypeFunction %v4float
-%gammaCorrection = OpFunction %v3float None %23
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+        %157 = OpTypeFunction %v4float
+%gammaCorrection = OpFunction %v3float None %26
           %v = OpFunctionParameter %v3float
      %params = OpFunctionParameter %GammaTransferParams
-         %27 = OpLabel
-         %41 = OpVariable %_ptr_Function_v3float Function %43
-         %53 = OpVariable %_ptr_Function_v3float Function %43
-         %59 = OpVariable %_ptr_Function_v3float Function %43
-         %28 = OpExtInst %v3float %29 FAbs %v
-         %30 = OpCompositeExtract %float %params 4
-         %31 = OpCompositeConstruct %v3float %30 %30 %30
-         %32 = OpFOrdLessThan %v3bool %28 %31
-         %35 = OpExtInst %v3float %29 FSign %v
-         %36 = OpCompositeExtract %float %params 3
-         %37 = OpExtInst %v3float %29 FAbs %v
-         %38 = OpVectorTimesScalar %v3float %37 %36
-         %39 = OpCompositeExtract %float %params 6
-         %44 = OpCompositeConstruct %v3float %39 %39 %39
-         %40 = OpFAdd %v3float %38 %44
-         %45 = OpFMul %v3float %35 %40
-         %46 = OpExtInst %v3float %29 FSign %v
-         %48 = OpCompositeExtract %float %params 1
-         %49 = OpExtInst %v3float %29 FAbs %v
-         %50 = OpVectorTimesScalar %v3float %49 %48
-         %51 = OpCompositeExtract %float %params 2
-         %54 = OpCompositeConstruct %v3float %51 %51 %51
-         %52 = OpFAdd %v3float %50 %54
-         %55 = OpCompositeExtract %float %params 0
-         %56 = OpCompositeConstruct %v3float %55 %55 %55
-         %47 = OpExtInst %v3float %29 Pow %52 %56
-         %57 = OpCompositeExtract %float %params 5
-         %60 = OpCompositeConstruct %v3float %57 %57 %57
-         %58 = OpFAdd %v3float %47 %60
-         %61 = OpFMul %v3float %46 %58
-         %62 = OpSelect %v3float %32 %45 %61
-               OpReturnValue %62
+         %30 = OpLabel
+         %44 = OpVariable %_ptr_Function_v3float Function %46
+         %56 = OpVariable %_ptr_Function_v3float Function %46
+         %62 = OpVariable %_ptr_Function_v3float Function %46
+         %31 = OpExtInst %v3float %32 FAbs %v
+         %33 = OpCompositeExtract %float %params 4
+         %34 = OpCompositeConstruct %v3float %33 %33 %33
+         %35 = OpFOrdLessThan %v3bool %31 %34
+         %38 = OpExtInst %v3float %32 FSign %v
+         %39 = OpCompositeExtract %float %params 3
+         %40 = OpExtInst %v3float %32 FAbs %v
+         %41 = OpVectorTimesScalar %v3float %40 %39
+         %42 = OpCompositeExtract %float %params 6
+         %47 = OpCompositeConstruct %v3float %42 %42 %42
+         %43 = OpFAdd %v3float %41 %47
+         %48 = OpFMul %v3float %38 %43
+         %49 = OpExtInst %v3float %32 FSign %v
+         %51 = OpCompositeExtract %float %params 1
+         %52 = OpExtInst %v3float %32 FAbs %v
+         %53 = OpVectorTimesScalar %v3float %52 %51
+         %54 = OpCompositeExtract %float %params 2
+         %57 = OpCompositeConstruct %v3float %54 %54 %54
+         %55 = OpFAdd %v3float %53 %57
+         %58 = OpCompositeExtract %float %params 0
+         %59 = OpCompositeConstruct %v3float %58 %58 %58
+         %50 = OpExtInst %v3float %32 Pow %55 %59
+         %60 = OpCompositeExtract %float %params 5
+         %63 = OpCompositeConstruct %v3float %60 %60 %60
+         %61 = OpFAdd %v3float %50 %63
+         %64 = OpFMul %v3float %49 %61
+         %65 = OpSelect %v3float %35 %48 %64
+               OpReturnValue %65
                OpFunctionEnd
-%textureLoadExternal = OpFunction %v4float None %63
+%textureLoadExternal = OpFunction %v4float None %66
      %plane0 = OpFunctionParameter %11
      %plane1 = OpFunctionParameter %11
       %coord = OpFunctionParameter %v2int
    %params_0 = OpFunctionParameter %ExternalTextureParams
-         %73 = OpLabel
-      %color = OpVariable %_ptr_Function_v3float Function %43
-         %77 = OpShiftRightArithmetic %v2int %coord %76
-         %79 = OpCompositeExtract %uint %params_0 0
-         %80 = OpIEqual %bool %79 %uint_1
-               OpSelectionMerge %81 None
-               OpBranchConditional %80 %82 %83
-         %82 = OpLabel
-         %84 = OpImageFetch %v4float %plane0 %coord Lod %85
-         %86 = OpVectorShuffle %v3float %84 %84 0 1 2
-               OpStore %color %86
-               OpBranch %81
-         %83 = OpLabel
-         %87 = OpImageFetch %v4float %plane0 %coord Lod %85
-         %88 = OpCompositeExtract %float %87 0
-         %89 = OpImageFetch %v4float %plane1 %77 Lod %85
-         %90 = OpVectorShuffle %v2float %89 %89 0 1
+         %76 = OpLabel
+      %color = OpVariable %_ptr_Function_v3float Function %46
+         %80 = OpShiftRightArithmetic %v2int %coord %79
+         %82 = OpCompositeExtract %uint %params_0 0
+         %83 = OpIEqual %bool %82 %uint_1
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %86
+         %85 = OpLabel
+         %87 = OpImageFetch %v4float %plane0 %coord Lod %88
+         %89 = OpVectorShuffle %v3float %87 %87 0 1 2
+               OpStore %color %89
+               OpBranch %84
+         %86 = OpLabel
+         %90 = OpImageFetch %v4float %plane0 %coord Lod %88
          %91 = OpCompositeExtract %float %90 0
-         %92 = OpCompositeExtract %float %90 1
-         %94 = OpCompositeConstruct %v4float %88 %91 %92 %float_1
-         %95 = OpCompositeExtract %mat3v4float %params_0 2
-         %96 = OpVectorTimesMatrix %v3float %94 %95
-               OpStore %color %96
-               OpBranch %81
-         %81 = OpLabel
-         %97 = OpCompositeExtract %uint %params_0 1
-         %99 = OpIEqual %bool %97 %98
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
-        %103 = OpLoad %v3float %color
-        %104 = OpCompositeExtract %GammaTransferParams %params_0 3
-        %102 = OpFunctionCall %v3float %gammaCorrection %103 %104
-               OpStore %color %102
-        %105 = OpCompositeExtract %mat3v3float %params_0 5
+         %92 = OpImageFetch %v4float %plane1 %80 Lod %88
+         %93 = OpVectorShuffle %v2float %92 %92 0 1
+         %94 = OpCompositeExtract %float %93 0
+         %95 = OpCompositeExtract %float %93 1
+         %97 = OpCompositeConstruct %v4float %91 %94 %95 %float_1
+         %98 = OpCompositeExtract %mat3v4float %params_0 2
+         %99 = OpVectorTimesMatrix %v3float %97 %98
+               OpStore %color %99
+               OpBranch %84
+         %84 = OpLabel
+        %100 = OpCompositeExtract %uint %params_0 1
+        %102 = OpIEqual %bool %100 %101
+               OpSelectionMerge %103 None
+               OpBranchConditional %102 %104 %103
+        %104 = OpLabel
         %106 = OpLoad %v3float %color
-        %107 = OpMatrixTimesVector %v3float %105 %106
-               OpStore %color %107
+        %107 = OpCompositeExtract %GammaTransferParams %params_0 3
+        %105 = OpFunctionCall %v3float %gammaCorrection %106 %107
+               OpStore %color %105
+        %108 = OpCompositeExtract %mat3v3float %params_0 5
         %109 = OpLoad %v3float %color
-        %110 = OpCompositeExtract %GammaTransferParams %params_0 4
-        %108 = OpFunctionCall %v3float %gammaCorrection %109 %110
-               OpStore %color %108
-               OpBranch %100
-        %100 = OpLabel
-        %111 = OpLoad %v3float %color
-        %112 = OpCompositeExtract %float %111 0
-        %113 = OpCompositeExtract %float %111 1
-        %114 = OpCompositeExtract %float %111 2
-        %115 = OpCompositeConstruct %v4float %112 %113 %114 %float_1
-               OpReturnValue %115
+        %110 = OpMatrixTimesVector %v3float %108 %109
+               OpStore %color %110
+        %112 = OpLoad %v3float %color
+        %113 = OpCompositeExtract %GammaTransferParams %params_0 4
+        %111 = OpFunctionCall %v3float %gammaCorrection %112 %113
+               OpStore %color %111
+               OpBranch %103
+        %103 = OpLabel
+        %114 = OpLoad %v3float %color
+        %115 = OpCompositeExtract %float %114 0
+        %116 = OpCompositeExtract %float %114 1
+        %117 = OpCompositeExtract %float %114 2
+        %118 = OpCompositeConstruct %v4float %115 %116 %117 %float_1
+               OpReturnValue %118
                OpFunctionEnd
-%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %116
+%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %119
         %val = OpFunctionParameter %ExternalTextureParams_std140
-        %119 = OpLabel
-        %120 = OpCompositeExtract %uint %val 0
-        %121 = OpCompositeExtract %uint %val 1
-        %122 = OpCompositeExtract %mat3v4float %val 2
-        %123 = OpCompositeExtract %GammaTransferParams %val 3
-        %124 = OpCompositeExtract %GammaTransferParams %val 4
-        %125 = OpCompositeExtract %mat3v3float %val 5
-        %126 = OpCompositeExtract %v2float %val 6
-        %127 = OpCompositeExtract %v2float %val 7
-        %128 = OpCompositeExtract %v2float %val 8
-        %129 = OpCompositeConstruct %mat3v2float %126 %127 %128
-        %130 = OpCompositeConstruct %ExternalTextureParams %120 %121 %122 %123 %124 %125 %129
-               OpReturnValue %130
+        %122 = OpLabel
+        %123 = OpCompositeExtract %uint %val 0
+        %124 = OpCompositeExtract %uint %val 1
+        %125 = OpCompositeExtract %mat3v4float %val 2
+        %126 = OpCompositeExtract %GammaTransferParams %val 3
+        %127 = OpCompositeExtract %GammaTransferParams %val 4
+        %128 = OpCompositeExtract %mat3v3float %val 5
+        %129 = OpCompositeExtract %v2float %val 6
+        %130 = OpCompositeExtract %v2float %val 7
+        %131 = OpCompositeExtract %v2float %val 8
+        %132 = OpCompositeConstruct %mat3v2float %129 %130 %131
+        %133 = OpCompositeConstruct %ExternalTextureParams %123 %124 %125 %126 %127 %128 %132
+               OpReturnValue %133
                OpFunctionEnd
-%textureLoad_8acf41 = OpFunction %void None %131
-        %134 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %139
+%textureLoad_8acf41 = OpFunction %void None %134
+        %137 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %142
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %136
-        %141 = OpLoad %11 %arg_0
-        %142 = OpLoad %11 %ext_tex_plane_1
-        %143 = OpLoad %v2int %arg_1
-        %147 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
-        %148 = OpLoad %ExternalTextureParams_std140 %147
-        %144 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %148
-        %140 = OpFunctionCall %v4float %textureLoadExternal %141 %142 %143 %144
-               OpStore %res %140
+               OpStore %arg_1 %139
+        %144 = OpLoad %11 %arg_0
+        %145 = OpLoad %11 %ext_tex_plane_1
+        %146 = OpLoad %v2int %arg_1
+        %150 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
+        %151 = OpLoad %ExternalTextureParams_std140 %150
+        %147 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %151
+        %143 = OpFunctionCall %v4float %textureLoadExternal %144 %145 %146 %147
+               OpStore %res %143
+        %155 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+        %156 = OpLoad %v4float %res
+               OpStore %155 %156
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %151
-        %153 = OpLabel
-        %154 = OpFunctionCall %void %textureLoad_8acf41
+%vertex_main_inner = OpFunction %v4float None %157
+        %159 = OpLabel
+        %160 = OpFunctionCall %void %textureLoad_8acf41
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %131
-        %156 = OpLabel
-        %157 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %157
+%vertex_main = OpFunction %void None %134
+        %162 = OpLabel
+        %163 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %163
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %131
-        %159 = OpLabel
-        %160 = OpFunctionCall %void %textureLoad_8acf41
+%fragment_main = OpFunction %void None %134
+        %165 = OpLabel
+        %166 = OpFunctionCall %void %textureLoad_8acf41
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %131
-        %162 = OpLabel
-        %163 = OpFunctionCall %void %textureLoad_8acf41
+%compute_main = OpFunction %void None %134
+        %168 = OpLabel
+        %169 = OpFunctionCall %void %textureLoad_8acf41
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.wgsl
index 90bedea..bae29bc 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn textureLoad_8acf41() {
   var arg_1 = vec2<i32>(1i);
   var res : vec4<f32> = textureLoad(arg_0, arg_1);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_8acf41();
diff --git a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl
index 4db4f0f..ea11548 100644
--- a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl
index cfaa745..1506ff5 100644
--- a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_8ccbe3() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   float res = arg_0.Load(int3(arg_1, int(arg_2))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl
index cfaa745..1506ff5 100644
--- a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_8ccbe3() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   float res = arg_0.Load(int3(arg_1, int(arg_2))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.glsl
index 658298a..af59e60 100644
--- a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_8ccbe3() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, arg_1, int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_8ccbe3() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, arg_1, int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_8ccbe3() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, arg_1, int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.msl
index c2a25ed..73d5f26 100644
--- a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_8ccbe3(depth2d<float, access::sample> tint_symbol_1) {
+void textureLoad_8ccbe3(depth2d<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureLoad_8ccbe3(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_8ccbe3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_8ccbe3(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_8ccbe3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_8ccbe3(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_8ccbe3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.spvasm
index 28a28a5..772a380 100644
--- a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_8ccbe3 "textureLoad_8ccbe3"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,63 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_8ccbe3 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
+%textureLoad_8ccbe3 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2int %arg_1
-         %32 = OpLoad %uint %arg_2
-         %29 = OpImageFetch %v4float %30 %31 Lod %32
-         %28 = OpCompositeExtract %float %29 0
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2int %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpImageFetch %v4float %33 %34 Lod %35
+         %31 = OpCompositeExtract %float %32 0
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %41 = OpLoad %float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_8ccbe3
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_8ccbe3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_8ccbe3
+%fragment_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_8ccbe3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_8ccbe3
+%compute_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_8ccbe3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.wgsl
index 0277d7e..dfbaa10 100644
--- a/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/8ccbe3.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_8ccbe3();
diff --git a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl
index cf4aad9..bfcb539 100644
--- a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.dxc.hlsl
index fc35c27..b0863c0 100644
--- a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_92eb1f() {
   uint3 arg_1 = (1u).xxx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(uint4(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.fxc.hlsl
index fc35c27..b0863c0 100644
--- a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_92eb1f() {
   uint3 arg_1 = (1u).xxx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(uint4(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.glsl
index 50d73c1..fc246b7 100644
--- a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_92eb1f() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_92eb1f() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_92eb1f() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.msl
index d6f31ed..380f468 100644
--- a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_92eb1f(texture3d<uint, access::sample> tint_symbol_1) {
+void textureLoad_92eb1f(texture3d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint3 arg_1 = uint3(1u);
   int arg_2 = 1;
   uint4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureLoad_92eb1f(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_92eb1f(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_92eb1f(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_92eb1f(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_92eb1f(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_92eb1f(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.spvasm
index 185df10..64a84da 100644
--- a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_92eb1f "textureLoad_92eb1f"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %23 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
+         %26 = OpConstantNull %v3uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %31 = OpConstantNull %int
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %35 = OpConstantNull %v4uint
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_92eb1f = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %35
-               OpStore %arg_1 %19
+%textureLoad_92eb1f = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %38
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v3uint %arg_1
-         %32 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4uint %30 %31 Lod %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v3uint %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpImageFetch %v4uint %33 %34 Lod %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_92eb1f
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_92eb1f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_92eb1f
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_92eb1f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_92eb1f
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_92eb1f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.wgsl
index 8180d4b..cd71fa4 100644
--- a/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/92eb1f.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_92eb1f();
diff --git a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl
index a7c6f4c..30d0c1e 100644
--- a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.dxc.hlsl
index f4d0e5d..15f7784 100644
--- a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_96efd5() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.fxc.hlsl
index f4d0e5d..15f7784 100644
--- a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_96efd5() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.glsl
index 6503ab3..4036450 100644
--- a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_96efd5() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_96efd5() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_96efd5() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.msl
index 2ab66e7..9cacf52 100644
--- a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_96efd5(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_96efd5(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_96efd5(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_96efd5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_96efd5(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_96efd5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_96efd5(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_96efd5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.spvasm
index 296c3a2..f04e5dd 100644
--- a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 52
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_96efd5 "textureLoad_96efd5"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,59 +44,67 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_96efd5 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-      %arg_3 = OpVariable %_ptr_Function_uint Function %25
+%textureLoad_96efd5 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
+      %arg_3 = OpVariable %_ptr_Function_uint Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %28 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2uint %arg_1
-         %31 = OpCompositeExtract %uint %30 0
-         %32 = OpCompositeExtract %uint %30 1
-         %33 = OpLoad %uint %arg_2
-         %34 = OpCompositeConstruct %v3uint %31 %32 %33
-         %35 = OpLoad %uint %arg_3
-         %27 = OpImageFetch %v4float %28 %34 Lod %35
-               OpStore %res %27
+         %31 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2uint %arg_1
+         %34 = OpCompositeExtract %uint %33 0
+         %35 = OpCompositeExtract %uint %33 1
+         %36 = OpLoad %uint %arg_2
+         %37 = OpCompositeConstruct %v3uint %34 %35 %36
+         %38 = OpLoad %uint %arg_3
+         %30 = OpImageFetch %v4float %31 %37 Lod %38
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %38
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureLoad_96efd5
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureLoad_96efd5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %44
+%vertex_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_96efd5
+%fragment_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_96efd5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureLoad_96efd5
+%compute_main = OpFunction %void None %15
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureLoad_96efd5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.wgsl
index 11a80a3..0e49810 100644
--- a/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/96efd5.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_96efd5();
diff --git a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl
index d762cb6..3a6522e 100644
--- a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.dxc.hlsl
index a6ce9eb..cfdec27 100644
--- a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9885b0() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.fxc.hlsl
index a6ce9eb..cfdec27 100644
--- a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9885b0() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.glsl
index 65bdb59..17b1a6a 100644
--- a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9885b0() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9885b0() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9885b0() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.msl
index 58b45be..aa8a879 100644
--- a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9885b0(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_9885b0(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_9885b0(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_9885b0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9885b0(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9885b0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9885b0(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9885b0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.spvasm
index bae79ed..b714a09 100644
--- a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 55
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9885b0 "textureLoad_9885b0"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,61 +45,69 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
+         %27 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %26 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %30 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %40 = OpConstantNull %v4int
-         %41 = OpTypeFunction %v4float
+         %43 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %48 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9885b0 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %26
-      %arg_3 = OpVariable %_ptr_Function_uint Function %26
-        %res = OpVariable %_ptr_Function_v4int Function %40
-               OpStore %arg_1 %20
+%textureLoad_9885b0 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+      %arg_3 = OpVariable %_ptr_Function_uint Function %30
+        %res = OpVariable %_ptr_Function_v4int Function %43
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %32 = OpLoad %v2uint %arg_1
-         %33 = OpCompositeExtract %uint %32 0
-         %34 = OpCompositeExtract %uint %32 1
-         %35 = OpLoad %uint %arg_2
-         %36 = OpCompositeConstruct %v3uint %33 %34 %35
-         %37 = OpLoad %uint %arg_3
-         %28 = OpImageFetch %v4int %30 %36 Lod %37
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %35 = OpLoad %v2uint %arg_1
+         %36 = OpCompositeExtract %uint %35 0
+         %37 = OpCompositeExtract %uint %35 1
+         %38 = OpLoad %uint %arg_2
+         %39 = OpCompositeConstruct %v3uint %36 %37 %38
+         %40 = OpLoad %uint %arg_3
+         %32 = OpImageFetch %v4int %33 %39 Lod %40
+               OpStore %res %32
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %47 = OpLoad %v4int %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_9885b0
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_9885b0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %17
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureLoad_9885b0
+%fragment_main = OpFunction %void None %17
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureLoad_9885b0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_9885b0
+%compute_main = OpFunction %void None %17
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_9885b0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.wgsl
index a7fa0f5..c21ddff 100644
--- a/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9885b0.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9885b0();
diff --git a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl
index 9311ce9..29eef57 100644
--- a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.dxc.hlsl
index 25e382b..ea1eabd 100644
--- a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9aa733() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int4 res = arg_0.Load(uint3(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.fxc.hlsl
index 25e382b..ea1eabd 100644
--- a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9aa733() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int4 res = arg_0.Load(uint3(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.glsl
index 1681f07..f13f811 100644
--- a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9aa733() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9aa733() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9aa733() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.msl
index 4afc04a..ec08ddc 100644
--- a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9aa733(texture2d<int, access::sample> tint_symbol_1) {
+void textureLoad_9aa733(texture2d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureLoad_9aa733(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_9aa733(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9aa733(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9aa733(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9aa733(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9aa733(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.spvasm
index 4e86f2f..7ebc345 100644
--- a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9aa733 "textureLoad_9aa733"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %20 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %24 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %23 = OpConstantNull %v2uint
+         %27 = OpConstantNull %v2uint
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %31 = OpConstantNull %int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %35 = OpConstantNull %v4int
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9aa733 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %35
-               OpStore %arg_1 %20
+%textureLoad_9aa733 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %38
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2uint %arg_1
-         %32 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4int %30 %31 Lod %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2uint %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpImageFetch %v4int %33 %34 Lod %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %42 = OpLoad %v4int %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_9aa733
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_9aa733
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_9aa733
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_9aa733
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_9aa733
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_9aa733
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.wgsl
index 26e1377..80ee0a5 100644
--- a/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9aa733.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9aa733();
diff --git a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl
index f471aef..58f853e 100644
--- a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.dxc.hlsl
index 9376a83..c6e4fb8 100644
--- a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9b2667() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   float res = arg_0.Load(int4(int3(arg_1, arg_2), arg_3)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.fxc.hlsl
index 9376a83..c6e4fb8 100644
--- a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9b2667() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   float res = arg_0.Load(int4(int3(arg_1, arg_2), arg_3)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.glsl
index b488ee0..15581ef 100644
--- a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9b2667() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9b2667() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9b2667() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.msl
index 8208bb5..a8ff9b5 100644
--- a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9b2667(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_9b2667(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   int arg_3 = 1;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_9b2667(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_9b2667(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9b2667(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9b2667(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9b2667(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9b2667(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.spvasm
index f42aff6..b896780 100644
--- a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9b2667 "textureLoad_9b2667"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,60 +44,69 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
       %v3int = OpTypeVector %int 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %39 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %47 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9b2667 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-      %arg_3 = OpVariable %_ptr_Function_int Function %25
+%textureLoad_9b2667 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
+      %arg_3 = OpVariable %_ptr_Function_int Function %28
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
                OpStore %arg_3 %int_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2int %arg_1
-         %32 = OpCompositeExtract %int %31 0
-         %33 = OpCompositeExtract %int %31 1
-         %34 = OpLoad %int %arg_2
-         %35 = OpCompositeConstruct %v3int %32 %33 %34
-         %36 = OpLoad %int %arg_3
-         %28 = OpImageFetch %v4float %29 %35 Lod %36
-         %27 = OpCompositeExtract %float %28 0
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2int %arg_1
+         %35 = OpCompositeExtract %int %34 0
+         %36 = OpCompositeExtract %int %34 1
+         %37 = OpLoad %int %arg_2
+         %38 = OpCompositeConstruct %v3int %35 %36 %37
+         %39 = OpLoad %int %arg_3
+         %31 = OpImageFetch %v4float %32 %38 Lod %39
+         %30 = OpCompositeExtract %float %31 0
+               OpStore %res %30
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %39
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_9b2667
+%vertex_main_inner = OpFunction %v4float None %47
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_9b2667
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %45
+%vertex_main = OpFunction %void None %15
+         %52 = OpLabel
+         %53 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %53
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_9b2667
+%fragment_main = OpFunction %void None %15
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureLoad_9b2667
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureLoad_9b2667
+%compute_main = OpFunction %void None %15
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_9b2667
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.wgsl
index 9da65be..896f3fe 100644
--- a/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9b2667.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9b2667();
diff --git a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl
index b610e53..5e7a8e8 100644
--- a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.dxc.hlsl
index e7d5bc4..38efcef 100644
--- a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9d70e9() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   int4 res = arg_0.Load(int4(int3(arg_1, arg_2), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.fxc.hlsl
index e7d5bc4..38efcef 100644
--- a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9d70e9() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   int4 res = arg_0.Load(int4(int3(arg_1, arg_2), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.glsl
index d3f7231..3ba0da3 100644
--- a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9d70e9() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9d70e9() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9d70e9() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.msl
index f374faa..1839186 100644
--- a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9d70e9(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_9d70e9(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_9d70e9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_9d70e9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9d70e9(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9d70e9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9d70e9(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9d70e9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.spvasm
index dcd5718..1b73a53 100644
--- a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9d70e9 "textureLoad_9d70e9"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,64 +45,72 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %23 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %26 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %29 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %34 = OpConstantNull %uint
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %43 = OpConstantNull %v4int
-         %44 = OpTypeFunction %v4float
+         %46 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9d70e9 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-      %arg_3 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %43
-               OpStore %arg_1 %19
+%textureLoad_9d70e9 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %29
+      %arg_3 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %46
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
                OpStore %arg_3 %uint_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2int %arg_1
-         %36 = OpCompositeExtract %int %35 0
-         %37 = OpCompositeExtract %int %35 1
-         %38 = OpLoad %int %arg_2
-         %39 = OpCompositeConstruct %v3int %36 %37 %38
-         %40 = OpLoad %uint %arg_3
-         %31 = OpImageFetch %v4int %33 %39 Lod %40
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2int %arg_1
+         %39 = OpCompositeExtract %int %38 0
+         %40 = OpCompositeExtract %int %38 1
+         %41 = OpLoad %int %arg_2
+         %42 = OpCompositeConstruct %v3int %39 %40 %41
+         %43 = OpLoad %uint %arg_3
+         %35 = OpImageFetch %v4int %36 %42 Lod %43
+               OpStore %res %35
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %50 = OpLoad %v4int %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_9d70e9
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_9d70e9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %17
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_9d70e9
+%fragment_main = OpFunction %void None %17
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_9d70e9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureLoad_9d70e9
+%compute_main = OpFunction %void None %17
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureLoad_9d70e9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.wgsl
index ea77eb9..a5e0cf9 100644
--- a/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9d70e9.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9d70e9();
diff --git a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl
index 9db0b27..4ba9ef8 100644
--- a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.dxc.hlsl
index 37dbf5f..1c9d1df 100644
--- a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9ed19e() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   float res = arg_0.Load(uint3(arg_1, arg_2)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.fxc.hlsl
index 37dbf5f..1c9d1df 100644
--- a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9ed19e() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   float res = arg_0.Load(uint3(arg_1, arg_2)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.glsl
index 6cb2a0e..1b687f5 100644
--- a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9ed19e() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9ed19e() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_9ed19e() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   float res = texelFetch(arg_0_1, ivec2(arg_1), int(arg_2)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.msl
index cea169f..06659c4 100644
--- a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9ed19e(depth2d<float, access::sample> tint_symbol_1) {
+void textureLoad_9ed19e(depth2d<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureLoad_9ed19e(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_9ed19e(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9ed19e(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9ed19e(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9ed19e(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9ed19e(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.spvasm
index 3e84bf3..7727397 100644
--- a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9ed19e "textureLoad_9ed19e"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,53 +43,61 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %33 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9ed19e = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
+%textureLoad_9ed19e = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v2uint %arg_1
-         %30 = OpLoad %uint %arg_2
-         %27 = OpImageFetch %v4float %28 %29 Lod %30
-         %26 = OpCompositeExtract %float %27 0
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v2uint %arg_1
+         %33 = OpLoad %uint %arg_2
+         %30 = OpImageFetch %v4float %31 %32 Lod %33
+         %29 = OpCompositeExtract %float %30 0
+               OpStore %res %29
+         %38 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %39 = OpLoad %float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureLoad_9ed19e
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_9ed19e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %39
+%vertex_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_9ed19e
+%fragment_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_9ed19e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_9ed19e
+%compute_main = OpFunction %void None %15
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_9ed19e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.wgsl
index 3a370c0..dae31dd 100644
--- a/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9ed19e.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1u;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9ed19e();
diff --git a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl
index b58b2f9..7088153 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl
index d289237..e004947 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9fbfd9() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl
index d289237..e004947 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_9fbfd9() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), int(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.glsl
index e5225ef..d931466 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9fbfd9() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9fbfd9() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_9fbfd9() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.msl
index e51e7d4..8ea8dc5 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_9fbfd9(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_9fbfd9(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   uint arg_3 = 1u;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_9fbfd9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_9fbfd9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_9fbfd9(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_9fbfd9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_9fbfd9(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_9fbfd9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.spvasm
index 66ff86b..248fff5 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_9fbfd9 "textureLoad_9fbfd9"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,63 +45,71 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %23 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %26 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %31 = OpConstantNull %uint
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %42 = OpConstantNull %v4int
-         %43 = OpTypeFunction %v4float
+         %45 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_9fbfd9 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-      %arg_3 = OpVariable %_ptr_Function_uint Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %42
-               OpStore %arg_1 %19
+%textureLoad_9fbfd9 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+      %arg_3 = OpVariable %_ptr_Function_uint Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %45
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %uint_1
-         %31 = OpLoad %11 %arg_0
-         %33 = OpLoad %v2int %arg_1
-         %34 = OpCompositeExtract %int %33 0
-         %35 = OpCompositeExtract %int %33 1
-         %37 = OpLoad %uint %arg_2
-         %36 = OpBitcast %int %37
-         %38 = OpCompositeConstruct %v3int %34 %35 %36
-         %39 = OpLoad %uint %arg_3
-         %29 = OpImageFetch %v4int %31 %38 Lod %39
-               OpStore %res %29
+         %34 = OpLoad %11 %arg_0
+         %36 = OpLoad %v2int %arg_1
+         %37 = OpCompositeExtract %int %36 0
+         %38 = OpCompositeExtract %int %36 1
+         %40 = OpLoad %uint %arg_2
+         %39 = OpBitcast %int %40
+         %41 = OpCompositeConstruct %v3int %37 %38 %39
+         %42 = OpLoad %uint %arg_3
+         %33 = OpImageFetch %v4int %34 %41 Lod %42
+               OpStore %res %33
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %49 = OpLoad %v4int %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_9fbfd9
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_9fbfd9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_9fbfd9
+%fragment_main = OpFunction %void None %17
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_9fbfd9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureLoad_9fbfd9
+%compute_main = OpFunction %void None %17
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureLoad_9fbfd9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.wgsl
index 2296540..d51ac6e 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/9fbfd9.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_9fbfd9();
diff --git a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl
index 948a8bd..ad9a41f 100644
--- a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.dxc.hlsl
index 077a798..4b0823b 100644
--- a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a24be1() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   uint4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.fxc.hlsl
index 077a798..4b0823b 100644
--- a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a24be1() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   uint4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.glsl
index 1fcbb32..02ba270 100644
--- a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a24be1() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a24be1() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a24be1() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), int(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.msl
index 8bceee3..33dec7b 100644
--- a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_a24be1(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureLoad_a24be1(texture2d_array<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   uint arg_3 = 1u;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureLoad_a24be1(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_a24be1(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_a24be1(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_a24be1(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_a24be1(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_a24be1(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.spvasm
index a6228e3..9b64c3f 100644
--- a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_a24be1 "textureLoad_a24be1"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,65 +45,73 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %26 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %31 = OpConstantNull %int
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %34 = OpConstantNull %uint
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %44 = OpConstantNull %v4uint
-         %45 = OpTypeFunction %v4float
+         %47 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %52 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_a24be1 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-      %arg_3 = OpVariable %_ptr_Function_uint Function %30
-        %res = OpVariable %_ptr_Function_v4uint Function %44
-               OpStore %arg_1 %19
+%textureLoad_a24be1 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+      %arg_3 = OpVariable %_ptr_Function_uint Function %34
+        %res = OpVariable %_ptr_Function_v4uint Function %47
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
                OpStore %arg_3 %uint_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2uint %arg_1
-         %36 = OpCompositeExtract %uint %35 0
-         %37 = OpCompositeExtract %uint %35 1
-         %39 = OpLoad %int %arg_2
-         %38 = OpBitcast %uint %39
-         %40 = OpCompositeConstruct %v3uint %36 %37 %38
-         %41 = OpLoad %uint %arg_3
-         %31 = OpImageFetch %v4uint %33 %40 Lod %41
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2uint %arg_1
+         %39 = OpCompositeExtract %uint %38 0
+         %40 = OpCompositeExtract %uint %38 1
+         %42 = OpLoad %int %arg_2
+         %41 = OpBitcast %uint %42
+         %43 = OpCompositeConstruct %v3uint %39 %40 %41
+         %44 = OpLoad %uint %arg_3
+         %35 = OpImageFetch %v4uint %36 %43 Lod %44
+               OpStore %res %35
+         %50 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %51 = OpLoad %v4uint %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_a24be1
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_a24be1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %17
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureLoad_a24be1
+%fragment_main = OpFunction %void None %17
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureLoad_a24be1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureLoad_a24be1
+%compute_main = OpFunction %void None %17
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureLoad_a24be1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.wgsl
index e321579..33cb9e3 100644
--- a/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/a24be1.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_a24be1();
diff --git a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl
index 0692104..5e84ef7 100644
--- a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.dxc.hlsl
index cf72504..54e80e0 100644
--- a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a583c9() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   float4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.fxc.hlsl
index cf72504..54e80e0 100644
--- a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a583c9() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   float4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.glsl
index cd79930..760ef70 100644
--- a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_a583c9() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_a583c9() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_a583c9() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.msl
index 285b756..bd3c245 100644
--- a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_a583c9(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_a583c9(texture2d_ms<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_a583c9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_a583c9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_a583c9(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_a583c9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_a583c9(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_a583c9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.spvasm
index b62cc21..b0f5677 100644
--- a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_a583c9 "textureLoad_a583c9"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,52 +43,61 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %32 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %40 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_a583c9 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
+%textureLoad_a583c9 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %27 = OpLoad %11 %arg_0
-         %28 = OpLoad %v2int %arg_1
-         %29 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4float %27 %28 Sample %29
-               OpStore %res %26
+         %30 = OpLoad %11 %arg_0
+         %31 = OpLoad %v2int %arg_1
+         %32 = OpLoad %int %arg_2
+         %29 = OpImageFetch %v4float %30 %31 Sample %32
+               OpStore %res %29
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %32
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureLoad_a583c9
+%vertex_main_inner = OpFunction %v4float None %40
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureLoad_a583c9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %37 = OpLabel
-         %38 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %38
+%vertex_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %46
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureLoad_a583c9
+%fragment_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_a583c9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_a583c9
+%compute_main = OpFunction %void None %15
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_a583c9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.wgsl
index bae2e0d..012ca4e 100644
--- a/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/a583c9.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_a583c9();
diff --git a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl
index 8769abe..ccc51e6 100644
--- a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.dxc.hlsl
index e3ec6e8..086fed2 100644
--- a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a9a9f5() {
   int3 arg_1 = (1).xxx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(int4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.fxc.hlsl
index e3ec6e8..086fed2 100644
--- a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_a9a9f5() {
   int3 arg_1 = (1).xxx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(int4(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.glsl
index cfa42c4..973ff2e 100644
--- a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a9a9f5() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a9a9f5() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_a9a9f5() {
   ivec3 arg_1 = ivec3(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.msl
index dd765b4..1b193ba 100644
--- a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_a9a9f5(texture3d<uint, access::sample> tint_symbol_1) {
+void textureLoad_a9a9f5(texture3d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int3 arg_1 = int3(1);
   int arg_2 = 1;
   uint4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureLoad_a9a9f5(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_a9a9f5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_a9a9f5(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_a9a9f5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_a9a9f5(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_a9a9f5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.spvasm
index 51d5467..d2e2d58 100644
--- a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_a9a9f5 "textureLoad_a9a9f5"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,54 +44,62 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %24 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %23 = OpConstantNull %v3int
+         %27 = OpConstantNull %v3int
 %_ptr_Function_int = OpTypePointer Function %int
-         %26 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %30 = OpConstantNull %int
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %34 = OpConstantNull %v4uint
-         %35 = OpTypeFunction %v4float
+         %37 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_a9a9f5 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %26
-        %res = OpVariable %_ptr_Function_v4uint Function %34
-               OpStore %arg_1 %20
+%textureLoad_a9a9f5 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+        %res = OpVariable %_ptr_Function_v4uint Function %37
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v3int %arg_1
-         %31 = OpLoad %int %arg_2
-         %27 = OpImageFetch %v4uint %29 %30 Lod %31
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v3int %arg_1
+         %34 = OpLoad %int %arg_2
+         %31 = OpImageFetch %v4uint %32 %33 Lod %34
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %41 = OpLoad %v4uint %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_a9a9f5
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_a9a9f5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_a9a9f5
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_a9a9f5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_a9a9f5
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_a9a9f5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.wgsl
index 3b9b743..5082bfa 100644
--- a/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/a9a9f5.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_a9a9f5();
diff --git a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl
index 7030cca..4e52998 100644
--- a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.dxc.hlsl
index eb30fed..184ec07 100644
--- a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b29f71() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   int4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.fxc.hlsl
index eb30fed..184ec07 100644
--- a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b29f71() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   int4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), arg_3));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.glsl
index 85fdeb5..269283d 100644
--- a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_b29f71() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_b29f71() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_b29f71() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   ivec4 res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.msl
index 2900129..bd0002d 100644
--- a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_b29f71(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureLoad_b29f71(texture2d_array<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureLoad_b29f71(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_b29f71(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_b29f71(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_b29f71(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_b29f71(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_b29f71(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.spvasm
index b72126d..1767ae1 100644
--- a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 59
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_b29f71 "textureLoad_b29f71"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,65 +45,73 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %23 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %26 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %31 = OpConstantNull %uint
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %34 = OpConstantNull %int
       %v3int = OpTypeVector %int 3
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %44 = OpConstantNull %v4int
-         %45 = OpTypeFunction %v4float
+         %47 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %52 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_b29f71 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-      %arg_3 = OpVariable %_ptr_Function_int Function %30
-        %res = OpVariable %_ptr_Function_v4int Function %44
-               OpStore %arg_1 %19
+%textureLoad_b29f71 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+      %arg_3 = OpVariable %_ptr_Function_int Function %34
+        %res = OpVariable %_ptr_Function_v4int Function %47
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %int_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2int %arg_1
-         %36 = OpCompositeExtract %int %35 0
-         %37 = OpCompositeExtract %int %35 1
-         %39 = OpLoad %uint %arg_2
-         %38 = OpBitcast %int %39
-         %40 = OpCompositeConstruct %v3int %36 %37 %38
-         %41 = OpLoad %int %arg_3
-         %31 = OpImageFetch %v4int %33 %40 Lod %41
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2int %arg_1
+         %39 = OpCompositeExtract %int %38 0
+         %40 = OpCompositeExtract %int %38 1
+         %42 = OpLoad %uint %arg_2
+         %41 = OpBitcast %int %42
+         %43 = OpCompositeConstruct %v3int %39 %40 %41
+         %44 = OpLoad %int %arg_3
+         %35 = OpImageFetch %v4int %36 %43 Lod %44
+               OpStore %res %35
+         %50 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %51 = OpLoad %v4int %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_b29f71
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_b29f71
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %17
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureLoad_b29f71
+%fragment_main = OpFunction %void None %17
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureLoad_b29f71
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureLoad_b29f71
+%compute_main = OpFunction %void None %17
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureLoad_b29f71
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.wgsl
index fe9529b..3b24681 100644
--- a/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/b29f71.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_b29f71();
diff --git a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl
index 04014e1..72f99b0 100644
--- a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl
index 3cf192a..d7c7a55 100644
--- a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b6ba5d() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   float res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl
index 3cf192a..d7c7a55 100644
--- a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b6ba5d() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   int arg_3 = 1;
   float res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.glsl
index 551eb08..c598430 100644
--- a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_b6ba5d() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_b6ba5d() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_b6ba5d() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, uint(arg_2))), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.msl
index 5a97ce5..ba9dc58 100644
--- a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_b6ba5d(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_b6ba5d(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   int arg_3 = 1;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_b6ba5d(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_b6ba5d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_b6ba5d(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_b6ba5d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_b6ba5d(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_b6ba5d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.spvasm
index f2a68b4..d9b3af2 100644
--- a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_b6ba5d "textureLoad_b6ba5d"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,63 +44,71 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %42 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_b6ba5d = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-      %arg_3 = OpVariable %_ptr_Function_int Function %27
+%textureLoad_b6ba5d = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+      %arg_3 = OpVariable %_ptr_Function_int Function %30
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
                OpStore %arg_3 %int_1
-         %31 = OpLoad %11 %arg_0
-         %33 = OpLoad %v2uint %arg_1
-         %34 = OpCompositeExtract %uint %33 0
-         %35 = OpCompositeExtract %uint %33 1
-         %37 = OpLoad %int %arg_2
-         %36 = OpBitcast %uint %37
-         %38 = OpCompositeConstruct %v3uint %34 %35 %36
-         %39 = OpLoad %int %arg_3
-         %30 = OpImageFetch %v4float %31 %38 Lod %39
-         %29 = OpCompositeExtract %float %30 0
-               OpStore %res %29
+         %34 = OpLoad %11 %arg_0
+         %36 = OpLoad %v2uint %arg_1
+         %37 = OpCompositeExtract %uint %36 0
+         %38 = OpCompositeExtract %uint %36 1
+         %40 = OpLoad %int %arg_2
+         %39 = OpBitcast %uint %40
+         %41 = OpCompositeConstruct %v3uint %37 %38 %39
+         %42 = OpLoad %int %arg_3
+         %33 = OpImageFetch %v4float %34 %41 Lod %42
+         %32 = OpCompositeExtract %float %33 0
+               OpStore %res %32
+         %47 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %48 = OpLoad %float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_b6ba5d
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_b6ba5d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureLoad_b6ba5d
+%fragment_main = OpFunction %void None %15
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureLoad_b6ba5d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureLoad_b6ba5d
+%compute_main = OpFunction %void None %15
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureLoad_b6ba5d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.wgsl
index 626f638..3891f5e 100644
--- a/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/b6ba5d.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1i;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_b6ba5d();
diff --git a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl
index 19912f4..d8b15e8 100644
--- a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.dxc.hlsl
index 9d88185..7942eae 100644
--- a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b73f6b() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(uint3(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.fxc.hlsl
index 9d88185..7942eae 100644
--- a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b73f6b() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(uint3(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.glsl
index 12f1e43..16c4e89 100644
--- a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_b73f6b() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_b73f6b() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_b73f6b() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.msl
index bc90f5e..e432cff 100644
--- a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_b73f6b(texture2d<uint, access::sample> tint_symbol_1) {
+void textureLoad_b73f6b(texture2d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureLoad_b73f6b(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_b73f6b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_b73f6b(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_b73f6b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_b73f6b(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_b73f6b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.spvasm
index b6c79a0..eb26f56 100644
--- a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_b73f6b "textureLoad_b73f6b"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %26 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %31 = OpConstantNull %int
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %35 = OpConstantNull %v4uint
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_b73f6b = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %35
-               OpStore %arg_1 %19
+%textureLoad_b73f6b = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %38
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2uint %arg_1
-         %32 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4uint %30 %31 Lod %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2uint %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpImageFetch %v4uint %33 %34 Lod %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_b73f6b
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_b73f6b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_b73f6b
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_b73f6b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_b73f6b
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_b73f6b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.wgsl
index 5af4ac7..34d5a65 100644
--- a/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/b73f6b.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_b73f6b();
diff --git a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl
index 23f0bbc..11da25e 100644
--- a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.dxc.hlsl
index 74c096e..29490e7 100644
--- a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b75d4a() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.fxc.hlsl
index 74c096e..29490e7 100644
--- a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_b75d4a() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   float4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.glsl
index adef08f..04aff45 100644
--- a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_b75d4a() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_b75d4a() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_b75d4a() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   vec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.msl
index f58711f..eee7773 100644
--- a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_b75d4a(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_b75d4a(texture2d_ms<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_b75d4a(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_b75d4a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_b75d4a(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_b75d4a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_b75d4a(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_b75d4a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.spvasm
index 8c13159..d807772 100644
--- a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_b75d4a "textureLoad_b75d4a"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,54 +43,62 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_b75d4a = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
+%textureLoad_b75d4a = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2int %arg_1
-         %31 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4float %29 %30 Sample %31
-               OpStore %res %28
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2int %arg_1
+         %34 = OpLoad %uint %arg_2
+         %31 = OpImageFetch %v4float %32 %33 Sample %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_b75d4a
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_b75d4a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_b75d4a
+%fragment_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_b75d4a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_b75d4a
+%compute_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_b75d4a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.wgsl
index 6117807..b7e4be5 100644
--- a/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/b75d4a.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_b75d4a();
diff --git a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl
index 4b2c143..4ef1920 100644
--- a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.dxc.hlsl
index 36ab4d3..adc6105 100644
--- a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_bc3201() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(uint2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.fxc.hlsl
index 36ab4d3..adc6105 100644
--- a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_bc3201() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(uint2(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.glsl
index 276c68b..6653ae9 100644
--- a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_bc3201() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_bc3201() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_bc3201() {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, ivec2(uvec2(arg_1, 0u)), int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.msl
index 3f5c7f1..78e4574 100644
--- a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_bc3201(texture1d<uint, access::sample> tint_symbol_1) {
+void textureLoad_bc3201(texture1d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint arg_1 = 1u;
   uint arg_2 = 1u;
   uint4 res = tint_symbol_1.read(uint(arg_1), 0);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureLoad_bc3201(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_bc3201(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_bc3201(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_bc3201(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_bc3201(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_bc3201(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.spvasm
index 393bb93..8071607 100644
--- a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_bc3201 "textureLoad_bc3201"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,49 +45,57 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %20 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %24 = OpConstantNull %uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %29 = OpConstantNull %v4uint
-         %30 = OpTypeFunction %v4float
+         %32 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_bc3201 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_uint Function %20
-      %arg_2 = OpVariable %_ptr_Function_uint Function %20
-        %res = OpVariable %_ptr_Function_v4uint Function %29
+%textureLoad_bc3201 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_uint Function %24
+      %arg_2 = OpVariable %_ptr_Function_uint Function %24
+        %res = OpVariable %_ptr_Function_v4uint Function %32
                OpStore %arg_1 %uint_1
                OpStore %arg_2 %uint_1
-         %24 = OpLoad %11 %arg_0
-         %25 = OpLoad %uint %arg_1
-         %26 = OpLoad %uint %arg_2
-         %22 = OpImageFetch %v4uint %24 %25 Lod %26
-               OpStore %res %22
+         %27 = OpLoad %11 %arg_0
+         %28 = OpLoad %uint %arg_1
+         %29 = OpLoad %uint %arg_2
+         %26 = OpImageFetch %v4uint %27 %28 Lod %29
+               OpStore %res %26
+         %35 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %36 = OpLoad %v4uint %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureLoad_bc3201
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureLoad_bc3201
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %36
+%vertex_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureLoad_bc3201
+%fragment_main = OpFunction %void None %17
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureLoad_bc3201
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureLoad_bc3201
+%compute_main = OpFunction %void None %17
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureLoad_bc3201
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.wgsl
index 0d810d1..0d72961 100644
--- a/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/bc3201.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = 1u;
   var arg_2 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_bc3201();
diff --git a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl
index 3833450..3e950d4 100644
--- a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl
index b196d9f..957e16a 100644
--- a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_bcbb3c() {
   uint3 arg_1 = (1u).xxx;
   int arg_2 = 1;
   float4 res = arg_0.Load(uint4(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl
index b196d9f..957e16a 100644
--- a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_bcbb3c() {
   uint3 arg_1 = (1u).xxx;
   int arg_2 = 1;
   float4 res = arg_0.Load(uint4(arg_1, uint(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.glsl
index 8f1cef3..0ed5d06 100644
--- a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_bcbb3c() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_bcbb3c() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_bcbb3c() {
   uvec3 arg_1 = uvec3(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.msl
index fbd76f6..be5d097 100644
--- a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_bcbb3c(texture3d<float, access::sample> tint_symbol_1) {
+void textureLoad_bcbb3c(texture3d<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint3 arg_1 = uint3(1u);
   int arg_2 = 1;
   float4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureLoad_bcbb3c(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_bcbb3c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_bcbb3c(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_bcbb3c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_bcbb3c(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_bcbb3c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.spvasm
index 562f9f7..1e0f863 100644
--- a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_bcbb3c "textureLoad_bcbb3c"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,54 +43,62 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v3uint = OpTypeVector %uint 3
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+         %22 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
 %_ptr_Function_v3uint = OpTypePointer Function %v3uint
-         %22 = OpConstantNull %v3uint
+         %25 = OpConstantNull %v3uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_bcbb3c = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
+%textureLoad_bcbb3c = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v3uint %arg_1
-         %31 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4float %29 %30 Lod %31
-               OpStore %res %28
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v3uint %arg_1
+         %34 = OpLoad %int %arg_2
+         %31 = OpImageFetch %v4float %32 %33 Lod %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_bcbb3c
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_bcbb3c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_bcbb3c
+%fragment_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_bcbb3c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_bcbb3c
+%compute_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_bcbb3c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.wgsl
index 23be829..74c2c53 100644
--- a/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/bcbb3c.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_bcbb3c();
diff --git a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl
index ed1b9a9..67a6e36 100644
--- a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.dxc.hlsl
index 03e9cf6..969c62a 100644
--- a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c16e00() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = arg_0.Load(int4(int3(arg_1, int(arg_2)), arg_3)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.fxc.hlsl
index 03e9cf6..969c62a 100644
--- a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c16e00() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = arg_0.Load(int4(int3(arg_1, int(arg_2)), arg_3)).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.glsl
index 674994b..038f2bae 100644
--- a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_c16e00() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_c16e00() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_c16e00() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(arg_1, int(arg_2)), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.msl
index 3b8aab4..63af2f6 100644
--- a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_c16e00(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_c16e00(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_c16e00(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_c16e00(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_c16e00(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_c16e00(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_c16e00(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_c16e00(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.spvasm
index a50dacf..da90223 100644
--- a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_c16e00 "textureLoad_c16e00"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,65 +44,73 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
+         %30 = OpConstantNull %uint
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
+         %33 = OpConstantNull %int
       %v3int = OpTypeVector %int 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %44 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %51 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_c16e00 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-      %arg_3 = OpVariable %_ptr_Function_int Function %30
+%textureLoad_c16e00 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %30
+      %arg_3 = OpVariable %_ptr_Function_int Function %33
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %int_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2int %arg_1
-         %36 = OpCompositeExtract %int %35 0
-         %37 = OpCompositeExtract %int %35 1
-         %39 = OpLoad %uint %arg_2
-         %38 = OpBitcast %int %39
-         %40 = OpCompositeConstruct %v3int %36 %37 %38
-         %41 = OpLoad %int %arg_3
-         %32 = OpImageFetch %v4float %33 %40 Lod %41
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2int %arg_1
+         %39 = OpCompositeExtract %int %38 0
+         %40 = OpCompositeExtract %int %38 1
+         %42 = OpLoad %uint %arg_2
+         %41 = OpBitcast %int %42
+         %43 = OpCompositeConstruct %v3int %39 %40 %41
+         %44 = OpLoad %int %arg_3
+         %35 = OpImageFetch %v4float %36 %43 Lod %44
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %49 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %50 = OpLoad %float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %44
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_c16e00
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_c16e00
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %49 = OpLabel
-         %50 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %50
+%vertex_main = OpFunction %void None %15
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureLoad_c16e00
+%fragment_main = OpFunction %void None %15
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureLoad_c16e00
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureLoad_c16e00
+%compute_main = OpFunction %void None %15
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureLoad_c16e00
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.wgsl
index f9aff39..b128f37 100644
--- a/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/c16e00.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_c16e00();
diff --git a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl
index 5c4a300..1151051 100644
--- a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.dxc.hlsl
index 24a7ffa..4fa0322 100644
--- a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c2a480() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int4 res = arg_0.Load(int3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.fxc.hlsl
index 24a7ffa..4fa0322 100644
--- a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c2a480() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int4 res = arg_0.Load(int3(arg_1, arg_2));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.glsl
index 199eecb..5da0369 100644
--- a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_c2a480() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_c2a480() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_c2a480() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.msl
index 3daa6a0..282ddec 100644
--- a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_c2a480(texture2d<int, access::sample> tint_symbol_1) {
+void textureLoad_c2a480(texture2d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureLoad_c2a480(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_c2a480(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_c2a480(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_c2a480(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_c2a480(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_c2a480(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.spvasm
index cb4beee..701874f 100644
--- a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_c2a480 "textureLoad_c2a480"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,53 +44,62 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %23 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %26 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %29 = OpConstantNull %int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %33 = OpConstantNull %v4int
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_c2a480 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %33
-               OpStore %arg_1 %19
+%textureLoad_c2a480 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %36
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v2int %arg_1
-         %30 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4int %28 %29 Lod %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v2int %arg_1
+         %33 = OpLoad %int %arg_2
+         %30 = OpImageFetch %v4int %31 %32 Lod %33
+               OpStore %res %30
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %41 = OpLoad %v4int %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_c2a480
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_c2a480
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_c2a480
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_c2a480
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_c2a480
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_c2a480
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.wgsl
index f7bac9a..dfea65b 100644
--- a/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/c2a480.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_c2a480();
diff --git a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl
index 091e0e5..5e2a8c7 100644
--- a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.dxc.hlsl
index 2df89369..feb898b 100644
--- a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c378ee() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.fxc.hlsl
index 2df89369..feb898b 100644
--- a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_c378ee() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.glsl
index e8e7b4c..b1f1530 100644
--- a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_c378ee() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_c378ee() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_c378ee() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.msl
index a8df92b..23974ec 100644
--- a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_c378ee(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureLoad_c378ee(texture2d_ms<uint, access::read> tint_symbol_1, device uint4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureLoad_c378ee(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_c378ee(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_c378ee(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_c378ee(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_c378ee(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_c378ee(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.spvasm
index 808c4e6..a02bd4c 100644
--- a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_c378ee "textureLoad_c378ee"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,54 +44,62 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %23 = OpConstantNull %v2int
+         %27 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %26 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %30 = OpConstantNull %int
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %34 = OpConstantNull %v4uint
-         %35 = OpTypeFunction %v4float
+         %37 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_c378ee = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %23
-      %arg_2 = OpVariable %_ptr_Function_int Function %26
-        %res = OpVariable %_ptr_Function_v4uint Function %34
-               OpStore %arg_1 %20
+%textureLoad_c378ee = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %27
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
+        %res = OpVariable %_ptr_Function_v4uint Function %37
+               OpStore %arg_1 %24
                OpStore %arg_2 %int_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2int %arg_1
-         %31 = OpLoad %int %arg_2
-         %27 = OpImageFetch %v4uint %29 %30 Sample %31
-               OpStore %res %27
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2int %arg_1
+         %34 = OpLoad %int %arg_2
+         %31 = OpImageFetch %v4uint %32 %33 Sample %34
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %41 = OpLoad %v4uint %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_c378ee
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_c378ee
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_c378ee
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_c378ee
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_c378ee
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_c378ee
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.wgsl
index 33e2b06..4cedf95 100644
--- a/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/c378ee.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_c378ee();
diff --git a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl
index 67b4f75..6b8b7e9 100644
--- a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.dxc.hlsl
index c00b762..2a9c309 100644
--- a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_cad5f2() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.fxc.hlsl
index c00b762..2a9c309 100644
--- a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_cad5f2() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.glsl
index e448cbd..2489764 100644
--- a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_cad5f2() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_cad5f2() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_cad5f2() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.msl
index 732b1a9..e117b22 100644
--- a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_cad5f2(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureLoad_cad5f2(texture2d_ms<uint, access::read> tint_symbol_1, device uint4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureLoad_cad5f2(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_cad5f2(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_cad5f2(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_cad5f2(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_cad5f2(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_cad5f2(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.spvasm
index 43f5fa2..891972c 100644
--- a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_cad5f2 "textureLoad_cad5f2"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %23 = OpConstantNull %v2int
+         %27 = OpConstantNull %v2int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %31 = OpConstantNull %uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %35 = OpConstantNull %v4uint
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_cad5f2 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %35
-               OpStore %arg_1 %20
+%textureLoad_cad5f2 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %38
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2int %arg_1
-         %32 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4uint %30 %31 Sample %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2int %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpImageFetch %v4uint %33 %34 Sample %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_cad5f2
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_cad5f2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_cad5f2
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_cad5f2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_cad5f2
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_cad5f2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.wgsl
index 05c2787..c017d3a 100644
--- a/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/cad5f2.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_cad5f2();
diff --git a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl
index 5aee221..116f3e8 100644
--- a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.dxc.hlsl
index 9ec09f6..6d8e263 100644
--- a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_cb57c2() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.fxc.hlsl
index 9ec09f6..6d8e263 100644
--- a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_cb57c2() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.glsl
index e0f0550..64412e4 100644
--- a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_cb57c2() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_cb57c2() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_cb57c2() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.msl
index c92ea65..4ff9112 100644
--- a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_cb57c2(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_cb57c2(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_cb57c2(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_cb57c2(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_cb57c2(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_cb57c2(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_cb57c2(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_cb57c2(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.spvasm
index 83f4137..2e973b5 100644
--- a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_cb57c2 "textureLoad_cb57c2"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,64 +44,72 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
+         %33 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %43 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_cb57c2 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-      %arg_3 = OpVariable %_ptr_Function_int Function %30
+%textureLoad_cb57c2 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
+      %arg_3 = OpVariable %_ptr_Function_int Function %33
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %int_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2uint %arg_1
-         %36 = OpCompositeExtract %uint %35 0
-         %37 = OpCompositeExtract %uint %35 1
-         %38 = OpLoad %uint %arg_2
-         %39 = OpCompositeConstruct %v3uint %36 %37 %38
-         %40 = OpLoad %int %arg_3
-         %32 = OpImageFetch %v4float %33 %39 Lod %40
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2uint %arg_1
+         %39 = OpCompositeExtract %uint %38 0
+         %40 = OpCompositeExtract %uint %38 1
+         %41 = OpLoad %uint %arg_2
+         %42 = OpCompositeConstruct %v3uint %39 %40 %41
+         %43 = OpLoad %int %arg_3
+         %35 = OpImageFetch %v4float %36 %42 Lod %43
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %48 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %49 = OpLoad %float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_cb57c2
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_cb57c2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %15
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_cb57c2
+%fragment_main = OpFunction %void None %15
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_cb57c2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureLoad_cb57c2
+%compute_main = OpFunction %void None %15
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureLoad_cb57c2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.wgsl
index 8c9f2ac..f3b6335 100644
--- a/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/cb57c2.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_cb57c2();
diff --git a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl
index f53b198..6ac8fde 100644
--- a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.dxc.hlsl
index 9e661e2..9b20d3a 100644
--- a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_e35f72() {
   int3 arg_1 = (1).xxx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(int4(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.fxc.hlsl
index 9e661e2..9b20d3a 100644
--- a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_e35f72() {
   int3 arg_1 = (1).xxx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(int4(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.glsl
index 3a88a78..6b302d4 100644
--- a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e35f72() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e35f72() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler3D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e35f72() {
   ivec3 arg_1 = ivec3(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.msl
index 978bd25..c10b0bc 100644
--- a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_e35f72(texture3d<int, access::sample> tint_symbol_1) {
+void textureLoad_e35f72(texture3d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int3 arg_1 = int3(1);
   uint arg_2 = 1u;
   int4 res = tint_symbol_1.read(uint3(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureLoad_e35f72(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_e35f72(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_e35f72(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_e35f72(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_e35f72(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_e35f72(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.spvasm
index e6502f1..f8f0dad 100644
--- a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_e35f72 "textureLoad_e35f72"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %23 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v3int = OpTypePointer Function %v3int
-         %22 = OpConstantNull %v3int
+         %26 = OpConstantNull %v3int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %31 = OpConstantNull %uint
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %35 = OpConstantNull %v4int
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_e35f72 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v3int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %35
-               OpStore %arg_1 %19
+%textureLoad_e35f72 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v3int Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %38
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v3int %arg_1
-         %32 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4int %30 %31 Lod %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v3int %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpImageFetch %v4int %33 %34 Lod %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %42 = OpLoad %v4int %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_e35f72
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_e35f72
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_e35f72
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_e35f72
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_e35f72
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_e35f72
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.wgsl
index b1df17e..6e95b14 100644
--- a/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/e35f72.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec3<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_e35f72();
diff --git a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl
index 8f380a4..61e428e 100644
--- a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.dxc.hlsl
index 0037606..1b4f681 100644
--- a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_e3d2cc() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.fxc.hlsl
index 0037606..1b4f681 100644
--- a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_e3d2cc() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   int4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.glsl
index 584ca2a..15487fd 100644
--- a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e3d2cc() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e3d2cc() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_e3d2cc() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.msl
index 9842b61..d443de5 100644
--- a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_e3d2cc(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureLoad_e3d2cc(texture2d_ms<int, access::read> tint_symbol_1, device int4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureLoad_e3d2cc(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_e3d2cc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_e3d2cc(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_e3d2cc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_e3d2cc(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_e3d2cc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.spvasm
index 8366280..31150ac 100644
--- a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_e3d2cc "textureLoad_e3d2cc"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,53 +44,62 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %23 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %26 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
-      %v4int = OpTypeVector %int 4
+         %29 = OpConstantNull %int
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %33 = OpConstantNull %v4int
-         %34 = OpTypeFunction %v4float
+         %36 = OpConstantNull %v4int
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_e3d2cc = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-        %res = OpVariable %_ptr_Function_v4int Function %33
-               OpStore %arg_1 %19
+%textureLoad_e3d2cc = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %29
+        %res = OpVariable %_ptr_Function_v4int Function %36
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
-         %28 = OpLoad %11 %arg_0
-         %29 = OpLoad %v2int %arg_1
-         %30 = OpLoad %int %arg_2
-         %26 = OpImageFetch %v4int %28 %29 Sample %30
-               OpStore %res %26
+         %31 = OpLoad %11 %arg_0
+         %32 = OpLoad %v2int %arg_1
+         %33 = OpLoad %int %arg_2
+         %30 = OpImageFetch %v4int %31 %32 Sample %33
+               OpStore %res %30
+         %40 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %41 = OpLoad %v4int %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_e3d2cc
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_e3d2cc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %17
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_e3d2cc
+%fragment_main = OpFunction %void None %17
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_e3d2cc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_e3d2cc
+%compute_main = OpFunction %void None %17
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_e3d2cc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.wgsl
index 27686e7..66845cb 100644
--- a/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/e3d2cc.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1i;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_e3d2cc();
diff --git a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl
index 0a4c3ba..aa1ce12 100644
--- a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.dxc.hlsl
index 03e13c8..a27d496 100644
--- a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_ebfb92() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(int3(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.fxc.hlsl
index 03e13c8..a27d496 100644
--- a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_ebfb92() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   uint4 res = arg_0.Load(int3(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.glsl
index 3530385..e57c3df 100644
--- a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_ebfb92() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_ebfb92() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_ebfb92() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   uvec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.msl
index e527ee2..efc8cca 100644
--- a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_ebfb92(texture2d<uint, access::sample> tint_symbol_1) {
+void textureLoad_ebfb92(texture2d<uint, access::sample> tint_symbol_1, device uint4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureLoad_ebfb92(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_ebfb92(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_ebfb92(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_ebfb92(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_ebfb92(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_ebfb92(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.spvasm
index 0329ceb..1a80691 100644
--- a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_ebfb92 "textureLoad_ebfb92"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %20 = OpConstantComposite %v2int %int_1 %int_1
+         %24 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %23 = OpConstantNull %v2int
+         %27 = OpConstantNull %v2int
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-     %v4uint = OpTypeVector %uint 4
+         %31 = OpConstantNull %uint
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %35 = OpConstantNull %v4uint
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_ebfb92 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %23
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %35
-               OpStore %arg_1 %20
+%textureLoad_ebfb92 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %27
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %38
+               OpStore %arg_1 %24
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2int %arg_1
-         %32 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4uint %30 %31 Lod %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2int %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpImageFetch %v4uint %33 %34 Lod %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_ebfb92
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_ebfb92
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_ebfb92
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_ebfb92
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_ebfb92
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_ebfb92
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.wgsl
index ba94b17..82f1fc6 100644
--- a/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/ebfb92.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_ebfb92();
diff --git a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl
index 32c32e7..bab587c 100644
--- a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.dxc.hlsl
index 5ba462d..5865841 100644
--- a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f0abad() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   float4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.fxc.hlsl
index 5ba462d..5865841 100644
--- a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f0abad() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   float4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.glsl
index 2925070..350427ce 100644
--- a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f0abad() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f0abad() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f0abad() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   vec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.msl
index 2e191f4..f025272 100644
--- a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_f0abad(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_f0abad(texture2d_ms<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_f0abad(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_f0abad(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_f0abad(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_f0abad(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_f0abad(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_f0abad(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.spvasm
index 1ef6220..ab19845 100644
--- a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 55
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_f0abad "textureLoad_f0abad"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,54 +43,62 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %34 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %41 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_f0abad = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
+%textureLoad_f0abad = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %29 = OpLoad %11 %arg_0
-         %30 = OpLoad %v2uint %arg_1
-         %31 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4float %29 %30 Sample %31
-               OpStore %res %28
+         %32 = OpLoad %11 %arg_0
+         %33 = OpLoad %v2uint %arg_1
+         %34 = OpLoad %int %arg_2
+         %31 = OpImageFetch %v4float %32 %33 Sample %34
+               OpStore %res %31
+         %39 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %40 = OpLoad %v4float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %34
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureLoad_f0abad
+%vertex_main_inner = OpFunction %v4float None %41
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureLoad_f0abad
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %39 = OpLabel
-         %40 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %40
+%vertex_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %47
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureLoad_f0abad
+%fragment_main = OpFunction %void None %15
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureLoad_f0abad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureLoad_f0abad
+%compute_main = OpFunction %void None %15
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureLoad_f0abad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.wgsl
index 208aa2d..66f8537 100644
--- a/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/f0abad.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_f0abad();
diff --git a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl
index 80914aa..f3899bc 100644
--- a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.dxc.hlsl
index 9a460dd..bff1ce2 100644
--- a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f348d9() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   float4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.fxc.hlsl
index 9a460dd..bff1ce2 100644
--- a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f348d9() {
   uint2 arg_1 = (1u).xx;
   uint arg_2 = 1u;
   int arg_3 = 1;
   float4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.glsl
index 0cc57a5..6367ba0 100644
--- a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f348d9() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f348d9() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureLoad_f348d9() {
   uvec2 arg_1 = uvec2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   vec4 res = texelFetch(arg_0_1, ivec3(uvec3(arg_1, arg_2)), arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.msl
index 9ea26fd..3ac0056 100644
--- a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_f348d9(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_f348d9(texture2d_array<float, access::sample> tint_symbol_1, device float4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   uint arg_2 = 1u;
   int arg_3 = 1;
   float4 res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_f348d9(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device float4* const tint_symbol_4) {
+  textureLoad_f348d9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_f348d9(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_f348d9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_f348d9(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_f348d9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.spvasm
index 7fa0aec..3392a13 100644
--- a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 63
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_f348d9 "textureLoad_f348d9"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,63 +44,71 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
+         %28 = OpConstantNull %uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %30 = OpConstantNull %int
+         %33 = OpConstantNull %int
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %42 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %49 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_f348d9 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %25
-      %arg_3 = OpVariable %_ptr_Function_int Function %30
+%textureLoad_f348d9 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_uint Function %28
+      %arg_3 = OpVariable %_ptr_Function_int Function %33
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %uint_1
                OpStore %arg_3 %int_1
-         %32 = OpLoad %11 %arg_0
-         %34 = OpLoad %v2uint %arg_1
-         %35 = OpCompositeExtract %uint %34 0
-         %36 = OpCompositeExtract %uint %34 1
-         %37 = OpLoad %uint %arg_2
-         %38 = OpCompositeConstruct %v3uint %35 %36 %37
-         %39 = OpLoad %int %arg_3
-         %31 = OpImageFetch %v4float %32 %38 Lod %39
-               OpStore %res %31
+         %35 = OpLoad %11 %arg_0
+         %37 = OpLoad %v2uint %arg_1
+         %38 = OpCompositeExtract %uint %37 0
+         %39 = OpCompositeExtract %uint %37 1
+         %40 = OpLoad %uint %arg_2
+         %41 = OpCompositeConstruct %v3uint %38 %39 %40
+         %42 = OpLoad %int %arg_3
+         %34 = OpImageFetch %v4float %35 %41 Lod %42
+               OpStore %res %34
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %48 = OpLoad %v4float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %42
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_f348d9
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_f348d9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %48
+%vertex_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureLoad_f348d9
+%fragment_main = OpFunction %void None %15
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureLoad_f348d9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureLoad_f348d9
+%compute_main = OpFunction %void None %15
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureLoad_f348d9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.wgsl
index 4ed1b7e..32c47fe 100644
--- a/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/f348d9.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1u;
   var arg_3 = 1i;
   var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_f348d9();
diff --git a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl
index 8e623c2..e8d54a6 100644
--- a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res: vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.dxc.hlsl
index 98bcff1..c6e8dfc 100644
--- a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f85291() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(int3(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.fxc.hlsl
index 98bcff1..c6e8dfc 100644
--- a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_f85291() {
   int2 arg_1 = (1).xx;
   uint arg_2 = 1u;
   int4 res = arg_0.Load(int3(arg_1, int(arg_2)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.glsl
index 34c2e1c..5bca90c 100644
--- a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_f85291() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_f85291() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp isampler2D arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  ivec4 inner;
+} prevent_dce;
+
 void textureLoad_f85291() {
   ivec2 arg_1 = ivec2(1);
   uint arg_2 = 1u;
   ivec4 res = texelFetch(arg_0_1, arg_1, int(arg_2));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.msl
index 8bf531b..3d787bb 100644
--- a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_f85291(texture2d<int, access::sample> tint_symbol_1) {
+void textureLoad_f85291(texture2d<int, access::sample> tint_symbol_1, device int4* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   uint arg_2 = 1u;
   int4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureLoad_f85291(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device int4* const tint_symbol_4) {
+  textureLoad_f85291(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device int4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_f85291(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device int4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_f85291(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_f85291(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device int4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_f85291(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.spvasm
index 29c7abd..aee6ac7 100644
--- a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_f85291 "textureLoad_f85291"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+      %v4int = OpTypeVector %int 4
+%prevent_dce_block = OpTypeStruct %v4int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %23 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %26 = OpConstantNull %v2int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %27 = OpConstantNull %uint
-      %v4int = OpTypeVector %int 4
+         %31 = OpConstantNull %uint
 %_ptr_Function_v4int = OpTypePointer Function %v4int
-         %35 = OpConstantNull %v4int
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_f85291 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_uint Function %27
-        %res = OpVariable %_ptr_Function_v4int Function %35
-               OpStore %arg_1 %19
+%textureLoad_f85291 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %26
+      %arg_2 = OpVariable %_ptr_Function_uint Function %31
+        %res = OpVariable %_ptr_Function_v4int Function %38
+               OpStore %arg_1 %23
                OpStore %arg_2 %uint_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2int %arg_1
-         %32 = OpLoad %uint %arg_2
-         %28 = OpImageFetch %v4int %30 %31 Lod %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2int %arg_1
+         %35 = OpLoad %uint %arg_2
+         %32 = OpImageFetch %v4int %33 %34 Lod %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4int %prevent_dce %uint_0
+         %42 = OpLoad %v4int %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_f85291
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_f85291
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_f85291
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_f85291
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_f85291
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_f85291
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.wgsl
index b5ea7cb..26ec422 100644
--- a/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/f85291.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<i32>(1i);
   var arg_2 = 1u;
   var res : vec4<i32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<i32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_f85291();
diff --git a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl
index c0ae5e9..4b1638e 100644
--- a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.dxc.hlsl
index 307416e..28bc36c 100644
--- a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_fcd23d() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   float res = arg_0.Load(uint3(arg_1, uint(0)), arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.fxc.hlsl
index 307416e..28bc36c 100644
--- a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_fcd23d() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   float res = arg_0.Load(uint3(arg_1, uint(0)), arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.glsl
index 7810099..a62a880 100644
--- a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_fcd23d() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, ivec2(arg_1), arg_2).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_fcd23d() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, ivec2(arg_1), arg_2).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp sampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_fcd23d() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   float res = texelFetch(arg_0_1, ivec2(arg_1), arg_2).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.msl
index e962910..69b35f0 100644
--- a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_fcd23d(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureLoad_fcd23d(depth2d_ms<float, access::read> tint_symbol_1, device float* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureLoad_fcd23d(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_fcd23d(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_fcd23d(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_fcd23d(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_fcd23d(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_fcd23d(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.spvasm
index 5819297..ffd4a6f 100644
--- a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_fcd23d "textureLoad_fcd23d"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,55 +43,63 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %22 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %25 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %42 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_fcd23d = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
+%textureLoad_fcd23d = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %30
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2uint %arg_1
-         %32 = OpLoad %int %arg_2
-         %29 = OpImageFetch %v4float %30 %31 Sample %32
-         %28 = OpCompositeExtract %float %29 0
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2uint %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpImageFetch %v4float %33 %34 Sample %35
+         %31 = OpCompositeExtract %float %32 0
+               OpStore %res %31
+         %40 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %41 = OpLoad %float %res
+               OpStore %40 %41
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %35
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureLoad_fcd23d
+%vertex_main_inner = OpFunction %v4float None %42
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureLoad_fcd23d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %40 = OpLabel
-         %41 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %41
+%vertex_main = OpFunction %void None %15
+         %47 = OpLabel
+         %48 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %48
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureLoad_fcd23d
+%fragment_main = OpFunction %void None %15
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureLoad_fcd23d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureLoad_fcd23d
+%compute_main = OpFunction %void None %15
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureLoad_fcd23d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.wgsl
index 15aea5d..fc6f371 100644
--- a/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/fcd23d.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_fcd23d();
diff --git a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl
index 3d1718e..940c74f 100644
--- a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl
@@ -27,7 +27,9 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res: vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.dxc.hlsl
index 4adfd92..69deed3 100644
--- a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_fe0565() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.fxc.hlsl
index 4adfd92..69deed3 100644
--- a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_fe0565() {
   uint2 arg_1 = (1u).xx;
   int arg_2 = 1;
   uint4 res = arg_0.Load(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.glsl
index dce2e13..4889f39 100644
--- a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.glsl
@@ -1,10 +1,15 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_fe0565() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -24,10 +29,15 @@
 precision mediump float;
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_fe0565() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -41,10 +51,15 @@
 #version 310 es
 
 uniform highp usampler2DMS arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uvec4 inner;
+} prevent_dce;
+
 void textureLoad_fe0565() {
   uvec2 arg_1 = uvec2(1u);
   int arg_2 = 1;
   uvec4 res = texelFetch(arg_0_1, ivec2(arg_1), arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.msl
index 34cbab3..b9760f1 100644
--- a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_fe0565(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureLoad_fe0565(texture2d_ms<uint, access::read> tint_symbol_1, device uint4* const tint_symbol_2) {
   uint2 arg_1 = uint2(1u);
   int arg_2 = 1;
   uint4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureLoad_fe0565(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint4* const tint_symbol_4) {
+  textureLoad_fe0565(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint4* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_fe0565(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint4* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_fe0565(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_fe0565(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint4* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_fe0565(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.spvasm
index 79c4e99..4489aac 100644
--- a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_fe0565 "textureLoad_fe0565"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,55 +44,63 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+     %v4uint = OpTypeVector %uint 4
+%prevent_dce_block = OpTypeStruct %v4uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %17 = OpTypeFunction %void
      %v2uint = OpTypeVector %uint 2
      %uint_1 = OpConstant %uint 1
-         %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %23 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-         %22 = OpConstantNull %v2uint
+         %26 = OpConstantNull %v2uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %27 = OpConstantNull %int
-     %v4uint = OpTypeVector %uint 4
+         %31 = OpConstantNull %int
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %35 = OpConstantNull %v4uint
-         %36 = OpTypeFunction %v4float
+         %38 = OpConstantNull %v4uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint
+         %43 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_fe0565 = OpFunction %void None %13
-         %16 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %27
-        %res = OpVariable %_ptr_Function_v4uint Function %35
-               OpStore %arg_1 %19
+%textureLoad_fe0565 = OpFunction %void None %17
+         %20 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2uint Function %26
+      %arg_2 = OpVariable %_ptr_Function_int Function %31
+        %res = OpVariable %_ptr_Function_v4uint Function %38
+               OpStore %arg_1 %23
                OpStore %arg_2 %int_1
-         %30 = OpLoad %11 %arg_0
-         %31 = OpLoad %v2uint %arg_1
-         %32 = OpLoad %int %arg_2
-         %28 = OpImageFetch %v4uint %30 %31 Sample %32
-               OpStore %res %28
+         %33 = OpLoad %11 %arg_0
+         %34 = OpLoad %v2uint %arg_1
+         %35 = OpLoad %int %arg_2
+         %32 = OpImageFetch %v4uint %33 %34 Sample %35
+               OpStore %res %32
+         %41 = OpAccessChain %_ptr_StorageBuffer_v4uint %prevent_dce %uint_0
+         %42 = OpLoad %v4uint %res
+               OpStore %41 %42
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureLoad_fe0565
+%vertex_main_inner = OpFunction %v4float None %43
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureLoad_fe0565
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %17
+         %48 = OpLabel
+         %49 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %49
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_fe0565
+%fragment_main = OpFunction %void None %17
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_fe0565
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureLoad_fe0565
+%compute_main = OpFunction %void None %17
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureLoad_fe0565
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.wgsl
index 4b1098a..9afb3d6 100644
--- a/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/fe0565.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
   var arg_1 = vec2<u32>(1u);
   var arg_2 = 1i;
   var res : vec4<u32> = textureLoad(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<u32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_fe0565();
diff --git a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl
index 2fa7a82..2dfc8bb 100644
--- a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res: f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.dxc.hlsl
index 437984d..e1b3b5e 100644
--- a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_ff1119() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = arg_0.Load(int4(int3(arg_1, arg_2), int(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.fxc.hlsl
index 437984d..e1b3b5e 100644
--- a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureLoad_ff1119() {
   int2 arg_1 = (1).xx;
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = arg_0.Load(int4(int3(arg_1, arg_2), int(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.glsl
index 04f4330..2987f1b 100644
--- a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.glsl
@@ -1,11 +1,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_ff1119() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -25,11 +30,16 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_ff1119() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -43,11 +53,16 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureLoad_ff1119() {
   ivec2 arg_1 = ivec2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = texelFetch(arg_0_1, ivec3(arg_1, arg_2), int(arg_3)).x;
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.msl
index e2c1dec..6060dd4 100644
--- a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureLoad_ff1119(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureLoad_ff1119(depth2d_array<float, access::sample> tint_symbol_1, device float* const tint_symbol_2) {
   int2 arg_1 = int2(1);
   int arg_2 = 1;
   uint arg_3 = 1u;
   float res = tint_symbol_1.read(uint2(arg_1), arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureLoad_ff1119(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device float* const tint_symbol_4) {
+  textureLoad_ff1119(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device float* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureLoad_ff1119(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device float* tint_symbol_8 [[buffer(0)]]) {
+  textureLoad_ff1119(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureLoad_ff1119(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device float* tint_symbol_10 [[buffer(0)]]) {
+  textureLoad_ff1119(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.spvasm
index 5dfa3c0..774a66f 100644
--- a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 57
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -13,6 +13,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureLoad_ff1119 "textureLoad_ff1119"
                OpName %arg_1 "arg_1"
                OpName %arg_2 "arg_2"
@@ -26,6 +29,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,64 +44,72 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %12 = OpTypeFunction %void
+         %15 = OpTypeFunction %void
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %19 = OpConstantComposite %v2int %int_1 %int_1
+         %22 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v2int = OpTypePointer Function %v2int
-         %22 = OpConstantNull %v2int
+         %25 = OpConstantNull %v2int
 %_ptr_Function_int = OpTypePointer Function %int
-         %25 = OpConstantNull %int
+         %28 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %30 = OpConstantNull %uint
+         %33 = OpConstantNull %uint
       %v3int = OpTypeVector %int 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %43 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureLoad_ff1119 = OpFunction %void None %12
-         %15 = OpLabel
-      %arg_1 = OpVariable %_ptr_Function_v2int Function %22
-      %arg_2 = OpVariable %_ptr_Function_int Function %25
-      %arg_3 = OpVariable %_ptr_Function_uint Function %30
+%textureLoad_ff1119 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+      %arg_2 = OpVariable %_ptr_Function_int Function %28
+      %arg_3 = OpVariable %_ptr_Function_uint Function %33
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_1 %19
+               OpStore %arg_1 %22
                OpStore %arg_2 %int_1
                OpStore %arg_3 %uint_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpLoad %v2int %arg_1
-         %36 = OpCompositeExtract %int %35 0
-         %37 = OpCompositeExtract %int %35 1
-         %38 = OpLoad %int %arg_2
-         %39 = OpCompositeConstruct %v3int %36 %37 %38
-         %40 = OpLoad %uint %arg_3
-         %32 = OpImageFetch %v4float %33 %39 Lod %40
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %36 = OpLoad %11 %arg_0
+         %38 = OpLoad %v2int %arg_1
+         %39 = OpCompositeExtract %int %38 0
+         %40 = OpCompositeExtract %int %38 1
+         %41 = OpLoad %int %arg_2
+         %42 = OpCompositeConstruct %v3int %39 %40 %41
+         %43 = OpLoad %uint %arg_3
+         %35 = OpImageFetch %v4float %36 %42 Lod %43
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %48 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %49 = OpLoad %float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureLoad_ff1119
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureLoad_ff1119
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %15
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureLoad_ff1119
+%fragment_main = OpFunction %void None %15
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureLoad_ff1119
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureLoad_ff1119
+%compute_main = OpFunction %void None %15
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureLoad_ff1119
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.wgsl
index 57916d8..4f711f3 100644
--- a/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureLoad/ff1119.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
   var arg_2 = 1i;
   var arg_3 = 1u;
   var res : f32 = textureLoad(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureLoad_ff1119();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl
index ddc52ad..faccc8a 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba16uint, write>) -> u32
 fn textureNumLayers_014a3b() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
index 470f2ac..2e51013 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_014a3b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
index 470f2ac..2e51013 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_014a3b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.glsl
index c1c9781..001d1ff 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_014a3b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_014a3b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_014a3b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.msl
index 4a03eda..3d95ab2 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_014a3b(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_014a3b(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_014a3b(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_014a3b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_014a3b(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_014a3b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_014a3b(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_014a3b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.spvasm
index 2acde0b..5ae6c69 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_014a3b "textureNumLayers_014a3b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_014a3b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_014a3b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_014a3b
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_014a3b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_014a3b
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_014a3b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_014a3b
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_014a3b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.wgsl
index 9c87b00..77ff4ca 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_014a3b() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_014a3b();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl
index 4ffee75..a600f9d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rg32uint, write>) -> u32
 fn textureNumLayers_071ebc() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
index 11a36cc..21687b3 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_071ebc() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
index 11a36cc..21687b3 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_071ebc() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.msl
index f9657e8..321ef94 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_071ebc(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_071ebc(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_071ebc(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_071ebc(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_071ebc(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_071ebc(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_071ebc(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_071ebc(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.spvasm
index 7a70e26..3f2b516 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_071ebc "textureNumLayers_071ebc"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,41 +45,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_071ebc = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_071ebc = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_071ebc
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_071ebc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_071ebc
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_071ebc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_071ebc
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_071ebc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.wgsl
index 61626de..8db525a 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_071ebc() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_071ebc();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl
index bba0167..f3ba91e 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_2d_array<f32>) -> u32
 fn textureNumLayers_0ec222() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
index 8ff2543..d4585bf 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_0ec222() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
index 8ff2543..d4585bf 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_0ec222() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.glsl
index 37ecbb1..e67a1c0 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_0ec222() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_0ec222() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_0ec222() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.msl
index 63e8634..618d019 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_0ec222(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureNumLayers_0ec222(texture2d_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureNumLayers_0ec222(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_0ec222(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_0ec222(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_0ec222(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_0ec222(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_0ec222(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.spvasm
index b6d7c2b..6650da1 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_0ec222 "textureNumLayers_0ec222"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_0ec222 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %25
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySizeLod %v3uint %20 %int_0
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_0ec222 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %28
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %23 %int_0
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureNumLayers_0ec222
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureNumLayers_0ec222
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLayers_0ec222
+%fragment_main = OpFunction %void None %16
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLayers_0ec222
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureNumLayers_0ec222
+%compute_main = OpFunction %void None %16
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureNumLayers_0ec222
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.wgsl
index 3f18e09..3a05299 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_0ec222() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_0ec222();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl
index d42261f..37991e6 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<bgra8unorm, write>) -> u32
 fn textureNumLayers_1f858a() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.dxc.hlsl
index d8f7810..4c51864 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_1f858a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.fxc.hlsl
index d8f7810..4c51864 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_1f858a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.glsl
index 0eff466..690008d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_1f858a() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_1f858a() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_1f858a() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.msl
index 688f54e..bea281a 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_1f858a(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_1f858a(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_1f858a(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_1f858a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_1f858a(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_1f858a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_1f858a(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_1f858a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.spvasm
index 9eab744..fe5e70c 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_1f858a "textureNumLayers_1f858a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_1f858a = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_1f858a = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_1f858a
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_1f858a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_1f858a
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_1f858a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_1f858a
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_1f858a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.wgsl
index d08138f..ce2df9f 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/1f858a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_1f858a() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_1f858a();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl
index 376f70d..b8b9391 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<r32float, write>) -> u32
 fn textureNumLayers_3465ec() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
index b8ba0b2..b966ed6 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_3465ec() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
index b8ba0b2..b966ed6 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_3465ec() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.glsl
index 0e7b8e8..0ef28f0 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_3465ec() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_3465ec() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_3465ec() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.msl
index 356deb4..2137269 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_3465ec(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_3465ec(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_3465ec(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_3465ec(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_3465ec(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_3465ec(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_3465ec(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_3465ec(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.spvasm
index fae4592..9e87f31 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_3465ec "textureNumLayers_3465ec"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 R32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_3465ec = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_3465ec = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_3465ec
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_3465ec
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_3465ec
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_3465ec
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_3465ec
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_3465ec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.wgsl
index 409c7e8..cb2757a 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_3465ec() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_3465ec();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl
index 881a6d3..cc14dda 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rg32sint, write>) -> u32
 fn textureNumLayers_3580ab() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
index 8ff6e3c..d47a7c6 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_3580ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
index 8ff6e3c..d47a7c6 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_3580ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.msl
index e6235c5..aaf3c1e 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_3580ab(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_3580ab(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_3580ab(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_3580ab(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_3580ab(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_3580ab(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_3580ab(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_3580ab(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.spvasm
index 2e0c867..b9ba8f7 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_3580ab "textureNumLayers_3580ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -38,42 +45,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_3580ab = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_3580ab = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_3580ab
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_3580ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_3580ab
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_3580ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_3580ab
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_3580ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.wgsl
index 6434d12..510aee0 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_3580ab() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_3580ab();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl
index 5b17e29..1aaeb53 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba8snorm, write>) -> u32
 fn textureNumLayers_4c4333() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
index f4f07a9..f68a984 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_4c4333() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
index f4f07a9..f68a984 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_4c4333() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.glsl
index 0fef0c7..1d5c395 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_4c4333() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_4c4333() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_4c4333() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.msl
index e7e878d..b4f9955 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_4c4333(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_4c4333(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_4c4333(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_4c4333(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_4c4333(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_4c4333(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_4c4333(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_4c4333(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.spvasm
index 942e442..bd24b3f 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_4c4333 "textureNumLayers_4c4333"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_4c4333 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_4c4333 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_4c4333
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_4c4333
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_4c4333
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_4c4333
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_4c4333
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_4c4333
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.wgsl
index 3217266..6b180b5 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_4c4333() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_4c4333();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl
index 6d37cbd..d673fe1 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<r32sint, write>) -> u32
 fn textureNumLayers_59eb57() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
index 6ac9329..350ae83 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_59eb57() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
index 6ac9329..350ae83 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_59eb57() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.glsl
index 5d27d74..af22f02 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_59eb57() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_59eb57() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_59eb57() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.msl
index bc42953..eb3c75b 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_59eb57(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_59eb57(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_59eb57(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_59eb57(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_59eb57(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_59eb57(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_59eb57(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_59eb57(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.spvasm
index 8fdfad3..85c6b71 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_59eb57 "textureNumLayers_59eb57"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 R32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_59eb57 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_59eb57 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_59eb57
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_59eb57
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_59eb57
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_59eb57
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_59eb57
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_59eb57
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.wgsl
index eb6df73..0131332 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_59eb57() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_59eb57();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl
index ef61c18..283194a 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba8uint, write>) -> u32
 fn textureNumLayers_61bd23() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
index 89f3e18..9a565a2 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_61bd23() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
index 89f3e18..9a565a2 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_61bd23() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.glsl
index c709957..b661842 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_61bd23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_61bd23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_61bd23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.msl
index cee795a..0b15875 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_61bd23(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_61bd23(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_61bd23(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_61bd23(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_61bd23(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_61bd23(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_61bd23(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_61bd23(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.spvasm
index ca56085..2cc1fbf 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_61bd23 "textureNumLayers_61bd23"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_61bd23 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_61bd23 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_61bd23
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_61bd23
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_61bd23
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_61bd23
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_61bd23
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_61bd23
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.wgsl
index 9a53a59..9b69b1b 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_61bd23() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_61bd23();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl
index a5ece22..ac6eb30 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_2d_array<i32>) -> u32
 fn textureNumLayers_77be7b() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
index baad1e8..283dc9c 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_77be7b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
index baad1e8..283dc9c 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_77be7b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.glsl
index 6af1d4b..f5f87b3 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_77be7b() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_77be7b() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp isampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_77be7b() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.msl
index bb749fd..7494a26 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_77be7b(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureNumLayers_77be7b(texture2d_array<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureNumLayers_77be7b(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_77be7b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_77be7b(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_77be7b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_77be7b(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_77be7b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.spvasm
index c5d95de..36ec10d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_77be7b "textureNumLayers_77be7b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_77be7b = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %25
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySizeLod %v3uint %21 %int_0
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_77be7b = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %28
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySizeLod %v3uint %24 %int_0
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureNumLayers_77be7b
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureNumLayers_77be7b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %17
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLayers_77be7b
+%fragment_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLayers_77be7b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureNumLayers_77be7b
+%compute_main = OpFunction %void None %17
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureNumLayers_77be7b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.wgsl
index e61657d..73c9c8b 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_77be7b() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_77be7b();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl
index 9184fe8..94229f8 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rg32float, write>) -> u32
 fn textureNumLayers_7f28cf() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
index ffe3a19..7429e92 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_7f28cf() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
index ffe3a19..7429e92 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_7f28cf() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.msl
index dfa6427..fe936f0 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_7f28cf(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_7f28cf(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_7f28cf(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_7f28cf(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_7f28cf(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_7f28cf(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_7f28cf(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_7f28cf(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.spvasm
index fae74c5..43de7fa 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability StorageImageExtendedFormats
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_7f28cf "textureNumLayers_7f28cf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -26,6 +29,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_7f28cf = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_7f28cf = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_7f28cf
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_7f28cf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_7f28cf
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_7f28cf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_7f28cf
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_7f28cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.wgsl
index 9315c01..0f1e810 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_7f28cf() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_7f28cf();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl
index 95d81a8..bf3ea7b 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba8sint, write>) -> u32
 fn textureNumLayers_878dea() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
index 60c70b1..2ea7b75 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_878dea() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
index 60c70b1..2ea7b75 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_878dea() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.glsl
index e29de3e..f2f8fe7 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_878dea() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_878dea() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_878dea() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.msl
index 7b10509..408d585 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_878dea(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_878dea(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_878dea(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_878dea(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_878dea(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_878dea(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_878dea(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_878dea(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.spvasm
index 8426d4a..8c4e6d8 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_878dea "textureNumLayers_878dea"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_878dea = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_878dea = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_878dea
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_878dea
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_878dea
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_878dea
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_878dea
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_878dea
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.wgsl
index c164c88..a60c4c7 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_878dea() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_878dea();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl
index 4939ab3..e855d67 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<r32uint, write>) -> u32
 fn textureNumLayers_87faad() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
index 04ccdcf..b3c201d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_87faad() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
index 04ccdcf..b3c201d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_87faad() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.glsl
index 00057ca..a635720 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_87faad() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_87faad() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_87faad() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.msl
index acf16b3..ac13e7f 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_87faad(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_87faad(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_87faad(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_87faad(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_87faad(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_87faad(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_87faad(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_87faad(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.spvasm
index 4a12d33..265840d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_87faad "textureNumLayers_87faad"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_87faad = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_87faad = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_87faad
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_87faad
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_87faad
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_87faad
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_87faad
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_87faad
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.wgsl
index fcd265c..dc82212 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_87faad() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_87faad();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl
index b3f969b..3c2e0d3 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_2d_array<u32>) -> u32
 fn textureNumLayers_8ac32a() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
index 92e4a10..a0b679a 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8ac32a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
index 92e4a10..a0b679a 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8ac32a() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.glsl
index 083cd13..8b87e5c 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8ac32a() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8ac32a() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp usampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8ac32a() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.msl
index 218af14..998366f 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_8ac32a(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureNumLayers_8ac32a(texture2d_array<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureNumLayers_8ac32a(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_8ac32a(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_8ac32a(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_8ac32a(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_8ac32a(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_8ac32a(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.spvasm
index febad27..e5e7227 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_8ac32a "textureNumLayers_8ac32a"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,43 +43,51 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_8ac32a = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %25
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySizeLod %v3uint %20 %int_0
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_8ac32a = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %28
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %23 %int_0
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureNumLayers_8ac32a
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureNumLayers_8ac32a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLayers_8ac32a
+%fragment_main = OpFunction %void None %16
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLayers_8ac32a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureNumLayers_8ac32a
+%compute_main = OpFunction %void None %16
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureNumLayers_8ac32a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.wgsl
index 65a1ae2..6b4be19 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_8ac32a() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_8ac32a();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl
index 95138eb..c4cba51 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba32sint, write>) -> u32
 fn textureNumLayers_8bd987() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
index dcf3497..d83e727 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8bd987() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
index dcf3497..d83e727 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8bd987() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.glsl
index 9c3f6ec..3c84a10 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8bd987() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8bd987() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8bd987() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.msl
index 004cbbb..9374ece 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_8bd987(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_8bd987(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_8bd987(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_8bd987(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_8bd987(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_8bd987(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_8bd987(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_8bd987(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.spvasm
index bebc91d..9247067 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_8bd987 "textureNumLayers_8bd987"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_8bd987 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_8bd987 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_8bd987
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_8bd987
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_8bd987
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_8bd987
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_8bd987
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_8bd987
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.wgsl
index 7183fb6..971c7ff 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_8bd987() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_8bd987();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl
index 3f42b29..c0a4577 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba8unorm, write>) -> u32
 fn textureNumLayers_8dbf23() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
index 4f752ed..cbff36e 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8dbf23() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
index 4f752ed..cbff36e 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_8dbf23() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.glsl
index 9015e24..c00260a 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8dbf23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8dbf23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_8dbf23() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.msl
index 8643e42..cc0c8ad 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_8dbf23(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_8dbf23(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_8dbf23(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_8dbf23(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_8dbf23(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_8dbf23(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_8dbf23(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_8dbf23(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.spvasm
index 9c3631f..debc253 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_8dbf23 "textureNumLayers_8dbf23"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_8dbf23 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_8dbf23 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_8dbf23
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_8dbf23
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_8dbf23
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_8dbf23
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_8dbf23
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_8dbf23
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.wgsl
index a64feba..f056108 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_8dbf23() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_8dbf23();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl
index d7a18ea..fb2759c 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba32uint, write>) -> u32
 fn textureNumLayers_9695c6() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
index 6ff2f32..48d7d57 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_9695c6() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
index 6ff2f32..48d7d57 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_9695c6() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.glsl
index f8c145d..95cdd1f 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_9695c6() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_9695c6() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_9695c6() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.msl
index 827321c..bacd5a0 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_9695c6(texture2d_array<uint, access::write> tint_symbol_1) {
+void textureNumLayers_9695c6(texture2d_array<uint, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
-  textureNumLayers_9695c6(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_9695c6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_9695c6(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_9695c6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_9695c6(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_9695c6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.spvasm
index 4d2ffb8..0f626d0 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_9695c6 "textureNumLayers_9695c6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,41 +44,49 @@
          %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_9695c6 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %17 = OpCompositeExtract %uint %18 2
-               OpStore %res %17
+%textureNumLayers_9695c6 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_9695c6
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_9695c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_9695c6
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_9695c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_9695c6
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_9695c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.wgsl
index 117a723..dca6cd9 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_9695c6() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_9695c6();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl
index b455e68..de6656d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba16float, write>) -> u32
 fn textureNumLayers_98a9cf() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
index 572767c..c13f3aa 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_98a9cf() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
index 572767c..c13f3aa 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_98a9cf() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.glsl
index b8ccb95..0b00cc7 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_98a9cf() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_98a9cf() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_98a9cf() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.msl
index b8c1954..be7b506 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_98a9cf(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_98a9cf(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_98a9cf(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_98a9cf(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_98a9cf(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_98a9cf(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_98a9cf(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_98a9cf(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.spvasm
index 1908b56..33e1af2 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_98a9cf "textureNumLayers_98a9cf"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_98a9cf = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_98a9cf = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_98a9cf
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_98a9cf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_98a9cf
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_98a9cf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_98a9cf
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_98a9cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.wgsl
index aa0b1f9..53de27c 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_98a9cf() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_98a9cf();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl
index 9c1cbc6..937c6ec 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_depth_2d_array) -> u32
 fn textureNumLayers_a9d3f5() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
index fca4556..d14e5ea 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_a9d3f5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
index fca4556..d14e5ea 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_a9d3f5() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.glsl
index 9e5f8bc..4705af1 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_a9d3f5() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_a9d3f5() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 uniform highp sampler2DArray arg_0_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_a9d3f5() {
   uint res = uint(textureSize(arg_0_1, 0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.msl
index 74a0acb..6467491 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_a9d3f5(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureNumLayers_a9d3f5(depth2d_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureNumLayers_a9d3f5(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_a9d3f5(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_a9d3f5(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_a9d3f5(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_a9d3f5(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_a9d3f5(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.spvasm
index 7d3120e..54a597e 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_a9d3f5 "textureNumLayers_a9d3f5"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,44 +42,52 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %25 = OpConstantNull %uint
-         %26 = OpTypeFunction %v4float
+         %28 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_a9d3f5 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %25
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySizeLod %v3uint %20 %int_0
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_a9d3f5 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %28
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySizeLod %v3uint %23 %int_0
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %32 = OpLoad %uint %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %textureNumLayers_a9d3f5
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureNumLayers_a9d3f5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %32
+%vertex_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLayers_a9d3f5
+%fragment_main = OpFunction %void None %16
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLayers_a9d3f5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureNumLayers_a9d3f5
+%compute_main = OpFunction %void None %16
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureNumLayers_a9d3f5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.wgsl
index 83afd90..61062bc 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_a9d3f5() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_a9d3f5();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl
index 979ac02..49cc0a2 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba32float, write>) -> u32
 fn textureNumLayers_d75a0b() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
index f358a3d..22a44ee 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_d75a0b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
index f358a3d..22a44ee 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_d75a0b() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.glsl
index 597783b..e54aa63 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_d75a0b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_d75a0b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_d75a0b() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.msl
index dfc443c..55b2bb6 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_d75a0b(texture2d_array<float, access::write> tint_symbol_1) {
+void textureNumLayers_d75a0b(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
-  textureNumLayers_d75a0b(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_d75a0b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_d75a0b(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_d75a0b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_d75a0b(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_d75a0b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.spvasm
index 7a3a47f..814a33e 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_d75a0b "textureNumLayers_d75a0b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,42 +43,50 @@
          %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %23 = OpConstantNull %uint
-         %24 = OpTypeFunction %v4float
+         %26 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_d75a0b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %23
-         %20 = OpLoad %11 %arg_0
-         %18 = OpImageQuerySize %v3uint %20
-         %16 = OpCompositeExtract %uint %18 2
-               OpStore %res %16
+%textureNumLayers_d75a0b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %26
+         %23 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySize %v3uint %23
+         %20 = OpCompositeExtract %uint %21 2
+               OpStore %res %20
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %30 = OpLoad %uint %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %textureNumLayers_d75a0b
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %textureNumLayers_d75a0b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %16
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureNumLayers_d75a0b
+%fragment_main = OpFunction %void None %16
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %textureNumLayers_d75a0b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %textureNumLayers_d75a0b
+%compute_main = OpFunction %void None %16
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %textureNumLayers_d75a0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.wgsl
index c5e7e0e..c1c703e 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_d75a0b() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_d75a0b();
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl
index 647b9db..1409f7e 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLayers(texture: texture_storage_2d_array<rgba16sint, write>) -> u32
 fn textureNumLayers_de8087() {
   var res: u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
index 4502c30..515081d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_de8087() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
index 4502c30..515081d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 RWTexture2DArray<int4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLayers_de8087() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.glsl
index 6fb197a..6f34c77 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_de8087() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -22,8 +27,13 @@
 precision mediump float;
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_de8087() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -37,8 +47,13 @@
 #version 310 es
 
 layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void textureNumLayers_de8087() {
   uint res = uint(imageSize(arg_0).z);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.msl
index cd677f5..8d65220 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLayers_de8087(texture2d_array<int, access::write> tint_symbol_1) {
+void textureNumLayers_de8087(texture2d_array<int, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_array_size();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
-  textureNumLayers_de8087(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLayers_de8087(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
-  textureNumLayers_de8087(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLayers_de8087(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
-  textureNumLayers_de8087(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLayers_de8087(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.spvasm
index 3065daf..11e2199 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLayers_de8087 "textureNumLayers_de8087"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %arg_0 NonReadable
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,42 +44,50 @@
          %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
      %v3uint = OpTypeVector %uint 3
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %24 = OpConstantNull %uint
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLayers_de8087 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %24
-         %21 = OpLoad %11 %arg_0
-         %19 = OpImageQuerySize %v3uint %21
-         %17 = OpCompositeExtract %uint %19 2
-               OpStore %res %17
+%textureNumLayers_de8087 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %27
+         %24 = OpLoad %11 %arg_0
+         %22 = OpImageQuerySize %v3uint %24
+         %21 = OpCompositeExtract %uint %22 2
+               OpStore %res %21
+         %30 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %31 = OpLoad %uint %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureNumLayers_de8087
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %textureNumLayers_de8087
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %17
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLayers_de8087
+%fragment_main = OpFunction %void None %17
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLayers_de8087
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureNumLayers_de8087
+%compute_main = OpFunction %void None %17
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %textureNumLayers_de8087
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.wgsl
index fdab8ff..73909d0 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLayers_de8087() {
   var res : u32 = textureNumLayers(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLayers_de8087();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl
index 6068edc..e8abd88 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d_array<u32>) -> u32
 fn textureNumLevels_181090() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.dxc.hlsl
index fa19226..13c1604 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_181090() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.fxc.hlsl
index fa19226..13c1604 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_181090() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.msl
index b685d58..33df0c9 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_181090(texture2d_array<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_181090(texture2d_array<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_181090(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_181090(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_181090(tint_symbol_4);
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_181090(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_181090(tint_symbol_5);
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_181090(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.spvasm
index b2fba9b..fa48fdb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_181090 "textureNumLevels_181090"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_181090 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_181090 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_181090
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_181090
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_181090
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_181090
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_181090
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_181090
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.wgsl
index cca5c8c..94b3345 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_181090() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_181090();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl
index 4aaac8f..dcf7a42 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d<i32>) -> u32
 fn textureNumLevels_1a3fa9() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
index b613075..0c746e4 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_1a3fa9() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
index b613075..0c746e4 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_1a3fa9() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.msl
index a5903ae..19c3fef 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_1a3fa9(texture2d<int, access::sample> tint_symbol_1) {
+void textureNumLevels_1a3fa9(texture2d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
-  textureNumLevels_1a3fa9(tint_symbol_2);
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_1a3fa9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_1a3fa9(tint_symbol_4);
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_1a3fa9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_1a3fa9(tint_symbol_5);
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_1a3fa9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.spvasm
index 21e699e..04245ab 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_1a3fa9 "textureNumLevels_1a3fa9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_1a3fa9 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_1a3fa9 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_1a3fa9
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_1a3fa9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_1a3fa9
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_1a3fa9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_1a3fa9
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_1a3fa9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.wgsl
index f5ad42c..e3b56e3 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_1a3fa9() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_1a3fa9();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl
index f08517f..db3b6c3 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_1d<u32>) -> u32
 fn textureNumLevels_1a7fc3() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
index 72945be..6e53b9d 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_1a7fc3() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
index 72945be..6e53b9d 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_1a7fc3() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.msl
index 7acfb61..aba7503 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_1a7fc3(texture1d<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_1a7fc3(texture1d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_1a7fc3(tint_symbol_2);
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_1a7fc3(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_1a7fc3(tint_symbol_4);
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_1a7fc3(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_1a7fc3(tint_symbol_5);
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_1a7fc3(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.spvasm
index 0a2fd38..60e1576 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_1a7fc3 "textureNumLevels_1a7fc3"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,39 +44,47 @@
          %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_1a7fc3 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_1a7fc3 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_1a7fc3
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_1a7fc3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_1a7fc3
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_1a7fc3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_1a7fc3
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_1a7fc3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.wgsl
index d092a9f..d83c8b0 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_1a7fc3() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_1a7fc3();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl
index 6086ab5..3f33b52 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube<i32>) -> u32
 fn textureNumLevels_2267d8() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
index 0ada818..c3235ba 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2267d8() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
index 0ada818..c3235ba 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2267d8() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.msl
index 082aa8c..c0636d3 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_2267d8(texturecube<int, access::sample> tint_symbol_1) {
+void textureNumLevels_2267d8(texturecube<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
-  textureNumLevels_2267d8(tint_symbol_2);
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_2267d8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_2267d8(tint_symbol_4);
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_2267d8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_2267d8(tint_symbol_5);
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_2267d8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.spvasm
index 0f18866..fc4282a 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_2267d8 "textureNumLevels_2267d8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_2267d8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_2267d8 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_2267d8
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_2267d8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_2267d8
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_2267d8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_2267d8
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_2267d8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.wgsl
index 5714150..2861a38 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_2267d8() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_2267d8();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl
index 1a638e9..a70494c 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d<f32>) -> u32
 fn textureNumLevels_24b2c6() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
index 47607cf..3fd1c1f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_24b2c6() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
index 47607cf..3fd1c1f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_24b2c6() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.msl
index a532f60..37896d6 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_24b2c6(texture2d<float, access::sample> tint_symbol_1) {
+void textureNumLevels_24b2c6(texture2d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
-  textureNumLevels_24b2c6(tint_symbol_2);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_24b2c6(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_24b2c6(tint_symbol_4);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_24b2c6(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_24b2c6(tint_symbol_5);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_24b2c6(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.spvasm
index 5e5b33c..7c2e9fd 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_24b2c6 "textureNumLevels_24b2c6"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_24b2c6 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_24b2c6 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_24b2c6
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_24b2c6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_24b2c6
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_24b2c6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_24b2c6
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_24b2c6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.wgsl
index 9ffcb78..e30e79c 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_24b2c6() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_24b2c6();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl
index 07b2473..cc2d4e7 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_depth_cube_array) -> u32
 fn textureNumLevels_2bea6c() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
index 62d1125..6b5dac1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2bea6c() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
index 62d1125..6b5dac1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2bea6c() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.msl
index 480e5f0..831fd1f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_2bea6c(depthcube_array<float, access::sample> tint_symbol_1) {
+void textureNumLevels_2bea6c(depthcube_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
-  textureNumLevels_2bea6c(tint_symbol_2);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_2bea6c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_2bea6c(tint_symbol_4);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_2bea6c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_2bea6c(tint_symbol_5);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_2bea6c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.spvasm
index e4cf270..43795a2 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_2bea6c "textureNumLevels_2bea6c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_2bea6c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_2bea6c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_2bea6c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_2bea6c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_2bea6c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_2bea6c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_2bea6c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_2bea6c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.wgsl
index b37c0d6..35e51e4 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_2bea6c() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_2bea6c();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl
index ddc2d13..5e54260 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube<f32>) -> u32
 fn textureNumLevels_2df1ab() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
index 10020ec..75ff97e 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2df1ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
index 10020ec..75ff97e 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_2df1ab() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.msl
index ecf68db..c55e206 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_2df1ab(texturecube<float, access::sample> tint_symbol_1) {
+void textureNumLevels_2df1ab(texturecube<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
-  textureNumLevels_2df1ab(tint_symbol_2);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_2df1ab(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_2df1ab(tint_symbol_4);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_2df1ab(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_2df1ab(tint_symbol_5);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_2df1ab(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.spvasm
index edaef1a..e3f70bd 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_2df1ab "textureNumLevels_2df1ab"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_2df1ab = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_2df1ab = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_2df1ab
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_2df1ab
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_2df1ab
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_2df1ab
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_2df1ab
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_2df1ab
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.wgsl
index 769cb30..b47a278 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_2df1ab() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_2df1ab();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl
index 9da74a3..c529153 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d_array<f32>) -> u32
 fn textureNumLevels_46dbd8() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
index 496e96a..a6639f1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_46dbd8() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
index 496e96a..a6639f1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_46dbd8() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.msl
index e8b2b34..bde3392 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_46dbd8(texture2d_array<float, access::sample> tint_symbol_1) {
+void textureNumLevels_46dbd8(texture2d_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
-  textureNumLevels_46dbd8(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_46dbd8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_46dbd8(tint_symbol_4);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_46dbd8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_46dbd8(tint_symbol_5);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_46dbd8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.spvasm
index ddaa69f..cf9771c 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_46dbd8 "textureNumLevels_46dbd8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_46dbd8 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_46dbd8 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_46dbd8
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_46dbd8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_46dbd8
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_46dbd8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_46dbd8
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_46dbd8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.wgsl
index c2e380d..7d90369 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_46dbd8() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_46dbd8();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl
index 3de5217..ed64701 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_3d<u32>) -> u32
 fn textureNumLevels_60d9b8() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
index 354f39f..ea35f1f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_60d9b8() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
index 354f39f..ea35f1f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_60d9b8() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.msl
index 663fb4b..42ca5c9 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_60d9b8(texture3d<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_60d9b8(texture3d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_60d9b8(tint_symbol_2);
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_60d9b8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_60d9b8(tint_symbol_4);
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_60d9b8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_60d9b8(tint_symbol_5);
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_60d9b8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.spvasm
index 3aed187..e06a448 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_60d9b8 "textureNumLevels_60d9b8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_60d9b8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_60d9b8 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_60d9b8
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_60d9b8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_60d9b8
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_60d9b8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_60d9b8
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_60d9b8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.wgsl
index 70615e2..0d5a4b0 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_60d9b8() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_60d9b8();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl
index 178aec9..45d1837 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube_array<i32>) -> u32
 fn textureNumLevels_903920() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.dxc.hlsl
index c70af53..3751631 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_903920() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.fxc.hlsl
index c70af53..3751631 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_903920() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.msl
index 883fee7..0f008d8 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_903920(texturecube_array<int, access::sample> tint_symbol_1) {
+void textureNumLevels_903920(texturecube_array<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
-  textureNumLevels_903920(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_903920(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_903920(tint_symbol_4);
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_903920(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_903920(tint_symbol_5);
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_903920(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.spvasm
index ac2e7d7..351701d 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_903920 "textureNumLevels_903920"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_903920 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_903920 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_903920
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_903920
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_903920
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_903920
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_903920
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_903920
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.wgsl
index b924f23..4c2a5fb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_903920() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_903920();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl
index 410ef17..8ac3e10 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_3d<i32>) -> u32
 fn textureNumLevels_9a1a65() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
index 9c9b0cd..a002c04 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_9a1a65() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
index 9c9b0cd..a002c04 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_9a1a65() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.msl
index 548d2fa..c5351b3 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_9a1a65(texture3d<int, access::sample> tint_symbol_1) {
+void textureNumLevels_9a1a65(texture3d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
-  textureNumLevels_9a1a65(tint_symbol_2);
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_9a1a65(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_9a1a65(tint_symbol_4);
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_9a1a65(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_9a1a65(tint_symbol_5);
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_9a1a65(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.spvasm
index c308aff..8bfc603 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_9a1a65 "textureNumLevels_9a1a65"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_9a1a65 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_9a1a65 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_9a1a65
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_9a1a65
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_9a1a65
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_9a1a65
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_9a1a65
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_9a1a65
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.wgsl
index e6d5452..dc27971 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_9a1a65() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_9a1a65();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl
index 19188f3..b0973fc 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d_array<i32>) -> u32
 fn textureNumLevels_adc783() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
index 2ec43ed..f9a0a2b 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_adc783() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
index 2ec43ed..f9a0a2b 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_adc783() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.msl
index 47f6910..1292e4b 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_adc783(texture2d_array<int, access::sample> tint_symbol_1) {
+void textureNumLevels_adc783(texture2d_array<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
-  textureNumLevels_adc783(tint_symbol_2);
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_adc783(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_adc783(tint_symbol_4);
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_adc783(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_adc783(tint_symbol_5);
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_adc783(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.spvasm
index 30e6a8c..95cf403 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_adc783 "textureNumLevels_adc783"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_adc783 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_adc783 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_adc783
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_adc783
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_adc783
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_adc783
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_adc783
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_adc783
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.wgsl
index b9595bf..c122a94 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_adc783() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_adc783();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl
index f279f4d..73cdfe7 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_depth_2d_array) -> u32
 fn textureNumLevels_ae911c() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
index f17da78..37f639b 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_ae911c() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
index f17da78..37f639b 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DArray arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_ae911c() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.msl
index 24d1b4a..e55f5cb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_ae911c(depth2d_array<float, access::sample> tint_symbol_1) {
+void textureNumLevels_ae911c(depth2d_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
-  textureNumLevels_ae911c(tint_symbol_2);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_ae911c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_ae911c(tint_symbol_4);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_ae911c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_ae911c(tint_symbol_5);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_ae911c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.spvasm
index c50b3b7..4f2923e 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_ae911c "textureNumLevels_ae911c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_ae911c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_ae911c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_ae911c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_ae911c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_ae911c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_ae911c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_ae911c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_ae911c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.wgsl
index de4db0c..4083303 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_ae911c() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_ae911c();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl
index c2befb8..7936a26 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube<u32>) -> u32
 fn textureNumLevels_c386c8() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
index 09ec1bf..ef724e1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c386c8() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
index 09ec1bf..ef724e1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c386c8() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.msl
index 0aa6d50..d9e55a1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_c386c8(texturecube<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_c386c8(texturecube<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_c386c8(tint_symbol_2);
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_c386c8(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_c386c8(tint_symbol_4);
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_c386c8(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_c386c8(tint_symbol_5);
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_c386c8(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.spvasm
index ae0b33e..0b5f2e6 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_c386c8 "textureNumLevels_c386c8"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_c386c8 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_c386c8 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_c386c8
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_c386c8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_c386c8
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_c386c8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_c386c8
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_c386c8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.wgsl
index a5df507..c8ac8b8 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_c386c8() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_c386c8();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl
index 81e95be..b2507d0 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_1d<f32>) -> u32
 fn textureNumLevels_c399f9() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
index b0e7a2c..d4ce86c 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c399f9() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
index b0e7a2c..d4ce86c 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c399f9() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.msl
index 1b81eda..bd1eca7 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_c399f9(texture1d<float, access::sample> tint_symbol_1) {
+void textureNumLevels_c399f9(texture1d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
-  textureNumLevels_c399f9(tint_symbol_2);
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_c399f9(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_c399f9(tint_symbol_4);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_c399f9(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_c399f9(tint_symbol_5);
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_c399f9(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.spvasm
index ad86c06..8ae2e20 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_c399f9 "textureNumLevels_c399f9"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_c399f9 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_c399f9 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_c399f9
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_c399f9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_c399f9
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_c399f9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_c399f9
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_c399f9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.wgsl
index b3bd844..03e6ecf 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_c399f9() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_c399f9();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl
index 814ecdf..f96f248 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_depth_cube) -> u32
 fn textureNumLevels_c8c25c() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
index 82cd2ba..6743680 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c8c25c() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
index 82cd2ba..6743680 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_c8c25c() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.msl
index 3373867..fccf754 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_c8c25c(depthcube<float, access::sample> tint_symbol_1) {
+void textureNumLevels_c8c25c(depthcube<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
-  textureNumLevels_c8c25c(tint_symbol_2);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_c8c25c(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_c8c25c(tint_symbol_4);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_c8c25c(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_c8c25c(tint_symbol_5);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_c8c25c(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.spvasm
index 302f9ab..e70c311 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_c8c25c "textureNumLevels_c8c25c"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_c8c25c = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_c8c25c = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_c8c25c
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_c8c25c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_c8c25c
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_c8c25c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_c8c25c
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_c8c25c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.wgsl
index e04b76d..c1deb0a 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_c8c25c() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_c8c25c();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl
index dac0818..dade7bf 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_depth_2d) -> u32
 fn textureNumLevels_d63126() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
index 3ff9634..60c007f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_d63126() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
index 3ff9634..60c007f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_d63126() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.msl
index dbfdf59..37ae504 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_d63126(depth2d<float, access::sample> tint_symbol_1) {
+void textureNumLevels_d63126(depth2d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
-  textureNumLevels_d63126(tint_symbol_2);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_d63126(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_d63126(tint_symbol_4);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_d63126(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_d63126(tint_symbol_5);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_d63126(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.spvasm
index 897b81c..3524297 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_d63126 "textureNumLevels_d63126"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_d63126 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_d63126 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_d63126
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_d63126
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_d63126
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_d63126
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_d63126
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_d63126
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.wgsl
index 29d43d5..ed09b6a 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_d63126() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_d63126();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl
index fc67fd5..905433e 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube_array<f32>) -> u32
 fn textureNumLevels_d8f73b() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
index 168d30f..11cdebb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_d8f73b() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
index 168d30f..11cdebb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_d8f73b() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.msl
index 235bcec..305aef1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_d8f73b(texturecube_array<float, access::sample> tint_symbol_1) {
+void textureNumLevels_d8f73b(texturecube_array<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
-  textureNumLevels_d8f73b(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_d8f73b(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_d8f73b(tint_symbol_4);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_d8f73b(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_d8f73b(tint_symbol_5);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_d8f73b(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.spvasm
index aac36d9..190eb81 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_d8f73b "textureNumLevels_d8f73b"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_d8f73b = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_d8f73b = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_d8f73b
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_d8f73b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_d8f73b
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_d8f73b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_d8f73b
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_d8f73b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.wgsl
index 3aa9f91..88e34f0 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_d8f73b() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_d8f73b();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl
index 3904443..3b5c638 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_3d<f32>) -> u32
 fn textureNumLevels_ef7944() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
index 4b71eed..98c63e3 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_ef7944() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
index 4b71eed..98c63e3 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_ef7944() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.msl
index e63ad5f..25fcf3b 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_ef7944(texture3d<float, access::sample> tint_symbol_1) {
+void textureNumLevels_ef7944(texture3d<float, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
-  textureNumLevels_ef7944(tint_symbol_2);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_ef7944(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_ef7944(tint_symbol_4);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_ef7944(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_ef7944(tint_symbol_5);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_ef7944(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.spvasm
index b1b27b3..b48d9fb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_ef7944 "textureNumLevels_ef7944"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_ef7944 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQueryLevels %uint %18
-               OpStore %res %16
+%textureNumLevels_ef7944 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_ef7944
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_ef7944
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_ef7944
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_ef7944
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_ef7944
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_ef7944
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.wgsl
index cdf4c05..4c8b8ee 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_ef7944() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_ef7944();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl
index 3304810..b539f8f 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_2d<u32>) -> u32
 fn textureNumLevels_efd6df() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
index d053690..966eba3 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_efd6df() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
index d053690..966eba3 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_efd6df() {
   int3 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.msl
index d0e4baf..f4bbbef 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_efd6df(texture2d<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_efd6df(texture2d<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_efd6df(tint_symbol_2);
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_efd6df(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_efd6df(tint_symbol_4);
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_efd6df(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_efd6df(tint_symbol_5);
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_efd6df(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.spvasm
index 818380b..dfd2ee5 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_efd6df "textureNumLevels_efd6df"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_efd6df = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_efd6df = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_efd6df
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_efd6df
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_efd6df
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_efd6df
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_efd6df
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_efd6df
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.wgsl
index 2f962e4..c490e1d 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_efd6df() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_efd6df();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl
index 8dbf86d..f99ab50 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_1d<i32>) -> u32
 fn textureNumLevels_f742c0() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
index e909b27..b9333cb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_f742c0() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
index e909b27..b9333cb 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_f742c0() {
   int2 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
   uint res = tint_tmp.y;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.msl
index e4bd743..2336b43 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_f742c0(texture1d<int, access::sample> tint_symbol_1) {
+void textureNumLevels_f742c0(texture1d<int, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
-  textureNumLevels_f742c0(tint_symbol_2);
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_f742c0(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_f742c0(tint_symbol_4);
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_f742c0(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_f742c0(tint_symbol_5);
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_f742c0(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.spvasm
index 2cbb0e7..941bfc4 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_f742c0 "textureNumLevels_f742c0"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,40 +44,48 @@
          %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_f742c0 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %19
-               OpStore %res %17
+%textureNumLevels_f742c0 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQueryLevels %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumLevels_f742c0
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumLevels_f742c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumLevels_f742c0
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumLevels_f742c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumLevels_f742c0
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumLevels_f742c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.wgsl
index 37f7f4c..0bdb1e0 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_f742c0() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_f742c0();
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl
index 2a5c129..9d8e930 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumLevels(texture: texture_cube_array<u32>) -> u32
 fn textureNumLevels_fe2171() {
   var res: u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
index 622e968..30809fa 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_fe2171() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
index 622e968..30809fa 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCubeArray<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumLevels_fe2171() {
   int4 tint_tmp;
   arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
   uint res = tint_tmp.w;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.msl
index a8221bf..02dc2ad 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumLevels_fe2171(texturecube_array<uint, access::sample> tint_symbol_1) {
+void textureNumLevels_fe2171(texturecube_array<uint, access::sample> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_mip_levels();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
-  textureNumLevels_fe2171(tint_symbol_2);
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumLevels_fe2171(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
-  textureNumLevels_fe2171(tint_symbol_4);
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumLevels_fe2171(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
-  textureNumLevels_fe2171(tint_symbol_5);
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumLevels_fe2171(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.spvasm
index 1382ffe..eaafde1 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumLevels_fe2171 "textureNumLevels_fe2171"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -25,6 +28,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -37,39 +44,47 @@
          %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumLevels_fe2171 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQueryLevels %uint %18
-               OpStore %res %17
+%textureNumLevels_fe2171 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQueryLevels %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumLevels_fe2171
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumLevels_fe2171
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumLevels_fe2171
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumLevels_fe2171
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumLevels_fe2171
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumLevels_fe2171
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.wgsl
index 8a0ab54..85b2ab7 100644
--- a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumLevels_fe2171() {
   var res : u32 = textureNumLevels(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumLevels_fe2171();
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl
index 47d2f3d..4c96b67 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumSamples(texture: texture_multisampled_2d<u32>) -> u32
 fn textureNumSamples_50f399() {
   var res: u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
index bfe4d22..3238202 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_50f399() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
index bfe4d22..3238202 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<uint4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_50f399() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.msl
index 4de37b0..478120f 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumSamples_50f399(texture2d_ms<uint, access::read> tint_symbol_1) {
+void textureNumSamples_50f399(texture2d_ms<uint, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_samples();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
-  textureNumSamples_50f399(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumSamples_50f399(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureNumSamples_50f399(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumSamples_50f399(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureNumSamples_50f399(tint_symbol_5);
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumSamples_50f399(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.spvasm
index 57be983..3058e52 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumSamples_50f399 "textureNumSamples_50f399"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,39 +43,47 @@
          %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %13 = OpTypeFunction %void
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumSamples_50f399 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySamples %uint %18
-               OpStore %res %17
+%textureNumSamples_50f399 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySamples %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumSamples_50f399
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumSamples_50f399
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumSamples_50f399
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumSamples_50f399
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumSamples_50f399
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumSamples_50f399
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.wgsl
index a2d6199..f03e792 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumSamples_50f399() {
   var res : u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumSamples_50f399();
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl
index dbae081..0194a29 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumSamples(texture: texture_multisampled_2d<i32>) -> u32
 fn textureNumSamples_c1a777() {
   var res: u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
index 4998404..480fde4 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_c1a777() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
index 4998404..480fde4 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<int4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_c1a777() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.msl
index a8cdede..023ee06 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumSamples_c1a777(texture2d_ms<int, access::read> tint_symbol_1) {
+void textureNumSamples_c1a777(texture2d_ms<int, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_samples();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
-  textureNumSamples_c1a777(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumSamples_c1a777(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureNumSamples_c1a777(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumSamples_c1a777(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureNumSamples_c1a777(tint_symbol_5);
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumSamples_c1a777(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.spvasm
index cb9cc2a..e41c69d 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumSamples_c1a777 "textureNumSamples_c1a777"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -36,40 +43,48 @@
          %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %17 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-         %23 = OpTypeFunction %v4float
+         %25 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumSamples_c1a777 = OpFunction %void None %13
-         %16 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %22
-         %19 = OpLoad %11 %arg_0
-         %17 = OpImageQuerySamples %uint %19
-               OpStore %res %17
+%textureNumSamples_c1a777 = OpFunction %void None %17
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %25
+         %22 = OpLoad %11 %arg_0
+         %21 = OpImageQuerySamples %uint %22
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %29 = OpLoad %uint %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %textureNumSamples_c1a777
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %textureNumSamples_c1a777
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %13
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %17
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %13
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %textureNumSamples_c1a777
+%fragment_main = OpFunction %void None %17
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %textureNumSamples_c1a777
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %13
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %textureNumSamples_c1a777
+%compute_main = OpFunction %void None %17
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureNumSamples_c1a777
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.wgsl
index 564ccf5..3f8f245 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumSamples_c1a777() {
   var res : u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumSamples_c1a777();
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl
index 5c9fcbb..22c7d5a 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumSamples(texture: texture_multisampled_2d<f32>) -> u32
 fn textureNumSamples_dbb799() {
   var res: u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
index 1878090..99e1f67 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_dbb799() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
index 1878090..99e1f67 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_dbb799() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.msl
index 2d6f774..a078949 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumSamples_dbb799(texture2d_ms<float, access::read> tint_symbol_1) {
+void textureNumSamples_dbb799(texture2d_ms<float, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_samples();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
-  textureNumSamples_dbb799(tint_symbol_2);
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumSamples_dbb799(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureNumSamples_dbb799(tint_symbol_4);
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumSamples_dbb799(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureNumSamples_dbb799(tint_symbol_5);
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumSamples_dbb799(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.spvasm
index b48af47..966775b 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumSamples_dbb799 "textureNumSamples_dbb799"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumSamples_dbb799 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySamples %uint %18
-               OpStore %res %16
+%textureNumSamples_dbb799 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySamples %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumSamples_dbb799
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumSamples_dbb799
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumSamples_dbb799
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumSamples_dbb799
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumSamples_dbb799
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumSamples_dbb799
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.wgsl
index 79ad99b..3709e3d 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumSamples_dbb799() {
   var res : u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumSamples_dbb799();
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl
index 9389a95..7e415b4 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl
@@ -25,7 +25,9 @@
 // fn textureNumSamples(texture: texture_depth_multisampled_2d) -> u32
 fn textureNumSamples_ecd321() {
   var res: u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
index 9015e45..658aa82 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_ecd321() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
index 9015e45..658aa82 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2DMS<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureNumSamples_ecd321() {
   int3 tint_tmp;
   arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
   uint res = tint_tmp.z;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.msl
index 95ee5b4..f9a55fb 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.msl
@@ -1,33 +1,34 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureNumSamples_ecd321(depth2d_ms<float, access::read> tint_symbol_1) {
+void textureNumSamples_ecd321(depth2d_ms<float, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
   uint res = tint_symbol_1.get_num_samples();
+  *(tint_symbol_2) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
-  textureNumSamples_ecd321(tint_symbol_2);
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+  textureNumSamples_ecd321(tint_symbol_3, tint_symbol_4);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_3);
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
-  textureNumSamples_ecd321(tint_symbol_4);
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+  textureNumSamples_ecd321(tint_symbol_7, tint_symbol_8);
   return;
 }
 
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
-  textureNumSamples_ecd321(tint_symbol_5);
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+  textureNumSamples_ecd321(tint_symbol_9, tint_symbol_10);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.spvasm
index 41ea05b..a818da2 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
@@ -14,6 +14,9 @@
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureNumSamples_ecd321 "textureNumSamples_ecd321"
                OpName %res "res"
                OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
                OpDecorate %vertex_point_size BuiltIn PointSize
                OpDecorate %arg_0 DescriptorSet 1
                OpDecorate %arg_0 Binding 0
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -35,40 +42,48 @@
          %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
 %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
       %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
-       %void = OpTypeVoid
-         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %16 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %v4float
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%textureNumSamples_ecd321 = OpFunction %void None %12
-         %15 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpLoad %11 %arg_0
-         %16 = OpImageQuerySamples %uint %18
-               OpStore %res %16
+%textureNumSamples_ecd321 = OpFunction %void None %16
+         %19 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpLoad %11 %arg_0
+         %20 = OpImageQuerySamples %uint %21
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %textureNumSamples_ecd321
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %textureNumSamples_ecd321
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %12
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %16
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %12
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %textureNumSamples_ecd321
+%fragment_main = OpFunction %void None %16
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureNumSamples_ecd321
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %12
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureNumSamples_ecd321
+%compute_main = OpFunction %void None %16
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureNumSamples_ecd321
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.wgsl
index 881972a..03ec0cb 100644
--- a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn textureNumSamples_ecd321() {
   var res : u32 = textureNumSamples(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureNumSamples_ecd321();
diff --git a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl
index e880138..0f242e5 100644
--- a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   const arg_3 = vec2<i32>(1i);
   var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.dxc.hlsl
index f2b5b24..ed492df 100644
--- a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.dxc.hlsl
@@ -1,12 +1,29 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_0dff6c() {
   float2 arg_2 = (1.0f).xx;
   float res = arg_0.Sample(arg_1, arg_2, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_0dff6c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.fxc.hlsl
index f2b5b24..ce25e7d 100644
--- a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_0dff6c() {
   float2 arg_2 = (1.0f).xx;
   float res = arg_0.Sample(arg_1, arg_2, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.glsl
index 93f2ef0..2aa5648 100644
--- a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_0dff6c() {
   vec2 arg_2 = vec2(1.0f);
   float res = textureOffset(arg_0_arg_1, vec3(arg_2, 0.0f), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.msl
index 1d077b7..093fd7f 100644
--- a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_0dff6c(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_0dff6c(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   float res = tint_symbol.sample(tint_symbol_1, arg_2, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_0dff6c(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_0dff6c(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.spvasm
index 199b9ca..f4d186a 100644
--- a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_0dff6c "textureSample_0dff6c"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,37 +31,46 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
     %v4float = OpTypeVector %float 4
-         %23 = OpTypeSampledImage %3
+         %26 = OpTypeSampledImage %3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %29 = OpConstantComposite %v2int %int_1 %int_1
+         %32 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %32 = OpConstantNull %float
-%textureSample_0dff6c = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-        %res = OpVariable %_ptr_Function_float Function %32
-               OpStore %arg_2 %14
-         %21 = OpLoad %7 %arg_1
-         %22 = OpLoad %3 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %25 = OpLoad %v2float %arg_2
-         %19 = OpImageSampleImplicitLod %v4float %24 %25 ConstOffset %29
-         %18 = OpCompositeExtract %float %19 0
-               OpStore %res %18
+         %35 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_0dff6c = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+        %res = OpVariable %_ptr_Function_float Function %35
+               OpStore %arg_2 %17
+         %24 = OpLoad %7 %arg_1
+         %25 = OpLoad %3 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %28 = OpLoad %v2float %arg_2
+         %22 = OpImageSampleImplicitLod %v4float %27 %28 ConstOffset %32
+         %21 = OpCompositeExtract %float %22 0
+               OpStore %res %21
+         %39 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %40 = OpLoad %float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureSample_0dff6c
+%fragment_main = OpFunction %void None %11
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureSample_0dff6c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.wgsl
index d6184b7..186f1bd 100644
--- a/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/0dff6c.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   const arg_3 = vec2<i32>(1i);
   var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_0dff6c();
diff --git a/test/tint/builtins/gen/var/textureSample/17e988.wgsl b/test/tint/builtins/gen/var/textureSample/17e988.wgsl
index ce00f1f..b80171c 100644
--- a/test/tint/builtins/gen/var/textureSample/17e988.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/17e988.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.dxc.hlsl
index c8a3fab..d67204e 100644
--- a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.dxc.hlsl
@@ -1,13 +1,30 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_17e988() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float4 res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_17e988();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.fxc.hlsl
index c8a3fab..09544f1 100644
--- a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_17e988() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float4 res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.glsl
index 348c3eb..8653d38 100644
--- a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_17e988() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec4 res = textureOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.msl
index f330dbb..dfaf4f7 100644
--- a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_17e988(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_17e988(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_17e988(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_17e988(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.spvasm
index 774724c..9e9c31a 100644
--- a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_17e988 "textureSample_17e988"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,46 +32,55 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
-    %v4float = OpTypeVector %float 4
-         %27 = OpTypeSampledImage %3
+         %26 = OpConstantNull %int
+         %30 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpConstantNull %v4float
-%textureSample_17e988 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-        %res = OpVariable %_ptr_Function_v4float Function %40
-               OpStore %arg_2 %14
+         %43 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_17e988 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_int Function %26
+        %res = OpVariable %_ptr_Function_v4float Function %43
+               OpStore %arg_2 %18
                OpStore %arg_3 %int_1
-         %25 = OpLoad %7 %arg_1
-         %26 = OpLoad %3 %arg_0
-         %28 = OpSampledImage %27 %26 %25
-         %30 = OpLoad %v2float %arg_2
-         %31 = OpCompositeExtract %float %30 0
-         %32 = OpCompositeExtract %float %30 1
-         %34 = OpLoad %int %arg_3
-         %33 = OpConvertSToF %float %34
-         %35 = OpCompositeConstruct %v3float %31 %32 %33
-         %23 = OpImageSampleImplicitLod %v4float %28 %35 ConstOffset %37
-               OpStore %res %23
+         %28 = OpLoad %7 %arg_1
+         %29 = OpLoad %3 %arg_0
+         %31 = OpSampledImage %30 %29 %28
+         %33 = OpLoad %v2float %arg_2
+         %34 = OpCompositeExtract %float %33 0
+         %35 = OpCompositeExtract %float %33 1
+         %37 = OpLoad %int %arg_3
+         %36 = OpConvertSToF %float %37
+         %38 = OpCompositeConstruct %v3float %34 %35 %36
+         %27 = OpImageSampleImplicitLod %v4float %31 %38 ConstOffset %40
+               OpStore %res %27
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %48 = OpLoad %v4float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSample_17e988
+%fragment_main = OpFunction %void None %12
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSample_17e988
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.wgsl
index 04cd29b..0773e9f 100644
--- a/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/17e988.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_17e988();
diff --git a/test/tint/builtins/gen/var/textureSample/193203.wgsl b/test/tint/builtins/gen/var/textureSample/193203.wgsl
index d5cac445..808cf88 100644
--- a/test/tint/builtins/gen/var/textureSample/193203.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/193203.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.dxc.hlsl
index 14ba49d..c95e11a 100644
--- a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.dxc.hlsl
@@ -1,13 +1,30 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_193203() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float4 res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_193203();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.fxc.hlsl
index 14ba49d..3de649d 100644
--- a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_193203() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float4 res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)), (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.glsl
index 683ab3b..edde093 100644
--- a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_193203() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec4 res = textureOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.msl
index 9754610..479020b 100644
--- a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_193203(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_193203(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_193203(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_193203(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.spvasm
index aed4148..e960c33 100644
--- a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_193203 "textureSample_193203"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,48 +32,56 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-    %v4float = OpTypeVector %float 4
-         %27 = OpTypeSampledImage %3
+         %26 = OpConstantNull %uint
+         %30 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %39 = OpConstantComposite %v2int %int_1 %int_1
+         %42 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %42 = OpConstantNull %v4float
-%textureSample_193203 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-        %res = OpVariable %_ptr_Function_v4float Function %42
-               OpStore %arg_2 %14
+         %45 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_193203 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_uint Function %26
+        %res = OpVariable %_ptr_Function_v4float Function %45
+               OpStore %arg_2 %18
                OpStore %arg_3 %uint_1
-         %25 = OpLoad %7 %arg_1
-         %26 = OpLoad %3 %arg_0
-         %28 = OpSampledImage %27 %26 %25
-         %30 = OpLoad %v2float %arg_2
-         %31 = OpCompositeExtract %float %30 0
-         %32 = OpCompositeExtract %float %30 1
-         %34 = OpLoad %uint %arg_3
-         %33 = OpConvertUToF %float %34
-         %35 = OpCompositeConstruct %v3float %31 %32 %33
-         %23 = OpImageSampleImplicitLod %v4float %28 %35 ConstOffset %39
-               OpStore %res %23
+         %28 = OpLoad %7 %arg_1
+         %29 = OpLoad %3 %arg_0
+         %31 = OpSampledImage %30 %29 %28
+         %33 = OpLoad %v2float %arg_2
+         %34 = OpCompositeExtract %float %33 0
+         %35 = OpCompositeExtract %float %33 1
+         %37 = OpLoad %uint %arg_3
+         %36 = OpConvertUToF %float %37
+         %38 = OpCompositeConstruct %v3float %34 %35 %36
+         %27 = OpImageSampleImplicitLod %v4float %31 %38 ConstOffset %42
+               OpStore %res %27
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %49 = OpLoad %v4float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSample_193203
+%fragment_main = OpFunction %void None %12
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSample_193203
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.wgsl
index 1bb14d4..1f77863 100644
--- a/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/193203.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_193203();
diff --git a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl
index 5939c98..de3a361 100644
--- a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1u;
   var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.dxc.hlsl
index deee4f8..c55ef74 100644
--- a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_1a4e1b() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.fxc.hlsl
index deee4f8..c55ef74 100644
--- a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_1a4e1b() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.glsl
index 1c06d2c..c76d896 100644
--- a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_1a4e1b() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), 0.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.msl
index 7eed709..32785ea 100644
--- a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_1a4e1b(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_1a4e1b(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_1a4e1b(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_1a4e1b(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.spvasm
index e71f035..118d43a 100644
--- a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_1a4e1b "textureSample_1a4e1b"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,45 +32,53 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %25 = OpConstantNull %uint
     %v4float = OpTypeVector %float 4
-         %28 = OpTypeSampledImage %3
+         %31 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %39 = OpConstantNull %float
-%textureSample_1a4e1b = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-        %res = OpVariable %_ptr_Function_float Function %39
-               OpStore %arg_2 %14
+         %42 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_1a4e1b = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_float Function %42
+               OpStore %arg_2 %17
                OpStore %arg_3 %uint_1
-         %26 = OpLoad %7 %arg_1
-         %27 = OpLoad %3 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %31 = OpLoad %v2float %arg_2
-         %32 = OpCompositeExtract %float %31 0
-         %33 = OpCompositeExtract %float %31 1
-         %35 = OpLoad %uint %arg_3
-         %34 = OpConvertUToF %float %35
-         %36 = OpCompositeConstruct %v3float %32 %33 %34
-         %24 = OpImageSampleImplicitLod %v4float %29 %36
-         %23 = OpCompositeExtract %float %24 0
-               OpStore %res %23
+         %29 = OpLoad %7 %arg_1
+         %30 = OpLoad %3 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %34 = OpLoad %v2float %arg_2
+         %35 = OpCompositeExtract %float %34 0
+         %36 = OpCompositeExtract %float %34 1
+         %38 = OpLoad %uint %arg_3
+         %37 = OpConvertUToF %float %38
+         %39 = OpCompositeConstruct %v3float %35 %36 %37
+         %27 = OpImageSampleImplicitLod %v4float %32 %39
+         %26 = OpCompositeExtract %float %27 0
+               OpStore %res %26
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSample_1a4e1b
+%fragment_main = OpFunction %void None %11
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSample_1a4e1b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.wgsl
index 58721bd..19dcd00 100644
--- a/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/1a4e1b.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1u;
   var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_1a4e1b();
diff --git a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl
index 2f44331..e3c438f 100644
--- a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   const arg_3 = vec3<i32>(1i);
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.dxc.hlsl
index 851fcb9..725c415 100644
--- a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.dxc.hlsl
@@ -1,12 +1,29 @@
+SKIP: FAILED
+
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_2149ec() {
   float3 arg_2 = (1.0f).xxx;
   float4 res = arg_0.Sample(arg_1, arg_2, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_2149ec();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.fxc.hlsl
index 851fcb9..5354ab7 100644
--- a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_2149ec() {
   float3 arg_2 = (1.0f).xxx;
   float4 res = arg_0.Sample(arg_1, arg_2, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.glsl
index 1f2238c..f4c425e 100644
--- a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_2149ec() {
   vec3 arg_2 = vec3(1.0f);
   vec4 res = textureOffset(arg_0_arg_1, arg_2, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.msl
index d41fa5a..3c68a43 100644
--- a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_2149ec(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_2149ec(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, int3(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_2149ec(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_2149ec(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.spvasm
index 2882225..540c678 100644
--- a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_2149ec "textureSample_2149ec"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,36 +31,45 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
-    %v4float = OpTypeVector %float 4
-         %22 = OpTypeSampledImage %3
+         %21 = OpConstantNull %v3float
+         %25 = OpTypeSampledImage %3
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %28 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %31 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpConstantNull %v4float
-%textureSample_2149ec = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-        %res = OpVariable %_ptr_Function_v4float Function %31
-               OpStore %arg_2 %14
-         %20 = OpLoad %7 %arg_1
-         %21 = OpLoad %3 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %24 = OpLoad %v3float %arg_2
-         %18 = OpImageSampleImplicitLod %v4float %23 %24 ConstOffset %28
-               OpStore %res %18
+         %34 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_2149ec = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v4float Function %34
+               OpStore %arg_2 %18
+         %23 = OpLoad %7 %arg_1
+         %24 = OpLoad %3 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %27 = OpLoad %v3float %arg_2
+         %22 = OpImageSampleImplicitLod %v4float %26 %27 ConstOffset %31
+               OpStore %res %22
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSample_2149ec
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureSample_2149ec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.wgsl
index 4504ed8..6fc5537 100644
--- a/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/2149ec.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   const arg_3 = vec3<i32>(1i);
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_2149ec();
diff --git a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl
index 2a51765..7cc87e6 100644
--- a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl
@@ -27,7 +27,9 @@
 fn textureSample_38bbb9() {
   var arg_2 = vec2<f32>(1.f);
   var res: f32 = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.dxc.hlsl
index 02dfbcd..4680452 100644
--- a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_38bbb9() {
   float2 arg_2 = (1.0f).xx;
   float res = arg_0.Sample(arg_1, arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.fxc.hlsl
index 02dfbcd..4680452 100644
--- a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_38bbb9() {
   float2 arg_2 = (1.0f).xx;
   float res = arg_0.Sample(arg_1, arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.glsl
index 4fe5c89..e22209e 100644
--- a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_38bbb9() {
   vec2 arg_2 = vec2(1.0f);
   float res = texture(arg_0_arg_1, vec3(arg_2, 0.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.msl
index 332cc17..66c3cca 100644
--- a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_38bbb9(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_38bbb9(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   float res = tint_symbol.sample(tint_symbol_1, arg_2);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_38bbb9(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_38bbb9(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.spvasm
index 67ed449..01e7342 100644
--- a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_38bbb9 "textureSample_38bbb9"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,33 +31,42 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
     %v4float = OpTypeVector %float 4
-         %23 = OpTypeSampledImage %3
+         %26 = OpTypeSampledImage %3
 %_ptr_Function_float = OpTypePointer Function %float
-         %28 = OpConstantNull %float
-%textureSample_38bbb9 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-        %res = OpVariable %_ptr_Function_float Function %28
-               OpStore %arg_2 %14
-         %21 = OpLoad %7 %arg_1
-         %22 = OpLoad %3 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %25 = OpLoad %v2float %arg_2
-         %19 = OpImageSampleImplicitLod %v4float %24 %25
-         %18 = OpCompositeExtract %float %19 0
-               OpStore %res %18
+         %31 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_38bbb9 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+        %res = OpVariable %_ptr_Function_float Function %31
+               OpStore %arg_2 %17
+         %24 = OpLoad %7 %arg_1
+         %25 = OpLoad %3 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %28 = OpLoad %v2float %arg_2
+         %22 = OpImageSampleImplicitLod %v4float %27 %28
+         %21 = OpCompositeExtract %float %22 0
+               OpStore %res %21
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureSample_38bbb9
+%fragment_main = OpFunction %void None %11
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureSample_38bbb9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.wgsl
index 9bad3e4..e1dd3f5 100644
--- a/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/38bbb9.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureSample_38bbb9() {
   var arg_2 = vec2<f32>(1.0f);
   var res : f32 = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_38bbb9();
diff --git a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl
index 07d3d57..7091444 100644
--- a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl
@@ -27,7 +27,9 @@
 fn textureSample_3b50bd() {
   var arg_2 = vec3<f32>(1.f);
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.dxc.hlsl
index 5eb33e5..612db24 100644
--- a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_3b50bd() {
   float3 arg_2 = (1.0f).xxx;
   float4 res = arg_0.Sample(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.fxc.hlsl
index 5eb33e5..612db24 100644
--- a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_3b50bd() {
   float3 arg_2 = (1.0f).xxx;
   float4 res = arg_0.Sample(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.glsl
index 5dedecf..26549ac 100644
--- a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_3b50bd() {
   vec3 arg_2 = vec3(1.0f);
   vec4 res = texture(arg_0_arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.msl
index 85f1579..0c6d6ad 100644
--- a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_3b50bd(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_3b50bd(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_3b50bd(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_3b50bd(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.spvasm
index 205ec4b..05101ae 100644
--- a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_3b50bd "textureSample_3b50bd"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,32 +31,41 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
-    %v4float = OpTypeVector %float 4
-         %22 = OpTypeSampledImage %3
+         %21 = OpConstantNull %v3float
+         %25 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %27 = OpConstantNull %v4float
-%textureSample_3b50bd = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-        %res = OpVariable %_ptr_Function_v4float Function %27
-               OpStore %arg_2 %14
-         %20 = OpLoad %7 %arg_1
-         %21 = OpLoad %3 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %24 = OpLoad %v3float %arg_2
-         %18 = OpImageSampleImplicitLod %v4float %23 %24
-               OpStore %res %18
+         %30 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_3b50bd = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v4float Function %30
+               OpStore %arg_2 %18
+         %23 = OpLoad %7 %arg_1
+         %24 = OpLoad %3 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %27 = OpLoad %v3float %arg_2
+         %22 = OpImageSampleImplicitLod %v4float %26 %27
+               OpStore %res %22
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureSample_3b50bd
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureSample_3b50bd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.wgsl
index e58076b..43a677b 100644
--- a/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/3b50bd.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureSample_3b50bd() {
   var arg_2 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_3b50bd();
diff --git a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl
index bd4f57c..c95f016 100644
--- a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   const arg_4 = vec2<i32>(1i);
   var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.dxc.hlsl
index 0a168db..da0dc4d 100644
--- a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.dxc.hlsl
@@ -1,13 +1,30 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_4703d0() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)), (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_4703d0();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.fxc.hlsl
index 0a168db..606a5fe 100644
--- a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_4703d0() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)), (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.msl
index 313f70a..0915df4 100644
--- a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_4703d0(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_4703d0(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_4703d0(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_4703d0(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.spvasm
index f42d049..712cf50 100644
--- a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_4703d0 "textureSample_4703d0"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,49 +32,57 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %25 = OpConstantNull %uint
     %v4float = OpTypeVector %float 4
-         %28 = OpTypeSampledImage %3
+         %31 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %40 = OpConstantComposite %v2int %int_1 %int_1
+         %43 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %43 = OpConstantNull %float
-%textureSample_4703d0 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-        %res = OpVariable %_ptr_Function_float Function %43
-               OpStore %arg_2 %14
+         %46 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_4703d0 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_float Function %46
+               OpStore %arg_2 %17
                OpStore %arg_3 %uint_1
-         %26 = OpLoad %7 %arg_1
-         %27 = OpLoad %3 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %31 = OpLoad %v2float %arg_2
-         %32 = OpCompositeExtract %float %31 0
-         %33 = OpCompositeExtract %float %31 1
-         %35 = OpLoad %uint %arg_3
-         %34 = OpConvertUToF %float %35
-         %36 = OpCompositeConstruct %v3float %32 %33 %34
-         %24 = OpImageSampleImplicitLod %v4float %29 %36 ConstOffset %40
-         %23 = OpCompositeExtract %float %24 0
-               OpStore %res %23
+         %29 = OpLoad %7 %arg_1
+         %30 = OpLoad %3 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %34 = OpLoad %v2float %arg_2
+         %35 = OpCompositeExtract %float %34 0
+         %36 = OpCompositeExtract %float %34 1
+         %38 = OpLoad %uint %arg_3
+         %37 = OpConvertUToF %float %38
+         %39 = OpCompositeConstruct %v3float %35 %36 %37
+         %27 = OpImageSampleImplicitLod %v4float %32 %39 ConstOffset %43
+         %26 = OpCompositeExtract %float %27 0
+               OpStore %res %26
+         %49 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %50 = OpLoad %float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSample_4703d0
+%fragment_main = OpFunction %void None %11
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSample_4703d0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.wgsl
index 946bf08..ad1eb4f 100644
--- a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   const arg_4 = vec2<i32>(1i);
   var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_4703d0();
diff --git a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl
index fbdf221..37cc436 100644
--- a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1i;
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.dxc.hlsl
index 5e80f0b..d37baa9 100644
--- a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_4dd1bf() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float4 res = arg_0.Sample(arg_1, float4(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.fxc.hlsl
index 5e80f0b..d37baa9 100644
--- a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_4dd1bf() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float4 res = arg_0.Sample(arg_1, float4(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.msl
index a643911..88e29ed 100644
--- a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_4dd1bf(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_4dd1bf(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_4dd1bf(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_4dd1bf(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.spvasm
index 16d357e..9f9e4ec 100644
--- a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_4dd1bf "textureSample_4dd1bf"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,44 +33,53 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
-    %v4float = OpTypeVector %float 4
-         %27 = OpTypeSampledImage %3
+         %26 = OpConstantNull %int
+         %30 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpConstantNull %v4float
-%textureSample_4dd1bf = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-        %res = OpVariable %_ptr_Function_v4float Function %38
-               OpStore %arg_2 %14
+         %41 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_4dd1bf = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_3 = OpVariable %_ptr_Function_int Function %26
+        %res = OpVariable %_ptr_Function_v4float Function %41
+               OpStore %arg_2 %18
                OpStore %arg_3 %int_1
-         %25 = OpLoad %7 %arg_1
-         %26 = OpLoad %3 %arg_0
-         %28 = OpSampledImage %27 %26 %25
-         %29 = OpLoad %v3float %arg_2
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpCompositeExtract %float %29 2
-         %34 = OpLoad %int %arg_3
-         %33 = OpConvertSToF %float %34
-         %35 = OpCompositeConstruct %v4float %30 %31 %32 %33
-         %23 = OpImageSampleImplicitLod %v4float %28 %35
-               OpStore %res %23
+         %28 = OpLoad %7 %arg_1
+         %29 = OpLoad %3 %arg_0
+         %31 = OpSampledImage %30 %29 %28
+         %32 = OpLoad %v3float %arg_2
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpCompositeExtract %float %32 2
+         %37 = OpLoad %int %arg_3
+         %36 = OpConvertSToF %float %37
+         %38 = OpCompositeConstruct %v4float %33 %34 %35 %36
+         %27 = OpImageSampleImplicitLod %v4float %31 %38
+               OpStore %res %27
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSample_4dd1bf
+%fragment_main = OpFunction %void None %12
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSample_4dd1bf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.wgsl
index c81daf1..8296c78 100644
--- a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1i;
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_4dd1bf();
diff --git a/test/tint/builtins/gen/var/textureSample/51b514.wgsl b/test/tint/builtins/gen/var/textureSample/51b514.wgsl
index 1e81aff..cbd347c 100644
--- a/test/tint/builtins/gen/var/textureSample/51b514.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/51b514.wgsl
@@ -27,7 +27,9 @@
 fn textureSample_51b514() {
   var arg_2 = vec2<f32>(1.f);
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.dxc.hlsl
index 05b317f..cef8aa8 100644
--- a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_51b514() {
   float2 arg_2 = (1.0f).xx;
   float4 res = arg_0.Sample(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.fxc.hlsl
index 05b317f..cef8aa8 100644
--- a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_51b514() {
   float2 arg_2 = (1.0f).xx;
   float4 res = arg_0.Sample(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.glsl
index 8728e28..0d05a57 100644
--- a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_51b514() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = texture(arg_0_arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.msl
index c988d80..76d7b10 100644
--- a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_51b514(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_51b514(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_51b514(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_51b514(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.spvasm
index 63296a4..b3286d8 100644
--- a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_51b514 "textureSample_51b514"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,32 +31,41 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
-    %v4float = OpTypeVector %float 4
-         %22 = OpTypeSampledImage %3
+         %21 = OpConstantNull %v2float
+         %25 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %27 = OpConstantNull %v4float
-%textureSample_51b514 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-        %res = OpVariable %_ptr_Function_v4float Function %27
-               OpStore %arg_2 %14
-         %20 = OpLoad %7 %arg_1
-         %21 = OpLoad %3 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %24 = OpLoad %v2float %arg_2
-         %18 = OpImageSampleImplicitLod %v4float %23 %24
-               OpStore %res %18
+         %30 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_51b514 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v4float Function %30
+               OpStore %arg_2 %18
+         %23 = OpLoad %7 %arg_1
+         %24 = OpLoad %3 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %27 = OpLoad %v2float %arg_2
+         %22 = OpImageSampleImplicitLod %v4float %26 %27
+               OpStore %res %22
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureSample_51b514
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureSample_51b514
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.wgsl
index 14161ec..c35e0f8 100644
--- a/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/51b514.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureSample_51b514() {
   var arg_2 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_51b514();
diff --git a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl
index 82d3e6f..ed72870 100644
--- a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   const arg_4 = vec2<i32>(1i);
   var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.dxc.hlsl
index 4d12d1b4a..580fc77 100644
--- a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.dxc.hlsl
@@ -1,13 +1,30 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_60bf45() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)), (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_60bf45();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.fxc.hlsl
index 4d12d1b4a..fb3bc61 100644
--- a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_60bf45() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)), (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.msl
index e2a533c..96bbbd7 100644
--- a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_60bf45(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_60bf45(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_60bf45(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_60bf45(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.spvasm
index 30716a2..1e66fba 100644
--- a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_60bf45 "textureSample_60bf45"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,47 +32,56 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %25 = OpConstantNull %int
     %v4float = OpTypeVector %float 4
-         %28 = OpTypeSampledImage %3
+         %31 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %41 = OpConstantNull %float
-%textureSample_60bf45 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-        %res = OpVariable %_ptr_Function_float Function %41
-               OpStore %arg_2 %14
+         %44 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_60bf45 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_float Function %44
+               OpStore %arg_2 %17
                OpStore %arg_3 %int_1
-         %26 = OpLoad %7 %arg_1
-         %27 = OpLoad %3 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %31 = OpLoad %v2float %arg_2
-         %32 = OpCompositeExtract %float %31 0
-         %33 = OpCompositeExtract %float %31 1
-         %35 = OpLoad %int %arg_3
-         %34 = OpConvertSToF %float %35
-         %36 = OpCompositeConstruct %v3float %32 %33 %34
-         %24 = OpImageSampleImplicitLod %v4float %29 %36 ConstOffset %38
-         %23 = OpCompositeExtract %float %24 0
-               OpStore %res %23
+         %29 = OpLoad %7 %arg_1
+         %30 = OpLoad %3 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %34 = OpLoad %v2float %arg_2
+         %35 = OpCompositeExtract %float %34 0
+         %36 = OpCompositeExtract %float %34 1
+         %38 = OpLoad %int %arg_3
+         %37 = OpConvertSToF %float %38
+         %39 = OpCompositeConstruct %v3float %35 %36 %37
+         %27 = OpImageSampleImplicitLod %v4float %32 %39 ConstOffset %41
+         %26 = OpCompositeExtract %float %27 0
+               OpStore %res %26
+         %48 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %49 = OpLoad %float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSample_60bf45
+%fragment_main = OpFunction %void None %11
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSample_60bf45
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.wgsl
index 20e38db..9befc24 100644
--- a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   const arg_4 = vec2<i32>(1i);
   var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_60bf45();
diff --git a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl
index d2bbdce..4619996 100644
--- a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1i;
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.dxc.hlsl
index 17ca05c..6078741 100644
--- a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_6717ca() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float4 res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.fxc.hlsl
index 17ca05c..6078741 100644
--- a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_6717ca() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float4 res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.glsl
index 785b0c8..3ebb7cd 100644
--- a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_6717ca() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec4 res = texture(arg_0_arg_1, vec3(arg_2, float(arg_3)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.msl
index 970129e..a96d344 100644
--- a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_6717ca(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_6717ca(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_6717ca(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_6717ca(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.spvasm
index 66cc8f4..514a91c 100644
--- a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_6717ca "textureSample_6717ca"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,44 +32,53 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
-    %v4float = OpTypeVector %float 4
-         %27 = OpTypeSampledImage %3
+         %26 = OpConstantNull %int
+         %30 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpConstantNull %v4float
-%textureSample_6717ca = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-        %res = OpVariable %_ptr_Function_v4float Function %38
-               OpStore %arg_2 %14
+         %41 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_6717ca = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_int Function %26
+        %res = OpVariable %_ptr_Function_v4float Function %41
+               OpStore %arg_2 %18
                OpStore %arg_3 %int_1
-         %25 = OpLoad %7 %arg_1
-         %26 = OpLoad %3 %arg_0
-         %28 = OpSampledImage %27 %26 %25
-         %30 = OpLoad %v2float %arg_2
-         %31 = OpCompositeExtract %float %30 0
-         %32 = OpCompositeExtract %float %30 1
-         %34 = OpLoad %int %arg_3
-         %33 = OpConvertSToF %float %34
-         %35 = OpCompositeConstruct %v3float %31 %32 %33
-         %23 = OpImageSampleImplicitLod %v4float %28 %35
-               OpStore %res %23
+         %28 = OpLoad %7 %arg_1
+         %29 = OpLoad %3 %arg_0
+         %31 = OpSampledImage %30 %29 %28
+         %33 = OpLoad %v2float %arg_2
+         %34 = OpCompositeExtract %float %33 0
+         %35 = OpCompositeExtract %float %33 1
+         %37 = OpLoad %int %arg_3
+         %36 = OpConvertSToF %float %37
+         %38 = OpCompositeConstruct %v3float %34 %35 %36
+         %27 = OpImageSampleImplicitLod %v4float %31 %38
+               OpStore %res %27
+         %45 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %46 = OpLoad %v4float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSample_6717ca
+%fragment_main = OpFunction %void None %12
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSample_6717ca
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.wgsl
index 44579f3..cf1b858 100644
--- a/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/6717ca.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1i;
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_6717ca();
diff --git a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl
index ced9dcb..473beb5 100644
--- a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl
@@ -27,7 +27,9 @@
 fn textureSample_6e64fb() {
   var arg_2 = 1.f;
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.dxc.hlsl
index e62e875..63d0133 100644
--- a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_6e64fb() {
   float arg_2 = 1.0f;
   float4 res = arg_0.Sample(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.fxc.hlsl
index e62e875..63d0133 100644
--- a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture1D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_6e64fb() {
   float arg_2 = 1.0f;
   float4 res = arg_0.Sample(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.glsl
index 1fe1c59..e3f09d1 100644
--- a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_6e64fb() {
   float arg_2 = 1.0f;
   vec4 res = texture(arg_0_arg_1, vec2(arg_2, 0.5f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.msl
index 3a9b0a5..450bcb5 100644
--- a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_6e64fb(texture1d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_6e64fb(texture1d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float arg_2 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_6e64fb(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_6e64fb(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.spvasm
index be90026..2ad625f 100644
--- a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
                OpCapability Sampled1D
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_6e64fb "textureSample_6e64fb"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 1D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,30 +32,39 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %15 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %20 = OpTypeSampledImage %3
+         %19 = OpConstantNull %float
+         %23 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %25 = OpConstantNull %v4float
-%textureSample_6e64fb = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_float Function %15
-        %res = OpVariable %_ptr_Function_v4float Function %25
+         %28 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_6e64fb = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_float Function %19
+        %res = OpVariable %_ptr_Function_v4float Function %28
                OpStore %arg_2 %float_1
-         %18 = OpLoad %7 %arg_1
-         %19 = OpLoad %3 %arg_0
-         %21 = OpSampledImage %20 %19 %18
-         %22 = OpLoad %float %arg_2
-         %16 = OpImageSampleImplicitLod %v4float %21 %22
-               OpStore %res %16
+         %21 = OpLoad %7 %arg_1
+         %22 = OpLoad %3 %arg_0
+         %24 = OpSampledImage %23 %22 %21
+         %25 = OpLoad %float %arg_2
+         %20 = OpImageSampleImplicitLod %v4float %24 %25
+               OpStore %res %20
+         %32 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %33 = OpLoad %v4float %res
+               OpStore %32 %33
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %textureSample_6e64fb
+%fragment_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %textureSample_6e64fb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.wgsl
index bc576c3..15e245a 100644
--- a/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/6e64fb.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureSample_6e64fb() {
   var arg_2 = 1.0f;
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_6e64fb();
diff --git a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl
index 066a4c0..3c2419f 100644
--- a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1i;
   var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.dxc.hlsl
index 5b1a5d9..c9f99c3 100644
--- a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_7e9ffd() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.fxc.hlsl
index 5b1a5d9..c9f99c3 100644
--- a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_7e9ffd() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.glsl
index fd4c016..8d3202f 100644
--- a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_7e9ffd() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), 0.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.msl
index 24cda54..de67ddc 100644
--- a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_7e9ffd(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_7e9ffd(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_7e9ffd(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_7e9ffd(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.spvasm
index ecc54a0..013aee9 100644
--- a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_7e9ffd "textureSample_7e9ffd"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,45 +32,54 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %25 = OpConstantNull %int
     %v4float = OpTypeVector %float 4
-         %28 = OpTypeSampledImage %3
+         %31 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %39 = OpConstantNull %float
-%textureSample_7e9ffd = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-        %res = OpVariable %_ptr_Function_float Function %39
-               OpStore %arg_2 %14
+         %42 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_7e9ffd = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_float Function %42
+               OpStore %arg_2 %17
                OpStore %arg_3 %int_1
-         %26 = OpLoad %7 %arg_1
-         %27 = OpLoad %3 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %31 = OpLoad %v2float %arg_2
-         %32 = OpCompositeExtract %float %31 0
-         %33 = OpCompositeExtract %float %31 1
-         %35 = OpLoad %int %arg_3
-         %34 = OpConvertSToF %float %35
-         %36 = OpCompositeConstruct %v3float %32 %33 %34
-         %24 = OpImageSampleImplicitLod %v4float %29 %36
-         %23 = OpCompositeExtract %float %24 0
-               OpStore %res %23
+         %29 = OpLoad %7 %arg_1
+         %30 = OpLoad %3 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %34 = OpLoad %v2float %arg_2
+         %35 = OpCompositeExtract %float %34 0
+         %36 = OpCompositeExtract %float %34 1
+         %38 = OpLoad %int %arg_3
+         %37 = OpConvertSToF %float %38
+         %39 = OpCompositeConstruct %v3float %35 %36 %37
+         %27 = OpImageSampleImplicitLod %v4float %32 %39
+         %26 = OpCompositeExtract %float %27 0
+               OpStore %res %26
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSample_7e9ffd
+%fragment_main = OpFunction %void None %11
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSample_7e9ffd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.wgsl
index 1b7dc85..786aabc 100644
--- a/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/7e9ffd.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1i;
   var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_7e9ffd();
diff --git a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl
index 1ca0664..76c4d4a 100644
--- a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1u;
   var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.dxc.hlsl
index 8543883..2b7c713 100644
--- a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_7fd8cb() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float res = arg_0.Sample(arg_1, float4(arg_2, float(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.fxc.hlsl
index 8543883..2b7c713 100644
--- a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_7fd8cb() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float res = arg_0.Sample(arg_1, float4(arg_2, float(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.msl
index ef80931..1c6cb27 100644
--- a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_7fd8cb(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_7fd8cb(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_7fd8cb(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_7fd8cb(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.spvasm
index 8bba39b..b3081d6 100644
--- a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_7fd8cb "textureSample_7fd8cb"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,45 +33,53 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %20 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %25 = OpConstantNull %uint
     %v4float = OpTypeVector %float 4
-         %28 = OpTypeSampledImage %3
+         %31 = OpTypeSampledImage %3
 %_ptr_Function_float = OpTypePointer Function %float
-         %39 = OpConstantNull %float
-%textureSample_7fd8cb = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-        %res = OpVariable %_ptr_Function_float Function %39
-               OpStore %arg_2 %14
+         %42 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_7fd8cb = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %20
+      %arg_3 = OpVariable %_ptr_Function_uint Function %25
+        %res = OpVariable %_ptr_Function_float Function %42
+               OpStore %arg_2 %17
                OpStore %arg_3 %uint_1
-         %26 = OpLoad %7 %arg_1
-         %27 = OpLoad %3 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v3float %arg_2
-         %31 = OpCompositeExtract %float %30 0
-         %32 = OpCompositeExtract %float %30 1
-         %33 = OpCompositeExtract %float %30 2
-         %35 = OpLoad %uint %arg_3
-         %34 = OpConvertUToF %float %35
-         %36 = OpCompositeConstruct %v4float %31 %32 %33 %34
-         %24 = OpImageSampleImplicitLod %v4float %29 %36
-         %23 = OpCompositeExtract %float %24 0
-               OpStore %res %23
+         %29 = OpLoad %7 %arg_1
+         %30 = OpLoad %3 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v3float %arg_2
+         %34 = OpCompositeExtract %float %33 0
+         %35 = OpCompositeExtract %float %33 1
+         %36 = OpCompositeExtract %float %33 2
+         %38 = OpLoad %uint %arg_3
+         %37 = OpConvertUToF %float %38
+         %39 = OpCompositeConstruct %v4float %34 %35 %36 %37
+         %27 = OpImageSampleImplicitLod %v4float %32 %39
+         %26 = OpCompositeExtract %float %27 0
+               OpStore %res %26
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSample_7fd8cb
+%fragment_main = OpFunction %void None %11
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSample_7fd8cb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.wgsl
index 6b4cfa7..5b6e0ce 100644
--- a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1u;
   var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_7fd8cb();
diff --git a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl
index 2c3b8c8..26418c6 100644
--- a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   const arg_3 = vec2<i32>(1i);
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.dxc.hlsl
index 582b2c5..c56dac5 100644
--- a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.dxc.hlsl
@@ -1,12 +1,29 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_85c4ba() {
   float2 arg_2 = (1.0f).xx;
   float4 res = arg_0.Sample(arg_1, arg_2, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSample_85c4ba();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.fxc.hlsl
index 582b2c5..27a41e4 100644
--- a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_85c4ba() {
   float2 arg_2 = (1.0f).xx;
   float4 res = arg_0.Sample(arg_1, arg_2, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.glsl
index fee2b62..68b53e0 100644
--- a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_85c4ba() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureOffset(arg_0_arg_1, arg_2, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.msl
index 1bf5459..49330b2 100644
--- a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_85c4ba(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_85c4ba(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_85c4ba(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_85c4ba(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.spvasm
index 320dfc4..e7dd5f5 100644
--- a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_85c4ba "textureSample_85c4ba"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,36 +31,45 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
-    %v4float = OpTypeVector %float 4
-         %22 = OpTypeSampledImage %3
+         %21 = OpConstantNull %v2float
+         %25 = OpTypeSampledImage %3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %28 = OpConstantComposite %v2int %int_1 %int_1
+         %31 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpConstantNull %v4float
-%textureSample_85c4ba = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-        %res = OpVariable %_ptr_Function_v4float Function %31
-               OpStore %arg_2 %14
-         %20 = OpLoad %7 %arg_1
-         %21 = OpLoad %3 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %24 = OpLoad %v2float %arg_2
-         %18 = OpImageSampleImplicitLod %v4float %23 %24 ConstOffset %28
-               OpStore %res %18
+         %34 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_85c4ba = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v4float Function %34
+               OpStore %arg_2 %18
+         %23 = OpLoad %7 %arg_1
+         %24 = OpLoad %3 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %27 = OpLoad %v2float %arg_2
+         %22 = OpImageSampleImplicitLod %v4float %26 %27 ConstOffset %31
+               OpStore %res %22
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSample_85c4ba
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureSample_85c4ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.wgsl
index 209f269..346cf9f 100644
--- a/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/85c4ba.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   const arg_3 = vec2<i32>(1i);
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_85c4ba();
diff --git a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl
index f47d67e..d04f83c 100644
--- a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1u;
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.dxc.hlsl
index de700b8..be59f8f 100644
--- a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_bc7477() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float4 res = arg_0.Sample(arg_1, float4(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.fxc.hlsl
index de700b8..be59f8f 100644
--- a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_bc7477() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float4 res = arg_0.Sample(arg_1, float4(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.msl
index c45ece0..4c1176d 100644
--- a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_bc7477(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_bc7477(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_bc7477(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_bc7477(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.spvasm
index 6732a66..e82dabd 100644
--- a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_bc7477 "textureSample_bc7477"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,44 +33,52 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-    %v4float = OpTypeVector %float 4
-         %27 = OpTypeSampledImage %3
+         %26 = OpConstantNull %uint
+         %30 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpConstantNull %v4float
-%textureSample_bc7477 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-        %res = OpVariable %_ptr_Function_v4float Function %38
-               OpStore %arg_2 %14
+         %41 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_bc7477 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_3 = OpVariable %_ptr_Function_uint Function %26
+        %res = OpVariable %_ptr_Function_v4float Function %41
+               OpStore %arg_2 %18
                OpStore %arg_3 %uint_1
-         %25 = OpLoad %7 %arg_1
-         %26 = OpLoad %3 %arg_0
-         %28 = OpSampledImage %27 %26 %25
-         %29 = OpLoad %v3float %arg_2
-         %30 = OpCompositeExtract %float %29 0
-         %31 = OpCompositeExtract %float %29 1
-         %32 = OpCompositeExtract %float %29 2
-         %34 = OpLoad %uint %arg_3
-         %33 = OpConvertUToF %float %34
-         %35 = OpCompositeConstruct %v4float %30 %31 %32 %33
-         %23 = OpImageSampleImplicitLod %v4float %28 %35
-               OpStore %res %23
+         %28 = OpLoad %7 %arg_1
+         %29 = OpLoad %3 %arg_0
+         %31 = OpSampledImage %30 %29 %28
+         %32 = OpLoad %v3float %arg_2
+         %33 = OpCompositeExtract %float %32 0
+         %34 = OpCompositeExtract %float %32 1
+         %35 = OpCompositeExtract %float %32 2
+         %37 = OpLoad %uint %arg_3
+         %36 = OpConvertUToF %float %37
+         %38 = OpCompositeConstruct %v4float %33 %34 %35 %36
+         %27 = OpImageSampleImplicitLod %v4float %31 %38
+               OpStore %res %27
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSample_bc7477
+%fragment_main = OpFunction %void None %12
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSample_bc7477
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.wgsl
index 159fd69..9d98400 100644
--- a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1u;
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_bc7477();
diff --git a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl
index 3937cec..18dfdf8 100644
--- a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1i;
   var res: f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.dxc.hlsl
index be2d46c..f668ed7 100644
--- a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_c2f4e8() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float res = arg_0.Sample(arg_1, float4(arg_2, float(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.fxc.hlsl
index be2d46c..f668ed7 100644
--- a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_c2f4e8() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float res = arg_0.Sample(arg_1, float4(arg_2, float(arg_3))).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.msl
index 5a7efc4..c88b611 100644
--- a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_c2f4e8(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_c2f4e8(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_c2f4e8(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_c2f4e8(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.spvasm
index 2e9a4e2..eaa7646 100644
--- a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_c2f4e8 "textureSample_c2f4e8"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,45 +33,54 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %20 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %25 = OpConstantNull %int
     %v4float = OpTypeVector %float 4
-         %28 = OpTypeSampledImage %3
+         %31 = OpTypeSampledImage %3
 %_ptr_Function_float = OpTypePointer Function %float
-         %39 = OpConstantNull %float
-%textureSample_c2f4e8 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-        %res = OpVariable %_ptr_Function_float Function %39
-               OpStore %arg_2 %14
+         %42 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_c2f4e8 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %20
+      %arg_3 = OpVariable %_ptr_Function_int Function %25
+        %res = OpVariable %_ptr_Function_float Function %42
+               OpStore %arg_2 %17
                OpStore %arg_3 %int_1
-         %26 = OpLoad %7 %arg_1
-         %27 = OpLoad %3 %arg_0
-         %29 = OpSampledImage %28 %27 %26
-         %30 = OpLoad %v3float %arg_2
-         %31 = OpCompositeExtract %float %30 0
-         %32 = OpCompositeExtract %float %30 1
-         %33 = OpCompositeExtract %float %30 2
-         %35 = OpLoad %int %arg_3
-         %34 = OpConvertSToF %float %35
-         %36 = OpCompositeConstruct %v4float %31 %32 %33 %34
-         %24 = OpImageSampleImplicitLod %v4float %29 %36
-         %23 = OpCompositeExtract %float %24 0
-               OpStore %res %23
+         %29 = OpLoad %7 %arg_1
+         %30 = OpLoad %3 %arg_0
+         %32 = OpSampledImage %31 %30 %29
+         %33 = OpLoad %v3float %arg_2
+         %34 = OpCompositeExtract %float %33 0
+         %35 = OpCompositeExtract %float %33 1
+         %36 = OpCompositeExtract %float %33 2
+         %38 = OpLoad %int %arg_3
+         %37 = OpConvertSToF %float %38
+         %39 = OpCompositeConstruct %v4float %34 %35 %36 %37
+         %27 = OpImageSampleImplicitLod %v4float %32 %39
+         %26 = OpCompositeExtract %float %27 0
+               OpStore %res %26
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSample_c2f4e8
+%fragment_main = OpFunction %void None %11
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSample_c2f4e8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.wgsl
index b5c02ef..742881c 100644
--- a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1i;
   var res : f32 = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_c2f4e8();
diff --git a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl
index 0a4bb40..948dbf8 100644
--- a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1u;
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.dxc.hlsl
index 00a1d0a..2f1d265 100644
--- a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_d6b281() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float4 res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.fxc.hlsl
index 00a1d0a..2f1d265 100644
--- a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_d6b281() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float4 res = arg_0.Sample(arg_1, float3(arg_2, float(arg_3)));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.glsl
index 309e180..f66ee37 100644
--- a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_d6b281() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec4 res = texture(arg_0_arg_1, vec3(arg_2, float(arg_3)));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.msl
index 2d0626f..a2d9778 100644
--- a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_d6b281(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_d6b281(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_d6b281(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_d6b281(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.spvasm
index c74ef88..8d1f29b 100644
--- a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_d6b281 "textureSample_d6b281"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,44 +32,52 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
-    %v4float = OpTypeVector %float 4
-         %27 = OpTypeSampledImage %3
+         %26 = OpConstantNull %uint
+         %30 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %38 = OpConstantNull %v4float
-%textureSample_d6b281 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-        %res = OpVariable %_ptr_Function_v4float Function %38
-               OpStore %arg_2 %14
+         %41 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_d6b281 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_uint Function %26
+        %res = OpVariable %_ptr_Function_v4float Function %41
+               OpStore %arg_2 %18
                OpStore %arg_3 %uint_1
-         %25 = OpLoad %7 %arg_1
-         %26 = OpLoad %3 %arg_0
-         %28 = OpSampledImage %27 %26 %25
-         %30 = OpLoad %v2float %arg_2
-         %31 = OpCompositeExtract %float %30 0
-         %32 = OpCompositeExtract %float %30 1
-         %34 = OpLoad %uint %arg_3
-         %33 = OpConvertUToF %float %34
-         %35 = OpCompositeConstruct %v3float %31 %32 %33
-         %23 = OpImageSampleImplicitLod %v4float %28 %35
-               OpStore %res %23
+         %28 = OpLoad %7 %arg_1
+         %29 = OpLoad %3 %arg_0
+         %31 = OpSampledImage %30 %29 %28
+         %33 = OpLoad %v2float %arg_2
+         %34 = OpCompositeExtract %float %33 0
+         %35 = OpCompositeExtract %float %33 1
+         %37 = OpLoad %uint %arg_3
+         %36 = OpConvertUToF %float %37
+         %38 = OpCompositeConstruct %v3float %34 %35 %36
+         %27 = OpImageSampleImplicitLod %v4float %31 %38
+               OpStore %res %27
+         %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %45 = OpLoad %v4float %res
+               OpStore %44 %45
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %40 = OpLabel
-         %41 = OpFunctionCall %void %textureSample_d6b281
+%fragment_main = OpFunction %void None %12
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSample_d6b281
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.wgsl
index 30e87bd..67e7df4 100644
--- a/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/d6b281.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1u;
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_d6b281();
diff --git a/test/tint/builtins/gen/var/textureSample/e53267.wgsl b/test/tint/builtins/gen/var/textureSample/e53267.wgsl
index be4d74e..73d867f 100644
--- a/test/tint/builtins/gen/var/textureSample/e53267.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/e53267.wgsl
@@ -27,7 +27,9 @@
 fn textureSample_e53267() {
   var arg_2 = vec3<f32>(1.f);
   var res: vec4<f32> = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.dxc.hlsl
index ab598e1..6dbfb00 100644
--- a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_e53267() {
   float3 arg_2 = (1.0f).xxx;
   float4 res = arg_0.Sample(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.fxc.hlsl
index ab598e1..6dbfb00 100644
--- a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_e53267() {
   float3 arg_2 = (1.0f).xxx;
   float4 res = arg_0.Sample(arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.glsl
index 3801b6b..7ab0379 100644
--- a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSample_e53267() {
   vec3 arg_2 = vec3(1.0f);
   vec4 res = texture(arg_0_arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.msl
index f5cc1bf..f034141 100644
--- a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_e53267(texturecube<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_e53267(texturecube<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_e53267(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_e53267(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.spvasm
index e75f05a..165b46b 100644
--- a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_e53267 "textureSample_e53267"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,32 +31,41 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
-    %v4float = OpTypeVector %float 4
-         %22 = OpTypeSampledImage %3
+         %21 = OpConstantNull %v3float
+         %25 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %27 = OpConstantNull %v4float
-%textureSample_e53267 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-        %res = OpVariable %_ptr_Function_v4float Function %27
-               OpStore %arg_2 %14
-         %20 = OpLoad %7 %arg_1
-         %21 = OpLoad %3 %arg_0
-         %23 = OpSampledImage %22 %21 %20
-         %24 = OpLoad %v3float %arg_2
-         %18 = OpImageSampleImplicitLod %v4float %23 %24
-               OpStore %res %18
+         %30 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSample_e53267 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v4float Function %30
+               OpStore %arg_2 %18
+         %23 = OpLoad %7 %arg_1
+         %24 = OpLoad %3 %arg_0
+         %26 = OpSampledImage %25 %24 %23
+         %27 = OpLoad %v3float %arg_2
+         %22 = OpImageSampleImplicitLod %v4float %26 %27
+               OpStore %res %22
+         %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %35 = OpLoad %v4float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %textureSample_e53267
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %textureSample_e53267
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.wgsl
index 7d409db..6f635a1 100644
--- a/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/e53267.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureSample_e53267() {
   var arg_2 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSample_e53267();
diff --git a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl
index 21f858d..0897800 100644
--- a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl
@@ -27,7 +27,9 @@
 fn textureSample_ea7030() {
   var arg_2 = vec3<f32>(1.f);
   var res: f32 = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.dxc.hlsl
index 454ec68..d448215 100644
--- a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.dxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_ea7030() {
   float3 arg_2 = (1.0f).xxx;
   float res = arg_0.Sample(arg_1, arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.fxc.hlsl
index 454ec68..d448215 100644
--- a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.fxc.hlsl
@@ -1,9 +1,11 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSample_ea7030() {
   float3 arg_2 = (1.0f).xxx;
   float res = arg_0.Sample(arg_1, arg_2).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.glsl
index 18eee21..532ed18 100644
--- a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.glsl
@@ -3,9 +3,14 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSample_ea7030() {
   vec3 arg_2 = vec3(1.0f);
   float res = texture(arg_0_arg_1, vec4(arg_2, 0.0f));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.msl
index 5b614e4..7223e25 100644
--- a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.msl
@@ -1,13 +1,14 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSample_ea7030(depthcube<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSample_ea7030(depthcube<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   float res = tint_symbol.sample(tint_symbol_1, arg_2);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSample_ea7030(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSample_ea7030(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.spvasm
index 1fc321e..7232ace 100644
--- a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSample_ea7030 "textureSample_ea7030"
                OpName %arg_2 "arg_2"
                OpName %res "res"
@@ -17,6 +20,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -24,33 +31,42 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %20 = OpConstantNull %v3float
     %v4float = OpTypeVector %float 4
-         %23 = OpTypeSampledImage %3
+         %26 = OpTypeSampledImage %3
 %_ptr_Function_float = OpTypePointer Function %float
-         %28 = OpConstantNull %float
-%textureSample_ea7030 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-        %res = OpVariable %_ptr_Function_float Function %28
-               OpStore %arg_2 %14
-         %21 = OpLoad %7 %arg_1
-         %22 = OpLoad %3 %arg_0
-         %24 = OpSampledImage %23 %22 %21
-         %25 = OpLoad %v3float %arg_2
-         %19 = OpImageSampleImplicitLod %v4float %24 %25
-         %18 = OpCompositeExtract %float %19 0
-               OpStore %res %18
+         %31 = OpConstantNull %float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSample_ea7030 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %20
+        %res = OpVariable %_ptr_Function_float Function %31
+               OpStore %arg_2 %17
+         %24 = OpLoad %7 %arg_1
+         %25 = OpLoad %3 %arg_0
+         %27 = OpSampledImage %26 %25 %24
+         %28 = OpLoad %v3float %arg_2
+         %22 = OpImageSampleImplicitLod %v4float %27 %28
+         %21 = OpCompositeExtract %float %22 0
+               OpStore %res %21
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureSample_ea7030
+%fragment_main = OpFunction %void None %11
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureSample_ea7030
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.wgsl
index 312fb8a..1a6731d 100644
--- a/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSample/ea7030.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureSample_ea7030() {
   var arg_2 = vec3<f32>(1.0f);
   var res : f32 = textureSample(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSample_ea7030();
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl
index f908bae..3599a8a 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl
@@ -27,7 +27,9 @@
 fn textureSampleBaseClampToEdge_7c04e6() {
   var arg_2 = vec2<f32>(1.f);
   var res: vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
index 3f7528b..8236354 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
@@ -102,9 +102,12 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureSampleBaseClampToEdge_7c04e6() {
   float2 arg_2 = (1.0f).xx;
   float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, arg_2, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
index 3f7528b..8236354 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
@@ -102,9 +102,12 @@
   return tint_symbol_2;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void textureSampleBaseClampToEdge_7c04e6() {
   float2 arg_2 = (1.0f).xx;
   float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, arg_2, ext_tex_params_load(0u));
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
index 764d338..6b17300 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
@@ -83,9 +83,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_7c04e6() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -187,9 +192,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_7c04e6() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -285,9 +295,14 @@
   return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), val.pad_2, val.pad_3);
 }
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_7c04e6() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = textureSampleExternal(arg_0_1, ext_tex_plane_1_1, arg_0_arg_1, ext_tex_plane_1_arg_1, arg_2, conv_ExternalTextureParams(ext_tex_params.inner));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
index d0d9b1d..dbe6998 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
@@ -101,34 +101,35 @@
   return float4(color, 1.0f);
 }
 
-void textureSampleBaseClampToEdge_7c04e6(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, sampler tint_symbol_3, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_4) {
+void textureSampleBaseClampToEdge_7c04e6(texture2d<float, access::sample> tint_symbol_1, texture2d<float, access::sample> tint_symbol_2, sampler tint_symbol_3, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_4, device float4* const tint_symbol_5) {
   float2 arg_2 = float2(1.0f);
   float4 res = textureSampleExternal(tint_symbol_1, tint_symbol_2, tint_symbol_3, arg_2, tint_unpack_vec3_in_composite_1(*(tint_symbol_4)));
+  *(tint_symbol_5) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, sampler tint_symbol_7, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_8) {
-  textureSampleBaseClampToEdge_7c04e6(tint_symbol_5, tint_symbol_6, tint_symbol_7, tint_symbol_8);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_6, texture2d<float, access::sample> tint_symbol_7, sampler tint_symbol_8, const constant ExternalTextureParams_tint_packed_vec3* const tint_symbol_9, device float4* const tint_symbol_10) {
+  textureSampleBaseClampToEdge_7c04e6(tint_symbol_6, tint_symbol_7, tint_symbol_8, tint_symbol_9, tint_symbol_10);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], texture2d<float, access::sample> tint_symbol_10 [[texture(1)]], sampler tint_symbol_11 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_12 [[buffer(2)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_11 [[texture(0)]], texture2d<float, access::sample> tint_symbol_12 [[texture(1)]], sampler tint_symbol_13 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_14 [[buffer(2)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_11, tint_symbol_12, tint_symbol_13, tint_symbol_14, tint_symbol_15);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], texture2d<float, access::sample> tint_symbol_14 [[texture(1)]], sampler tint_symbol_15 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_16 [[buffer(2)]]) {
-  textureSampleBaseClampToEdge_7c04e6(tint_symbol_13, tint_symbol_14, tint_symbol_15, tint_symbol_16);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_16 [[texture(0)]], texture2d<float, access::sample> tint_symbol_17 [[texture(1)]], sampler tint_symbol_18 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_19 [[buffer(2)]], device float4* tint_symbol_20 [[buffer(0)]]) {
+  textureSampleBaseClampToEdge_7c04e6(tint_symbol_16, tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_17 [[texture(0)]], texture2d<float, access::sample> tint_symbol_18 [[texture(1)]], sampler tint_symbol_19 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_20 [[buffer(2)]]) {
-  textureSampleBaseClampToEdge_7c04e6(tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_21 [[texture(0)]], texture2d<float, access::sample> tint_symbol_22 [[texture(1)]], sampler tint_symbol_23 [[sampler(0)]], const constant ExternalTextureParams_tint_packed_vec3* tint_symbol_24 [[buffer(2)]], device float4* tint_symbol_25 [[buffer(0)]]) {
+  textureSampleBaseClampToEdge_7c04e6(tint_symbol_21, tint_symbol_22, tint_symbol_23, tint_symbol_24, tint_symbol_25);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
index 1abcb63..6cdb21d 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 190
+; Bound: 196
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
-         %32 = OpExtInstImport "GLSL.std.450"
+         %35 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -39,6 +39,9 @@
                OpName %ext_tex_params "ext_tex_params"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %gammaCorrection "gammaCorrection"
                OpName %v "v"
                OpName %params "params"
@@ -100,6 +103,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
                OpMemberDecorate %ExternalTextureParams 0 Offset 0
                OpMemberDecorate %ExternalTextureParams 1 Offset 4
                OpMemberDecorate %ExternalTextureParams 2 Offset 16
@@ -138,198 +145,205 @@
          %25 = OpTypeSampler
 %_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
       %arg_1 = OpVariable %_ptr_UniformConstant_25 UniformConstant
-         %26 = OpTypeFunction %v3float %v3float %GammaTransferParams
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %29 = OpTypeFunction %v3float %v3float %GammaTransferParams
        %bool = OpTypeBool
      %v3bool = OpTypeVector %bool 3
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %46 = OpConstantNull %v3float
+         %49 = OpConstantNull %v3float
 %mat3v2float = OpTypeMatrix %v2float 3
 %ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float %mat3v2float
-         %66 = OpTypeFunction %v4float %11 %11 %25 %v2float %ExternalTextureParams
+         %69 = OpTypeFunction %v4float %11 %11 %25 %v2float %ExternalTextureParams
     %float_1 = OpConstant %float 1
      %v2uint = OpTypeVector %uint 2
         %int = OpTypeInt 32 1
-         %86 = OpConstantNull %int
+         %89 = OpConstantNull %int
   %float_0_5 = OpConstant %float 0.5
-         %88 = OpConstantComposite %v2float %float_0_5 %float_0_5
+         %91 = OpConstantComposite %v2float %float_0_5 %float_0_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %94 = OpConstantNull %v2float
+         %97 = OpConstantNull %v2float
      %uint_1 = OpConstant %uint 1
-        %111 = OpTypeSampledImage %11
-        %126 = OpConstantNull %uint
-        %144 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
+        %114 = OpTypeSampledImage %11
+        %129 = OpConstantNull %uint
+        %147 = OpTypeFunction %ExternalTextureParams %ExternalTextureParams_std140
        %void = OpTypeVoid
-        %159 = OpTypeFunction %void
-        %163 = OpConstantComposite %v2float %float_1 %float_1
+        %162 = OpTypeFunction %void
+        %166 = OpConstantComposite %v2float %float_1 %float_1
      %uint_0 = OpConstant %uint 0
 %_ptr_Uniform_ExternalTextureParams_std140 = OpTypePointer Uniform %ExternalTextureParams_std140
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-        %177 = OpTypeFunction %v4float
-%gammaCorrection = OpFunction %v3float None %26
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+        %183 = OpTypeFunction %v4float
+%gammaCorrection = OpFunction %v3float None %29
           %v = OpFunctionParameter %v3float
      %params = OpFunctionParameter %GammaTransferParams
-         %30 = OpLabel
-         %44 = OpVariable %_ptr_Function_v3float Function %46
-         %56 = OpVariable %_ptr_Function_v3float Function %46
-         %62 = OpVariable %_ptr_Function_v3float Function %46
-         %31 = OpExtInst %v3float %32 FAbs %v
-         %33 = OpCompositeExtract %float %params 4
-         %34 = OpCompositeConstruct %v3float %33 %33 %33
-         %35 = OpFOrdLessThan %v3bool %31 %34
-         %38 = OpExtInst %v3float %32 FSign %v
-         %39 = OpCompositeExtract %float %params 3
-         %40 = OpExtInst %v3float %32 FAbs %v
-         %41 = OpVectorTimesScalar %v3float %40 %39
-         %42 = OpCompositeExtract %float %params 6
-         %47 = OpCompositeConstruct %v3float %42 %42 %42
-         %43 = OpFAdd %v3float %41 %47
-         %48 = OpFMul %v3float %38 %43
-         %49 = OpExtInst %v3float %32 FSign %v
-         %51 = OpCompositeExtract %float %params 1
-         %52 = OpExtInst %v3float %32 FAbs %v
-         %53 = OpVectorTimesScalar %v3float %52 %51
-         %54 = OpCompositeExtract %float %params 2
-         %57 = OpCompositeConstruct %v3float %54 %54 %54
-         %55 = OpFAdd %v3float %53 %57
-         %58 = OpCompositeExtract %float %params 0
-         %59 = OpCompositeConstruct %v3float %58 %58 %58
-         %50 = OpExtInst %v3float %32 Pow %55 %59
-         %60 = OpCompositeExtract %float %params 5
-         %63 = OpCompositeConstruct %v3float %60 %60 %60
-         %61 = OpFAdd %v3float %50 %63
-         %64 = OpFMul %v3float %49 %61
-         %65 = OpSelect %v3float %35 %48 %64
-               OpReturnValue %65
+         %33 = OpLabel
+         %47 = OpVariable %_ptr_Function_v3float Function %49
+         %59 = OpVariable %_ptr_Function_v3float Function %49
+         %65 = OpVariable %_ptr_Function_v3float Function %49
+         %34 = OpExtInst %v3float %35 FAbs %v
+         %36 = OpCompositeExtract %float %params 4
+         %37 = OpCompositeConstruct %v3float %36 %36 %36
+         %38 = OpFOrdLessThan %v3bool %34 %37
+         %41 = OpExtInst %v3float %35 FSign %v
+         %42 = OpCompositeExtract %float %params 3
+         %43 = OpExtInst %v3float %35 FAbs %v
+         %44 = OpVectorTimesScalar %v3float %43 %42
+         %45 = OpCompositeExtract %float %params 6
+         %50 = OpCompositeConstruct %v3float %45 %45 %45
+         %46 = OpFAdd %v3float %44 %50
+         %51 = OpFMul %v3float %41 %46
+         %52 = OpExtInst %v3float %35 FSign %v
+         %54 = OpCompositeExtract %float %params 1
+         %55 = OpExtInst %v3float %35 FAbs %v
+         %56 = OpVectorTimesScalar %v3float %55 %54
+         %57 = OpCompositeExtract %float %params 2
+         %60 = OpCompositeConstruct %v3float %57 %57 %57
+         %58 = OpFAdd %v3float %56 %60
+         %61 = OpCompositeExtract %float %params 0
+         %62 = OpCompositeConstruct %v3float %61 %61 %61
+         %53 = OpExtInst %v3float %35 Pow %58 %62
+         %63 = OpCompositeExtract %float %params 5
+         %66 = OpCompositeConstruct %v3float %63 %63 %63
+         %64 = OpFAdd %v3float %53 %66
+         %67 = OpFMul %v3float %52 %64
+         %68 = OpSelect %v3float %38 %51 %67
+               OpReturnValue %68
                OpFunctionEnd
-%textureSampleExternal = OpFunction %v4float None %66
+%textureSampleExternal = OpFunction %v4float None %69
      %plane0 = OpFunctionParameter %11
      %plane1 = OpFunctionParameter %11
         %smp = OpFunctionParameter %25
       %coord = OpFunctionParameter %v2float
    %params_0 = OpFunctionParameter %ExternalTextureParams
-         %75 = OpLabel
-         %92 = OpVariable %_ptr_Function_v2float Function %94
-        %101 = OpVariable %_ptr_Function_v2float Function %94
-      %color = OpVariable %_ptr_Function_v3float Function %46
-         %76 = OpCompositeExtract %mat3v2float %params_0 6
-         %77 = OpCompositeExtract %float %coord 0
-         %78 = OpCompositeExtract %float %coord 1
-         %80 = OpCompositeConstruct %v3float %77 %78 %float_1
-         %81 = OpMatrixTimesVector %v2float %76 %80
-         %83 = OpImageQuerySizeLod %v2uint %plane0 %86
-         %82 = OpConvertUToF %v2float %83
-         %89 = OpFDiv %v2float %88 %82
-         %95 = OpCompositeConstruct %v2float %float_1 %float_1
-         %91 = OpFSub %v2float %95 %89
-         %90 = OpExtInst %v2float %32 NClamp %81 %89 %91
-         %97 = OpImageQuerySizeLod %v2uint %plane1 %86
-         %96 = OpConvertUToF %v2float %97
-         %98 = OpFDiv %v2float %88 %96
-        %102 = OpCompositeConstruct %v2float %float_1 %float_1
-        %100 = OpFSub %v2float %102 %98
-         %99 = OpExtInst %v2float %32 NClamp %81 %98 %100
-        %104 = OpCompositeExtract %uint %params_0 0
-        %106 = OpIEqual %bool %104 %uint_1
-               OpSelectionMerge %107 None
-               OpBranchConditional %106 %108 %109
-        %108 = OpLabel
-        %112 = OpSampledImage %111 %plane0 %smp
-        %110 = OpImageSampleExplicitLod %v4float %112 %90 Lod %8
-        %113 = OpVectorShuffle %v3float %110 %110 0 1 2
-               OpStore %color %113
-               OpBranch %107
-        %109 = OpLabel
-        %115 = OpSampledImage %111 %plane0 %smp
-        %114 = OpImageSampleExplicitLod %v4float %115 %90 Lod %8
-        %116 = OpCompositeExtract %float %114 0
-        %118 = OpSampledImage %111 %plane1 %smp
-        %117 = OpImageSampleExplicitLod %v4float %118 %99 Lod %8
-        %119 = OpVectorShuffle %v2float %117 %117 0 1
-        %120 = OpCompositeExtract %float %119 0
-        %121 = OpCompositeExtract %float %119 1
-        %122 = OpCompositeConstruct %v4float %116 %120 %121 %float_1
-        %123 = OpCompositeExtract %mat3v4float %params_0 2
-        %124 = OpVectorTimesMatrix %v3float %122 %123
-               OpStore %color %124
-               OpBranch %107
-        %107 = OpLabel
-        %125 = OpCompositeExtract %uint %params_0 1
-        %127 = OpIEqual %bool %125 %126
-               OpSelectionMerge %128 None
-               OpBranchConditional %127 %129 %128
-        %129 = OpLabel
-        %131 = OpLoad %v3float %color
-        %132 = OpCompositeExtract %GammaTransferParams %params_0 3
-        %130 = OpFunctionCall %v3float %gammaCorrection %131 %132
-               OpStore %color %130
-        %133 = OpCompositeExtract %mat3v3float %params_0 5
+         %78 = OpLabel
+         %95 = OpVariable %_ptr_Function_v2float Function %97
+        %104 = OpVariable %_ptr_Function_v2float Function %97
+      %color = OpVariable %_ptr_Function_v3float Function %49
+         %79 = OpCompositeExtract %mat3v2float %params_0 6
+         %80 = OpCompositeExtract %float %coord 0
+         %81 = OpCompositeExtract %float %coord 1
+         %83 = OpCompositeConstruct %v3float %80 %81 %float_1
+         %84 = OpMatrixTimesVector %v2float %79 %83
+         %86 = OpImageQuerySizeLod %v2uint %plane0 %89
+         %85 = OpConvertUToF %v2float %86
+         %92 = OpFDiv %v2float %91 %85
+         %98 = OpCompositeConstruct %v2float %float_1 %float_1
+         %94 = OpFSub %v2float %98 %92
+         %93 = OpExtInst %v2float %35 NClamp %84 %92 %94
+        %100 = OpImageQuerySizeLod %v2uint %plane1 %89
+         %99 = OpConvertUToF %v2float %100
+        %101 = OpFDiv %v2float %91 %99
+        %105 = OpCompositeConstruct %v2float %float_1 %float_1
+        %103 = OpFSub %v2float %105 %101
+        %102 = OpExtInst %v2float %35 NClamp %84 %101 %103
+        %107 = OpCompositeExtract %uint %params_0 0
+        %109 = OpIEqual %bool %107 %uint_1
+               OpSelectionMerge %110 None
+               OpBranchConditional %109 %111 %112
+        %111 = OpLabel
+        %115 = OpSampledImage %114 %plane0 %smp
+        %113 = OpImageSampleExplicitLod %v4float %115 %93 Lod %8
+        %116 = OpVectorShuffle %v3float %113 %113 0 1 2
+               OpStore %color %116
+               OpBranch %110
+        %112 = OpLabel
+        %118 = OpSampledImage %114 %plane0 %smp
+        %117 = OpImageSampleExplicitLod %v4float %118 %93 Lod %8
+        %119 = OpCompositeExtract %float %117 0
+        %121 = OpSampledImage %114 %plane1 %smp
+        %120 = OpImageSampleExplicitLod %v4float %121 %102 Lod %8
+        %122 = OpVectorShuffle %v2float %120 %120 0 1
+        %123 = OpCompositeExtract %float %122 0
+        %124 = OpCompositeExtract %float %122 1
+        %125 = OpCompositeConstruct %v4float %119 %123 %124 %float_1
+        %126 = OpCompositeExtract %mat3v4float %params_0 2
+        %127 = OpVectorTimesMatrix %v3float %125 %126
+               OpStore %color %127
+               OpBranch %110
+        %110 = OpLabel
+        %128 = OpCompositeExtract %uint %params_0 1
+        %130 = OpIEqual %bool %128 %129
+               OpSelectionMerge %131 None
+               OpBranchConditional %130 %132 %131
+        %132 = OpLabel
         %134 = OpLoad %v3float %color
-        %135 = OpMatrixTimesVector %v3float %133 %134
-               OpStore %color %135
+        %135 = OpCompositeExtract %GammaTransferParams %params_0 3
+        %133 = OpFunctionCall %v3float %gammaCorrection %134 %135
+               OpStore %color %133
+        %136 = OpCompositeExtract %mat3v3float %params_0 5
         %137 = OpLoad %v3float %color
-        %138 = OpCompositeExtract %GammaTransferParams %params_0 4
-        %136 = OpFunctionCall %v3float %gammaCorrection %137 %138
-               OpStore %color %136
-               OpBranch %128
-        %128 = OpLabel
-        %139 = OpLoad %v3float %color
-        %140 = OpCompositeExtract %float %139 0
-        %141 = OpCompositeExtract %float %139 1
-        %142 = OpCompositeExtract %float %139 2
-        %143 = OpCompositeConstruct %v4float %140 %141 %142 %float_1
-               OpReturnValue %143
+        %138 = OpMatrixTimesVector %v3float %136 %137
+               OpStore %color %138
+        %140 = OpLoad %v3float %color
+        %141 = OpCompositeExtract %GammaTransferParams %params_0 4
+        %139 = OpFunctionCall %v3float %gammaCorrection %140 %141
+               OpStore %color %139
+               OpBranch %131
+        %131 = OpLabel
+        %142 = OpLoad %v3float %color
+        %143 = OpCompositeExtract %float %142 0
+        %144 = OpCompositeExtract %float %142 1
+        %145 = OpCompositeExtract %float %142 2
+        %146 = OpCompositeConstruct %v4float %143 %144 %145 %float_1
+               OpReturnValue %146
                OpFunctionEnd
-%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %144
+%conv_ExternalTextureParams = OpFunction %ExternalTextureParams None %147
         %val = OpFunctionParameter %ExternalTextureParams_std140
-        %147 = OpLabel
-        %148 = OpCompositeExtract %uint %val 0
-        %149 = OpCompositeExtract %uint %val 1
-        %150 = OpCompositeExtract %mat3v4float %val 2
-        %151 = OpCompositeExtract %GammaTransferParams %val 3
-        %152 = OpCompositeExtract %GammaTransferParams %val 4
-        %153 = OpCompositeExtract %mat3v3float %val 5
-        %154 = OpCompositeExtract %v2float %val 6
-        %155 = OpCompositeExtract %v2float %val 7
-        %156 = OpCompositeExtract %v2float %val 8
-        %157 = OpCompositeConstruct %mat3v2float %154 %155 %156
-        %158 = OpCompositeConstruct %ExternalTextureParams %148 %149 %150 %151 %152 %153 %157
-               OpReturnValue %158
+        %150 = OpLabel
+        %151 = OpCompositeExtract %uint %val 0
+        %152 = OpCompositeExtract %uint %val 1
+        %153 = OpCompositeExtract %mat3v4float %val 2
+        %154 = OpCompositeExtract %GammaTransferParams %val 3
+        %155 = OpCompositeExtract %GammaTransferParams %val 4
+        %156 = OpCompositeExtract %mat3v3float %val 5
+        %157 = OpCompositeExtract %v2float %val 6
+        %158 = OpCompositeExtract %v2float %val 7
+        %159 = OpCompositeExtract %v2float %val 8
+        %160 = OpCompositeConstruct %mat3v2float %157 %158 %159
+        %161 = OpCompositeConstruct %ExternalTextureParams %151 %152 %153 %154 %155 %156 %160
+               OpReturnValue %161
                OpFunctionEnd
-%textureSampleBaseClampToEdge_7c04e6 = OpFunction %void None %159
-        %162 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %94
+%textureSampleBaseClampToEdge_7c04e6 = OpFunction %void None %162
+        %165 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %97
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %163
-        %166 = OpLoad %11 %arg_0
-        %167 = OpLoad %11 %ext_tex_plane_1
-        %168 = OpLoad %25 %arg_1
-        %169 = OpLoad %v2float %arg_2
-        %173 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
-        %174 = OpLoad %ExternalTextureParams_std140 %173
-        %170 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %174
-        %165 = OpFunctionCall %v4float %textureSampleExternal %166 %167 %168 %169 %170
-               OpStore %res %165
+               OpStore %arg_2 %166
+        %169 = OpLoad %11 %arg_0
+        %170 = OpLoad %11 %ext_tex_plane_1
+        %171 = OpLoad %25 %arg_1
+        %172 = OpLoad %v2float %arg_2
+        %176 = OpAccessChain %_ptr_Uniform_ExternalTextureParams_std140 %ext_tex_params %uint_0
+        %177 = OpLoad %ExternalTextureParams_std140 %176
+        %173 = OpFunctionCall %ExternalTextureParams %conv_ExternalTextureParams %177
+        %168 = OpFunctionCall %v4float %textureSampleExternal %169 %170 %171 %172 %173
+               OpStore %res %168
+        %181 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+        %182 = OpLoad %v4float %res
+               OpStore %181 %182
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %177
-        %179 = OpLabel
-        %180 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
+%vertex_main_inner = OpFunction %v4float None %183
+        %185 = OpLabel
+        %186 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %159
-        %182 = OpLabel
-        %183 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %183
+%vertex_main = OpFunction %void None %162
+        %188 = OpLabel
+        %189 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %189
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %159
-        %185 = OpLabel
-        %186 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
+%fragment_main = OpFunction %void None %162
+        %191 = OpLabel
+        %192 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %159
-        %188 = OpLabel
-        %189 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
+%compute_main = OpFunction %void None %162
+        %194 = OpLabel
+        %195 = OpFunctionCall %void %textureSampleBaseClampToEdge_7c04e6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.wgsl
index 55d13b7..cdef537 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureSampleBaseClampToEdge_7c04e6() {
   var arg_2 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleBaseClampToEdge_7c04e6();
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl
index e45b575..5b20638 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl
@@ -27,7 +27,9 @@
 fn textureSampleBaseClampToEdge_9ca02c() {
   var arg_2 = vec2<f32>(1.f);
   var res: vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.dxc.hlsl
index 8382f63..9a0d698 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.dxc.hlsl
@@ -9,10 +9,12 @@
 
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBaseClampToEdge_9ca02c() {
   float2 arg_2 = (1.0f).xx;
   float4 res = tint_textureSampleBaseClampToEdge(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.fxc.hlsl
index 8382f63..9a0d698 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.fxc.hlsl
@@ -9,10 +9,12 @@
 
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBaseClampToEdge_9ca02c() {
   float2 arg_2 = (1.0f).xx;
   float4 res = tint_textureSampleBaseClampToEdge(arg_0, arg_1, arg_2);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
index f746b03..df1af06 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
@@ -10,9 +10,14 @@
 
 uniform highp sampler2D arg_0_1;
 uniform highp sampler2D arg_0_arg_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_9ca02c() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = tint_textureSampleBaseClampToEdge(arg_0_1, arg_0_arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -41,9 +46,14 @@
 
 uniform highp sampler2D arg_0_1;
 uniform highp sampler2D arg_0_arg_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_9ca02c() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = tint_textureSampleBaseClampToEdge(arg_0_1, arg_0_arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -66,9 +76,14 @@
 
 uniform highp sampler2D arg_0_1;
 uniform highp sampler2D arg_0_arg_1;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBaseClampToEdge_9ca02c() {
   vec2 arg_2 = vec2(1.0f);
   vec4 res = tint_textureSampleBaseClampToEdge(arg_0_1, arg_0_arg_1, arg_2);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
index f582c805..1b6c0d8 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
@@ -8,34 +8,35 @@
   return t.sample(s, clamped, level(0.0f));
 }
 
-void textureSampleBaseClampToEdge_9ca02c(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleBaseClampToEdge_9ca02c(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float4 res = tint_textureSampleBaseClampToEdge(tint_symbol_1, tint_symbol_2, arg_2);
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleBaseClampToEdge_9ca02c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleBaseClampToEdge_9ca02c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleBaseClampToEdge_9ca02c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleBaseClampToEdge_9ca02c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleBaseClampToEdge_9ca02c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleBaseClampToEdge_9ca02c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
index b9de795..fe66628 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 67
+; Bound: 74
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
-         %32 = OpExtInstImport "GLSL.std.450"
+         %35 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -16,6 +16,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_textureSampleBaseClampToEdge "tint_textureSampleBaseClampToEdge"
                OpName %t "t"
                OpName %s "s"
@@ -33,6 +36,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -47,70 +54,78 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
     %v2float = OpTypeVector %float 2
-         %15 = OpTypeFunction %v4float %11 %14 %v2float
+         %18 = OpTypeFunction %v4float %11 %14 %v2float
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
         %int = OpTypeInt 32 1
-         %27 = OpConstantNull %int
+         %30 = OpConstantNull %int
   %float_0_5 = OpConstant %float 0.5
-         %29 = OpConstantComposite %v2float %float_0_5 %float_0_5
+         %32 = OpConstantComposite %v2float %float_0_5 %float_0_5
     %float_1 = OpConstant %float 1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %37 = OpConstantNull %v2float
-         %40 = OpTypeSampledImage %11
+         %40 = OpConstantNull %v2float
+         %43 = OpTypeSampledImage %11
        %void = OpTypeVoid
-         %42 = OpTypeFunction %void
-         %46 = OpConstantComposite %v2float %float_1 %float_1
+         %45 = OpTypeFunction %void
+         %49 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %54 = OpTypeFunction %v4float
-%tint_textureSampleBaseClampToEdge = OpFunction %v4float None %15
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %61 = OpTypeFunction %v4float
+%tint_textureSampleBaseClampToEdge = OpFunction %v4float None %18
           %t = OpFunctionParameter %11
           %s = OpFunctionParameter %14
       %coord = OpFunctionParameter %v2float
-         %21 = OpLabel
-         %35 = OpVariable %_ptr_Function_v2float Function %37
-         %23 = OpImageQuerySizeLod %v2uint %t %27
-         %22 = OpConvertUToF %v2float %23
-         %30 = OpFDiv %v2float %29 %22
-         %38 = OpCompositeConstruct %v2float %float_1 %float_1
-         %34 = OpFSub %v2float %38 %30
-         %31 = OpExtInst %v2float %32 NClamp %coord %30 %34
-         %41 = OpSampledImage %40 %t %s
-         %39 = OpImageSampleExplicitLod %v4float %41 %31 Lod %8
-               OpReturnValue %39
+         %24 = OpLabel
+         %38 = OpVariable %_ptr_Function_v2float Function %40
+         %26 = OpImageQuerySizeLod %v2uint %t %30
+         %25 = OpConvertUToF %v2float %26
+         %33 = OpFDiv %v2float %32 %25
+         %41 = OpCompositeConstruct %v2float %float_1 %float_1
+         %37 = OpFSub %v2float %41 %33
+         %34 = OpExtInst %v2float %35 NClamp %coord %33 %37
+         %44 = OpSampledImage %43 %t %s
+         %42 = OpImageSampleExplicitLod %v4float %44 %34 Lod %8
+               OpReturnValue %42
                OpFunctionEnd
-%textureSampleBaseClampToEdge_9ca02c = OpFunction %void None %42
-         %45 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %37
+%textureSampleBaseClampToEdge_9ca02c = OpFunction %void None %45
+         %48 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %40
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %46
-         %49 = OpLoad %11 %arg_0
-         %50 = OpLoad %14 %arg_1
-         %51 = OpLoad %v2float %arg_2
-         %48 = OpFunctionCall %v4float %tint_textureSampleBaseClampToEdge %49 %50 %51
-               OpStore %res %48
+               OpStore %arg_2 %49
+         %52 = OpLoad %11 %arg_0
+         %53 = OpLoad %14 %arg_1
+         %54 = OpLoad %v2float %arg_2
+         %51 = OpFunctionCall %v4float %tint_textureSampleBaseClampToEdge %52 %53 %54
+               OpStore %res %51
+         %59 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %60 = OpLoad %v4float %res
+               OpStore %59 %60
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %54
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%vertex_main_inner = OpFunction %v4float None %61
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %42
-         %59 = OpLabel
-         %60 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %60
+%vertex_main = OpFunction %void None %45
+         %66 = OpLabel
+         %67 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %67
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %42
-         %62 = OpLabel
-         %63 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%fragment_main = OpFunction %void None %45
+         %69 = OpLabel
+         %70 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %42
-         %65 = OpLabel
-         %66 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%compute_main = OpFunction %void None %45
+         %72 = OpLabel
+         %73 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.wgsl
index 50130e1..ce44d5c 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.wgsl
@@ -5,8 +5,11 @@
 fn textureSampleBaseClampToEdge_9ca02c() {
   var arg_2 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureSampleBaseClampToEdge(arg_0, arg_1, arg_2);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleBaseClampToEdge_9ca02c();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl
index c783034..ebc2d1f 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.dxc.hlsl
index 5c5477d..981b77e 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_1c707e() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.fxc.hlsl
index 5c5477d..981b77e 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_1c707e() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.glsl
index ac47fee..6ea2a85 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.glsl
@@ -3,11 +3,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_1c707e() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = texture(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.msl
index 137fdb0..56aef23 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_1c707e(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_1c707e(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, bias(arg_4));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_1c707e(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_1c707e(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.spvasm
index 12fa1f8..30dadb1 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_1c707e "textureSampleBias_1c707e"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,49 +33,57 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %26 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %30 = OpTypeSampledImage %3
+         %29 = OpConstantNull %float
+         %33 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %42 = OpConstantNull %v4float
-%textureSampleBias_1c707e = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_v4float Function %42
-               OpStore %arg_2 %14
+         %45 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_1c707e = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_uint Function %26
+      %arg_4 = OpVariable %_ptr_Function_float Function %29
+        %res = OpVariable %_ptr_Function_v4float Function %45
+               OpStore %arg_2 %18
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %28 = OpLoad %7 %arg_1
-         %29 = OpLoad %3 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %33 = OpLoad %v2float %arg_2
-         %34 = OpCompositeExtract %float %33 0
-         %35 = OpCompositeExtract %float %33 1
-         %37 = OpLoad %uint %arg_3
-         %36 = OpConvertUToF %float %37
-         %38 = OpCompositeConstruct %v3float %34 %35 %36
-         %39 = OpLoad %float %arg_4
-         %26 = OpImageSampleImplicitLod %v4float %31 %38 Bias %39
-               OpStore %res %26
+         %31 = OpLoad %7 %arg_1
+         %32 = OpLoad %3 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %36 = OpLoad %v2float %arg_2
+         %37 = OpCompositeExtract %float %36 0
+         %38 = OpCompositeExtract %float %36 1
+         %40 = OpLoad %uint %arg_3
+         %39 = OpConvertUToF %float %40
+         %41 = OpCompositeConstruct %v3float %37 %38 %39
+         %42 = OpLoad %float %arg_4
+         %30 = OpImageSampleImplicitLod %v4float %34 %41 Bias %42
+               OpStore %res %30
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %49 = OpLoad %v4float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleBias_1c707e
+%fragment_main = OpFunction %void None %12
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleBias_1c707e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.wgsl
index 5baf826..5e34531 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/1c707e.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_1c707e();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl
index fca7000..b210e14 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1.f;
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.dxc.hlsl
index 53cba96..b848d96 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_53b9f7() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.fxc.hlsl
index 53cba96..b848d96 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_53b9f7() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.glsl
index b6be7d7..d343ccf 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_53b9f7() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = texture(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.msl
index e9e8884..e62ab16 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_53b9f7(texturecube<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_53b9f7(texturecube<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, bias(arg_3));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_53b9f7(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_53b9f7(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.spvasm
index 1881889..da45e1f 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_53b9f7 "textureSampleBias_53b9f7"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,37 +32,46 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %25 = OpTypeSampledImage %3
+         %24 = OpConstantNull %float
+         %28 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpConstantNull %v4float
-%textureSampleBias_53b9f7 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_float Function %20
-        %res = OpVariable %_ptr_Function_v4float Function %31
-               OpStore %arg_2 %14
+         %34 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_53b9f7 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_3 = OpVariable %_ptr_Function_float Function %24
+        %res = OpVariable %_ptr_Function_v4float Function %34
+               OpStore %arg_2 %18
                OpStore %arg_3 %float_1
-         %23 = OpLoad %7 %arg_1
-         %24 = OpLoad %3 %arg_0
-         %26 = OpSampledImage %25 %24 %23
-         %27 = OpLoad %v3float %arg_2
-         %28 = OpLoad %float %arg_3
-         %21 = OpImageSampleImplicitLod %v4float %26 %27 Bias %28
-               OpStore %res %21
+         %26 = OpLoad %7 %arg_1
+         %27 = OpLoad %3 %arg_0
+         %29 = OpSampledImage %28 %27 %26
+         %30 = OpLoad %v3float %arg_2
+         %31 = OpLoad %float %arg_3
+         %25 = OpImageSampleImplicitLod %v4float %29 %30 Bias %31
+               OpStore %res %25
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSampleBias_53b9f7
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureSampleBias_53b9f7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.wgsl
index 013d566..0297d12 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/53b9f7.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_53b9f7();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl
index b21f984..92e070e 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1.f;
   const arg_4 = vec3<i32>(1i);
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.dxc.hlsl
index d031784..5de4339 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.dxc.hlsl
@@ -1,13 +1,30 @@
+SKIP: FAILED
+
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_594824() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleBias_594824();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleBias.f32(i32 61, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.fxc.hlsl
index d031784..31891a1 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_594824() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.glsl
index e8156db..320e351 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_594824() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureOffset(arg_0_arg_1, arg_2, ivec3(1), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.msl
index 46b053a..81a4e62 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_594824(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_594824(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, bias(arg_3), int3(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_594824(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_594824(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.spvasm
index 2a8998d..be70203 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_594824 "textureSampleBias_594824"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,41 +32,50 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %25 = OpTypeSampledImage %3
+         %24 = OpConstantNull %float
+         %28 = OpTypeSampledImage %3
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %32 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %35 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpConstantNull %v4float
-%textureSampleBias_594824 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_float Function %20
-        %res = OpVariable %_ptr_Function_v4float Function %35
-               OpStore %arg_2 %14
+         %38 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_594824 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_3 = OpVariable %_ptr_Function_float Function %24
+        %res = OpVariable %_ptr_Function_v4float Function %38
+               OpStore %arg_2 %18
                OpStore %arg_3 %float_1
-         %23 = OpLoad %7 %arg_1
-         %24 = OpLoad %3 %arg_0
-         %26 = OpSampledImage %25 %24 %23
-         %27 = OpLoad %v3float %arg_2
-         %28 = OpLoad %float %arg_3
-         %21 = OpImageSampleImplicitLod %v4float %26 %27 Bias|ConstOffset %28 %32
-               OpStore %res %21
+         %26 = OpLoad %7 %arg_1
+         %27 = OpLoad %3 %arg_0
+         %29 = OpSampledImage %28 %27 %26
+         %30 = OpLoad %v3float %arg_2
+         %31 = OpLoad %float %arg_3
+         %25 = OpImageSampleImplicitLod %v4float %29 %30 Bias|ConstOffset %31 %35
+               OpStore %res %25
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleBias_594824
+%fragment_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleBias_594824
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.wgsl
index ff3c1c0..6568cc9 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/594824.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1.0f;
   const arg_4 = vec3<i32>(1i);
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_594824();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl
index 01d7ab4..47d271e 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1.f;
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.dxc.hlsl
index daef964..0c3b3c8 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_6a9113() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.fxc.hlsl
index daef964..0c3b3c8 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_6a9113() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.glsl
index 738eb81..3d30505 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_6a9113() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = texture(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.msl
index 31f81b9..384c0c5 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_6a9113(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_6a9113(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, bias(arg_3));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_6a9113(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_6a9113(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.spvasm
index 3ebab6b..1e629bd 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_6a9113 "textureSampleBias_6a9113"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,37 +32,46 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %25 = OpTypeSampledImage %3
+         %24 = OpConstantNull %float
+         %28 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpConstantNull %v4float
-%textureSampleBias_6a9113 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_float Function %20
-        %res = OpVariable %_ptr_Function_v4float Function %31
-               OpStore %arg_2 %14
+         %34 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_6a9113 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_float Function %24
+        %res = OpVariable %_ptr_Function_v4float Function %34
+               OpStore %arg_2 %18
                OpStore %arg_3 %float_1
-         %23 = OpLoad %7 %arg_1
-         %24 = OpLoad %3 %arg_0
-         %26 = OpSampledImage %25 %24 %23
-         %27 = OpLoad %v2float %arg_2
-         %28 = OpLoad %float %arg_3
-         %21 = OpImageSampleImplicitLod %v4float %26 %27 Bias %28
-               OpStore %res %21
+         %26 = OpLoad %7 %arg_1
+         %27 = OpLoad %3 %arg_0
+         %29 = OpSampledImage %28 %27 %26
+         %30 = OpLoad %v2float %arg_2
+         %31 = OpLoad %float %arg_3
+         %25 = OpImageSampleImplicitLod %v4float %29 %30 Bias %31
+               OpStore %res %25
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSampleBias_6a9113
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureSampleBias_6a9113
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.wgsl
index 532fbbe..57aae91 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/6a9113.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_6a9113();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl
index e0c8861..b431cdb 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.dxc.hlsl
index 0e3bcba..35b6361 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_80e579() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.fxc.hlsl
index 0e3bcba..35b6361 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_80e579() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.glsl
index cdf9c71..e0198c0 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.glsl
@@ -3,11 +3,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_80e579() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = texture(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.msl
index 982a2b6..f8a8d66 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_80e579(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_80e579(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, bias(arg_4));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_80e579(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_80e579(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.spvasm
index 76efd81..f370e70 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_80e579 "textureSampleBias_80e579"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,49 +33,58 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %26 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %30 = OpTypeSampledImage %3
+         %29 = OpConstantNull %float
+         %33 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %42 = OpConstantNull %v4float
-%textureSampleBias_80e579 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_v4float Function %42
-               OpStore %arg_2 %14
+         %45 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_80e579 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_int Function %26
+      %arg_4 = OpVariable %_ptr_Function_float Function %29
+        %res = OpVariable %_ptr_Function_v4float Function %45
+               OpStore %arg_2 %18
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %28 = OpLoad %7 %arg_1
-         %29 = OpLoad %3 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %33 = OpLoad %v2float %arg_2
-         %34 = OpCompositeExtract %float %33 0
-         %35 = OpCompositeExtract %float %33 1
-         %37 = OpLoad %int %arg_3
-         %36 = OpConvertSToF %float %37
-         %38 = OpCompositeConstruct %v3float %34 %35 %36
-         %39 = OpLoad %float %arg_4
-         %26 = OpImageSampleImplicitLod %v4float %31 %38 Bias %39
-               OpStore %res %26
+         %31 = OpLoad %7 %arg_1
+         %32 = OpLoad %3 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %36 = OpLoad %v2float %arg_2
+         %37 = OpCompositeExtract %float %36 0
+         %38 = OpCompositeExtract %float %36 1
+         %40 = OpLoad %int %arg_3
+         %39 = OpConvertSToF %float %40
+         %41 = OpCompositeConstruct %v3float %37 %38 %39
+         %42 = OpLoad %float %arg_4
+         %30 = OpImageSampleImplicitLod %v4float %34 %41 Bias %42
+               OpStore %res %30
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %50 = OpLoad %v4float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleBias_80e579
+%fragment_main = OpFunction %void None %12
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleBias_80e579
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.wgsl
index 4a78359..ef4c537 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/80e579.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_80e579();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl
index 75c7373..0b12576 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.dxc.hlsl
index 8d7ff39..ceb21c7 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.dxc.hlsl
@@ -1,14 +1,31 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_87915c() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleBias_87915c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleBias.f32(i32 61, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.fxc.hlsl
index 8d7ff39..aa6eab2 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_87915c() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.glsl
index 06cb44a..4c303a4 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.glsl
@@ -3,11 +3,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_87915c() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), ivec2(1), arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.msl
index 1232dd5..c66d3df 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_87915c(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_87915c(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, bias(arg_4), int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_87915c(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_87915c(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.spvasm
index d9a8476..d9a8483 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_87915c "textureSampleBias_87915c"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,53 +33,61 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %26 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %30 = OpTypeSampledImage %3
+         %29 = OpConstantNull %float
+         %33 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %43 = OpConstantComposite %v2int %int_1 %int_1
+         %46 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %46 = OpConstantNull %v4float
-%textureSampleBias_87915c = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_v4float Function %46
-               OpStore %arg_2 %14
+         %49 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_87915c = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_uint Function %26
+      %arg_4 = OpVariable %_ptr_Function_float Function %29
+        %res = OpVariable %_ptr_Function_v4float Function %49
+               OpStore %arg_2 %18
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %28 = OpLoad %7 %arg_1
-         %29 = OpLoad %3 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %33 = OpLoad %v2float %arg_2
-         %34 = OpCompositeExtract %float %33 0
-         %35 = OpCompositeExtract %float %33 1
-         %37 = OpLoad %uint %arg_3
-         %36 = OpConvertUToF %float %37
-         %38 = OpCompositeConstruct %v3float %34 %35 %36
-         %39 = OpLoad %float %arg_4
-         %26 = OpImageSampleImplicitLod %v4float %31 %38 Bias|ConstOffset %39 %43
-               OpStore %res %26
+         %31 = OpLoad %7 %arg_1
+         %32 = OpLoad %3 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %36 = OpLoad %v2float %arg_2
+         %37 = OpCompositeExtract %float %36 0
+         %38 = OpCompositeExtract %float %36 1
+         %40 = OpLoad %uint %arg_3
+         %39 = OpConvertUToF %float %40
+         %41 = OpCompositeConstruct %v3float %37 %38 %39
+         %42 = OpLoad %float %arg_4
+         %30 = OpImageSampleImplicitLod %v4float %34 %41 Bias|ConstOffset %42 %46
+               OpStore %res %30
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %53 = OpLoad %v4float %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleBias_87915c
+%fragment_main = OpFunction %void None %12
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleBias_87915c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.wgsl
index e25a562..3d44c8f 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/87915c.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_87915c();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl
index 0f3e7c5..4abd1cf 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.dxc.hlsl
index 10dfcf3..765c84b 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.dxc.hlsl
@@ -1,14 +1,31 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_9dbb51() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleBias_9dbb51();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleBias.f32(i32 61, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.fxc.hlsl
index 10dfcf3..4ef877a 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_9dbb51() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.glsl
index 0a1a04e..214f9f0 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.glsl
@@ -3,11 +3,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_9dbb51() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), ivec2(1), arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.msl
index c55ab29..a6fdbb1 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_9dbb51(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_9dbb51(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, bias(arg_4), int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_9dbb51(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_9dbb51(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.spvasm
index d1511f4..1460164 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 48
+; Bound: 56
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_9dbb51 "textureSampleBias_9dbb51"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,51 +33,60 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %26 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %30 = OpTypeSampledImage %3
+         %29 = OpConstantNull %float
+         %33 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %41 = OpConstantComposite %v2int %int_1 %int_1
+         %44 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %44 = OpConstantNull %v4float
-%textureSampleBias_9dbb51 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_v4float Function %44
-               OpStore %arg_2 %14
+         %47 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_9dbb51 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_int Function %26
+      %arg_4 = OpVariable %_ptr_Function_float Function %29
+        %res = OpVariable %_ptr_Function_v4float Function %47
+               OpStore %arg_2 %18
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %28 = OpLoad %7 %arg_1
-         %29 = OpLoad %3 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %33 = OpLoad %v2float %arg_2
-         %34 = OpCompositeExtract %float %33 0
-         %35 = OpCompositeExtract %float %33 1
-         %37 = OpLoad %int %arg_3
-         %36 = OpConvertSToF %float %37
-         %38 = OpCompositeConstruct %v3float %34 %35 %36
-         %39 = OpLoad %float %arg_4
-         %26 = OpImageSampleImplicitLod %v4float %31 %38 Bias|ConstOffset %39 %41
-               OpStore %res %26
+         %31 = OpLoad %7 %arg_1
+         %32 = OpLoad %3 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %36 = OpLoad %v2float %arg_2
+         %37 = OpCompositeExtract %float %36 0
+         %38 = OpCompositeExtract %float %36 1
+         %40 = OpLoad %int %arg_3
+         %39 = OpConvertSToF %float %40
+         %41 = OpCompositeConstruct %v3float %37 %38 %39
+         %42 = OpLoad %float %arg_4
+         %30 = OpImageSampleImplicitLod %v4float %34 %41 Bias|ConstOffset %42 %44
+               OpStore %res %30
+         %51 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %52 = OpLoad %v4float %res
+               OpStore %51 %52
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %46 = OpLabel
-         %47 = OpFunctionCall %void %textureSampleBias_9dbb51
+%fragment_main = OpFunction %void None %12
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleBias_9dbb51
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.wgsl
index 8f61e65..0d08f3a 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/9dbb51.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_9dbb51();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl
index dcbacbb..2fbcd26 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1.f;
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.dxc.hlsl
index f9a8c9b..257e59e 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.dxc.hlsl
@@ -1,13 +1,30 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_a161cf() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleBias_a161cf();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleBias.f32(i32 61, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.fxc.hlsl
index f9a8c9b..511c326 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_a161cf() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.glsl
index 315d0e0..3f6d7e8 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_a161cf() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureOffset(arg_0_arg_1, arg_2, ivec2(1), arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.msl
index 040f251..22c29af 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_a161cf(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_a161cf(texture2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, bias(arg_3), int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_a161cf(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_a161cf(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.spvasm
index ee1997a..da8230d 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_a161cf "textureSampleBias_a161cf"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,41 +32,50 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %18 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %21 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %25 = OpTypeSampledImage %3
+         %24 = OpConstantNull %float
+         %28 = OpTypeSampledImage %3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %32 = OpConstantComposite %v2int %int_1 %int_1
+         %35 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %35 = OpConstantNull %v4float
-%textureSampleBias_a161cf = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_float Function %20
-        %res = OpVariable %_ptr_Function_v4float Function %35
-               OpStore %arg_2 %14
+         %38 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_a161cf = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %21
+      %arg_3 = OpVariable %_ptr_Function_float Function %24
+        %res = OpVariable %_ptr_Function_v4float Function %38
+               OpStore %arg_2 %18
                OpStore %arg_3 %float_1
-         %23 = OpLoad %7 %arg_1
-         %24 = OpLoad %3 %arg_0
-         %26 = OpSampledImage %25 %24 %23
-         %27 = OpLoad %v2float %arg_2
-         %28 = OpLoad %float %arg_3
-         %21 = OpImageSampleImplicitLod %v4float %26 %27 Bias|ConstOffset %28 %32
-               OpStore %res %21
+         %26 = OpLoad %7 %arg_1
+         %27 = OpLoad %3 %arg_0
+         %29 = OpSampledImage %28 %27 %26
+         %30 = OpLoad %v2float %arg_2
+         %31 = OpLoad %float %arg_3
+         %25 = OpImageSampleImplicitLod %v4float %29 %30 Bias|ConstOffset %31 %35
+               OpStore %res %25
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %textureSampleBias_a161cf
+%fragment_main = OpFunction %void None %12
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %textureSampleBias_a161cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.wgsl
index 877ccaf..54e9990 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/a161cf.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1.0f;
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_a161cf();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl
index 7d318c3..9744f74 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.dxc.hlsl
index a059def..c6d1c09 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_c6953d() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.fxc.hlsl
index a059def..c6d1c09 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_c6953d() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.msl
index 3995304..cf51ddd 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_c6953d(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_c6953d(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, bias(arg_4));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_c6953d(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_c6953d(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.spvasm
index 810f45d..68e1e2d 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_c6953d "textureSampleBias_c6953d"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -20,6 +23,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -27,49 +34,57 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %26 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %30 = OpTypeSampledImage %3
+         %29 = OpConstantNull %float
+         %33 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %42 = OpConstantNull %v4float
-%textureSampleBias_c6953d = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_v4float Function %42
-               OpStore %arg_2 %14
+         %45 = OpConstantNull %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_c6953d = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_3 = OpVariable %_ptr_Function_uint Function %26
+      %arg_4 = OpVariable %_ptr_Function_float Function %29
+        %res = OpVariable %_ptr_Function_v4float Function %45
+               OpStore %arg_2 %18
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %28 = OpLoad %7 %arg_1
-         %29 = OpLoad %3 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpCompositeExtract %float %32 0
-         %34 = OpCompositeExtract %float %32 1
-         %35 = OpCompositeExtract %float %32 2
-         %37 = OpLoad %uint %arg_3
-         %36 = OpConvertUToF %float %37
-         %38 = OpCompositeConstruct %v4float %33 %34 %35 %36
-         %39 = OpLoad %float %arg_4
-         %26 = OpImageSampleImplicitLod %v4float %31 %38 Bias %39
-               OpStore %res %26
+         %31 = OpLoad %7 %arg_1
+         %32 = OpLoad %3 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpCompositeExtract %float %35 0
+         %37 = OpCompositeExtract %float %35 1
+         %38 = OpCompositeExtract %float %35 2
+         %40 = OpLoad %uint %arg_3
+         %39 = OpConvertUToF %float %40
+         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
+         %42 = OpLoad %float %arg_4
+         %30 = OpImageSampleImplicitLod %v4float %34 %41 Bias %42
+               OpStore %res %30
+         %48 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %49 = OpLoad %v4float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleBias_c6953d
+%fragment_main = OpFunction %void None %12
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleBias_c6953d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.wgsl
index 226af92..cc1e27c 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_c6953d();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl
index f4b1477..461dffb 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1.f;
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.dxc.hlsl
index c33134c..80f48a1 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_d3fa1b() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.fxc.hlsl
index c33134c..80f48a1 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_d3fa1b() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.glsl
index 9045a9b..52958fa 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleBias_d3fa1b() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = texture(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.msl
index debd918..ef084a3 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_d3fa1b(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_d3fa1b(texture3d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, bias(arg_3));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_d3fa1b(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_d3fa1b(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.spvasm
index d3a2da1..dc10e0d 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_d3fa1b "textureSampleBias_d3fa1b"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 3D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,37 +32,46 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %25 = OpTypeSampledImage %3
+         %24 = OpConstantNull %float
+         %28 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %31 = OpConstantNull %v4float
-%textureSampleBias_d3fa1b = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_float Function %20
-        %res = OpVariable %_ptr_Function_v4float Function %31
-               OpStore %arg_2 %14
+         %34 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_d3fa1b = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_3 = OpVariable %_ptr_Function_float Function %24
+        %res = OpVariable %_ptr_Function_v4float Function %34
+               OpStore %arg_2 %18
                OpStore %arg_3 %float_1
-         %23 = OpLoad %7 %arg_1
-         %24 = OpLoad %3 %arg_0
-         %26 = OpSampledImage %25 %24 %23
-         %27 = OpLoad %v3float %arg_2
-         %28 = OpLoad %float %arg_3
-         %21 = OpImageSampleImplicitLod %v4float %26 %27 Bias %28
-               OpStore %res %21
+         %26 = OpLoad %7 %arg_1
+         %27 = OpLoad %3 %arg_0
+         %29 = OpSampledImage %28 %27 %26
+         %30 = OpLoad %v3float %arg_2
+         %31 = OpLoad %float %arg_3
+         %25 = OpImageSampleImplicitLod %v4float %29 %30 Bias %31
+               OpStore %res %25
+         %38 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %39 = OpLoad %v4float %res
+               OpStore %38 %39
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %textureSampleBias_d3fa1b
+%fragment_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %textureSampleBias_d3fa1b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.wgsl
index 6bbdd3a..9480c09 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/d3fa1b.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_d3fa1b();
diff --git a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl
index e5679f7..1bd3dd7 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.dxc.hlsl
index 02d7069..ce6be4b 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_eed7c4() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.fxc.hlsl
index 02d7069..ce6be4b 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleBias_eed7c4() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleBias(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.msl
index 1ff60f1..e6335b3 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleBias_eed7c4(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleBias_eed7c4(texturecube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float4* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol.sample(tint_symbol_1, arg_2, arg_3, bias(arg_4));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleBias_eed7c4(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float4* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleBias_eed7c4(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.spvasm
index 6f53582b..aea7f41 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 46
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleBias_eed7c4 "textureSampleBias_eed7c4"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -20,6 +23,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -27,49 +34,58 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+    %v4float = OpTypeVector %float 4
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %18 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %21 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %26 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-    %v4float = OpTypeVector %float 4
-         %30 = OpTypeSampledImage %3
+         %29 = OpConstantNull %float
+         %33 = OpTypeSampledImage %3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %42 = OpConstantNull %v4float
-%textureSampleBias_eed7c4 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_v4float Function %42
-               OpStore %arg_2 %14
+         %45 = OpConstantNull %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+%textureSampleBias_eed7c4 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %21
+      %arg_3 = OpVariable %_ptr_Function_int Function %26
+      %arg_4 = OpVariable %_ptr_Function_float Function %29
+        %res = OpVariable %_ptr_Function_v4float Function %45
+               OpStore %arg_2 %18
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %28 = OpLoad %7 %arg_1
-         %29 = OpLoad %3 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpCompositeExtract %float %32 0
-         %34 = OpCompositeExtract %float %32 1
-         %35 = OpCompositeExtract %float %32 2
-         %37 = OpLoad %int %arg_3
-         %36 = OpConvertSToF %float %37
-         %38 = OpCompositeConstruct %v4float %33 %34 %35 %36
-         %39 = OpLoad %float %arg_4
-         %26 = OpImageSampleImplicitLod %v4float %31 %38 Bias %39
-               OpStore %res %26
+         %31 = OpLoad %7 %arg_1
+         %32 = OpLoad %3 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpCompositeExtract %float %35 0
+         %37 = OpCompositeExtract %float %35 1
+         %38 = OpCompositeExtract %float %35 2
+         %40 = OpLoad %int %arg_3
+         %39 = OpConvertSToF %float %40
+         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
+         %42 = OpLoad %float %arg_4
+         %30 = OpImageSampleImplicitLod %v4float %34 %41 Bias %42
+               OpStore %res %30
+         %49 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %50 = OpLoad %v4float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleBias_eed7c4
+%fragment_main = OpFunction %void None %12
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleBias_eed7c4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.wgsl
index 370747d..528d3e8 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureSampleBias(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @fragment
 fn fragment_main() {
   textureSampleBias_eed7c4();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl
index cbc3437..8a0bfc2 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.dxc.hlsl
index 5b8163f..094347a 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_1912e5() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.fxc.hlsl
index 5b8163f..094347a 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_1912e5() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.msl
index b92236a..0378540 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_1912e5(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_1912e5(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3, arg_4);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_1912e5(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_1912e5(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.spvasm
index 4b70484..68148a6 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_1912e5 "textureSampleCompare_1912e5"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -20,6 +23,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -27,47 +34,55 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %20 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %25 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-         %29 = OpTypeSampledImage %3
+         %28 = OpConstantNull %float
+         %32 = OpTypeSampledImage %3
     %v4float = OpTypeVector %float 4
-%textureSampleCompare_1912e5 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_float Function %25
-               OpStore %arg_2 %14
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_1912e5 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %20
+      %arg_3 = OpVariable %_ptr_Function_uint Function %25
+      %arg_4 = OpVariable %_ptr_Function_float Function %28
+        %res = OpVariable %_ptr_Function_float Function %28
+               OpStore %arg_2 %17
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %27 = OpLoad %7 %arg_1
-         %28 = OpLoad %3 %arg_0
-         %30 = OpSampledImage %29 %28 %27
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpCompositeExtract %float %32 0
-         %34 = OpCompositeExtract %float %32 1
-         %35 = OpCompositeExtract %float %32 2
-         %37 = OpLoad %uint %arg_3
-         %36 = OpConvertUToF %float %37
-         %38 = OpCompositeConstruct %v4float %33 %34 %35 %36
-         %39 = OpLoad %float %arg_4
-         %26 = OpImageSampleDrefImplicitLod %float %30 %38 %39
-               OpStore %res %26
+         %30 = OpLoad %7 %arg_1
+         %31 = OpLoad %3 %arg_0
+         %33 = OpSampledImage %32 %31 %30
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpCompositeExtract %float %35 0
+         %37 = OpCompositeExtract %float %35 1
+         %38 = OpCompositeExtract %float %35 2
+         %40 = OpLoad %uint %arg_3
+         %39 = OpConvertUToF %float %40
+         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
+         %42 = OpLoad %float %arg_4
+         %29 = OpImageSampleDrefImplicitLod %float %33 %41 %42
+               OpStore %res %29
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleCompare_1912e5
+%fragment_main = OpFunction %void None %11
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleCompare_1912e5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.wgsl
index 6668830..185f767 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_1912e5();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl
index fe0c27f..782879d 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1.f;
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.dxc.hlsl
index 57c2cf9..c530777 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_3a5923() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.fxc.hlsl
index 57c2cf9..c530777 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_3a5923() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.glsl
index 0bb26bb..2a0e458 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_3a5923() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   float res = texture(arg_0_arg_1, vec3(arg_2, arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.msl
index 6ca4c0d..6b55d59 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_3a5923(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_3a5923(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_3a5923(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_3a5923(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.spvasm
index f9f7536..d0f26b2 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_3a5923 "textureSampleCompare_3a5923"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,34 +32,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpConstantNull %float
-         %24 = OpTypeSampledImage %3
-%textureSampleCompare_3a5923 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_float Function %20
-        %res = OpVariable %_ptr_Function_float Function %20
-               OpStore %arg_2 %14
+         %23 = OpConstantNull %float
+         %27 = OpTypeSampledImage %3
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_3a5923 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_float Function %23
+        %res = OpVariable %_ptr_Function_float Function %23
+               OpStore %arg_2 %17
                OpStore %arg_3 %float_1
-         %22 = OpLoad %7 %arg_1
-         %23 = OpLoad %3 %arg_0
-         %25 = OpSampledImage %24 %23 %22
-         %26 = OpLoad %v2float %arg_2
-         %27 = OpLoad %float %arg_3
-         %21 = OpImageSampleDrefImplicitLod %float %25 %26 %27
-               OpStore %res %21
+         %25 = OpLoad %7 %arg_1
+         %26 = OpLoad %3 %arg_0
+         %28 = OpSampledImage %27 %26 %25
+         %29 = OpLoad %v2float %arg_2
+         %30 = OpLoad %float %arg_3
+         %24 = OpImageSampleDrefImplicitLod %float %28 %29 %30
+               OpStore %res %24
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureSampleCompare_3a5923
+%fragment_main = OpFunction %void None %11
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureSampleCompare_3a5923
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.wgsl
index bd314d6..1d0c19f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/3a5923.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_3a5923();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl
index e9ae16b..6eeba1d 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1.f;
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.dxc.hlsl
index 7d3ca77..e9624e4 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_63fb83() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.fxc.hlsl
index 7d3ca77..e9624e4 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_63fb83() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.glsl
index 9a48a46..9828944 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_63fb83() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(arg_2, arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.msl
index d9fecce..c395414 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_63fb83(depthcube<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_63fb83(depthcube<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_63fb83(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_63fb83(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.spvasm
index eab7849..18ab702 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_63fb83 "textureSampleCompare_63fb83"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,34 +32,43 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %20 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpConstantNull %float
-         %24 = OpTypeSampledImage %3
-%textureSampleCompare_63fb83 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_float Function %20
-        %res = OpVariable %_ptr_Function_float Function %20
-               OpStore %arg_2 %14
+         %23 = OpConstantNull %float
+         %27 = OpTypeSampledImage %3
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_63fb83 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %20
+      %arg_3 = OpVariable %_ptr_Function_float Function %23
+        %res = OpVariable %_ptr_Function_float Function %23
+               OpStore %arg_2 %17
                OpStore %arg_3 %float_1
-         %22 = OpLoad %7 %arg_1
-         %23 = OpLoad %3 %arg_0
-         %25 = OpSampledImage %24 %23 %22
-         %26 = OpLoad %v3float %arg_2
-         %27 = OpLoad %float %arg_3
-         %21 = OpImageSampleDrefImplicitLod %float %25 %26 %27
-               OpStore %res %21
+         %25 = OpLoad %7 %arg_1
+         %26 = OpLoad %3 %arg_0
+         %28 = OpSampledImage %27 %26 %25
+         %29 = OpLoad %v3float %arg_2
+         %30 = OpLoad %float %arg_3
+         %24 = OpImageSampleDrefImplicitLod %float %28 %29 %30
+               OpStore %res %24
+         %35 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %36 = OpLoad %float %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %textureSampleCompare_63fb83
+%fragment_main = OpFunction %void None %11
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %textureSampleCompare_63fb83
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.wgsl
index 5a5a765..3635801 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/63fb83.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_63fb83();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl
index 04a3439..0ca7207 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.dxc.hlsl
index b198097..1b8a31f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.dxc.hlsl
@@ -1,14 +1,31 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_7b5025() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleCompare_7b5025();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.fxc.hlsl
index b198097..c5bd37e 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_7b5025() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.msl
index 4fc5720..2afcb45 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_7b5025(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_7b5025(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3, arg_4, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_7b5025(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_7b5025(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.spvasm
index d6a699b..b99e2c8 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 47
+; Bound: 54
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_7b5025 "textureSampleCompare_7b5025"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,50 +33,58 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %25 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-         %29 = OpTypeSampledImage %3
+         %28 = OpConstantNull %float
+         %32 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %42 = OpConstantComposite %v2int %int_1 %int_1
-%textureSampleCompare_7b5025 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_float Function %25
-               OpStore %arg_2 %14
+         %45 = OpConstantComposite %v2int %int_1 %int_1
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_7b5025 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_uint Function %25
+      %arg_4 = OpVariable %_ptr_Function_float Function %28
+        %res = OpVariable %_ptr_Function_float Function %28
+               OpStore %arg_2 %17
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %27 = OpLoad %7 %arg_1
-         %28 = OpLoad %3 %arg_0
-         %30 = OpSampledImage %29 %28 %27
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpCompositeExtract %float %32 0
-         %34 = OpCompositeExtract %float %32 1
-         %36 = OpLoad %uint %arg_3
-         %35 = OpConvertUToF %float %36
-         %37 = OpCompositeConstruct %v3float %33 %34 %35
-         %38 = OpLoad %float %arg_4
-         %26 = OpImageSampleDrefImplicitLod %float %30 %37 %38 ConstOffset %42
-               OpStore %res %26
+         %30 = OpLoad %7 %arg_1
+         %31 = OpLoad %3 %arg_0
+         %33 = OpSampledImage %32 %31 %30
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpCompositeExtract %float %35 0
+         %37 = OpCompositeExtract %float %35 1
+         %39 = OpLoad %uint %arg_3
+         %38 = OpConvertUToF %float %39
+         %40 = OpCompositeConstruct %v3float %36 %37 %38
+         %41 = OpLoad %float %arg_4
+         %29 = OpImageSampleDrefImplicitLod %float %33 %40 %41 ConstOffset %45
+               OpStore %res %29
+         %49 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %50 = OpLoad %float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleCompare_7b5025
+%fragment_main = OpFunction %void None %11
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleCompare_7b5025
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.wgsl
index 7df4e6f..1a035d7 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_7b5025();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl
index 94aa4fe..d1cb695 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.dxc.hlsl
index 6f59515..9f49603 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_90ae56() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.fxc.hlsl
index 6f59515..9f49603 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_90ae56() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.glsl
index 1999c7e..6624672 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.glsl
@@ -3,11 +3,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_90ae56() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), arg_4));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.msl
index d88ca51..4b4060b 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_90ae56(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_90ae56(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3, arg_4);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_90ae56(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_90ae56(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.spvasm
index 56a26c3..d7cd082 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 50
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_90ae56 "textureSampleCompare_90ae56"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,46 +33,54 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %22 = OpConstantNull %uint
+         %25 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-         %29 = OpTypeSampledImage %3
+         %28 = OpConstantNull %float
+         %32 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
-%textureSampleCompare_90ae56 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_uint Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_float Function %25
-               OpStore %arg_2 %14
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_90ae56 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_uint Function %25
+      %arg_4 = OpVariable %_ptr_Function_float Function %28
+        %res = OpVariable %_ptr_Function_float Function %28
+               OpStore %arg_2 %17
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %27 = OpLoad %7 %arg_1
-         %28 = OpLoad %3 %arg_0
-         %30 = OpSampledImage %29 %28 %27
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpCompositeExtract %float %32 0
-         %34 = OpCompositeExtract %float %32 1
-         %36 = OpLoad %uint %arg_3
-         %35 = OpConvertUToF %float %36
-         %37 = OpCompositeConstruct %v3float %33 %34 %35
-         %38 = OpLoad %float %arg_4
-         %26 = OpImageSampleDrefImplicitLod %float %30 %37 %38
-               OpStore %res %26
+         %30 = OpLoad %7 %arg_1
+         %31 = OpLoad %3 %arg_0
+         %33 = OpSampledImage %32 %31 %30
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpCompositeExtract %float %35 0
+         %37 = OpCompositeExtract %float %35 1
+         %39 = OpLoad %uint %arg_3
+         %38 = OpConvertUToF %float %39
+         %40 = OpCompositeConstruct %v3float %36 %37 %38
+         %41 = OpLoad %float %arg_4
+         %29 = OpImageSampleDrefImplicitLod %float %33 %40 %41
+               OpStore %res %29
+         %45 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %46 = OpLoad %float %res
+               OpStore %45 %46
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleCompare_90ae56
+%fragment_main = OpFunction %void None %11
+         %48 = OpLabel
+         %49 = OpFunctionCall %void %textureSampleCompare_90ae56
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.wgsl
index dad5b9d..3a5450f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/90ae56.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_90ae56();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl
index adb1f55..e7f41d4 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.dxc.hlsl
index dca9cdf..70a88a6 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_a3ca7e() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.fxc.hlsl
index dca9cdf..70a88a6 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_a3ca7e() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.msl
index 81e30a3..e8752bc 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_a3ca7e(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_a3ca7e(depthcube_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3, arg_4);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_a3ca7e(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_a3ca7e(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.spvasm
index 14c991b..076677a 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 52
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -10,6 +10,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_a3ca7e "textureSampleCompare_a3ca7e"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -20,6 +23,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float Cube 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -27,47 +34,56 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %17 = OpConstantNull %v3float
+         %20 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %25 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-         %29 = OpTypeSampledImage %3
+         %28 = OpConstantNull %float
+         %32 = OpTypeSampledImage %3
     %v4float = OpTypeVector %float 4
-%textureSampleCompare_a3ca7e = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_float Function %25
-               OpStore %arg_2 %14
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_a3ca7e = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %20
+      %arg_3 = OpVariable %_ptr_Function_int Function %25
+      %arg_4 = OpVariable %_ptr_Function_float Function %28
+        %res = OpVariable %_ptr_Function_float Function %28
+               OpStore %arg_2 %17
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %27 = OpLoad %7 %arg_1
-         %28 = OpLoad %3 %arg_0
-         %30 = OpSampledImage %29 %28 %27
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpCompositeExtract %float %32 0
-         %34 = OpCompositeExtract %float %32 1
-         %35 = OpCompositeExtract %float %32 2
-         %37 = OpLoad %int %arg_3
-         %36 = OpConvertSToF %float %37
-         %38 = OpCompositeConstruct %v4float %33 %34 %35 %36
-         %39 = OpLoad %float %arg_4
-         %26 = OpImageSampleDrefImplicitLod %float %30 %38 %39
-               OpStore %res %26
+         %30 = OpLoad %7 %arg_1
+         %31 = OpLoad %3 %arg_0
+         %33 = OpSampledImage %32 %31 %30
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpCompositeExtract %float %35 0
+         %37 = OpCompositeExtract %float %35 1
+         %38 = OpCompositeExtract %float %35 2
+         %40 = OpLoad %int %arg_3
+         %39 = OpConvertSToF %float %40
+         %41 = OpCompositeConstruct %v4float %36 %37 %38 %39
+         %42 = OpLoad %float %arg_4
+         %29 = OpImageSampleDrefImplicitLod %float %33 %41 %42
+               OpStore %res %29
+         %47 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %48 = OpLoad %float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleCompare_a3ca7e
+%fragment_main = OpFunction %void None %11
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleCompare_a3ca7e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.wgsl
index fa3a6a8..118e563 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_a3ca7e();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl
index cde0d28..8bc2e6a 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.dxc.hlsl
index 3a08b41..3fce7a3 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.dxc.hlsl
@@ -1,14 +1,31 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_af1051() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleCompare_af1051();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.fxc.hlsl
index 3a08b41..a5b2ef3 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_af1051() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.msl
index b1cc778..32e8f8f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_af1051(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_af1051(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3, arg_4, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_af1051(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_af1051(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.spvasm
index 36521c5..5ab7121 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 45
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_af1051 "textureSampleCompare_af1051"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,48 +33,57 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %25 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-         %29 = OpTypeSampledImage %3
+         %28 = OpConstantNull %float
+         %32 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %40 = OpConstantComposite %v2int %int_1 %int_1
-%textureSampleCompare_af1051 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_float Function %25
-               OpStore %arg_2 %14
+         %43 = OpConstantComposite %v2int %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_af1051 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_int Function %25
+      %arg_4 = OpVariable %_ptr_Function_float Function %28
+        %res = OpVariable %_ptr_Function_float Function %28
+               OpStore %arg_2 %17
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %27 = OpLoad %7 %arg_1
-         %28 = OpLoad %3 %arg_0
-         %30 = OpSampledImage %29 %28 %27
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpCompositeExtract %float %32 0
-         %34 = OpCompositeExtract %float %32 1
-         %36 = OpLoad %int %arg_3
-         %35 = OpConvertSToF %float %36
-         %37 = OpCompositeConstruct %v3float %33 %34 %35
-         %38 = OpLoad %float %arg_4
-         %26 = OpImageSampleDrefImplicitLod %float %30 %37 %38 ConstOffset %40
-               OpStore %res %26
+         %30 = OpLoad %7 %arg_1
+         %31 = OpLoad %3 %arg_0
+         %33 = OpSampledImage %32 %31 %30
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpCompositeExtract %float %35 0
+         %37 = OpCompositeExtract %float %35 1
+         %39 = OpLoad %int %arg_3
+         %38 = OpConvertSToF %float %39
+         %40 = OpCompositeConstruct %v3float %36 %37 %38
+         %41 = OpLoad %float %arg_4
+         %29 = OpImageSampleDrefImplicitLod %float %33 %40 %41 ConstOffset %43
+               OpStore %res %29
+         %48 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %49 = OpLoad %float %res
+               OpStore %48 %49
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleCompare_af1051
+%fragment_main = OpFunction %void None %11
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleCompare_af1051
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.wgsl
index 60fba5e..e5b6b7c 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_af1051();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl
index a4d132e..39fd343 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.dxc.hlsl
index 6a97450..4a2d29c 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_dd431d() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.fxc.hlsl
index 6a97450..4a2d29c 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_dd431d() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.glsl
index 69cd114..b00d8d5 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.glsl
@@ -3,11 +3,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_dd431d() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), arg_4));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.msl
index d9041fa..61bf101 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.msl
@@ -1,15 +1,16 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_dd431d(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_dd431d(depth2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3, arg_4);
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_dd431d(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_dd431d(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.spvasm
index 4f1f1a0..69531ff 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_dd431d "textureSampleCompare_dd431d"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -19,6 +22,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 1 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -26,46 +33,55 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
+         %25 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %25 = OpConstantNull %float
-         %29 = OpTypeSampledImage %3
+         %28 = OpConstantNull %float
+         %32 = OpTypeSampledImage %3
     %v3float = OpTypeVector %float 3
-%textureSampleCompare_dd431d = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_int Function %22
-      %arg_4 = OpVariable %_ptr_Function_float Function %25
-        %res = OpVariable %_ptr_Function_float Function %25
-               OpStore %arg_2 %14
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_dd431d = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_int Function %25
+      %arg_4 = OpVariable %_ptr_Function_float Function %28
+        %res = OpVariable %_ptr_Function_float Function %28
+               OpStore %arg_2 %17
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %27 = OpLoad %7 %arg_1
-         %28 = OpLoad %3 %arg_0
-         %30 = OpSampledImage %29 %28 %27
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpCompositeExtract %float %32 0
-         %34 = OpCompositeExtract %float %32 1
-         %36 = OpLoad %int %arg_3
-         %35 = OpConvertSToF %float %36
-         %37 = OpCompositeConstruct %v3float %33 %34 %35
-         %38 = OpLoad %float %arg_4
-         %26 = OpImageSampleDrefImplicitLod %float %30 %37 %38
-               OpStore %res %26
+         %30 = OpLoad %7 %arg_1
+         %31 = OpLoad %3 %arg_0
+         %33 = OpSampledImage %32 %31 %30
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpCompositeExtract %float %35 0
+         %37 = OpCompositeExtract %float %35 1
+         %39 = OpLoad %int %arg_3
+         %38 = OpConvertSToF %float %39
+         %40 = OpCompositeConstruct %v3float %36 %37 %38
+         %41 = OpLoad %float %arg_4
+         %29 = OpImageSampleDrefImplicitLod %float %33 %40 %41
+               OpStore %res %29
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %textureSampleCompare_dd431d
+%fragment_main = OpFunction %void None %11
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %textureSampleCompare_dd431d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.wgsl
index c973460..269db6b 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dd431d.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_dd431d();
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl
index c479d1e..5e0bbb5 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1.f;
   const arg_4 = vec2<i32>(1i);
   var res: f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @fragment
 fn fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.dxc.hlsl
index b955a0f..01aaf8a 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.dxc.hlsl
@@ -1,13 +1,30 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_dec064() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
   textureSampleCompare_dec064();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmp.f32(i32 64, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.fxc.hlsl
index b955a0f..68f2211 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompare_dec064() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmp(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.glsl
index 01e9c58..c28c43b 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.glsl
@@ -3,10 +3,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompare_dec064() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   float res = textureOffset(arg_0_arg_1, vec3(arg_2, arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.msl
index 7625b7c..233bbb1 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.msl
@@ -1,14 +1,15 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompare_dec064(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1) {
+void textureSampleCompare_dec064(depth2d<float, access::sample> tint_symbol, sampler tint_symbol_1, device float* const tint_symbol_2) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float res = tint_symbol.sample_compare(tint_symbol_1, arg_2, arg_3, int2(1));
+  *(tint_symbol_2) = res;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_2 [[texture(0)]], sampler tint_symbol_3 [[sampler(0)]]) {
-  textureSampleCompare_dec064(tint_symbol_2, tint_symbol_3);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]], device float* tint_symbol_5 [[buffer(0)]]) {
+  textureSampleCompare_dec064(tint_symbol_3, tint_symbol_4, tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.spvasm
index 9713419..8e53e61 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %fragment_main OriginUpperLeft
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompare_dec064 "textureSampleCompare_dec064"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -18,6 +21,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
           %3 = OpTypeImage %float 2D 0 0 0 1 Unknown
 %_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
@@ -25,38 +32,47 @@
           %7 = OpTypeSampler
 %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
       %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %8 = OpTypeFunction %void
+         %11 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %14 = OpConstantComposite %v2float %float_1 %float_1
+         %17 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %17 = OpConstantNull %v2float
+         %20 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpConstantNull %float
-         %24 = OpTypeSampledImage %3
+         %23 = OpConstantNull %float
+         %27 = OpTypeSampledImage %3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %31 = OpConstantComposite %v2int %int_1 %int_1
-%textureSampleCompare_dec064 = OpFunction %void None %8
-         %11 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %17
-      %arg_3 = OpVariable %_ptr_Function_float Function %20
-        %res = OpVariable %_ptr_Function_float Function %20
-               OpStore %arg_2 %14
+         %34 = OpConstantComposite %v2int %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+%textureSampleCompare_dec064 = OpFunction %void None %11
+         %14 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %20
+      %arg_3 = OpVariable %_ptr_Function_float Function %23
+        %res = OpVariable %_ptr_Function_float Function %23
+               OpStore %arg_2 %17
                OpStore %arg_3 %float_1
-         %22 = OpLoad %7 %arg_1
-         %23 = OpLoad %3 %arg_0
-         %25 = OpSampledImage %24 %23 %22
-         %26 = OpLoad %v2float %arg_2
-         %27 = OpLoad %float %arg_3
-         %21 = OpImageSampleDrefImplicitLod %float %25 %26 %27 ConstOffset %31
-               OpStore %res %21
+         %25 = OpLoad %7 %arg_1
+         %26 = OpLoad %3 %arg_0
+         %28 = OpSampledImage %27 %26 %25
+         %29 = OpLoad %v2float %arg_2
+         %30 = OpLoad %float %arg_3
+         %24 = OpImageSampleDrefImplicitLod %float %28 %29 %30 ConstOffset %34
+               OpStore %res %24
+         %39 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %40 = OpLoad %float %res
+               OpStore %39 %40
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %8
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %textureSampleCompare_dec064
+%fragment_main = OpFunction %void None %11
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %textureSampleCompare_dec064
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.wgsl
index 43246d2..caaf141 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/dec064.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1.0f;
   const arg_4 = vec2<i32>(1i);
   var res : f32 = textureSampleCompare(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @fragment
 fn fragment_main() {
   textureSampleCompare_dec064();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl
index 752117a..d747b50 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.dxc.hlsl
index 8a156a2..04573a5 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_1116ed() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.fxc.hlsl
index 8a156a2..04573a5 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_1116ed() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.glsl
index 0383b2e..b2ff988 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1116ed() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), arg_4));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1116ed() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), arg_4));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1116ed() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), arg_4));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.msl
index fc084f6..934a55f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_1116ed(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_1116ed(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, arg_4, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_1116ed(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_1116ed(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_1116ed(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_1116ed(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_1116ed(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_1116ed(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.spvasm
index c187ec1..20b0967 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_1116ed "textureSampleCompareLevel_1116ed"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,64 +50,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_0 = OpConstant %float 0
-         %47 = OpTypeFunction %v4float
-%textureSampleCompareLevel_1116ed = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %55 = OpTypeFunction %v4float
+%textureSampleCompareLevel_1116ed = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleDrefExplicitLod %float %36 %43 %44 Lod %float_0
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleDrefExplicitLod %float %39 %46 %47 Lod %float_0
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %54 = OpLoad %float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleCompareLevel_1116ed
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.wgsl
index 1ef36d7..6ba568d 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_1116ed();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl
index b0be6cd..4652183 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1.f;
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.dxc.hlsl
index fe49ba4..3d0e2b6 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_1568e3() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.fxc.hlsl
index fe49ba4..3d0e2b6 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_1568e3() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.glsl
index d85527c..75cdc7d 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1568e3() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(arg_2, arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1568e3() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(arg_2, arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp samplerCubeShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_1568e3() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(arg_2, arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.msl
index 53f4c9c..75e3d41 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_1568e3(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_1568e3(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_1568e3(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_1568e3(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_1568e3(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_1568e3(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_1568e3(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_1568e3(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.spvasm
index db66d65..80828f7 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_1568e3 "textureSampleCompareLevel_1568e3"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
     %float_0 = OpConstant %float 0
-         %36 = OpTypeFunction %v4float
-%textureSampleCompareLevel_1568e3 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %44 = OpTypeFunction %v4float
+%textureSampleCompareLevel_1568e3 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageSampleDrefExplicitLod %float %31 %32 %33 Lod %float_0
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageSampleDrefExplicitLod %float %34 %35 %36 Lod %float_0
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %43 = OpLoad %float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleCompareLevel_1568e3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.wgsl
index 4952803..832de5f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_1568e3();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl
index dd93828..815339d 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1.f;
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.dxc.hlsl
index b25f1dd..209f5db 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_2ad2b1() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.fxc.hlsl
index b25f1dd..209f5db 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_2ad2b1() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, arg_2, arg_3);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.glsl
index 5e9a77b..c3e1af8 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_2ad2b1() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   float res = texture(arg_0_arg_1, vec3(arg_2, arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_2ad2b1() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   float res = texture(arg_0_arg_1, vec3(arg_2, arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_2ad2b1() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   float res = texture(arg_0_arg_1, vec3(arg_2, arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl
index 2e023a2..e2ba1b0 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_2ad2b1(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_2ad2b1(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_2ad2b1(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_2ad2b1(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_2ad2b1(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_2ad2b1(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_2ad2b1(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_2ad2b1(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.spvasm
index 31ce90d..e47c2c5 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_2ad2b1 "textureSampleCompareLevel_2ad2b1"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
     %float_0 = OpConstant %float 0
-         %36 = OpTypeFunction %v4float
-%textureSampleCompareLevel_2ad2b1 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %44 = OpTypeFunction %v4float
+%textureSampleCompareLevel_2ad2b1 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageSampleDrefExplicitLod %float %31 %32 %33 Lod %float_0
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageSampleDrefExplicitLod %float %34 %35 %36 Lod %float_0
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %43 = OpLoad %float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleCompareLevel_2ad2b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.wgsl
index 2956adc..3bd3f95 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_2ad2b1();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl
index bff8b92..b0458ff 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.dxc.hlsl
index 109d02d..4e4cb2f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_4cf3a2() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.fxc.hlsl
index 109d02d..4e4cb2f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_4cf3a2() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl
index 2bbfa78..f51e761 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_4cf3a2(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_4cf3a2(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, arg_4, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_4cf3a2(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_4cf3a2(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_4cf3a2(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_4cf3a2(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_4cf3a2(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_4cf3a2(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.spvasm
index fe0d7cd..b5dc9cc 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_4cf3a2 "textureSampleCompareLevel_4cf3a2"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,64 +51,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %float_0 = OpConstant %float 0
-         %47 = OpTypeFunction %v4float
-%textureSampleCompareLevel_4cf3a2 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %55 = OpTypeFunction %v4float
+%textureSampleCompareLevel_4cf3a2 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleDrefExplicitLod %float %36 %43 %44 Lod %float_0
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleDrefExplicitLod %float %39 %46 %47 Lod %float_0
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %54 = OpLoad %float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleCompareLevel_4cf3a2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.wgsl
index 081c1ec..ee3bd92 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_4cf3a2();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl
index fbb9dac..29bcf4a 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.dxc.hlsl
index 90c9f70..0c4458e 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_7dc3c0() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.fxc.hlsl
index 90c9f70..0c4458e 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_7dc3c0() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.glsl
index 7ec21aa..54122c2 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7dc3c0() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), arg_4));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7dc3c0() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), arg_4));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArrayShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7dc3c0() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = texture(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), arg_4));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.msl
index 817418d..806b7da 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_7dc3c0(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_7dc3c0(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, arg_4, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_7dc3c0(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_7dc3c0(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_7dc3c0(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_7dc3c0(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_7dc3c0(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_7dc3c0(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.spvasm
index 1533c38..ac71fc1 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_7dc3c0 "textureSampleCompareLevel_7dc3c0"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,64 +50,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_0 = OpConstant %float 0
-         %47 = OpTypeFunction %v4float
-%textureSampleCompareLevel_7dc3c0 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %54 = OpTypeFunction %v4float
+%textureSampleCompareLevel_7dc3c0 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleDrefExplicitLod %float %36 %43 %44 Lod %float_0
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleDrefExplicitLod %float %39 %46 %47 Lod %float_0
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %53 = OpLoad %float %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
+%fragment_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
+%compute_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureSampleCompareLevel_7dc3c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.wgsl
index 48140b2..8398648 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_7dc3c0();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl
index 72bec7b..1ff42b6 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1.f;
   const arg_4 = vec2<i32>(1i);
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.dxc.hlsl
index a3aea8d..7ec5034 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_7f2b9a() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureSampleCompareLevel_7f2b9a();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.fxc.hlsl
index a3aea8d..4b3bcb8 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_7f2b9a() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.glsl
index c600c05..19fff0f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7f2b9a() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   float res = textureOffset(arg_0_arg_1, vec3(arg_2, arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7f2b9a() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   float res = textureOffset(arg_0_arg_1, vec3(arg_2, arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleCompareLevel_7f2b9a() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   float res = textureOffset(arg_0_arg_1, vec3(arg_2, arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.msl
index b552184..a6a3e5e 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_7f2b9a(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_7f2b9a(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, level(0), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_7f2b9a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_7f2b9a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_7f2b9a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_7f2b9a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_7f2b9a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_7f2b9a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.spvasm
index 6ea24fd..c356721 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_7f2b9a "textureSampleCompareLevel_7f2b9a"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,56 +49,65 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
     %float_0 = OpConstant %float 0
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %38 = OpConstantComposite %v2int %int_1 %int_1
-         %40 = OpTypeFunction %v4float
-%textureSampleCompareLevel_7f2b9a = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
+         %41 = OpConstantComposite %v2int %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %48 = OpTypeFunction %v4float
+%textureSampleCompareLevel_7f2b9a = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageSampleDrefExplicitLod %float %31 %32 %33 Lod|ConstOffset %float_0 %38
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageSampleDrefExplicitLod %float %34 %35 %36 Lod|ConstOffset %float_0 %41
+               OpStore %res %30
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleCompareLevel_7f2b9a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.wgsl
index 704668b..3edf774 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1.0f;
   const arg_4 = vec2<i32>(1i);
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_7f2b9a();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl
index 82e5958..625e686 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.dxc.hlsl
index 3e709bb..42f41e2 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_958c87() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.fxc.hlsl
index 3e709bb..42f41e2 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_958c87() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.msl
index c4f6727..e88662d 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_958c87(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_958c87(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, arg_4, level(0));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_958c87(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_958c87(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_958c87(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_958c87(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_958c87(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_958c87(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.spvasm
index 0ee630f..570c48b 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_958c87 "textureSampleCompareLevel_958c87"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,64 +51,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %float_0 = OpConstant %float 0
-         %47 = OpTypeFunction %v4float
-%textureSampleCompareLevel_958c87 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %54 = OpTypeFunction %v4float
+%textureSampleCompareLevel_958c87 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleDrefExplicitLod %float %36 %43 %44 Lod %float_0
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleDrefExplicitLod %float %39 %46 %47 Lod %float_0
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %53 = OpLoad %float %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleCompareLevel_958c87
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleCompareLevel_958c87
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureSampleCompareLevel_958c87
+%fragment_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureSampleCompareLevel_958c87
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleCompareLevel_958c87
+%compute_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureSampleCompareLevel_958c87
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.wgsl
index 01f883a..04f050c 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_958c87();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl
index a9c88a7..6bb2415 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.dxc.hlsl
index ede8cdf..0f29359 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_b6e47c() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleCompareLevel_b6e47c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.fxc.hlsl
index ede8cdf..ecf2890 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_b6e47c() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.msl
index a2e73b6..c302fdf 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_b6e47c(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_b6e47c(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, arg_4, level(0), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_b6e47c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_b6e47c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_b6e47c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_b6e47c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_b6e47c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_b6e47c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.spvasm
index 26a8b53..2f0c753 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 62
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_b6e47c "textureSampleCompareLevel_b6e47c"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,66 +50,75 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_0 = OpConstant %float 0
       %v2int = OpTypeVector %int 2
-         %47 = OpConstantComposite %v2int %int_1 %int_1
-         %49 = OpTypeFunction %v4float
-%textureSampleCompareLevel_b6e47c = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+         %50 = OpConstantComposite %v2int %int_1 %int_1
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %57 = OpTypeFunction %v4float
+%textureSampleCompareLevel_b6e47c = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleDrefExplicitLod %float %36 %43 %44 Lod|ConstOffset %float_0 %47
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleDrefExplicitLod %float %39 %46 %47 Lod|ConstOffset %float_0 %50
+               OpStore %res %35
+         %55 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %56 = OpLoad %float %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %49
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %55
+%vertex_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
+%fragment_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
+%compute_main = OpFunction %void None %18
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureSampleCompareLevel_b6e47c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.wgsl
index bc85181..946dc88 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_b6e47c();
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl
index 8778005..e171357 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.dxc.hlsl
index a6bf181..5d766f4 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_bcb3dd() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleCompareLevel_bcb3dd();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleCmpLevelZero.f32(i32 65, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.fxc.hlsl
index a6bf181..f40b0ca 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerComparisonState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleCompareLevel_bcb3dd() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = arg_0.SampleCmpLevelZero(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.msl
index 05c636e..f7241fe 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleCompareLevel_bcb3dd(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleCompareLevel_bcb3dd(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float res = tint_symbol_1.sample_compare(tint_symbol_2, arg_2, arg_3, arg_4, level(0), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleCompareLevel_bcb3dd(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleCompareLevel_bcb3dd(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleCompareLevel_bcb3dd(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleCompareLevel_bcb3dd(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleCompareLevel_bcb3dd(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleCompareLevel_bcb3dd(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.spvasm
index 9571f9e..196c560 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 64
+; Bound: 71
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleCompareLevel_bcb3dd "textureSampleCompareLevel_bcb3dd"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,68 +50,76 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
     %float_0 = OpConstant %float 0
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %49 = OpConstantComposite %v2int %int_1 %int_1
-         %51 = OpTypeFunction %v4float
-%textureSampleCompareLevel_bcb3dd = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+         %52 = OpConstantComposite %v2int %int_1 %int_1
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %58 = OpTypeFunction %v4float
+%textureSampleCompareLevel_bcb3dd = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleDrefExplicitLod %float %36 %43 %44 Lod|ConstOffset %float_0 %49
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleDrefExplicitLod %float %39 %46 %47 Lod|ConstOffset %float_0 %52
+               OpStore %res %35
+         %56 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %57 = OpLoad %float %res
+               OpStore %56 %57
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %51
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
+%vertex_main_inner = OpFunction %v4float None %58
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %57
+%vertex_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %64
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
+%fragment_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %62 = OpLabel
-         %63 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
+%compute_main = OpFunction %void None %18
+         %69 = OpLabel
+         %70 = OpFunctionCall %void %textureSampleCompareLevel_bcb3dd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.wgsl
index c62bf2e..ba4d3b8 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : f32 = textureSampleCompareLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleCompareLevel_bcb3dd();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl
index 451c787..0c1b4bb 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = vec3<f32>(1.f);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.dxc.hlsl
index 5c9e277..03943b5 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_21402b() {
   float3 arg_2 = (1.0f).xxx;
   float3 arg_3 = (1.0f).xxx;
   float3 arg_4 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.fxc.hlsl
index 5c9e277..03943b5 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_21402b() {
   float3 arg_2 = (1.0f).xxx;
   float3 arg_3 = (1.0f).xxx;
   float3 arg_4 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.glsl
index 594e89c..8cf4cef 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_21402b() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_21402b() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_21402b() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.msl
index 4d88911..e21658d 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_21402b(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_21402b(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float3 arg_3 = float3(1.0f);
   float3 arg_4 = float3(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, gradient3d(arg_3, arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_21402b(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_21402b(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_21402b(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_21402b(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_21402b(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_21402b(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.spvasm
index abfec7b..455ed98 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_21402b "textureSampleGrad_21402b"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,54 +50,63 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
-         %30 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v3float
+         %33 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %37 = OpTypeFunction %v4float
-%textureSampleGrad_21402b = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_4 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureSampleGrad_21402b = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_4 = OpVariable %_ptr_Function_v3float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
-               OpStore %arg_3 %21
-               OpStore %arg_4 %21
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpLoad %v3float %arg_3
-         %34 = OpLoad %v3float %arg_4
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Grad %33 %34
-               OpStore %res %27
+               OpStore %arg_2 %24
+               OpStore %arg_3 %24
+               OpStore %arg_4 %24
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpLoad %v3float %arg_3
+         %37 = OpLoad %v3float %arg_4
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Grad %36 %37
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureSampleGrad_21402b
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSampleGrad_21402b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleGrad_21402b
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleGrad_21402b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleGrad_21402b
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleGrad_21402b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.wgsl
index 19b255e..1f3fa53 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/21402b.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_21402b();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl
index 2d7f8e1..1d1a553 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = vec2<f32>(1.f);
   var arg_5 = vec2<f32>(1.f);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.dxc.hlsl
index 21a8ee8..3adaea2 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,6 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_2ecd8f() {
   float2 arg_2 = (1.0f).xx;
@@ -7,6 +8,7 @@
   float2 arg_4 = (1.0f).xx;
   float2 arg_5 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, float3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.fxc.hlsl
index 21a8ee8..3adaea2 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,6 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_2ecd8f() {
   float2 arg_2 = (1.0f).xx;
@@ -7,6 +8,7 @@
   float2 arg_4 = (1.0f).xx;
   float2 arg_5 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, float3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.glsl
index b18edb0..3a27222 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.glsl
@@ -2,12 +2,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_2ecd8f() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,12 +33,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_2ecd8f() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,12 +58,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_2ecd8f() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.msl
index 6dedc05..7b532e8 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.msl
@@ -1,37 +1,38 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_2ecd8f(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_2ecd8f(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float2 arg_4 = float2(1.0f);
   float2 arg_5 = float2(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, gradient2d(arg_4, arg_5));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_2ecd8f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_2ecd8f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_2ecd8f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_2ecd8f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_2ecd8f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_2ecd8f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
index 435994b..35a5fba 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 69
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_2ecd8f "textureSampleGrad_2ecd8f"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,66 +51,75 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %48 = OpTypeFunction %v4float
-%textureSampleGrad_2ecd8f = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_5 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %56 = OpTypeFunction %v4float
+%textureSampleGrad_2ecd8f = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_5 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-               OpStore %arg_4 %21
-               OpStore %arg_5 %21
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %v2float %arg_4
-         %45 = OpLoad %v2float %arg_5
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Grad %44 %45
-               OpStore %res %32
+               OpStore %arg_4 %24
+               OpStore %arg_5 %24
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %v2float %arg_4
+         %48 = OpLoad %v2float %arg_5
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Grad %47 %48
+               OpStore %res %35
+         %54 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %55 = OpLoad %v4float %res
+               OpStore %54 %55
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+%vertex_main_inner = OpFunction %v4float None %56
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleGrad_2ecd8f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %62
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+%fragment_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureSampleGrad_2ecd8f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+%compute_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleGrad_2ecd8f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
index 04e6328..a688ac7 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = vec2<f32>(1.0f);
   var arg_5 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_2ecd8f();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl
index 806c605..f89e361 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec2<f32>(1.f);
   var arg_4 = vec2<f32>(1.f);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.dxc.hlsl
index bfe8460..1021347 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_521263() {
   float2 arg_2 = (1.0f).xx;
   float2 arg_3 = (1.0f).xx;
   float2 arg_4 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.fxc.hlsl
index bfe8460..1021347 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_521263() {
   float2 arg_2 = (1.0f).xx;
   float2 arg_3 = (1.0f).xx;
   float2 arg_4 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.glsl
index 0e9fd5c..e0d4aa8 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_521263() {
   vec2 arg_2 = vec2(1.0f);
   vec2 arg_3 = vec2(1.0f);
   vec2 arg_4 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_521263() {
   vec2 arg_2 = vec2(1.0f);
   vec2 arg_3 = vec2(1.0f);
   vec2 arg_4 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_521263() {
   vec2 arg_2 = vec2(1.0f);
   vec2 arg_3 = vec2(1.0f);
   vec2 arg_4 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.msl
index 1494a9c..64ff336 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_521263(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_521263(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float2 arg_3 = float2(1.0f);
   float2 arg_4 = float2(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, gradient2d(arg_3, arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_521263(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_521263(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_521263(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_521263(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_521263(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_521263(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.spvasm
index 50b4b51..b9c95f1 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_521263 "textureSampleGrad_521263"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,54 +50,63 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %30 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %37 = OpTypeFunction %v4float
-%textureSampleGrad_521263 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureSampleGrad_521263 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
-               OpStore %arg_3 %21
-               OpStore %arg_4 %21
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpLoad %v2float %arg_3
-         %34 = OpLoad %v2float %arg_4
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Grad %33 %34
-               OpStore %res %27
+               OpStore %arg_2 %24
+               OpStore %arg_3 %24
+               OpStore %arg_4 %24
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpLoad %v2float %arg_3
+         %37 = OpLoad %v2float %arg_4
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Grad %36 %37
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureSampleGrad_521263
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSampleGrad_521263
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleGrad_521263
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleGrad_521263
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleGrad_521263
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleGrad_521263
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.wgsl
index 025d0d7..3941db8 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/521263.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec2<f32>(1.0f);
   var arg_4 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_521263();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl
index 53c0a00..49a7f1e 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = vec3<f32>(1.f);
   var arg_4 = vec3<f32>(1.f);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.dxc.hlsl
index 61b7b3b..ba0be4f 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_5312f4() {
   float3 arg_2 = (1.0f).xxx;
   float3 arg_3 = (1.0f).xxx;
   float3 arg_4 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.fxc.hlsl
index 61b7b3b..ba0be4f 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_5312f4() {
   float3 arg_2 = (1.0f).xxx;
   float3 arg_3 = (1.0f).xxx;
   float3 arg_4 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.glsl
index ce0c150..e3695d5 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5312f4() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5312f4() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5312f4() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, arg_2, arg_3, arg_4);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.msl
index dcb72de..caf056e 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_5312f4(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_5312f4(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float3 arg_3 = float3(1.0f);
   float3 arg_4 = float3(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, gradientcube(arg_3, arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_5312f4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_5312f4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_5312f4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_5312f4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_5312f4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_5312f4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.spvasm
index bbb5adb..f0b8cec5 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 50
+; Bound: 58
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_5312f4 "textureSampleGrad_5312f4"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,54 +50,63 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
-         %30 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v3float
+         %33 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %37 = OpTypeFunction %v4float
-%textureSampleGrad_5312f4 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_4 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %45 = OpTypeFunction %v4float
+%textureSampleGrad_5312f4 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_4 = OpVariable %_ptr_Function_v3float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
-               OpStore %arg_3 %21
-               OpStore %arg_4 %21
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpLoad %v3float %arg_3
-         %34 = OpLoad %v3float %arg_4
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Grad %33 %34
-               OpStore %res %27
+               OpStore %arg_2 %24
+               OpStore %arg_3 %24
+               OpStore %arg_4 %24
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpLoad %v3float %arg_3
+         %37 = OpLoad %v3float %arg_4
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Grad %36 %37
+               OpStore %res %30
+         %43 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %44 = OpLoad %v4float %res
+               OpStore %43 %44
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %37
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %textureSampleGrad_5312f4
+%vertex_main_inner = OpFunction %v4float None %45
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %textureSampleGrad_5312f4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %42 = OpLabel
-         %43 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %43
+%vertex_main = OpFunction %void None %18
+         %50 = OpLabel
+         %51 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %51
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleGrad_5312f4
+%fragment_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleGrad_5312f4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleGrad_5312f4
+%compute_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleGrad_5312f4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.wgsl
index 58801e8..b29bd98 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5312f4.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = vec3<f32>(1.0f);
   var arg_4 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_5312f4();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl
index 8f3892c..bd01689 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = vec3<f32>(1.f);
   const arg_5 = vec3<i32>(1i);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.dxc.hlsl
index 05ae8f1..6b171bb 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_5884dd() {
   float3 arg_2 = (1.0f).xxx;
   float3 arg_3 = (1.0f).xxx;
   float3 arg_4 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleGrad_5884dd();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.fxc.hlsl
index 05ae8f1..08b0707 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_5884dd() {
   float3 arg_2 = (1.0f).xxx;
   float3 arg_3 = (1.0f).xxx;
   float3 arg_4 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.glsl
index c3bafa5..839af66 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5884dd() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, arg_2, arg_3, arg_4, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5884dd() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, arg_2, arg_3, arg_4, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_5884dd() {
   vec3 arg_2 = vec3(1.0f);
   vec3 arg_3 = vec3(1.0f);
   vec3 arg_4 = vec3(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, arg_2, arg_3, arg_4, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.msl
index b9f3bf6..1c81737 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_5884dd(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_5884dd(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float3 arg_3 = float3(1.0f);
   float3 arg_4 = float3(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, gradient3d(arg_3, arg_4), int3(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_5884dd(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_5884dd(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_5884dd(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_5884dd(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_5884dd(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_5884dd(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.spvasm
index a0799ad..2e7fa65 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_5884dd "textureSampleGrad_5884dd"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,58 +50,67 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
-         %30 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v3float
+         %33 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %38 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %41 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %41 = OpTypeFunction %v4float
-%textureSampleGrad_5884dd = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_4 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %49 = OpTypeFunction %v4float
+%textureSampleGrad_5884dd = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_4 = OpVariable %_ptr_Function_v3float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
-               OpStore %arg_3 %21
-               OpStore %arg_4 %21
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpLoad %v3float %arg_3
-         %34 = OpLoad %v3float %arg_4
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Grad|ConstOffset %33 %34 %38
-               OpStore %res %27
+               OpStore %arg_2 %24
+               OpStore %arg_3 %24
+               OpStore %arg_4 %24
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpLoad %v3float %arg_3
+         %37 = OpLoad %v3float %arg_4
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Grad|ConstOffset %36 %37 %41
+               OpStore %res %30
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %48 = OpLoad %v4float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleGrad_5884dd
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleGrad_5884dd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleGrad_5884dd
+%fragment_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleGrad_5884dd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleGrad_5884dd
+%compute_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleGrad_5884dd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.wgsl
index bd81e44..9866ecc 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/5884dd.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = vec3<f32>(1.0f);
   const arg_5 = vec3<i32>(1i);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_5884dd();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl
index ca3e634..766a2ed 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl
@@ -31,7 +31,9 @@
   var arg_5 = vec2<f32>(1.f);
   const arg_6 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.dxc.hlsl
index 30e5c08..cc8a9c7 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_7cd6de() {
   float2 arg_2 = (1.0f).xx;
@@ -7,6 +10,7 @@
   float2 arg_4 = (1.0f).xx;
   float2 arg_5 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, float3(arg_2, float(arg_3)), arg_4, arg_5, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -35,3 +39,40 @@
   textureSampleGrad_7cd6de();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.fxc.hlsl
index 30e5c08..fb7f50e 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.fxc.hlsl
@@ -1,5 +1,6 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_7cd6de() {
   float2 arg_2 = (1.0f).xx;
@@ -7,6 +8,7 @@
   float2 arg_4 = (1.0f).xx;
   float2 arg_5 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, float3(arg_2, float(arg_3)), arg_4, arg_5, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.glsl
index d8c267f..69dde9b 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.glsl
@@ -2,12 +2,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_7cd6de() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,12 +33,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_7cd6de() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,12 +58,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_7cd6de() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.msl
index 00d9c11..05dc612 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.msl
@@ -1,37 +1,38 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_7cd6de(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_7cd6de(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float2 arg_4 = float2(1.0f);
   float2 arg_5 = float2(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, gradient2d(arg_4, arg_5), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_7cd6de(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_7cd6de(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_7cd6de(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_7cd6de(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_7cd6de(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_7cd6de(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.spvasm
index c44f828..9516d2d 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 72
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_7cd6de "textureSampleGrad_7cd6de"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,70 +51,78 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %49 = OpConstantComposite %v2int %int_1 %int_1
+         %52 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %52 = OpTypeFunction %v4float
-%textureSampleGrad_7cd6de = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_5 = OpVariable %_ptr_Function_v2float Function %24
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %59 = OpTypeFunction %v4float
+%textureSampleGrad_7cd6de = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_5 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-               OpStore %arg_4 %21
-               OpStore %arg_5 %21
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %v2float %arg_4
-         %45 = OpLoad %v2float %arg_5
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Grad|ConstOffset %44 %45 %49
-               OpStore %res %32
+               OpStore %arg_4 %24
+               OpStore %arg_5 %24
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %v2float %arg_4
+         %48 = OpLoad %v2float %arg_5
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Grad|ConstOffset %47 %48 %52
+               OpStore %res %35
+         %57 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %58 = OpLoad %v4float %res
+               OpStore %57 %58
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %52
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureSampleGrad_7cd6de
+%vertex_main_inner = OpFunction %v4float None %59
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureSampleGrad_7cd6de
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %58
+%vertex_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %65
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleGrad_7cd6de
+%fragment_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleGrad_7cd6de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %63 = OpLabel
-         %64 = OpFunctionCall %void %textureSampleGrad_7cd6de
+%compute_main = OpFunction %void None %18
+         %70 = OpLabel
+         %71 = OpFunctionCall %void %textureSampleGrad_7cd6de
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.wgsl
index ecdd746..2c96493 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/7cd6de.wgsl.expected.wgsl
@@ -9,8 +9,11 @@
   var arg_5 = vec2<f32>(1.0f);
   const arg_6 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_7cd6de();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl
index 4ece919..8348951 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = vec2<f32>(1.f);
   var arg_5 = vec2<f32>(1.f);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.dxc.hlsl
index b77b05f..ef3e1a7 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.dxc.hlsl
@@ -1,5 +1,6 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_a09131() {
   float2 arg_2 = (1.0f).xx;
@@ -7,6 +8,7 @@
   float2 arg_4 = (1.0f).xx;
   float2 arg_5 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, float3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.fxc.hlsl
index b77b05f..ef3e1a7 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.fxc.hlsl
@@ -1,5 +1,6 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_a09131() {
   float2 arg_2 = (1.0f).xx;
@@ -7,6 +8,7 @@
   float2 arg_4 = (1.0f).xx;
   float2 arg_5 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, float3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.glsl
index 931674d..c00e47d 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.glsl
@@ -2,12 +2,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_a09131() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,12 +33,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_a09131() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,12 +58,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_a09131() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGrad(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.msl
index 54fa329..a301aca 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.msl
@@ -1,37 +1,38 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_a09131(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_a09131(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float2 arg_4 = float2(1.0f);
   float2 arg_5 = float2(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, gradient2d(arg_4, arg_5));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_a09131(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_a09131(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_a09131(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_a09131(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_a09131(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_a09131(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.spvasm
index 013b899..1c294d9 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_a09131 "textureSampleGrad_a09131"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,66 +51,74 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %48 = OpTypeFunction %v4float
-%textureSampleGrad_a09131 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_5 = OpVariable %_ptr_Function_v2float Function %24
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureSampleGrad_a09131 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_5 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-               OpStore %arg_4 %21
-               OpStore %arg_5 %21
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %v2float %arg_4
-         %45 = OpLoad %v2float %arg_5
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Grad %44 %45
-               OpStore %res %32
+               OpStore %arg_4 %24
+               OpStore %arg_5 %24
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %v2float %arg_4
+         %48 = OpLoad %v2float %arg_5
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Grad %47 %48
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleGrad_a09131
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleGrad_a09131
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleGrad_a09131
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleGrad_a09131
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleGrad_a09131
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleGrad_a09131
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.wgsl
index c358991..fd6002d 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/a09131.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = vec2<f32>(1.0f);
   var arg_5 = vec2<f32>(1.0f);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_a09131();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl
index 911b398..8bb7a29 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = vec3<f32>(1.f);
   var arg_5 = vec3<f32>(1.f);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.dxc.hlsl
index fbe11fc..6d9a2e2 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,6 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_bbb58f() {
   float3 arg_2 = (1.0f).xxx;
@@ -7,6 +8,7 @@
   float3 arg_4 = (1.0f).xxx;
   float3 arg_5 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, float4(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.fxc.hlsl
index fbe11fc..6d9a2e2 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.fxc.hlsl
@@ -1,5 +1,6 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_bbb58f() {
   float3 arg_2 = (1.0f).xxx;
@@ -7,6 +8,7 @@
   float3 arg_4 = (1.0f).xxx;
   float3 arg_5 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, float4(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.msl
index ec2e05e..baeab44 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.msl
@@ -1,37 +1,38 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_bbb58f(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_bbb58f(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float3 arg_4 = float3(1.0f);
   float3 arg_5 = float3(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, gradientcube(arg_4, arg_5));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_bbb58f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_bbb58f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_bbb58f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_bbb58f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_bbb58f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_bbb58f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.spvasm
index f95babe..14c43ab 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_bbb58f "textureSampleGrad_bbb58f"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -31,6 +34,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -45,66 +52,74 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %48 = OpTypeFunction %v4float
-%textureSampleGrad_bbb58f = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_5 = OpVariable %_ptr_Function_v3float Function %24
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureSampleGrad_bbb58f = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_5 = OpVariable %_ptr_Function_v3float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-               OpStore %arg_4 %21
-               OpStore %arg_5 %21
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %44 = OpLoad %v3float %arg_4
-         %45 = OpLoad %v3float %arg_5
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Grad %44 %45
-               OpStore %res %32
+               OpStore %arg_4 %24
+               OpStore %arg_5 %24
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %47 = OpLoad %v3float %arg_4
+         %48 = OpLoad %v3float %arg_5
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Grad %47 %48
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleGrad_bbb58f
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleGrad_bbb58f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleGrad_bbb58f
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleGrad_bbb58f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleGrad_bbb58f
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleGrad_bbb58f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.wgsl
index e05c270..076256a 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = vec3<f32>(1.0f);
   var arg_5 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_bbb58f();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl
index 2fc3391..b9c5a82 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = vec2<f32>(1.f);
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.dxc.hlsl
index 411191f..ee010cd 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_d4e3c5() {
   float2 arg_2 = (1.0f).xx;
   float2 arg_3 = (1.0f).xx;
   float2 arg_4 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleGrad_d4e3c5();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.fxc.hlsl
index 411191f..7dbce60 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_d4e3c5() {
   float2 arg_2 = (1.0f).xx;
   float2 arg_3 = (1.0f).xx;
   float2 arg_4 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, arg_2, arg_3, arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.glsl
index fbc2291..66d4934 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d4e3c5() {
   vec2 arg_2 = vec2(1.0f);
   vec2 arg_3 = vec2(1.0f);
   vec2 arg_4 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, arg_2, arg_3, arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d4e3c5() {
   vec2 arg_2 = vec2(1.0f);
   vec2 arg_3 = vec2(1.0f);
   vec2 arg_4 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, arg_2, arg_3, arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d4e3c5() {
   vec2 arg_2 = vec2(1.0f);
   vec2 arg_3 = vec2(1.0f);
   vec2 arg_4 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, arg_2, arg_3, arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.msl
index 8a6867e..1ee3707 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_d4e3c5(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_d4e3c5(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float2 arg_3 = float2(1.0f);
   float2 arg_4 = float2(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, gradient2d(arg_3, arg_4), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_d4e3c5(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_d4e3c5(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_d4e3c5(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_d4e3c5(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_d4e3c5(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_d4e3c5(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.spvasm
index 08693ff..551fcd6 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_d4e3c5 "textureSampleGrad_d4e3c5"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,58 +50,67 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %30 = OpTypeSampledImage %11
+         %27 = OpConstantNull %v2float
+         %33 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %38 = OpConstantComposite %v2int %int_1 %int_1
+         %41 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %41 = OpTypeFunction %v4float
-%textureSampleGrad_d4e3c5 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_4 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %49 = OpTypeFunction %v4float
+%textureSampleGrad_d4e3c5 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_4 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
-               OpStore %arg_3 %21
-               OpStore %arg_4 %21
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpLoad %v2float %arg_3
-         %34 = OpLoad %v2float %arg_4
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Grad|ConstOffset %33 %34 %38
-               OpStore %res %27
+               OpStore %arg_2 %24
+               OpStore %arg_3 %24
+               OpStore %arg_4 %24
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpLoad %v2float %arg_3
+         %37 = OpLoad %v2float %arg_4
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Grad|ConstOffset %36 %37 %41
+               OpStore %res %30
+         %47 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %48 = OpLoad %v4float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleGrad_d4e3c5
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleGrad_d4e3c5
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleGrad_d4e3c5
+%fragment_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleGrad_d4e3c5
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleGrad_d4e3c5
+%compute_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleGrad_d4e3c5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.wgsl
index 8989eb7..2ec6bba 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d4e3c5.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = vec2<f32>(1.0f);
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_d4e3c5();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl
index f198c4e..e2286f2 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl
@@ -31,7 +31,9 @@
   var arg_5 = vec2<f32>(1.f);
   const arg_6 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.dxc.hlsl
index 62d6d63..694538d 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.dxc.hlsl
@@ -1,5 +1,8 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_d65515() {
   float2 arg_2 = (1.0f).xx;
@@ -7,6 +10,7 @@
   float2 arg_4 = (1.0f).xx;
   float2 arg_5 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, float3(arg_2, float(arg_3)), arg_4, arg_5, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -35,3 +39,40 @@
   textureSampleGrad_d65515();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleGrad.f32(i32 63, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00, float 1.000000e+00, float undef, float 1.000000e+00, float 1.000000e+00, float undef, float undef)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.fxc.hlsl
index 62d6d63..ca1cd54 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.fxc.hlsl
@@ -1,5 +1,6 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_d65515() {
   float2 arg_2 = (1.0f).xx;
@@ -7,6 +8,7 @@
   float2 arg_4 = (1.0f).xx;
   float2 arg_5 = (1.0f).xx;
   float4 res = arg_0.SampleGrad(arg_1, float3(arg_2, float(arg_3)), arg_4, arg_5, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.glsl
index 8c93957..bff77b7 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.glsl
@@ -2,12 +2,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d65515() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -28,12 +33,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d65515() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -48,12 +58,17 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleGrad_d65515() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   vec2 arg_4 = vec2(1.0f);
   vec2 arg_5 = vec2(1.0f);
   vec4 res = textureGradOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, arg_5, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.msl
index cf94801..91f4ce4 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.msl
@@ -1,37 +1,38 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_d65515(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_d65515(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float2 arg_4 = float2(1.0f);
   float2 arg_5 = float2(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, gradient2d(arg_4, arg_5), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_d65515(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_d65515(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_d65515(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_d65515(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_d65515(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_d65515(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.spvasm
index f99de76..c8bdb4c 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 71
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_d65515 "textureSampleGrad_d65515"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,68 +51,77 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %47 = OpConstantComposite %v2int %int_1 %int_1
+         %50 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %50 = OpTypeFunction %v4float
-%textureSampleGrad_d65515 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_5 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %58 = OpTypeFunction %v4float
+%textureSampleGrad_d65515 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_5 = OpVariable %_ptr_Function_v2float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-               OpStore %arg_4 %21
-               OpStore %arg_5 %21
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %v2float %arg_4
-         %45 = OpLoad %v2float %arg_5
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Grad|ConstOffset %44 %45 %47
-               OpStore %res %32
+               OpStore %arg_4 %24
+               OpStore %arg_5 %24
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %v2float %arg_4
+         %48 = OpLoad %v2float %arg_5
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Grad|ConstOffset %47 %48 %50
+               OpStore %res %35
+         %56 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %57 = OpLoad %v4float %res
+               OpStore %56 %57
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleGrad_d65515
+%vertex_main_inner = OpFunction %v4float None %58
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleGrad_d65515
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %56
+%vertex_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %64
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleGrad_d65515
+%fragment_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleGrad_d65515
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %61 = OpLabel
-         %62 = OpFunctionCall %void %textureSampleGrad_d65515
+%compute_main = OpFunction %void None %18
+         %69 = OpLabel
+         %70 = OpFunctionCall %void %textureSampleGrad_d65515
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.wgsl
index 30244fd..7209d9d 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/d65515.wgsl.expected.wgsl
@@ -9,8 +9,11 @@
   var arg_5 = vec2<f32>(1.0f);
   const arg_6 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_d65515();
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl
index 9100f4d..4e7cb73 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = vec3<f32>(1.f);
   var arg_5 = vec3<f32>(1.f);
   var res: vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.dxc.hlsl
index bb27c4d..18fb4a8 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.dxc.hlsl
@@ -1,5 +1,6 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_e383db() {
   float3 arg_2 = (1.0f).xxx;
@@ -7,6 +8,7 @@
   float3 arg_4 = (1.0f).xxx;
   float3 arg_5 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, float4(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.fxc.hlsl
index bb27c4d..18fb4a8 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.fxc.hlsl
@@ -1,5 +1,6 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleGrad_e383db() {
   float3 arg_2 = (1.0f).xxx;
@@ -7,6 +8,7 @@
   float3 arg_4 = (1.0f).xxx;
   float3 arg_5 = (1.0f).xxx;
   float4 res = arg_0.SampleGrad(arg_1, float4(arg_2, float(arg_3)), arg_4, arg_5);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.msl
index dcd5806..3c92028 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.msl
@@ -1,37 +1,38 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleGrad_e383db(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleGrad_e383db(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float3 arg_4 = float3(1.0f);
   float3 arg_5 = float3(1.0f);
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, gradientcube(arg_4, arg_5));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleGrad_e383db(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleGrad_e383db(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleGrad_e383db(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleGrad_e383db(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleGrad_e383db(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleGrad_e383db(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.spvasm
index 206ee79..be809ba 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 69
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleGrad_e383db "textureSampleGrad_e383db"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -31,6 +34,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -45,66 +52,75 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %48 = OpTypeFunction %v4float
-%textureSampleGrad_e383db = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_5 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %56 = OpTypeFunction %v4float
+%textureSampleGrad_e383db = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_5 = OpVariable %_ptr_Function_v3float Function %27
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-               OpStore %arg_4 %21
-               OpStore %arg_5 %21
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %44 = OpLoad %v3float %arg_4
-         %45 = OpLoad %v3float %arg_5
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Grad %44 %45
-               OpStore %res %32
+               OpStore %arg_4 %24
+               OpStore %arg_5 %24
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %47 = OpLoad %v3float %arg_4
+         %48 = OpLoad %v3float %arg_5
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Grad %47 %48
+               OpStore %res %35
+         %54 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %55 = OpLoad %v4float %res
+               OpStore %54 %55
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleGrad_e383db
+%vertex_main_inner = OpFunction %v4float None %56
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleGrad_e383db
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %62
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleGrad_e383db
+%fragment_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureSampleGrad_e383db
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleGrad_e383db
+%compute_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleGrad_e383db
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.wgsl
index e4f9c71..eb0e0f3 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = vec3<f32>(1.0f);
   var arg_5 = vec3<f32>(1.0f);
   var res : vec4<f32> = textureSampleGrad(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleGrad_e383db();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl
index cf57717..002e4ab 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1i;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.dxc.hlsl
index ce6b9cd..5167b75 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_02be59() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.fxc.hlsl
index ce6b9cd..5167b75 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_02be59() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.glsl
index ecada9c..91a191c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_02be59() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float res = textureLod(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_02be59() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float res = textureLod(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_02be59() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float res = textureLod(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.msl
index d40c8b3..ea0cecf 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_02be59(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_02be59(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_02be59(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_02be59(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_02be59(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_02be59(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_02be59(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_02be59(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.spvasm
index 2a9f874..310b2b0 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_02be59 "textureSampleLevel_02be59"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,57 +49,66 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %34 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
 %_ptr_Function_float = OpTypePointer Function %float
-         %41 = OpTypeFunction %v4float
-%textureSampleLevel_02be59 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %49 = OpTypeFunction %v4float
+%textureSampleLevel_02be59 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-         %32 = OpLoad %14 %arg_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v2float %arg_2
-         %38 = OpLoad %int %arg_3
-         %37 = OpConvertSToF %float %38
-         %31 = OpImageSampleExplicitLod %v4float %35 %36 Lod %37
-         %30 = OpCompositeExtract %float %31 0
-               OpStore %res %30
+         %35 = OpLoad %14 %arg_1
+         %36 = OpLoad %11 %arg_0
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v2float %arg_2
+         %41 = OpLoad %int %arg_3
+         %40 = OpConvertSToF %float %41
+         %34 = OpImageSampleExplicitLod %v4float %38 %39 Lod %40
+         %33 = OpCompositeExtract %float %34 0
+               OpStore %res %33
+         %47 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %48 = OpLoad %float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleLevel_02be59
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_02be59
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_02be59
+%fragment_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_02be59
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleLevel_02be59
+%compute_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleLevel_02be59
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.wgsl
index 3596bc5..754c3b1 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/02be59.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1i;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_02be59();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl
index 6755159..61aff8a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1.f;
   const arg_4 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.dxc.hlsl
index 905839c..4a79763 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_0b0a1b() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureSampleLevel_0b0a1b();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.fxc.hlsl
index 905839c..f5ded76 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_0b0a1b() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.glsl
index 07d5757..e08c310 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_0b0a1b() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, arg_2, arg_3, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_0b0a1b() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, arg_2, arg_3, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_0b0a1b() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, arg_2, arg_3, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.msl
index 8f75c79..8e15a80 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_0b0a1b(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_0b0a1b(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_0b0a1b(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_0b0a1b(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_0b0a1b(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_0b0a1b(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_0b0a1b(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_0b0a1b(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.spvasm
index aeac662..d7a1295 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_0b0a1b "textureSampleLevel_0b0a1b"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,56 +49,65 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v2int %int_1 %int_1
+         %40 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureSampleLevel_0b0a1b = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %48 = OpTypeFunction %v4float
+%textureSampleLevel_0b0a1b = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Lod|ConstOffset %33 %37
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Lod|ConstOffset %36 %40
+               OpStore %res %30
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %47 = OpLoad %v4float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleLevel_0b0a1b
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleLevel_0b0a1b
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_0b0a1b
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_0b0a1b
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_0b0a1b
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleLevel_0b0a1b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.wgsl
index 2ec980a..2fa8789 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0b0a1b.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1.0f;
   const arg_4 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_0b0a1b();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl
index b02c9c6..9676df8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.dxc.hlsl
index a8e6b49..90f2b37 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_0bdd9a() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.fxc.hlsl
index a8e6b49..90f2b37 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_0bdd9a() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.msl
index 8a29dcc..768232e 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_0bdd9a(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_0bdd9a(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_0bdd9a(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_0bdd9a(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_0bdd9a(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_0bdd9a(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_0bdd9a(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_0bdd9a(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
index c8663d9..8ca8da8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_0bdd9a "textureSampleLevel_0bdd9a"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,64 +51,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureSampleLevel_0bdd9a = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureSampleLevel_0bdd9a = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod %44
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod %47
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_0bdd9a
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleLevel_0bdd9a
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleLevel_0bdd9a
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
index c3d8c93..b178495 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_0bdd9a();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl
index 51222b0..6a114f5 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1i;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.dxc.hlsl
index b4f563f..c5f6569 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_1b0291() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.fxc.hlsl
index b4f563f..c5f6569 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_1b0291() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.msl
index 0aeb5a1..eae02d3 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_1b0291(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_1b0291(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_1b0291(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_1b0291(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_1b0291(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_1b0291(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_1b0291(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_1b0291(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.spvasm
index 97476be..cb89929 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_1b0291 "textureSampleLevel_1b0291"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,57 +49,66 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %34 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
 %_ptr_Function_float = OpTypePointer Function %float
-         %41 = OpTypeFunction %v4float
-%textureSampleLevel_1b0291 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %49 = OpTypeFunction %v4float
+%textureSampleLevel_1b0291 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-         %32 = OpLoad %14 %arg_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v3float %arg_2
-         %38 = OpLoad %int %arg_3
-         %37 = OpConvertSToF %float %38
-         %31 = OpImageSampleExplicitLod %v4float %35 %36 Lod %37
-         %30 = OpCompositeExtract %float %31 0
-               OpStore %res %30
+         %35 = OpLoad %14 %arg_1
+         %36 = OpLoad %11 %arg_0
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v3float %arg_2
+         %41 = OpLoad %int %arg_3
+         %40 = OpConvertSToF %float %41
+         %34 = OpImageSampleExplicitLod %v4float %38 %39 Lod %40
+         %33 = OpCompositeExtract %float %34 0
+               OpStore %res %33
+         %47 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %48 = OpLoad %float %res
+               OpStore %47 %48
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleLevel_1b0291
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %textureSampleLevel_1b0291
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %18
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_1b0291
+%fragment_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_1b0291
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleLevel_1b0291
+%compute_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleLevel_1b0291
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.wgsl
index 859e5f4..dffaaba 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1i;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_1b0291();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl
index 4f106f7..5bc25b0 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1i;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.dxc.hlsl
index aebf22d..e325309 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_1bf73e() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.fxc.hlsl
index aebf22d..e325309 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_1bf73e() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.msl
index 86811a4..d660495 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_1bf73e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_1bf73e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   int arg_4 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_1bf73e(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_1bf73e(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_1bf73e(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_1bf73e(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_1bf73e(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_1bf73e(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.spvasm
index 2ac3b75..4375009 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 69
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_1bf73e "textureSampleLevel_1bf73e"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,65 +50,74 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %48 = OpTypeFunction %v4float
-%textureSampleLevel_1bf73e = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %56 = OpTypeFunction %v4float
+%textureSampleLevel_1bf73e = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %int_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %45 = OpLoad %int %arg_4
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
          %44 = OpConvertSToF %float %45
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod %44
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %48 = OpLoad %int %arg_4
+         %47 = OpConvertSToF %float %48
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod %47
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %54 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %55 = OpLoad %float %res
+               OpStore %54 %55
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleLevel_1bf73e
+%vertex_main_inner = OpFunction %v4float None %56
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleLevel_1bf73e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %62
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleLevel_1bf73e
+%fragment_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureSampleLevel_1bf73e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleLevel_1bf73e
+%compute_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleLevel_1bf73e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.wgsl
index f286a51..d07dcdb 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1i;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_1bf73e();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl
index 0ad52fb..11239fd 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.dxc.hlsl
index ad30972..ff92619 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_265cc7() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.fxc.hlsl
index ad30972..ff92619 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_265cc7() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.glsl
index 0d6741f..9496eb9 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_265cc7() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_265cc7() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_265cc7() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.msl
index 81fc96a..779ebdf 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_265cc7(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_265cc7(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_265cc7(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_265cc7(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_265cc7(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_265cc7(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_265cc7(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_265cc7(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.spvasm
index dfbca6a..ab6e2b3 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_265cc7 "textureSampleLevel_265cc7"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,64 +50,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureSampleLevel_265cc7 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %54 = OpTypeFunction %v4float
+%textureSampleLevel_265cc7 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod %44
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod %47
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %53 = OpLoad %v4float %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_265cc7
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_265cc7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureSampleLevel_265cc7
+%fragment_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureSampleLevel_265cc7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleLevel_265cc7
+%compute_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureSampleLevel_265cc7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.wgsl
index 44e2223..a0467e6 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/265cc7.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_265cc7();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl
index 3112aef..4ac83da 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1u;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl
index 21e3ab2..524bf87 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_2974eb() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl
index 21e3ab2..524bf87 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_2974eb() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.msl
index c665c33..3db51c0 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_2974eb(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_2974eb(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_2974eb(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_2974eb(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_2974eb(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_2974eb(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_2974eb(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_2974eb(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.spvasm
index 0262bb6..755827c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 72
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_2974eb "textureSampleLevel_2974eb"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,69 +50,77 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %34 = OpConstantNull %uint
-         %39 = OpTypeSampledImage %11
+         %37 = OpConstantNull %uint
+         %42 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %52 = OpTypeFunction %v4float
-%textureSampleLevel_2974eb = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %59 = OpTypeFunction %v4float
+%textureSampleLevel_2974eb = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_uint Function %37
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %uint_1
-         %37 = OpLoad %14 %arg_1
-         %38 = OpLoad %11 %arg_0
-         %40 = OpSampledImage %39 %38 %37
-         %42 = OpLoad %v2float %arg_2
-         %43 = OpCompositeExtract %float %42 0
-         %44 = OpCompositeExtract %float %42 1
-         %46 = OpLoad %int %arg_3
-         %45 = OpConvertSToF %float %46
-         %47 = OpCompositeConstruct %v3float %43 %44 %45
-         %49 = OpLoad %uint %arg_4
+         %40 = OpLoad %14 %arg_1
+         %41 = OpLoad %11 %arg_0
+         %43 = OpSampledImage %42 %41 %40
+         %45 = OpLoad %v2float %arg_2
+         %46 = OpCompositeExtract %float %45 0
+         %47 = OpCompositeExtract %float %45 1
+         %49 = OpLoad %int %arg_3
          %48 = OpConvertSToF %float %49
-         %36 = OpImageSampleExplicitLod %v4float %40 %47 Lod %48
-         %35 = OpCompositeExtract %float %36 0
-               OpStore %res %35
+         %50 = OpCompositeConstruct %v3float %46 %47 %48
+         %52 = OpLoad %uint %arg_4
+         %51 = OpConvertSToF %float %52
+         %39 = OpImageSampleExplicitLod %v4float %43 %50 Lod %51
+         %38 = OpCompositeExtract %float %39 0
+               OpStore %res %38
+         %57 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %58 = OpLoad %float %res
+               OpStore %57 %58
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %52
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureSampleLevel_2974eb
+%vertex_main_inner = OpFunction %v4float None %59
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureSampleLevel_2974eb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %58
+%vertex_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %65
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleLevel_2974eb
+%fragment_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleLevel_2974eb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %63 = OpLabel
-         %64 = OpFunctionCall %void %textureSampleLevel_2974eb
+%compute_main = OpFunction %void None %18
+         %70 = OpLabel
+         %71 = OpFunctionCall %void %textureSampleLevel_2974eb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.wgsl
index 5785bac..8167429 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1u;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_2974eb();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl
index 5d4fa18..7c6e005 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.dxc.hlsl
index 349d78a1..f4a2fcc 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_302be4() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.fxc.hlsl
index 349d78a1..f4a2fcc 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_302be4() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.glsl
index c808922..c2c0334 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_302be4() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_302be4() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_302be4() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.msl
index 3e68abc..868c040 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_302be4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_302be4(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_302be4(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_302be4(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_302be4(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_302be4(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_302be4(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_302be4(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.spvasm
index 4f760f9..543134d 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_302be4 "textureSampleLevel_302be4"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,64 +50,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureSampleLevel_302be4 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %55 = OpTypeFunction %v4float
+%textureSampleLevel_302be4 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod %44
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod %47
+               OpStore %res %35
+         %53 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %54 = OpLoad %v4float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_302be4
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_302be4
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureSampleLevel_302be4
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleLevel_302be4
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleLevel_302be4
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleLevel_302be4
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.wgsl
index d70cb89..0eec3a2 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/302be4.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_302be4();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl
index 109df30..2512e84 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.dxc.hlsl
index 631b705..c1b1495 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_36780e() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleLevel_36780e();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.fxc.hlsl
index 631b705..174d7ef 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_36780e() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.msl
index 53ffa0d..b1a2679 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_36780e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_36780e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   int arg_4 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_36780e(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_36780e(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_36780e(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_36780e(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_36780e(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_36780e(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.spvasm
index 4e64bdd..cc2171a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 71
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_36780e "textureSampleLevel_36780e"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,67 +50,76 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %47 = OpConstantComposite %v2int %int_1 %int_1
+         %50 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %50 = OpTypeFunction %v4float
-%textureSampleLevel_36780e = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %58 = OpTypeFunction %v4float
+%textureSampleLevel_36780e = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %int_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %45 = OpLoad %int %arg_4
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
          %44 = OpConvertSToF %float %45
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod|ConstOffset %44 %47
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %48 = OpLoad %int %arg_4
+         %47 = OpConvertSToF %float %48
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod|ConstOffset %47 %50
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %56 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %57 = OpLoad %float %res
+               OpStore %56 %57
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleLevel_36780e
+%vertex_main_inner = OpFunction %v4float None %58
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleLevel_36780e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %56
+%vertex_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %64
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleLevel_36780e
+%fragment_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleLevel_36780e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %61 = OpLabel
-         %62 = OpFunctionCall %void %textureSampleLevel_36780e
+%compute_main = OpFunction %void None %18
+         %69 = OpLabel
+         %70 = OpFunctionCall %void %textureSampleLevel_36780e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.wgsl
index efa2a14..ecb55d7 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_36780e();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl
index d9222e8..e1e304a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl
index 8959ed2..233e7fc 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_36f0d3() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleLevel_36f0d3();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl
index 8959ed2..cb095e1 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_36f0d3() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.msl
index f7c22f2..820a051 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_36f0d3(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_36f0d3(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_36f0d3(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_36f0d3(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_36f0d3(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_36f0d3(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_36f0d3(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_36f0d3(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.spvasm
index 612754f..3fdd41d 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 67
+; Bound: 74
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_36f0d3 "textureSampleLevel_36f0d3"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,71 +50,79 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %34 = OpConstantNull %uint
-         %39 = OpTypeSampledImage %11
+         %37 = OpConstantNull %uint
+         %42 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %51 = OpConstantComposite %v2int %int_1 %int_1
+         %54 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %54 = OpTypeFunction %v4float
-%textureSampleLevel_36f0d3 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %61 = OpTypeFunction %v4float
+%textureSampleLevel_36f0d3 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_uint Function %37
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %uint_1
-         %37 = OpLoad %14 %arg_1
-         %38 = OpLoad %11 %arg_0
-         %40 = OpSampledImage %39 %38 %37
-         %42 = OpLoad %v2float %arg_2
-         %43 = OpCompositeExtract %float %42 0
-         %44 = OpCompositeExtract %float %42 1
-         %46 = OpLoad %int %arg_3
-         %45 = OpConvertSToF %float %46
-         %47 = OpCompositeConstruct %v3float %43 %44 %45
-         %49 = OpLoad %uint %arg_4
+         %40 = OpLoad %14 %arg_1
+         %41 = OpLoad %11 %arg_0
+         %43 = OpSampledImage %42 %41 %40
+         %45 = OpLoad %v2float %arg_2
+         %46 = OpCompositeExtract %float %45 0
+         %47 = OpCompositeExtract %float %45 1
+         %49 = OpLoad %int %arg_3
          %48 = OpConvertSToF %float %49
-         %36 = OpImageSampleExplicitLod %v4float %40 %47 Lod|ConstOffset %48 %51
-         %35 = OpCompositeExtract %float %36 0
-               OpStore %res %35
+         %50 = OpCompositeConstruct %v3float %46 %47 %48
+         %52 = OpLoad %uint %arg_4
+         %51 = OpConvertSToF %float %52
+         %39 = OpImageSampleExplicitLod %v4float %43 %50 Lod|ConstOffset %51 %54
+         %38 = OpCompositeExtract %float %39 0
+               OpStore %res %38
+         %59 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %60 = OpLoad %float %res
+               OpStore %59 %60
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %54
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleLevel_36f0d3
+%vertex_main_inner = OpFunction %v4float None %61
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleLevel_36f0d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %60
+%vertex_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %67
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %62 = OpLabel
-         %63 = OpFunctionCall %void %textureSampleLevel_36f0d3
+%fragment_main = OpFunction %void None %18
+         %69 = OpLabel
+         %70 = OpFunctionCall %void %textureSampleLevel_36f0d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %65 = OpLabel
-         %66 = OpFunctionCall %void %textureSampleLevel_36f0d3
+%compute_main = OpFunction %void None %18
+         %72 = OpLabel
+         %73 = OpFunctionCall %void %textureSampleLevel_36f0d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.wgsl
index b7aa845..7b083a7 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_36f0d3();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl
index b971e4d..1e10c2d 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1i;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl
index 3865538..de72d23 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_3c3442() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl
index 3865538..de72d23 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_3c3442() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.msl
index 93bd50c..44b13f1 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_3c3442(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_3c3442(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_3c3442(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_3c3442(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_3c3442(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_3c3442(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_3c3442(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_3c3442(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.spvasm
index 1fa0e90..798e401 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 72
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_3c3442 "textureSampleLevel_3c3442"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,69 +50,77 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %34 = OpConstantNull %int
-         %39 = OpTypeSampledImage %11
+         %37 = OpConstantNull %int
+         %42 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %52 = OpTypeFunction %v4float
-%textureSampleLevel_3c3442 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_int Function %34
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %59 = OpTypeFunction %v4float
+%textureSampleLevel_3c3442 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_int Function %37
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %int_1
-         %37 = OpLoad %14 %arg_1
-         %38 = OpLoad %11 %arg_0
-         %40 = OpSampledImage %39 %38 %37
-         %42 = OpLoad %v2float %arg_2
-         %43 = OpCompositeExtract %float %42 0
-         %44 = OpCompositeExtract %float %42 1
-         %46 = OpLoad %uint %arg_3
-         %45 = OpConvertUToF %float %46
-         %47 = OpCompositeConstruct %v3float %43 %44 %45
-         %49 = OpLoad %int %arg_4
-         %48 = OpConvertSToF %float %49
-         %36 = OpImageSampleExplicitLod %v4float %40 %47 Lod %48
-         %35 = OpCompositeExtract %float %36 0
-               OpStore %res %35
+         %40 = OpLoad %14 %arg_1
+         %41 = OpLoad %11 %arg_0
+         %43 = OpSampledImage %42 %41 %40
+         %45 = OpLoad %v2float %arg_2
+         %46 = OpCompositeExtract %float %45 0
+         %47 = OpCompositeExtract %float %45 1
+         %49 = OpLoad %uint %arg_3
+         %48 = OpConvertUToF %float %49
+         %50 = OpCompositeConstruct %v3float %46 %47 %48
+         %52 = OpLoad %int %arg_4
+         %51 = OpConvertSToF %float %52
+         %39 = OpImageSampleExplicitLod %v4float %43 %50 Lod %51
+         %38 = OpCompositeExtract %float %39 0
+               OpStore %res %38
+         %57 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %58 = OpLoad %float %res
+               OpStore %57 %58
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %52
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureSampleLevel_3c3442
+%vertex_main_inner = OpFunction %v4float None %59
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureSampleLevel_3c3442
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %58
+%vertex_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %65
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleLevel_3c3442
+%fragment_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleLevel_3c3442
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %63 = OpLabel
-         %64 = OpFunctionCall %void %textureSampleLevel_3c3442
+%compute_main = OpFunction %void None %18
+         %70 = OpLabel
+         %71 = OpFunctionCall %void %textureSampleLevel_3c3442
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.wgsl
index 0320df3..e8d5886 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1i;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_3c3442();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl
index 9a88375..637db2d 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1u;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.dxc.hlsl
index a581ba2..9f690df 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_615583() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.fxc.hlsl
index a581ba2..9f690df 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_615583() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.msl
index a162e3a..658d628 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_615583(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_615583(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_615583(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_615583(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_615583(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_615583(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_615583(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_615583(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.spvasm
index 6f3511f..06fd9e8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_615583 "textureSampleLevel_615583"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,65 +50,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %48 = OpTypeFunction %v4float
-%textureSampleLevel_615583 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %55 = OpTypeFunction %v4float
+%textureSampleLevel_615583 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %45 = OpLoad %uint %arg_4
-         %44 = OpConvertSToF %float %45
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod %44
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %48 = OpLoad %uint %arg_4
+         %47 = OpConvertSToF %float %48
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod %47
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %53 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %54 = OpLoad %float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleLevel_615583
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_615583
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleLevel_615583
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleLevel_615583
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleLevel_615583
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleLevel_615583
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.wgsl
index 1c573ad..ba087e8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1u;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_615583();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl
index d5a1e74..0a98d11 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1u;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.dxc.hlsl
index 8e507ed..5bfa7c8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_73e892() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.fxc.hlsl
index 8e507ed..5bfa7c8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_73e892() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.glsl
index d634058..2182e6b 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_73e892() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float res = textureLod(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_73e892() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float res = textureLod(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_73e892() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float res = textureLod(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.msl
index fd1ebab..071de47 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_73e892(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_73e892(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_73e892(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_73e892(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_73e892(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_73e892(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_73e892(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_73e892(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.spvasm
index 88bb69b..b976c22 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_73e892 "textureSampleLevel_73e892"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,57 +49,65 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %34 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
 %_ptr_Function_float = OpTypePointer Function %float
-         %41 = OpTypeFunction %v4float
-%textureSampleLevel_73e892 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %48 = OpTypeFunction %v4float
+%textureSampleLevel_73e892 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-         %32 = OpLoad %14 %arg_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v2float %arg_2
-         %38 = OpLoad %uint %arg_3
-         %37 = OpConvertSToF %float %38
-         %31 = OpImageSampleExplicitLod %v4float %35 %36 Lod %37
-         %30 = OpCompositeExtract %float %31 0
-               OpStore %res %30
+         %35 = OpLoad %14 %arg_1
+         %36 = OpLoad %11 %arg_0
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v2float %arg_2
+         %41 = OpLoad %uint %arg_3
+         %40 = OpConvertSToF %float %41
+         %34 = OpImageSampleExplicitLod %v4float %38 %39 Lod %40
+         %33 = OpCompositeExtract %float %34 0
+               OpStore %res %33
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleLevel_73e892
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleLevel_73e892
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_73e892
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_73e892
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleLevel_73e892
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleLevel_73e892
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.wgsl
index e61a548..a0e58bc 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/73e892.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1u;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_73e892();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl
index cb1b048..7960029 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   const arg_4 = vec2<i32>(1i);
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.dxc.hlsl
index 9e1020a..a88b0cc 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_749baf() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureSampleLevel_749baf();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.fxc.hlsl
index 9e1020a..c184758 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_749baf() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.glsl
index f2fbbd3..fda2021 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_749baf() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float res = textureLodOffset(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_749baf() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float res = textureLodOffset(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_749baf() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float res = textureLodOffset(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.msl
index dbd714d..0e38915 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_749baf(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_749baf(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_749baf(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_749baf(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_749baf(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_749baf(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_749baf(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_749baf(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.spvasm
index 2a9f5e2..17d7cf3 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_749baf "textureSampleLevel_749baf"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,59 +49,68 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %34 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %37 = OpTypeSampledImage %11
       %v2int = OpTypeVector %int 2
-         %40 = OpConstantComposite %v2int %int_1 %int_1
+         %43 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %43 = OpTypeFunction %v4float
-%textureSampleLevel_749baf = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %51 = OpTypeFunction %v4float
+%textureSampleLevel_749baf = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
-         %32 = OpLoad %14 %arg_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v2float %arg_2
-         %38 = OpLoad %int %arg_3
-         %37 = OpConvertSToF %float %38
-         %31 = OpImageSampleExplicitLod %v4float %35 %36 Lod|ConstOffset %37 %40
-         %30 = OpCompositeExtract %float %31 0
-               OpStore %res %30
+         %35 = OpLoad %14 %arg_1
+         %36 = OpLoad %11 %arg_0
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v2float %arg_2
+         %41 = OpLoad %int %arg_3
+         %40 = OpConvertSToF %float %41
+         %34 = OpImageSampleExplicitLod %v4float %38 %39 Lod|ConstOffset %40 %43
+         %33 = OpCompositeExtract %float %34 0
+               OpStore %res %33
+         %49 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %50 = OpLoad %float %res
+               OpStore %49 %50
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %43
-         %45 = OpLabel
-         %46 = OpFunctionCall %void %textureSampleLevel_749baf
+%vertex_main_inner = OpFunction %v4float None %51
+         %53 = OpLabel
+         %54 = OpFunctionCall %void %textureSampleLevel_749baf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %49
+%vertex_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %57
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_749baf
+%fragment_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleLevel_749baf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureSampleLevel_749baf
+%compute_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureSampleLevel_749baf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.wgsl
index 80a39fb..17669ec 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/749baf.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   const arg_4 = vec2<i32>(1i);
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_749baf();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl
index 13fd205..fbfb0c3 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1u;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.dxc.hlsl
index 1d07f98..eb4c1ff 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_941a53() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.fxc.hlsl
index 1d07f98..eb4c1ff 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_941a53() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.msl
index 17b58e6..e13f763 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_941a53(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_941a53(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_941a53(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_941a53(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_941a53(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_941a53(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_941a53(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_941a53(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.spvasm
index f725458..1d3ff97 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 68
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_941a53 "textureSampleLevel_941a53"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,65 +51,73 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_float = OpTypePointer Function %float
-         %48 = OpTypeFunction %v4float
-%textureSampleLevel_941a53 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %55 = OpTypeFunction %v4float
+%textureSampleLevel_941a53 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %45 = OpLoad %uint %arg_4
-         %44 = OpConvertSToF %float %45
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod %44
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %48 = OpLoad %uint %arg_4
+         %47 = OpConvertSToF %float %48
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod %47
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %53 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %54 = OpLoad %float %res
+               OpStore %53 %54
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleLevel_941a53
+%vertex_main_inner = OpFunction %v4float None %55
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %textureSampleLevel_941a53
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %61
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleLevel_941a53
+%fragment_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleLevel_941a53
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleLevel_941a53
+%compute_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleLevel_941a53
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.wgsl
index 118ea63..ee92ae1 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1u;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_941a53();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl
index 7d6e3ff..9937920 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1u;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl
index 87c53a0..1a5d429 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_a12142() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl
index 87c53a0..1a5d429 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_a12142() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.msl
index f3d6ea6..15e7349 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_a12142(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_a12142(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   uint arg_4 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_a12142(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_a12142(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_a12142(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_a12142(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_a12142(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_a12142(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.spvasm
index 60fe8b6..82e0ce8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 72
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_a12142 "textureSampleLevel_a12142"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,69 +51,77 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %34 = OpConstantNull %uint
-         %39 = OpTypeSampledImage %11
+         %37 = OpConstantNull %uint
+         %42 = OpTypeSampledImage %11
 %_ptr_Function_float = OpTypePointer Function %float
-         %52 = OpTypeFunction %v4float
-%textureSampleLevel_a12142 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_uint Function %34
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %59 = OpTypeFunction %v4float
+%textureSampleLevel_a12142 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_uint Function %37
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %uint_1
-         %37 = OpLoad %14 %arg_1
-         %38 = OpLoad %11 %arg_0
-         %40 = OpSampledImage %39 %38 %37
-         %41 = OpLoad %v3float %arg_2
-         %42 = OpCompositeExtract %float %41 0
-         %43 = OpCompositeExtract %float %41 1
-         %44 = OpCompositeExtract %float %41 2
-         %46 = OpLoad %int %arg_3
-         %45 = OpConvertSToF %float %46
-         %47 = OpCompositeConstruct %v4float %42 %43 %44 %45
-         %49 = OpLoad %uint %arg_4
+         %40 = OpLoad %14 %arg_1
+         %41 = OpLoad %11 %arg_0
+         %43 = OpSampledImage %42 %41 %40
+         %44 = OpLoad %v3float %arg_2
+         %45 = OpCompositeExtract %float %44 0
+         %46 = OpCompositeExtract %float %44 1
+         %47 = OpCompositeExtract %float %44 2
+         %49 = OpLoad %int %arg_3
          %48 = OpConvertSToF %float %49
-         %36 = OpImageSampleExplicitLod %v4float %40 %47 Lod %48
-         %35 = OpCompositeExtract %float %36 0
-               OpStore %res %35
+         %50 = OpCompositeConstruct %v4float %45 %46 %47 %48
+         %52 = OpLoad %uint %arg_4
+         %51 = OpConvertSToF %float %52
+         %39 = OpImageSampleExplicitLod %v4float %43 %50 Lod %51
+         %38 = OpCompositeExtract %float %39 0
+               OpStore %res %38
+         %57 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %58 = OpLoad %float %res
+               OpStore %57 %58
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %52
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureSampleLevel_a12142
+%vertex_main_inner = OpFunction %v4float None %59
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureSampleLevel_a12142
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %58
+%vertex_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %65
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleLevel_a12142
+%fragment_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleLevel_a12142
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %63 = OpLabel
-         %64 = OpFunctionCall %void %textureSampleLevel_a12142
+%compute_main = OpFunction %void None %18
+         %70 = OpLabel
+         %71 = OpFunctionCall %void %textureSampleLevel_a12142
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.wgsl
index be10276..bb2b3e1 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1u;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_a12142();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl
index 7b91247..808560d 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1.f;
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.dxc.hlsl
index f11a31b..f51744c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_aab3b9() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.fxc.hlsl
index f11a31b..f51744c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_aab3b9() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.msl
index 2493730..425bfd8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_aab3b9(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_aab3b9(texturecube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_aab3b9(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_aab3b9(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_aab3b9(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_aab3b9(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_aab3b9(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_aab3b9(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.spvasm
index b11e9f1..8b37f59 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 60
+; Bound: 67
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_aab3b9 "textureSampleLevel_aab3b9"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,64 +51,72 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %47 = OpTypeFunction %v4float
-%textureSampleLevel_aab3b9 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %54 = OpTypeFunction %v4float
+%textureSampleLevel_aab3b9 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod %44
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod %47
+               OpStore %res %35
+         %52 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %53 = OpLoad %v4float %res
+               OpStore %52 %53
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %47
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_aab3b9
+%vertex_main_inner = OpFunction %v4float None %54
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_aab3b9
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %53
+%vertex_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %60
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %55 = OpLabel
-         %56 = OpFunctionCall %void %textureSampleLevel_aab3b9
+%fragment_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %textureSampleLevel_aab3b9
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %58 = OpLabel
-         %59 = OpFunctionCall %void %textureSampleLevel_aab3b9
+%compute_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureSampleLevel_aab3b9
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.wgsl
index 3c0fb7f..b36704a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1.0f;
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_aab3b9();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl
index a55b802..1f0fe6b 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1.f;
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.dxc.hlsl
index a9952cd..beccac2 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_abfcc0() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.fxc.hlsl
index a9952cd..beccac2 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_abfcc0() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.glsl
index 26e29df..67ea1d0 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_abfcc0() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_abfcc0() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_abfcc0() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.msl
index 92c1064..900023c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_abfcc0(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_abfcc0(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_abfcc0(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_abfcc0(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_abfcc0(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_abfcc0(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_abfcc0(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_abfcc0(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.spvasm
index 4b754e7..a59a542 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_abfcc0 "textureSampleLevel_abfcc0"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleLevel_abfcc0 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureSampleLevel_abfcc0 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Lod %33
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Lod %36
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleLevel_abfcc0
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleLevel_abfcc0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_abfcc0
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_abfcc0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleLevel_abfcc0
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_abfcc0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.wgsl
index 3d87e97..b729e3c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/abfcc0.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_abfcc0();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl
index e083760..b95b264 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1i;
   var arg_4 = 1i;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.dxc.hlsl
index ab9072b..49c3413 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ae5e39() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.fxc.hlsl
index ab9072b..49c3413 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ae5e39() {
   float3 arg_2 = (1.0f).xxx;
   int arg_3 = 1;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.msl
index ba65b1f..d972026 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_ae5e39(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_ae5e39(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   int arg_3 = 1;
   int arg_4 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_ae5e39(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_ae5e39(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_ae5e39(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_ae5e39(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_ae5e39(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_ae5e39(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.spvasm
index 2fcafc0..fb3f1b7 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 61
+; Bound: 69
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_ae5e39 "textureSampleLevel_ae5e39"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,65 +51,74 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %int
+         %38 = OpTypeSampledImage %11
 %_ptr_Function_float = OpTypePointer Function %float
-         %48 = OpTypeFunction %v4float
-%textureSampleLevel_ae5e39 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
-      %arg_4 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %56 = OpTypeFunction %v4float
+%textureSampleLevel_ae5e39 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
+      %arg_4 = OpVariable %_ptr_Function_int Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %int_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %37 = OpLoad %v3float %arg_2
-         %38 = OpCompositeExtract %float %37 0
-         %39 = OpCompositeExtract %float %37 1
-         %40 = OpCompositeExtract %float %37 2
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v4float %38 %39 %40 %41
-         %45 = OpLoad %int %arg_4
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %40 = OpLoad %v3float %arg_2
+         %41 = OpCompositeExtract %float %40 0
+         %42 = OpCompositeExtract %float %40 1
+         %43 = OpCompositeExtract %float %40 2
+         %45 = OpLoad %int %arg_3
          %44 = OpConvertSToF %float %45
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod %44
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %46 = OpCompositeConstruct %v4float %41 %42 %43 %44
+         %48 = OpLoad %int %arg_4
+         %47 = OpConvertSToF %float %48
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod %47
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %54 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %55 = OpLoad %float %res
+               OpStore %54 %55
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %48
-         %50 = OpLabel
-         %51 = OpFunctionCall %void %textureSampleLevel_ae5e39
+%vertex_main_inner = OpFunction %v4float None %56
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %textureSampleLevel_ae5e39
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %54
+%vertex_main = OpFunction %void None %18
+         %61 = OpLabel
+         %62 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %62
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleLevel_ae5e39
+%fragment_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %textureSampleLevel_ae5e39
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleLevel_ae5e39
+%compute_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleLevel_ae5e39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.wgsl
index b2ae0da..7d01736 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1i;
   var arg_4 = 1i;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_ae5e39();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl
index ce45b30..8133d64 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1u;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.dxc.hlsl
index 1b711c4..f70036d 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ae92a2() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.fxc.hlsl
index 1b711c4..f70036d 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ae92a2() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.msl
index 4c6aa45..d158136 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_ae92a2(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_ae92a2(depthcube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_ae92a2(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_ae92a2(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_ae92a2(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_ae92a2(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_ae92a2(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_ae92a2(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.spvasm
index 29bcc63..341fce2 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 54
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_ae92a2 "textureSampleLevel_ae92a2"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,57 +49,65 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %34 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
 %_ptr_Function_float = OpTypePointer Function %float
-         %41 = OpTypeFunction %v4float
-%textureSampleLevel_ae92a2 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %48 = OpTypeFunction %v4float
+%textureSampleLevel_ae92a2 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-         %32 = OpLoad %14 %arg_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v3float %arg_2
-         %38 = OpLoad %uint %arg_3
-         %37 = OpConvertSToF %float %38
-         %31 = OpImageSampleExplicitLod %v4float %35 %36 Lod %37
-         %30 = OpCompositeExtract %float %31 0
-               OpStore %res %30
+         %35 = OpLoad %14 %arg_1
+         %36 = OpLoad %11 %arg_0
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v3float %arg_2
+         %41 = OpLoad %uint %arg_3
+         %40 = OpConvertSToF %float %41
+         %34 = OpImageSampleExplicitLod %v4float %38 %39 Lod %40
+         %33 = OpCompositeExtract %float %34 0
+               OpStore %res %33
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %47 = OpLoad %float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %41
-         %43 = OpLabel
-         %44 = OpFunctionCall %void %textureSampleLevel_ae92a2
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleLevel_ae92a2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %46 = OpLabel
-         %47 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %47
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %49 = OpLabel
-         %50 = OpFunctionCall %void %textureSampleLevel_ae92a2
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_ae92a2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %52 = OpLabel
-         %53 = OpFunctionCall %void %textureSampleLevel_ae92a2
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleLevel_ae92a2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.wgsl
index 6e70dbc..cc08384 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1u;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_ae92a2();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl
index 6763b94..bdc0012 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.dxc.hlsl
index 80efd9f..61edc26 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_b7c55c() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleLevel_b7c55c();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.fxc.hlsl
index 80efd9f..aabdfc9 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_b7c55c() {
   float2 arg_2 = (1.0f).xx;
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.glsl
index 4fda959..8d64a32 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_b7c55c() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_b7c55c() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_b7c55c() {
   vec2 arg_2 = vec2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.msl
index 4f18a1e..e4a0903 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_b7c55c(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_b7c55c(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   int arg_3 = 1;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_b7c55c(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_b7c55c(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_b7c55c(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_b7c55c(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_b7c55c(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_b7c55c(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.spvasm
index d46e0ac..6e7148d 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 62
+; Bound: 70
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_b7c55c "textureSampleLevel_b7c55c"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,66 +50,75 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %29 = OpConstantNull %int
+         %32 = OpConstantNull %int
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %46 = OpConstantComposite %v2int %int_1 %int_1
+         %49 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %49 = OpTypeFunction %v4float
-%textureSampleLevel_b7c55c = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_int Function %29
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %57 = OpTypeFunction %v4float
+%textureSampleLevel_b7c55c = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_int Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %int_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %int %arg_3
-         %41 = OpConvertSToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod|ConstOffset %44 %46
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %int %arg_3
+         %44 = OpConvertSToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod|ConstOffset %47 %49
+               OpStore %res %35
+         %55 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %56 = OpLoad %v4float %res
+               OpStore %55 %56
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %49
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_b7c55c
+%vertex_main_inner = OpFunction %v4float None %57
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleLevel_b7c55c
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %54 = OpLabel
-         %55 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %55
+%vertex_main = OpFunction %void None %18
+         %62 = OpLabel
+         %63 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %63
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %void %textureSampleLevel_b7c55c
+%fragment_main = OpFunction %void None %18
+         %65 = OpLabel
+         %66 = OpFunctionCall %void %textureSampleLevel_b7c55c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleLevel_b7c55c
+%compute_main = OpFunction %void None %18
+         %68 = OpLabel
+         %69 = OpFunctionCall %void %textureSampleLevel_b7c55c
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.wgsl
index 00db2de..b0f47e8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/b7c55c.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_b7c55c();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl
index 2b59e72..7bba5a7 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec3<f32>(1.f);
   var arg_3 = 1.f;
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.dxc.hlsl
index 825239f..bbb7e7e 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_c32df7() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.fxc.hlsl
index 825239f..bbb7e7e 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 TextureCube<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_c32df7() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.glsl
index 533331f..9ce338a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c32df7() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c32df7() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp samplerCube arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c32df7() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.msl
index b08aa7d..9036258 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_c32df7(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_c32df7(texturecube<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_c32df7(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_c32df7(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_c32df7(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_c32df7(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_c32df7(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_c32df7(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.spvasm
index 12dd55a..992a690 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_c32df7 "textureSampleLevel_c32df7"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleLevel_c32df7 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureSampleLevel_c32df7 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Lod %33
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Lod %36
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleLevel_c32df7
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleLevel_c32df7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_c32df7
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_c32df7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleLevel_c32df7
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_c32df7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.wgsl
index 475f975..00df8a8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c32df7.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec3<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_c32df7();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl
index 20e1dda..a204263 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl
@@ -28,7 +28,9 @@
   var arg_2 = vec2<f32>(1.f);
   var arg_3 = 1.f;
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.dxc.hlsl
index e8d8bba..d38d054 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.dxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_c6aca6() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.fxc.hlsl
index e8d8bba..d38d054 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_c6aca6() {
   float2 arg_2 = (1.0f).xx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.glsl
index 8b40949..a0735b4 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c6aca6() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c6aca6() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_c6aca6() {
   vec2 arg_2 = vec2(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLod(arg_0_arg_1, arg_2, arg_3);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.msl
index 074bcb0..927b232 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_c6aca6(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_c6aca6(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_c6aca6(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_c6aca6(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_c6aca6(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_c6aca6(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_c6aca6(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_c6aca6(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.spvasm
index 5e35948..403f29f 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 49
+; Bound: 57
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_c6aca6 "textureSampleLevel_c6aca6"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,52 +49,61 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %36 = OpTypeFunction %v4float
-%textureSampleLevel_c6aca6 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %44 = OpTypeFunction %v4float
+%textureSampleLevel_c6aca6 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v2float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Lod %33
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v2float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Lod %36
+               OpStore %res %30
+         %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %43 = OpLoad %v4float %res
+               OpStore %42 %43
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %36
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %textureSampleLevel_c6aca6
+%vertex_main_inner = OpFunction %v4float None %44
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %textureSampleLevel_c6aca6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %41 = OpLabel
-         %42 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %42
+%vertex_main = OpFunction %void None %18
+         %49 = OpLabel
+         %50 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %50
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %44 = OpLabel
-         %45 = OpFunctionCall %void %textureSampleLevel_c6aca6
+%fragment_main = OpFunction %void None %18
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %textureSampleLevel_c6aca6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleLevel_c6aca6
+%compute_main = OpFunction %void None %18
+         %55 = OpLabel
+         %56 = OpFunctionCall %void %textureSampleLevel_c6aca6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.wgsl
index a7f1a9d..23c7067 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/c6aca6.wgsl.expected.wgsl
@@ -6,8 +6,11 @@
   var arg_2 = vec2<f32>(1.0f);
   var arg_3 = 1.0f;
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_c6aca6();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl
index d3e1c5b..488b72c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.dxc.hlsl
index d226209..e867259 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_cdfe0f() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleLevel_cdfe0f();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.fxc.hlsl
index d226209..9647dca 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_cdfe0f() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.msl
index b572e16..e921724 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_cdfe0f(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_cdfe0f(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   uint arg_4 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_cdfe0f(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_cdfe0f(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_cdfe0f(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_cdfe0f(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_cdfe0f(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_cdfe0f(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.spvasm
index 37ea878..914649b 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 72
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_cdfe0f "textureSampleLevel_cdfe0f"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,69 +50,77 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %35 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %49 = OpConstantComposite %v2int %int_1 %int_1
+         %52 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %52 = OpTypeFunction %v4float
-%textureSampleLevel_cdfe0f = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %59 = OpTypeFunction %v4float
+%textureSampleLevel_cdfe0f = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %uint_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %45 = OpLoad %uint %arg_4
-         %44 = OpConvertSToF %float %45
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod|ConstOffset %44 %49
-         %31 = OpCompositeExtract %float %32 0
-               OpStore %res %31
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %48 = OpLoad %uint %arg_4
+         %47 = OpConvertSToF %float %48
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod|ConstOffset %47 %52
+         %34 = OpCompositeExtract %float %35 0
+               OpStore %res %34
+         %57 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %58 = OpLoad %float %res
+               OpStore %57 %58
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %52
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureSampleLevel_cdfe0f
+%vertex_main_inner = OpFunction %v4float None %59
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureSampleLevel_cdfe0f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %58
+%vertex_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %65
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleLevel_cdfe0f
+%fragment_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleLevel_cdfe0f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %63 = OpLabel
-         %64 = OpFunctionCall %void %textureSampleLevel_cdfe0f
+%compute_main = OpFunction %void None %18
+         %70 = OpLabel
+         %71 = OpFunctionCall %void %textureSampleLevel_cdfe0f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.wgsl
index 9332bbe..691e8f3 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1u;
   const arg_5 = vec2<i32>(1i);
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_cdfe0f();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl
index 611aa36..f7caf9f 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1.f;
   const arg_4 = vec3<i32>(1i);
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.dxc.hlsl
index 2da8cf6..9a76b95 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_dcbecb() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureSampleLevel_dcbecb();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i64 1, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.fxc.hlsl
index 2da8cf6..39c1d5f 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture3D<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_dcbecb() {
   float3 arg_2 = (1.0f).xxx;
   float arg_3 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, arg_2, arg_3, (1).xxx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.glsl
index e0c5e7e..4dfe052 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_dcbecb() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, arg_2, arg_3, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_dcbecb() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, arg_2, arg_3, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler3D arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_dcbecb() {
   vec3 arg_2 = vec3(1.0f);
   float arg_3 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, arg_2, arg_3, ivec3(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.msl
index 5512f6a..5754e39 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_dcbecb(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_dcbecb(texture3d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   float arg_3 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3), int3(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_dcbecb(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_dcbecb(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_dcbecb(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_dcbecb(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_dcbecb(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_dcbecb(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.spvasm
index f3ec385..03a6e2c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 53
+; Bound: 61
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_dcbecb "textureSampleLevel_dcbecb"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,56 +49,65 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
 %_ptr_Function_float = OpTypePointer Function %float
-         %30 = OpTypeSampledImage %11
+         %33 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %v3int = OpTypeVector %int 3
       %int_1 = OpConstant %int 1
-         %37 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+         %40 = OpConstantComposite %v3int %int_1 %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %40 = OpTypeFunction %v4float
-%textureSampleLevel_dcbecb = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %48 = OpTypeFunction %v4float
+%textureSampleLevel_dcbecb = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
       %arg_3 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %float_1
-         %28 = OpLoad %14 %arg_1
-         %29 = OpLoad %11 %arg_0
-         %31 = OpSampledImage %30 %29 %28
-         %32 = OpLoad %v3float %arg_2
-         %33 = OpLoad %float %arg_3
-         %27 = OpImageSampleExplicitLod %v4float %31 %32 Lod|ConstOffset %33 %37
-               OpStore %res %27
+         %31 = OpLoad %14 %arg_1
+         %32 = OpLoad %11 %arg_0
+         %34 = OpSampledImage %33 %32 %31
+         %35 = OpLoad %v3float %arg_2
+         %36 = OpLoad %float %arg_3
+         %30 = OpImageSampleExplicitLod %v4float %34 %35 Lod|ConstOffset %36 %40
+               OpStore %res %30
+         %46 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %47 = OpLoad %v4float %res
+               OpStore %46 %47
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %40
-         %42 = OpLabel
-         %43 = OpFunctionCall %void %textureSampleLevel_dcbecb
+%vertex_main_inner = OpFunction %v4float None %48
+         %50 = OpLabel
+         %51 = OpFunctionCall %void %textureSampleLevel_dcbecb
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %45 = OpLabel
-         %46 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %46
+%vertex_main = OpFunction %void None %18
+         %53 = OpLabel
+         %54 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %54
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %48 = OpLabel
-         %49 = OpFunctionCall %void %textureSampleLevel_dcbecb
+%fragment_main = OpFunction %void None %18
+         %56 = OpLabel
+         %57 = OpFunctionCall %void %textureSampleLevel_dcbecb
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %51 = OpLabel
-         %52 = OpFunctionCall %void %textureSampleLevel_dcbecb
+%compute_main = OpFunction %void None %18
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %textureSampleLevel_dcbecb
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.wgsl
index 0bb9522..a84c47b 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/dcbecb.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1.0f;
   const arg_4 = vec3<i32>(1i);
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_dcbecb();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl
index 4aa6650..ad3f387 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl
index b836f82..d3f437c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_e6ce9e() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleLevel_e6ce9e();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl
index b836f82..058b49f 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_e6ce9e() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.msl
index 222b2c3..153fff3 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_e6ce9e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_e6ce9e(depth2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_e6ce9e(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_e6ce9e(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_e6ce9e(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_e6ce9e(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_e6ce9e(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_e6ce9e(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.spvasm
index ea6785b..dec730e 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 67
+; Bound: 74
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_e6ce9e "textureSampleLevel_e6ce9e"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,71 +50,79 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %34 = OpConstantNull %int
-         %39 = OpTypeSampledImage %11
+         %37 = OpConstantNull %int
+         %42 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
       %v2int = OpTypeVector %int 2
-         %51 = OpConstantComposite %v2int %int_1 %int_1
+         %54 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %54 = OpTypeFunction %v4float
-%textureSampleLevel_e6ce9e = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_int Function %34
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %61 = OpTypeFunction %v4float
+%textureSampleLevel_e6ce9e = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_int Function %37
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %int_1
-         %37 = OpLoad %14 %arg_1
-         %38 = OpLoad %11 %arg_0
-         %40 = OpSampledImage %39 %38 %37
-         %42 = OpLoad %v2float %arg_2
-         %43 = OpCompositeExtract %float %42 0
-         %44 = OpCompositeExtract %float %42 1
-         %46 = OpLoad %uint %arg_3
-         %45 = OpConvertUToF %float %46
-         %47 = OpCompositeConstruct %v3float %43 %44 %45
-         %49 = OpLoad %int %arg_4
-         %48 = OpConvertSToF %float %49
-         %36 = OpImageSampleExplicitLod %v4float %40 %47 Lod|ConstOffset %48 %51
-         %35 = OpCompositeExtract %float %36 0
-               OpStore %res %35
+         %40 = OpLoad %14 %arg_1
+         %41 = OpLoad %11 %arg_0
+         %43 = OpSampledImage %42 %41 %40
+         %45 = OpLoad %v2float %arg_2
+         %46 = OpCompositeExtract %float %45 0
+         %47 = OpCompositeExtract %float %45 1
+         %49 = OpLoad %uint %arg_3
+         %48 = OpConvertUToF %float %49
+         %50 = OpCompositeConstruct %v3float %46 %47 %48
+         %52 = OpLoad %int %arg_4
+         %51 = OpConvertSToF %float %52
+         %39 = OpImageSampleExplicitLod %v4float %43 %50 Lod|ConstOffset %51 %54
+         %38 = OpCompositeExtract %float %39 0
+               OpStore %res %38
+         %59 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %60 = OpLoad %float %res
+               OpStore %59 %60
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %54
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+%vertex_main_inner = OpFunction %v4float None %61
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleLevel_e6ce9e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %60
+%vertex_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %67
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %62 = OpLabel
-         %63 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+%fragment_main = OpFunction %void None %18
+         %69 = OpLabel
+         %70 = OpFunctionCall %void %textureSampleLevel_e6ce9e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %65 = OpLabel
-         %66 = OpFunctionCall %void %textureSampleLevel_e6ce9e
+%compute_main = OpFunction %void None %18
+         %72 = OpLabel
+         %73 = OpFunctionCall %void %textureSampleLevel_e6ce9e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.wgsl
index 724e8e3..6c3b226 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1i;
   const arg_5 = vec2<i32>(1i);
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_e6ce9e();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl
index 3392a3e..49a98ab 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   const arg_4 = vec2<i32>(1i);
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.dxc.hlsl
index 84069c6..972b0db 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.dxc.hlsl
@@ -1,10 +1,14 @@
+SKIP: FAILED
+
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_f3b2c8() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -33,3 +37,40 @@
   textureSampleLevel_f3b2c8();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float undef, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.fxc.hlsl
index 84069c6..a50a511 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.fxc.hlsl
@@ -1,10 +1,12 @@
 Texture2D arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_f3b2c8() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float res = arg_0.SampleLevel(arg_1, arg_2, arg_3, (1).xx).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.glsl
index c5343b9..fee0d6a 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.glsl
@@ -2,10 +2,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_f3b2c8() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float res = textureLodOffset(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -26,10 +31,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_f3b2c8() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float res = textureLodOffset(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -44,10 +54,15 @@
 
 uniform highp sampler2DShadow arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void textureSampleLevel_f3b2c8() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float res = textureLodOffset(arg_0_arg_1, vec3(arg_2, 0.0f), float(arg_3), ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.msl
index 3be2b49..ba552b2 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.msl
@@ -1,35 +1,36 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_f3b2c8(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_f3b2c8(depth2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, level(arg_3), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_f3b2c8(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_f3b2c8(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_f3b2c8(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_f3b2c8(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_f3b2c8(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_f3b2c8(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.spvasm
index 8d13036..83875e5 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 65
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_f3b2c8 "textureSampleLevel_f3b2c8"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -28,6 +31,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,61 +49,69 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
-         %34 = OpTypeSampledImage %11
+         %32 = OpConstantNull %uint
+         %37 = OpTypeSampledImage %11
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %42 = OpConstantComposite %v2int %int_1 %int_1
+         %45 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_float = OpTypePointer Function %float
-         %45 = OpTypeFunction %v4float
-%textureSampleLevel_f3b2c8 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %52 = OpTypeFunction %v4float
+%textureSampleLevel_f3b2c8 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
-         %32 = OpLoad %14 %arg_1
-         %33 = OpLoad %11 %arg_0
-         %35 = OpSampledImage %34 %33 %32
-         %36 = OpLoad %v2float %arg_2
-         %38 = OpLoad %uint %arg_3
-         %37 = OpConvertSToF %float %38
-         %31 = OpImageSampleExplicitLod %v4float %35 %36 Lod|ConstOffset %37 %42
-         %30 = OpCompositeExtract %float %31 0
-               OpStore %res %30
+         %35 = OpLoad %14 %arg_1
+         %36 = OpLoad %11 %arg_0
+         %38 = OpSampledImage %37 %36 %35
+         %39 = OpLoad %v2float %arg_2
+         %41 = OpLoad %uint %arg_3
+         %40 = OpConvertSToF %float %41
+         %34 = OpImageSampleExplicitLod %v4float %38 %39 Lod|ConstOffset %40 %45
+         %33 = OpCompositeExtract %float %34 0
+               OpStore %res %33
+         %50 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %51 = OpLoad %float %res
+               OpStore %50 %51
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %45
-         %47 = OpLabel
-         %48 = OpFunctionCall %void %textureSampleLevel_f3b2c8
+%vertex_main_inner = OpFunction %v4float None %52
+         %54 = OpLabel
+         %55 = OpFunctionCall %void %textureSampleLevel_f3b2c8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %50 = OpLabel
-         %51 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %51
+%vertex_main = OpFunction %void None %18
+         %57 = OpLabel
+         %58 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %58
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureSampleLevel_f3b2c8
+%fragment_main = OpFunction %void None %18
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleLevel_f3b2c8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %void %textureSampleLevel_f3b2c8
+%compute_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %void %textureSampleLevel_f3b2c8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.wgsl
index b8c2a96..8f6e564 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/f3b2c8.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   const arg_4 = vec2<i32>(1i);
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_f3b2c8();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl
index 711b6a6..07847b8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl
@@ -30,7 +30,9 @@
   var arg_4 = 1.f;
   const arg_5 = vec2<i32>(1i);
   var res: vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.dxc.hlsl
index f6a9777..5c1c1f0 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.dxc.hlsl
@@ -1,11 +1,15 @@
+SKIP: FAILED
+
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_faa6d7() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
@@ -34,3 +38,40 @@
   textureSampleLevel_faa6d7();
   return;
 }
+DXC validation failure:
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
+warning: DXIL.dll not found.  Resulting DXIL will not be signed for use in release environments.
+
+error: validation errors
+error: Module bitcode is invalid.
+error: Call parameter type does not match function signature!
+i64 1
+ i32  %4 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %2, %dx.types.Handle %3, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float undef, i64 1, i64 1, i32 undef, float 1.000000e+00)
+
+Validation failed.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.fxc.hlsl
index f6a9777..f766262 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 Texture2DArray<float4> arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_faa6d7() {
   float2 arg_2 = (1.0f).xx;
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = arg_0.SampleLevel(arg_1, float3(arg_2, float(arg_3)), arg_4, (1).xx);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.glsl
index cf4331e..1c1367c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.glsl
@@ -2,11 +2,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_faa6d7() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -27,11 +32,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_faa6d7() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -46,11 +56,16 @@
 
 uniform highp sampler2DArray arg_0_arg_1;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void textureSampleLevel_faa6d7() {
   vec2 arg_2 = vec2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   vec4 res = textureLodOffset(arg_0_arg_1, vec3(arg_2, float(arg_3)), arg_4, ivec2(1));
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.msl
index 04ccb6e..40c7b02 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_faa6d7(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_faa6d7(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float4* const tint_symbol_3) {
   float2 arg_2 = float2(1.0f);
   uint arg_3 = 1u;
   float arg_4 = 1.0f;
   float4 res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4), int2(1));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_faa6d7(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float4* const tint_symbol_6) {
+  textureSampleLevel_faa6d7(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float4* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_faa6d7(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float4* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_faa6d7(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_faa6d7(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float4* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_faa6d7(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.spvasm
index c43e66d..bb591be 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 64
+; Bound: 71
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -14,6 +14,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_faa6d7 "textureSampleLevel_faa6d7"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -29,6 +32,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -43,68 +50,76 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v2float %float_1 %float_1
+         %24 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
+         %27 = OpConstantNull %v2float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
 %_ptr_Function_float = OpTypePointer Function %float
-         %35 = OpTypeSampledImage %11
+         %38 = OpTypeSampledImage %11
     %v3float = OpTypeVector %float 3
         %int = OpTypeInt 32 1
       %v2int = OpTypeVector %int 2
       %int_1 = OpConstant %int 1
-         %48 = OpConstantComposite %v2int %int_1 %int_1
+         %51 = OpConstantComposite %v2int %int_1 %int_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %51 = OpTypeFunction %v4float
-%textureSampleLevel_faa6d7 = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v2float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %58 = OpTypeFunction %v4float
+%textureSampleLevel_faa6d7 = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v2float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
       %arg_4 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %float_1
-         %33 = OpLoad %14 %arg_1
-         %34 = OpLoad %11 %arg_0
-         %36 = OpSampledImage %35 %34 %33
-         %38 = OpLoad %v2float %arg_2
-         %39 = OpCompositeExtract %float %38 0
-         %40 = OpCompositeExtract %float %38 1
-         %42 = OpLoad %uint %arg_3
-         %41 = OpConvertUToF %float %42
-         %43 = OpCompositeConstruct %v3float %39 %40 %41
-         %44 = OpLoad %float %arg_4
-         %32 = OpImageSampleExplicitLod %v4float %36 %43 Lod|ConstOffset %44 %48
-               OpStore %res %32
+         %36 = OpLoad %14 %arg_1
+         %37 = OpLoad %11 %arg_0
+         %39 = OpSampledImage %38 %37 %36
+         %41 = OpLoad %v2float %arg_2
+         %42 = OpCompositeExtract %float %41 0
+         %43 = OpCompositeExtract %float %41 1
+         %45 = OpLoad %uint %arg_3
+         %44 = OpConvertUToF %float %45
+         %46 = OpCompositeConstruct %v3float %42 %43 %44
+         %47 = OpLoad %float %arg_4
+         %35 = OpImageSampleExplicitLod %v4float %39 %46 Lod|ConstOffset %47 %51
+               OpStore %res %35
+         %56 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %57 = OpLoad %v4float %res
+               OpStore %56 %57
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %51
-         %53 = OpLabel
-         %54 = OpFunctionCall %void %textureSampleLevel_faa6d7
+%vertex_main_inner = OpFunction %v4float None %58
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %textureSampleLevel_faa6d7
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %56 = OpLabel
-         %57 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %57
+%vertex_main = OpFunction %void None %18
+         %63 = OpLabel
+         %64 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %64
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %59 = OpLabel
-         %60 = OpFunctionCall %void %textureSampleLevel_faa6d7
+%fragment_main = OpFunction %void None %18
+         %66 = OpLabel
+         %67 = OpFunctionCall %void %textureSampleLevel_faa6d7
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %62 = OpLabel
-         %63 = OpFunctionCall %void %textureSampleLevel_faa6d7
+%compute_main = OpFunction %void None %18
+         %69 = OpLabel
+         %70 = OpFunctionCall %void %textureSampleLevel_faa6d7
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.wgsl
index aa0a6a9..2d0753f 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/faa6d7.wgsl.expected.wgsl
@@ -8,8 +8,11 @@
   var arg_4 = 1.0f;
   const arg_5 = vec2<i32>(1i);
   var res : vec4<f32> = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_faa6d7();
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl
index 4b45581..263e915 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl
@@ -29,7 +29,9 @@
   var arg_3 = 1u;
   var arg_4 = 1i;
   var res: f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl
index a185c7e..3ea6da2 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.dxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ff11bc() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl
index a185c7e..3ea6da2 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.fxc.hlsl
@@ -1,11 +1,13 @@
 TextureCubeArray arg_0 : register(t0, space1);
 SamplerState arg_1 : register(s1, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void textureSampleLevel_ff11bc() {
   float3 arg_2 = (1.0f).xxx;
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = arg_0.SampleLevel(arg_1, float4(arg_2, float(arg_3)), arg_4).x;
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.msl
index a6909d5..446d6dc 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.msl
@@ -1,36 +1,37 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void textureSampleLevel_ff11bc(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
+void textureSampleLevel_ff11bc(depthcube_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2, device float* const tint_symbol_3) {
   float3 arg_2 = float3(1.0f);
   uint arg_3 = 1u;
   int arg_4 = 1;
   float res = tint_symbol_1.sample(tint_symbol_2, arg_2, arg_3, level(arg_4));
+  *(tint_symbol_3) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_3, sampler tint_symbol_4) {
-  textureSampleLevel_ff11bc(tint_symbol_3, tint_symbol_4);
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_4, sampler tint_symbol_5, device float* const tint_symbol_6) {
+  textureSampleLevel_ff11bc(tint_symbol_4, tint_symbol_5, tint_symbol_6);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]], sampler tint_symbol_6 [[sampler(0)]]) {
-  float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], device float* tint_symbol_9 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8, tint_symbol_9);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) {
-  textureSampleLevel_ff11bc(tint_symbol_7, tint_symbol_8);
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_10 [[texture(0)]], sampler tint_symbol_11 [[sampler(0)]], device float* tint_symbol_12 [[buffer(0)]]) {
+  textureSampleLevel_ff11bc(tint_symbol_10, tint_symbol_11, tint_symbol_12);
   return;
 }
 
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_9 [[texture(0)]], sampler tint_symbol_10 [[sampler(0)]]) {
-  textureSampleLevel_ff11bc(tint_symbol_9, tint_symbol_10);
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_13 [[texture(0)]], sampler tint_symbol_14 [[sampler(0)]], device float* tint_symbol_15 [[buffer(0)]]) {
+  textureSampleLevel_ff11bc(tint_symbol_13, tint_symbol_14, tint_symbol_15);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.spvasm
index ce0b555..8e3a9ca 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 72
 ; Schema: 0
                OpCapability Shader
                OpCapability SampledCubeArray
@@ -15,6 +15,9 @@
                OpName %vertex_point_size "vertex_point_size"
                OpName %arg_0 "arg_0"
                OpName %arg_1 "arg_1"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %textureSampleLevel_ff11bc "textureSampleLevel_ff11bc"
                OpName %arg_2 "arg_2"
                OpName %arg_3 "arg_3"
@@ -30,6 +33,10 @@
                OpDecorate %arg_0 Binding 0
                OpDecorate %arg_1 DescriptorSet 1
                OpDecorate %arg_1 Binding 1
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -44,69 +51,77 @@
          %14 = OpTypeSampler
 %_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
       %arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %24 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %24 = OpConstantNull %v3float
+         %27 = OpConstantNull %v3float
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %29 = OpConstantNull %uint
+         %32 = OpConstantNull %uint
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
 %_ptr_Function_int = OpTypePointer Function %int
-         %34 = OpConstantNull %int
-         %39 = OpTypeSampledImage %11
+         %37 = OpConstantNull %int
+         %42 = OpTypeSampledImage %11
 %_ptr_Function_float = OpTypePointer Function %float
-         %52 = OpTypeFunction %v4float
-%textureSampleLevel_ff11bc = OpFunction %void None %15
-         %18 = OpLabel
-      %arg_2 = OpVariable %_ptr_Function_v3float Function %24
-      %arg_3 = OpVariable %_ptr_Function_uint Function %29
-      %arg_4 = OpVariable %_ptr_Function_int Function %34
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %59 = OpTypeFunction %v4float
+%textureSampleLevel_ff11bc = OpFunction %void None %18
+         %21 = OpLabel
+      %arg_2 = OpVariable %_ptr_Function_v3float Function %27
+      %arg_3 = OpVariable %_ptr_Function_uint Function %32
+      %arg_4 = OpVariable %_ptr_Function_int Function %37
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_2 %21
+               OpStore %arg_2 %24
                OpStore %arg_3 %uint_1
                OpStore %arg_4 %int_1
-         %37 = OpLoad %14 %arg_1
-         %38 = OpLoad %11 %arg_0
-         %40 = OpSampledImage %39 %38 %37
-         %41 = OpLoad %v3float %arg_2
-         %42 = OpCompositeExtract %float %41 0
-         %43 = OpCompositeExtract %float %41 1
-         %44 = OpCompositeExtract %float %41 2
-         %46 = OpLoad %uint %arg_3
-         %45 = OpConvertUToF %float %46
-         %47 = OpCompositeConstruct %v4float %42 %43 %44 %45
-         %49 = OpLoad %int %arg_4
-         %48 = OpConvertSToF %float %49
-         %36 = OpImageSampleExplicitLod %v4float %40 %47 Lod %48
-         %35 = OpCompositeExtract %float %36 0
-               OpStore %res %35
+         %40 = OpLoad %14 %arg_1
+         %41 = OpLoad %11 %arg_0
+         %43 = OpSampledImage %42 %41 %40
+         %44 = OpLoad %v3float %arg_2
+         %45 = OpCompositeExtract %float %44 0
+         %46 = OpCompositeExtract %float %44 1
+         %47 = OpCompositeExtract %float %44 2
+         %49 = OpLoad %uint %arg_3
+         %48 = OpConvertUToF %float %49
+         %50 = OpCompositeConstruct %v4float %45 %46 %47 %48
+         %52 = OpLoad %int %arg_4
+         %51 = OpConvertSToF %float %52
+         %39 = OpImageSampleExplicitLod %v4float %43 %50 Lod %51
+         %38 = OpCompositeExtract %float %39 0
+               OpStore %res %38
+         %57 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %58 = OpLoad %float %res
+               OpStore %57 %58
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %52
-         %54 = OpLabel
-         %55 = OpFunctionCall %void %textureSampleLevel_ff11bc
+%vertex_main_inner = OpFunction %v4float None %59
+         %61 = OpLabel
+         %62 = OpFunctionCall %void %textureSampleLevel_ff11bc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %15
-         %57 = OpLabel
-         %58 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %58
+%vertex_main = OpFunction %void None %18
+         %64 = OpLabel
+         %65 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %65
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %15
-         %60 = OpLabel
-         %61 = OpFunctionCall %void %textureSampleLevel_ff11bc
+%fragment_main = OpFunction %void None %18
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %textureSampleLevel_ff11bc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %63 = OpLabel
-         %64 = OpFunctionCall %void %textureSampleLevel_ff11bc
+%compute_main = OpFunction %void None %18
+         %70 = OpLabel
+         %71 = OpFunctionCall %void %textureSampleLevel_ff11bc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.wgsl
index 3f0462a..2a275c9 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.wgsl
@@ -7,8 +7,11 @@
   var arg_3 = 1u;
   var arg_4 = 1i;
   var res : f32 = textureSampleLevel(arg_0, arg_1, arg_2, arg_3, arg_4);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureSampleLevel_ff11bc();
diff --git a/test/tint/builtins/gen/var/textureStore/00ca64.wgsl b/test/tint/builtins/gen/var/textureStore/00ca64.wgsl
index 7cd1264..63a77ad 100644
--- a/test/tint/builtins/gen/var/textureStore/00ca64.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/00ca64.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_00ca64();
diff --git a/test/tint/builtins/gen/var/textureStore/0148bd.wgsl b/test/tint/builtins/gen/var/textureStore/0148bd.wgsl
index 64ec2f8..8627fa2 100644
--- a/test/tint/builtins/gen/var/textureStore/0148bd.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/0148bd.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0148bd();
diff --git a/test/tint/builtins/gen/var/textureStore/05ce15.wgsl b/test/tint/builtins/gen/var/textureStore/05ce15.wgsl
index ec9d7a9..400da8c 100644
--- a/test/tint/builtins/gen/var/textureStore/05ce15.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/05ce15.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_05ce15();
diff --git a/test/tint/builtins/gen/var/textureStore/064c7f.wgsl b/test/tint/builtins/gen/var/textureStore/064c7f.wgsl
index 31d8bf5..3b86493 100644
--- a/test/tint/builtins/gen/var/textureStore/064c7f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/064c7f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_064c7f();
diff --git a/test/tint/builtins/gen/var/textureStore/068641.wgsl b/test/tint/builtins/gen/var/textureStore/068641.wgsl
index e1e22c9..8822c38 100644
--- a/test/tint/builtins/gen/var/textureStore/068641.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/068641.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_068641();
diff --git a/test/tint/builtins/gen/var/textureStore/06e49c.wgsl b/test/tint/builtins/gen/var/textureStore/06e49c.wgsl
index 2a75d72..159954c 100644
--- a/test/tint/builtins/gen/var/textureStore/06e49c.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/06e49c.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_06e49c();
diff --git a/test/tint/builtins/gen/var/textureStore/07548b.wgsl b/test/tint/builtins/gen/var/textureStore/07548b.wgsl
index 7ddcb61..41776ae 100644
--- a/test/tint/builtins/gen/var/textureStore/07548b.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/07548b.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_07548b();
diff --git a/test/tint/builtins/gen/var/textureStore/0a1a79.wgsl b/test/tint/builtins/gen/var/textureStore/0a1a79.wgsl
index 9a69d14..a948807 100644
--- a/test/tint/builtins/gen/var/textureStore/0a1a79.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/0a1a79.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0a1a79();
diff --git a/test/tint/builtins/gen/var/textureStore/0af6b5.wgsl b/test/tint/builtins/gen/var/textureStore/0af6b5.wgsl
index eb144e5..a39b998 100644
--- a/test/tint/builtins/gen/var/textureStore/0af6b5.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/0af6b5.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0af6b5();
diff --git a/test/tint/builtins/gen/var/textureStore/0c3dff.wgsl b/test/tint/builtins/gen/var/textureStore/0c3dff.wgsl
index 655177a..ceee3a1 100644
--- a/test/tint/builtins/gen/var/textureStore/0c3dff.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/0c3dff.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0c3dff();
diff --git a/test/tint/builtins/gen/var/textureStore/0cc825.wgsl b/test/tint/builtins/gen/var/textureStore/0cc825.wgsl
index 94cff34..40513dc 100644
--- a/test/tint/builtins/gen/var/textureStore/0cc825.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/0cc825.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_0cc825();
diff --git a/test/tint/builtins/gen/var/textureStore/102722.wgsl b/test/tint/builtins/gen/var/textureStore/102722.wgsl
index 6a983d5..7b13f88 100644
--- a/test/tint/builtins/gen/var/textureStore/102722.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/102722.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_102722();
diff --git a/test/tint/builtins/gen/var/textureStore/158cf0.wgsl b/test/tint/builtins/gen/var/textureStore/158cf0.wgsl
index 36d1073..6271460 100644
--- a/test/tint/builtins/gen/var/textureStore/158cf0.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/158cf0.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_158cf0();
diff --git a/test/tint/builtins/gen/var/textureStore/1839f2.wgsl b/test/tint/builtins/gen/var/textureStore/1839f2.wgsl
index d7fda87..409f99a 100644
--- a/test/tint/builtins/gen/var/textureStore/1839f2.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/1839f2.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1839f2();
diff --git a/test/tint/builtins/gen/var/textureStore/1a7d35.wgsl b/test/tint/builtins/gen/var/textureStore/1a7d35.wgsl
index 544693a..c274236 100644
--- a/test/tint/builtins/gen/var/textureStore/1a7d35.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/1a7d35.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1a7d35();
diff --git a/test/tint/builtins/gen/var/textureStore/1bbd08.wgsl b/test/tint/builtins/gen/var/textureStore/1bbd08.wgsl
index 5fd9db6..1c2d02a 100644
--- a/test/tint/builtins/gen/var/textureStore/1bbd08.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/1bbd08.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1bbd08();
diff --git a/test/tint/builtins/gen/var/textureStore/1c02e7.wgsl b/test/tint/builtins/gen/var/textureStore/1c02e7.wgsl
index b7226e4..9ac967d 100644
--- a/test/tint/builtins/gen/var/textureStore/1c02e7.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/1c02e7.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1c02e7();
diff --git a/test/tint/builtins/gen/var/textureStore/1dc954.wgsl b/test/tint/builtins/gen/var/textureStore/1dc954.wgsl
index fbfcdb4..ad6e5a4 100644
--- a/test/tint/builtins/gen/var/textureStore/1dc954.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/1dc954.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1dc954();
diff --git a/test/tint/builtins/gen/var/textureStore/1e20f2.wgsl b/test/tint/builtins/gen/var/textureStore/1e20f2.wgsl
index 16e0779..ae32cf1 100644
--- a/test/tint/builtins/gen/var/textureStore/1e20f2.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/1e20f2.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1e20f2();
diff --git a/test/tint/builtins/gen/var/textureStore/1efc36.wgsl b/test/tint/builtins/gen/var/textureStore/1efc36.wgsl
index 36c3e77..f3d2b34 100644
--- a/test/tint/builtins/gen/var/textureStore/1efc36.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/1efc36.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1efc36();
diff --git a/test/tint/builtins/gen/var/textureStore/1f1ef8.wgsl b/test/tint/builtins/gen/var/textureStore/1f1ef8.wgsl
index 3992003..76fb366 100644
--- a/test/tint/builtins/gen/var/textureStore/1f1ef8.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/1f1ef8.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_1f1ef8();
diff --git a/test/tint/builtins/gen/var/textureStore/207fdd.wgsl b/test/tint/builtins/gen/var/textureStore/207fdd.wgsl
index 0c9fc1f..f928004 100644
--- a/test/tint/builtins/gen/var/textureStore/207fdd.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/207fdd.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_207fdd();
diff --git a/test/tint/builtins/gen/var/textureStore/22d955.wgsl b/test/tint/builtins/gen/var/textureStore/22d955.wgsl
index 741a0d9..c9b9ae9 100644
--- a/test/tint/builtins/gen/var/textureStore/22d955.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/22d955.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_22d955();
diff --git a/test/tint/builtins/gen/var/textureStore/22f045.wgsl b/test/tint/builtins/gen/var/textureStore/22f045.wgsl
index 6ad75f8..67ac74b 100644
--- a/test/tint/builtins/gen/var/textureStore/22f045.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/22f045.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_22f045();
diff --git a/test/tint/builtins/gen/var/textureStore/2383fc.wgsl b/test/tint/builtins/gen/var/textureStore/2383fc.wgsl
index 7a8c885..4aaaeb7 100644
--- a/test/tint/builtins/gen/var/textureStore/2383fc.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/2383fc.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2383fc();
diff --git a/test/tint/builtins/gen/var/textureStore/258ab0.wgsl b/test/tint/builtins/gen/var/textureStore/258ab0.wgsl
index 008b5c9..4ea06d5 100644
--- a/test/tint/builtins/gen/var/textureStore/258ab0.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/258ab0.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_258ab0();
diff --git a/test/tint/builtins/gen/var/textureStore/26bf70.wgsl b/test/tint/builtins/gen/var/textureStore/26bf70.wgsl
index 224f16a..c59e761 100644
--- a/test/tint/builtins/gen/var/textureStore/26bf70.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/26bf70.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_26bf70();
diff --git a/test/tint/builtins/gen/var/textureStore/27063a.wgsl b/test/tint/builtins/gen/var/textureStore/27063a.wgsl
index d4c6cff..71ab9e2 100644
--- a/test/tint/builtins/gen/var/textureStore/27063a.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/27063a.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_27063a();
diff --git a/test/tint/builtins/gen/var/textureStore/2796b4.wgsl b/test/tint/builtins/gen/var/textureStore/2796b4.wgsl
index 074f8c3..af1eb8f 100644
--- a/test/tint/builtins/gen/var/textureStore/2796b4.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/2796b4.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2796b4();
diff --git a/test/tint/builtins/gen/var/textureStore/285218.wgsl b/test/tint/builtins/gen/var/textureStore/285218.wgsl
index 2e7da69..effec8f 100644
--- a/test/tint/builtins/gen/var/textureStore/285218.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/285218.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_285218();
diff --git a/test/tint/builtins/gen/var/textureStore/28a7ec.wgsl b/test/tint/builtins/gen/var/textureStore/28a7ec.wgsl
index 889a179..4264717 100644
--- a/test/tint/builtins/gen/var/textureStore/28a7ec.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/28a7ec.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_28a7ec();
diff --git a/test/tint/builtins/gen/var/textureStore/2ac6c7.wgsl b/test/tint/builtins/gen/var/textureStore/2ac6c7.wgsl
index 1333e72..893d5e6 100644
--- a/test/tint/builtins/gen/var/textureStore/2ac6c7.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/2ac6c7.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2ac6c7();
diff --git a/test/tint/builtins/gen/var/textureStore/2d2835.wgsl b/test/tint/builtins/gen/var/textureStore/2d2835.wgsl
index 08d4370..072fa67 100644
--- a/test/tint/builtins/gen/var/textureStore/2d2835.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/2d2835.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2d2835();
diff --git a/test/tint/builtins/gen/var/textureStore/2e4245.wgsl b/test/tint/builtins/gen/var/textureStore/2e4245.wgsl
index 70bf322..def7036 100644
--- a/test/tint/builtins/gen/var/textureStore/2e4245.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/2e4245.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2e4245();
diff --git a/test/tint/builtins/gen/var/textureStore/2e6102.wgsl b/test/tint/builtins/gen/var/textureStore/2e6102.wgsl
index ffe422a..05b37d1 100644
--- a/test/tint/builtins/gen/var/textureStore/2e6102.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/2e6102.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2e6102();
diff --git a/test/tint/builtins/gen/var/textureStore/2eb2a4.wgsl b/test/tint/builtins/gen/var/textureStore/2eb2a4.wgsl
index d293c97..428f466 100644
--- a/test/tint/builtins/gen/var/textureStore/2eb2a4.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/2eb2a4.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2eb2a4();
diff --git a/test/tint/builtins/gen/var/textureStore/2ed2a3.wgsl b/test/tint/builtins/gen/var/textureStore/2ed2a3.wgsl
index f2d8621..56914dd 100644
--- a/test/tint/builtins/gen/var/textureStore/2ed2a3.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/2ed2a3.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_2ed2a3();
diff --git a/test/tint/builtins/gen/var/textureStore/30b0b0.wgsl b/test/tint/builtins/gen/var/textureStore/30b0b0.wgsl
index 16db314..0bfa638 100644
--- a/test/tint/builtins/gen/var/textureStore/30b0b0.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/30b0b0.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_30b0b0();
diff --git a/test/tint/builtins/gen/var/textureStore/31745b.wgsl b/test/tint/builtins/gen/var/textureStore/31745b.wgsl
index 27b9e30..485ea29 100644
--- a/test/tint/builtins/gen/var/textureStore/31745b.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/31745b.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_31745b();
diff --git a/test/tint/builtins/gen/var/textureStore/319029.wgsl b/test/tint/builtins/gen/var/textureStore/319029.wgsl
index 0eec371..562ac01 100644
--- a/test/tint/builtins/gen/var/textureStore/319029.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/319029.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_319029();
diff --git a/test/tint/builtins/gen/var/textureStore/32f368.wgsl b/test/tint/builtins/gen/var/textureStore/32f368.wgsl
index e31b404..1973352 100644
--- a/test/tint/builtins/gen/var/textureStore/32f368.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/32f368.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_32f368();
diff --git a/test/tint/builtins/gen/var/textureStore/330b7c.wgsl b/test/tint/builtins/gen/var/textureStore/330b7c.wgsl
index f8c0832..f801cc6 100644
--- a/test/tint/builtins/gen/var/textureStore/330b7c.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/330b7c.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_330b7c();
diff --git a/test/tint/builtins/gen/var/textureStore/331aee.wgsl b/test/tint/builtins/gen/var/textureStore/331aee.wgsl
index 4dfd7ec..93a13c8 100644
--- a/test/tint/builtins/gen/var/textureStore/331aee.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/331aee.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_331aee();
diff --git a/test/tint/builtins/gen/var/textureStore/33cec0.wgsl b/test/tint/builtins/gen/var/textureStore/33cec0.wgsl
index f075034..650d211 100644
--- a/test/tint/builtins/gen/var/textureStore/33cec0.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/33cec0.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_33cec0();
diff --git a/test/tint/builtins/gen/var/textureStore/37ffd4.wgsl b/test/tint/builtins/gen/var/textureStore/37ffd4.wgsl
index b8a7ce1..7ba921b 100644
--- a/test/tint/builtins/gen/var/textureStore/37ffd4.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/37ffd4.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_37ffd4();
diff --git a/test/tint/builtins/gen/var/textureStore/38e8d7.wgsl b/test/tint/builtins/gen/var/textureStore/38e8d7.wgsl
index 97302a4..6fec880 100644
--- a/test/tint/builtins/gen/var/textureStore/38e8d7.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/38e8d7.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_38e8d7();
diff --git a/test/tint/builtins/gen/var/textureStore/3a52ac.wgsl b/test/tint/builtins/gen/var/textureStore/3a52ac.wgsl
index b492c44..4be6bfc 100644
--- a/test/tint/builtins/gen/var/textureStore/3a52ac.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/3a52ac.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3a52ac();
diff --git a/test/tint/builtins/gen/var/textureStore/3bb7a1.wgsl b/test/tint/builtins/gen/var/textureStore/3bb7a1.wgsl
index 906047c..6bb49e5 100644
--- a/test/tint/builtins/gen/var/textureStore/3bb7a1.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/3bb7a1.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3bb7a1();
diff --git a/test/tint/builtins/gen/var/textureStore/3bec15.wgsl b/test/tint/builtins/gen/var/textureStore/3bec15.wgsl
index 47169e7..39e62ef 100644
--- a/test/tint/builtins/gen/var/textureStore/3bec15.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/3bec15.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3bec15();
diff --git a/test/tint/builtins/gen/var/textureStore/3c1937.wgsl b/test/tint/builtins/gen/var/textureStore/3c1937.wgsl
index 2d5497a..8aa2947 100644
--- a/test/tint/builtins/gen/var/textureStore/3c1937.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/3c1937.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3c1937();
diff --git a/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl b/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl
index edc8ab5..1363a94 100644
--- a/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3d6f01();
diff --git a/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl b/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl
index 5348787..159aa05 100644
--- a/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_3fb31f();
diff --git a/test/tint/builtins/gen/var/textureStore/40c455.wgsl b/test/tint/builtins/gen/var/textureStore/40c455.wgsl
index dab5410..cfecd11 100644
--- a/test/tint/builtins/gen/var/textureStore/40c455.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/40c455.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_40c455();
diff --git a/test/tint/builtins/gen/var/textureStore/4288fc.wgsl b/test/tint/builtins/gen/var/textureStore/4288fc.wgsl
index 9365274..ecc4186 100644
--- a/test/tint/builtins/gen/var/textureStore/4288fc.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/4288fc.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_4288fc();
diff --git a/test/tint/builtins/gen/var/textureStore/441ba8.wgsl b/test/tint/builtins/gen/var/textureStore/441ba8.wgsl
index 8b1099f..c9927e1 100644
--- a/test/tint/builtins/gen/var/textureStore/441ba8.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/441ba8.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_441ba8();
diff --git a/test/tint/builtins/gen/var/textureStore/44daa7.wgsl b/test/tint/builtins/gen/var/textureStore/44daa7.wgsl
index 23b0f00..704dc09 100644
--- a/test/tint/builtins/gen/var/textureStore/44daa7.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/44daa7.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_44daa7();
diff --git a/test/tint/builtins/gen/var/textureStore/486500.wgsl b/test/tint/builtins/gen/var/textureStore/486500.wgsl
index 34f0cd4..d9baea3 100644
--- a/test/tint/builtins/gen/var/textureStore/486500.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/486500.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_486500();
diff --git a/test/tint/builtins/gen/var/textureStore/4c454f.wgsl b/test/tint/builtins/gen/var/textureStore/4c454f.wgsl
index accfa13..7806495 100644
--- a/test/tint/builtins/gen/var/textureStore/4c454f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/4c454f.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_4c454f();
diff --git a/test/tint/builtins/gen/var/textureStore/4d359d.wgsl b/test/tint/builtins/gen/var/textureStore/4d359d.wgsl
index 65547f4c..d2c06ef 100644
--- a/test/tint/builtins/gen/var/textureStore/4d359d.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/4d359d.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_4d359d();
diff --git a/test/tint/builtins/gen/var/textureStore/4fc057.wgsl b/test/tint/builtins/gen/var/textureStore/4fc057.wgsl
index 8a4c152..3d0d1cd 100644
--- a/test/tint/builtins/gen/var/textureStore/4fc057.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/4fc057.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_4fc057();
diff --git a/test/tint/builtins/gen/var/textureStore/506a71.wgsl b/test/tint/builtins/gen/var/textureStore/506a71.wgsl
index 623255e..19f3379 100644
--- a/test/tint/builtins/gen/var/textureStore/506a71.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/506a71.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_506a71();
diff --git a/test/tint/builtins/gen/var/textureStore/52f503.wgsl b/test/tint/builtins/gen/var/textureStore/52f503.wgsl
index c9fefcef..d74218a 100644
--- a/test/tint/builtins/gen/var/textureStore/52f503.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/52f503.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_52f503();
diff --git a/test/tint/builtins/gen/var/textureStore/5841f8.wgsl b/test/tint/builtins/gen/var/textureStore/5841f8.wgsl
index eaab31e..2250610 100644
--- a/test/tint/builtins/gen/var/textureStore/5841f8.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/5841f8.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5841f8();
diff --git a/test/tint/builtins/gen/var/textureStore/59a0ab.wgsl b/test/tint/builtins/gen/var/textureStore/59a0ab.wgsl
index affb43a..7af8842 100644
--- a/test/tint/builtins/gen/var/textureStore/59a0ab.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/59a0ab.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_59a0ab();
diff --git a/test/tint/builtins/gen/var/textureStore/5a2f8f.wgsl b/test/tint/builtins/gen/var/textureStore/5a2f8f.wgsl
index 7c83c5a..0e02589 100644
--- a/test/tint/builtins/gen/var/textureStore/5a2f8f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/5a2f8f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5a2f8f();
diff --git a/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl b/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl
index 241e4cc..b6d3800 100644
--- a/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5bc4f3();
diff --git a/test/tint/builtins/gen/var/textureStore/5ddc61.wgsl b/test/tint/builtins/gen/var/textureStore/5ddc61.wgsl
index 93a6d15..9bc396b 100644
--- a/test/tint/builtins/gen/var/textureStore/5ddc61.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/5ddc61.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5ddc61();
diff --git a/test/tint/builtins/gen/var/textureStore/5f9a49.wgsl b/test/tint/builtins/gen/var/textureStore/5f9a49.wgsl
index bcc40ed..bd110f8 100644
--- a/test/tint/builtins/gen/var/textureStore/5f9a49.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/5f9a49.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_5f9a49();
diff --git a/test/tint/builtins/gen/var/textureStore/602b5a.wgsl b/test/tint/builtins/gen/var/textureStore/602b5a.wgsl
index ee3842c..701bdf9 100644
--- a/test/tint/builtins/gen/var/textureStore/602b5a.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/602b5a.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_602b5a();
diff --git a/test/tint/builtins/gen/var/textureStore/60975f.wgsl b/test/tint/builtins/gen/var/textureStore/60975f.wgsl
index 68a1d18..db11883 100644
--- a/test/tint/builtins/gen/var/textureStore/60975f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/60975f.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_60975f();
diff --git a/test/tint/builtins/gen/var/textureStore/658a74.wgsl b/test/tint/builtins/gen/var/textureStore/658a74.wgsl
index 88879be..560e31e 100644
--- a/test/tint/builtins/gen/var/textureStore/658a74.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/658a74.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_658a74();
diff --git a/test/tint/builtins/gen/var/textureStore/682fd6.wgsl b/test/tint/builtins/gen/var/textureStore/682fd6.wgsl
index 12fea92..0e3e670 100644
--- a/test/tint/builtins/gen/var/textureStore/682fd6.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/682fd6.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_682fd6();
diff --git a/test/tint/builtins/gen/var/textureStore/699a1b.wgsl b/test/tint/builtins/gen/var/textureStore/699a1b.wgsl
index 89f19ea..c91e732 100644
--- a/test/tint/builtins/gen/var/textureStore/699a1b.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/699a1b.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_699a1b();
diff --git a/test/tint/builtins/gen/var/textureStore/6b75c3.wgsl b/test/tint/builtins/gen/var/textureStore/6b75c3.wgsl
index 8c49a1a..1e69614 100644
--- a/test/tint/builtins/gen/var/textureStore/6b75c3.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/6b75c3.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6b75c3();
diff --git a/test/tint/builtins/gen/var/textureStore/6b80d2.wgsl b/test/tint/builtins/gen/var/textureStore/6b80d2.wgsl
index 2f19c1d..5a4e52c 100644
--- a/test/tint/builtins/gen/var/textureStore/6b80d2.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/6b80d2.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6b80d2();
diff --git a/test/tint/builtins/gen/var/textureStore/6cff2e.wgsl b/test/tint/builtins/gen/var/textureStore/6cff2e.wgsl
index 6b2ab9a..e106283 100644
--- a/test/tint/builtins/gen/var/textureStore/6cff2e.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/6cff2e.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6cff2e();
diff --git a/test/tint/builtins/gen/var/textureStore/6da692.wgsl b/test/tint/builtins/gen/var/textureStore/6da692.wgsl
index 7260963..57fe283 100644
--- a/test/tint/builtins/gen/var/textureStore/6da692.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/6da692.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6da692();
diff --git a/test/tint/builtins/gen/var/textureStore/6f8642.wgsl b/test/tint/builtins/gen/var/textureStore/6f8642.wgsl
index b10038e..2ed321e 100644
--- a/test/tint/builtins/gen/var/textureStore/6f8642.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/6f8642.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_6f8642();
diff --git a/test/tint/builtins/gen/var/textureStore/726472.wgsl b/test/tint/builtins/gen/var/textureStore/726472.wgsl
index c758e8d..42ff30c 100644
--- a/test/tint/builtins/gen/var/textureStore/726472.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/726472.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_726472();
diff --git a/test/tint/builtins/gen/var/textureStore/72fa64.wgsl b/test/tint/builtins/gen/var/textureStore/72fa64.wgsl
index a7805f3..228803e 100644
--- a/test/tint/builtins/gen/var/textureStore/72fa64.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/72fa64.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_72fa64();
diff --git a/test/tint/builtins/gen/var/textureStore/731349.wgsl b/test/tint/builtins/gen/var/textureStore/731349.wgsl
index 2063ea5..834bb26 100644
--- a/test/tint/builtins/gen/var/textureStore/731349.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/731349.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_731349();
diff --git a/test/tint/builtins/gen/var/textureStore/73bbbc.wgsl b/test/tint/builtins/gen/var/textureStore/73bbbc.wgsl
index 95ca71c..1f4083a 100644
--- a/test/tint/builtins/gen/var/textureStore/73bbbc.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/73bbbc.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_73bbbc();
diff --git a/test/tint/builtins/gen/var/textureStore/752da6.wgsl b/test/tint/builtins/gen/var/textureStore/752da6.wgsl
index 80276c2..04f8f3d 100644
--- a/test/tint/builtins/gen/var/textureStore/752da6.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/752da6.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_752da6();
diff --git a/test/tint/builtins/gen/var/textureStore/76affd.wgsl b/test/tint/builtins/gen/var/textureStore/76affd.wgsl
index 4ddff3f..d5078d7 100644
--- a/test/tint/builtins/gen/var/textureStore/76affd.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/76affd.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_76affd();
diff --git a/test/tint/builtins/gen/var/textureStore/779d14.wgsl b/test/tint/builtins/gen/var/textureStore/779d14.wgsl
index 66154bc..6f7b510 100644
--- a/test/tint/builtins/gen/var/textureStore/779d14.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/779d14.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_779d14();
diff --git a/test/tint/builtins/gen/var/textureStore/77c0ae.wgsl b/test/tint/builtins/gen/var/textureStore/77c0ae.wgsl
index add7ba4..1715884 100644
--- a/test/tint/builtins/gen/var/textureStore/77c0ae.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/77c0ae.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_77c0ae();
diff --git a/test/tint/builtins/gen/var/textureStore/7bb211.wgsl b/test/tint/builtins/gen/var/textureStore/7bb211.wgsl
index 3588d57..9714429 100644
--- a/test/tint/builtins/gen/var/textureStore/7bb211.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/7bb211.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_7bb211();
diff --git a/test/tint/builtins/gen/var/textureStore/7cec8d.wgsl b/test/tint/builtins/gen/var/textureStore/7cec8d.wgsl
index c51618c..5930f3b 100644
--- a/test/tint/builtins/gen/var/textureStore/7cec8d.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/7cec8d.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_7cec8d();
diff --git a/test/tint/builtins/gen/var/textureStore/7cf6e7.wgsl b/test/tint/builtins/gen/var/textureStore/7cf6e7.wgsl
index 1728981..56ceaa8 100644
--- a/test/tint/builtins/gen/var/textureStore/7cf6e7.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/7cf6e7.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_7cf6e7();
diff --git a/test/tint/builtins/gen/var/textureStore/7f7fae.wgsl b/test/tint/builtins/gen/var/textureStore/7f7fae.wgsl
index 6357ca2..337abf7 100644
--- a/test/tint/builtins/gen/var/textureStore/7f7fae.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/7f7fae.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_7f7fae();
diff --git a/test/tint/builtins/gen/var/textureStore/804942.wgsl b/test/tint/builtins/gen/var/textureStore/804942.wgsl
index be1271a..2043d77 100644
--- a/test/tint/builtins/gen/var/textureStore/804942.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/804942.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_804942();
diff --git a/test/tint/builtins/gen/var/textureStore/805dae.wgsl b/test/tint/builtins/gen/var/textureStore/805dae.wgsl
index 96b5ec1..a796d2f 100644
--- a/test/tint/builtins/gen/var/textureStore/805dae.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/805dae.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_805dae();
diff --git a/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl b/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl
index e0476d9..0caba40 100644
--- a/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_83bcc1();
diff --git a/test/tint/builtins/gen/var/textureStore/872747.wgsl b/test/tint/builtins/gen/var/textureStore/872747.wgsl
index 71d6beb..f38585b 100644
--- a/test/tint/builtins/gen/var/textureStore/872747.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/872747.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_872747();
diff --git a/test/tint/builtins/gen/var/textureStore/8b9310.wgsl b/test/tint/builtins/gen/var/textureStore/8b9310.wgsl
index 8924093..5877734 100644
--- a/test/tint/builtins/gen/var/textureStore/8b9310.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/8b9310.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8b9310();
diff --git a/test/tint/builtins/gen/var/textureStore/8bb287.wgsl b/test/tint/builtins/gen/var/textureStore/8bb287.wgsl
index cf485b6..7654673 100644
--- a/test/tint/builtins/gen/var/textureStore/8bb287.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/8bb287.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8bb287();
diff --git a/test/tint/builtins/gen/var/textureStore/8c76e9.wgsl b/test/tint/builtins/gen/var/textureStore/8c76e9.wgsl
index df2a149..ca69a3b 100644
--- a/test/tint/builtins/gen/var/textureStore/8c76e9.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/8c76e9.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8c76e9();
diff --git a/test/tint/builtins/gen/var/textureStore/8dc54f.wgsl b/test/tint/builtins/gen/var/textureStore/8dc54f.wgsl
index f17830e..2eede8a 100644
--- a/test/tint/builtins/gen/var/textureStore/8dc54f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/8dc54f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8dc54f();
diff --git a/test/tint/builtins/gen/var/textureStore/8e0479.wgsl b/test/tint/builtins/gen/var/textureStore/8e0479.wgsl
index 96639ec..1856c41 100644
--- a/test/tint/builtins/gen/var/textureStore/8e0479.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/8e0479.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8e0479();
diff --git a/test/tint/builtins/gen/var/textureStore/8ed9f8.wgsl b/test/tint/builtins/gen/var/textureStore/8ed9f8.wgsl
index 963166a..fb9dc40 100644
--- a/test/tint/builtins/gen/var/textureStore/8ed9f8.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/8ed9f8.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8ed9f8();
diff --git a/test/tint/builtins/gen/var/textureStore/8f71a1.wgsl b/test/tint/builtins/gen/var/textureStore/8f71a1.wgsl
index 12d406f..59670a7 100644
--- a/test/tint/builtins/gen/var/textureStore/8f71a1.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/8f71a1.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8f71a1();
diff --git a/test/tint/builtins/gen/var/textureStore/8ff674.wgsl b/test/tint/builtins/gen/var/textureStore/8ff674.wgsl
index 79cf930..fe201c4 100644
--- a/test/tint/builtins/gen/var/textureStore/8ff674.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/8ff674.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_8ff674();
diff --git a/test/tint/builtins/gen/var/textureStore/958353.wgsl b/test/tint/builtins/gen/var/textureStore/958353.wgsl
index 0d1dcd6..686c942 100644
--- a/test/tint/builtins/gen/var/textureStore/958353.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/958353.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_958353();
diff --git a/test/tint/builtins/gen/var/textureStore/959d94.wgsl b/test/tint/builtins/gen/var/textureStore/959d94.wgsl
index 37080fa..c938f71 100644
--- a/test/tint/builtins/gen/var/textureStore/959d94.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/959d94.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_959d94();
diff --git a/test/tint/builtins/gen/var/textureStore/95e452.wgsl b/test/tint/builtins/gen/var/textureStore/95e452.wgsl
index e93a933..271fa9c 100644
--- a/test/tint/builtins/gen/var/textureStore/95e452.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/95e452.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_95e452();
diff --git a/test/tint/builtins/gen/var/textureStore/969534.wgsl b/test/tint/builtins/gen/var/textureStore/969534.wgsl
index be1ee39..57f2550 100644
--- a/test/tint/builtins/gen/var/textureStore/969534.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/969534.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_969534();
diff --git a/test/tint/builtins/gen/var/textureStore/9938b7.wgsl b/test/tint/builtins/gen/var/textureStore/9938b7.wgsl
index c722fc7..0f845d1 100644
--- a/test/tint/builtins/gen/var/textureStore/9938b7.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/9938b7.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9938b7();
diff --git a/test/tint/builtins/gen/var/textureStore/9a3ecc.wgsl b/test/tint/builtins/gen/var/textureStore/9a3ecc.wgsl
index add0fbc..2458895 100644
--- a/test/tint/builtins/gen/var/textureStore/9a3ecc.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/9a3ecc.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9a3ecc();
diff --git a/test/tint/builtins/gen/var/textureStore/9aedd3.wgsl b/test/tint/builtins/gen/var/textureStore/9aedd3.wgsl
index 1da47d1..aaf0c48 100644
--- a/test/tint/builtins/gen/var/textureStore/9aedd3.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/9aedd3.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9aedd3();
diff --git a/test/tint/builtins/gen/var/textureStore/9d8668.wgsl b/test/tint/builtins/gen/var/textureStore/9d8668.wgsl
index 43c26e5..374e1e4 100644
--- a/test/tint/builtins/gen/var/textureStore/9d8668.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/9d8668.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9d8668();
diff --git a/test/tint/builtins/gen/var/textureStore/9d9cd5.wgsl b/test/tint/builtins/gen/var/textureStore/9d9cd5.wgsl
index 68cd648..a89f7a6 100644
--- a/test/tint/builtins/gen/var/textureStore/9d9cd5.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/9d9cd5.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9d9cd5();
diff --git a/test/tint/builtins/gen/var/textureStore/9e3ec5.wgsl b/test/tint/builtins/gen/var/textureStore/9e3ec5.wgsl
index 859fd3c..700a47d 100644
--- a/test/tint/builtins/gen/var/textureStore/9e3ec5.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/9e3ec5.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9e3ec5();
diff --git a/test/tint/builtins/gen/var/textureStore/9f5318.wgsl b/test/tint/builtins/gen/var/textureStore/9f5318.wgsl
index fa9d76b..b435ce9 100644
--- a/test/tint/builtins/gen/var/textureStore/9f5318.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/9f5318.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9f5318();
diff --git a/test/tint/builtins/gen/var/textureStore/9f7cea.wgsl b/test/tint/builtins/gen/var/textureStore/9f7cea.wgsl
index 0ed2545..c4d64f2 100644
--- a/test/tint/builtins/gen/var/textureStore/9f7cea.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/9f7cea.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_9f7cea();
diff --git a/test/tint/builtins/gen/var/textureStore/a0f96e.wgsl b/test/tint/builtins/gen/var/textureStore/a0f96e.wgsl
index 2088a74..cfc401a 100644
--- a/test/tint/builtins/gen/var/textureStore/a0f96e.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/a0f96e.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a0f96e();
diff --git a/test/tint/builtins/gen/var/textureStore/a1352c.wgsl b/test/tint/builtins/gen/var/textureStore/a1352c.wgsl
index 4be46e8..672246e 100644
--- a/test/tint/builtins/gen/var/textureStore/a1352c.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/a1352c.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a1352c();
diff --git a/test/tint/builtins/gen/var/textureStore/a165b8.wgsl b/test/tint/builtins/gen/var/textureStore/a165b8.wgsl
index d604cd7..14b97f2 100644
--- a/test/tint/builtins/gen/var/textureStore/a165b8.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/a165b8.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a165b8();
diff --git a/test/tint/builtins/gen/var/textureStore/a4c338.wgsl b/test/tint/builtins/gen/var/textureStore/a4c338.wgsl
index dc78645..1d2e1a1 100644
--- a/test/tint/builtins/gen/var/textureStore/a4c338.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/a4c338.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a4c338();
diff --git a/test/tint/builtins/gen/var/textureStore/a5e80d.wgsl b/test/tint/builtins/gen/var/textureStore/a5e80d.wgsl
index 7e5099f..44fff27 100644
--- a/test/tint/builtins/gen/var/textureStore/a5e80d.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/a5e80d.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a5e80d();
diff --git a/test/tint/builtins/gen/var/textureStore/a6a986.wgsl b/test/tint/builtins/gen/var/textureStore/a6a986.wgsl
index 8b6da07..49dd70c 100644
--- a/test/tint/builtins/gen/var/textureStore/a6a986.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/a6a986.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a6a986();
diff --git a/test/tint/builtins/gen/var/textureStore/a6e78f.wgsl b/test/tint/builtins/gen/var/textureStore/a6e78f.wgsl
index fc02f9f..5acdba2 100644
--- a/test/tint/builtins/gen/var/textureStore/a6e78f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/a6e78f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a6e78f();
diff --git a/test/tint/builtins/gen/var/textureStore/a9426c.wgsl b/test/tint/builtins/gen/var/textureStore/a9426c.wgsl
index 4560e16..866454e 100644
--- a/test/tint/builtins/gen/var/textureStore/a9426c.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/a9426c.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_a9426c();
diff --git a/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl b/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl
index 8fb06fb..b7b170c 100644
--- a/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_ac67aa();
diff --git a/test/tint/builtins/gen/var/textureStore/aeb38a.wgsl b/test/tint/builtins/gen/var/textureStore/aeb38a.wgsl
index feace1b..e49cc03 100644
--- a/test/tint/builtins/gen/var/textureStore/aeb38a.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/aeb38a.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_aeb38a();
diff --git a/test/tint/builtins/gen/var/textureStore/b42fd3.wgsl b/test/tint/builtins/gen/var/textureStore/b42fd3.wgsl
index c98d5f7..4f0858b 100644
--- a/test/tint/builtins/gen/var/textureStore/b42fd3.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/b42fd3.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b42fd3();
diff --git a/test/tint/builtins/gen/var/textureStore/b706b1.wgsl b/test/tint/builtins/gen/var/textureStore/b706b1.wgsl
index b0fa1ca..472a9f9 100644
--- a/test/tint/builtins/gen/var/textureStore/b706b1.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/b706b1.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b706b1();
diff --git a/test/tint/builtins/gen/var/textureStore/b70ded.wgsl b/test/tint/builtins/gen/var/textureStore/b70ded.wgsl
index 50126ba..a3e0e74 100644
--- a/test/tint/builtins/gen/var/textureStore/b70ded.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/b70ded.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b70ded();
diff --git a/test/tint/builtins/gen/var/textureStore/b76ff3.wgsl b/test/tint/builtins/gen/var/textureStore/b76ff3.wgsl
index 3e35e34..9a14c43 100644
--- a/test/tint/builtins/gen/var/textureStore/b76ff3.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/b76ff3.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b76ff3();
diff --git a/test/tint/builtins/gen/var/textureStore/b77161.wgsl b/test/tint/builtins/gen/var/textureStore/b77161.wgsl
index 35f54ba..f2ae0a3 100644
--- a/test/tint/builtins/gen/var/textureStore/b77161.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/b77161.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_b77161();
diff --git a/test/tint/builtins/gen/var/textureStore/bbcb7f.wgsl b/test/tint/builtins/gen/var/textureStore/bbcb7f.wgsl
index 90ca4db..2b5995d 100644
--- a/test/tint/builtins/gen/var/textureStore/bbcb7f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/bbcb7f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_bbcb7f();
diff --git a/test/tint/builtins/gen/var/textureStore/be6e30.wgsl b/test/tint/builtins/gen/var/textureStore/be6e30.wgsl
index abb928b..8d046d2 100644
--- a/test/tint/builtins/gen/var/textureStore/be6e30.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/be6e30.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_be6e30();
diff --git a/test/tint/builtins/gen/var/textureStore/bedbfc.wgsl b/test/tint/builtins/gen/var/textureStore/bedbfc.wgsl
index 5beb6bc..046d644 100644
--- a/test/tint/builtins/gen/var/textureStore/bedbfc.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/bedbfc.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_bedbfc();
diff --git a/test/tint/builtins/gen/var/textureStore/bf775c.wgsl b/test/tint/builtins/gen/var/textureStore/bf775c.wgsl
index dcea5ed..ab69e3f 100644
--- a/test/tint/builtins/gen/var/textureStore/bf775c.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/bf775c.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_bf775c();
diff --git a/test/tint/builtins/gen/var/textureStore/c1f29e.wgsl b/test/tint/builtins/gen/var/textureStore/c1f29e.wgsl
index b36ad4c..4a7e24a 100644
--- a/test/tint/builtins/gen/var/textureStore/c1f29e.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/c1f29e.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c1f29e();
diff --git a/test/tint/builtins/gen/var/textureStore/c2ca46.wgsl b/test/tint/builtins/gen/var/textureStore/c2ca46.wgsl
index 4a31b49..ccbdea3 100644
--- a/test/tint/builtins/gen/var/textureStore/c2ca46.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/c2ca46.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c2ca46();
diff --git a/test/tint/builtins/gen/var/textureStore/c32905.wgsl b/test/tint/builtins/gen/var/textureStore/c32905.wgsl
index fd11547..8038532 100644
--- a/test/tint/builtins/gen/var/textureStore/c32905.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/c32905.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c32905();
diff --git a/test/tint/builtins/gen/var/textureStore/c5af1e.wgsl b/test/tint/builtins/gen/var/textureStore/c5af1e.wgsl
index 4f58ba3..d5a709f 100644
--- a/test/tint/builtins/gen/var/textureStore/c5af1e.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/c5af1e.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c5af1e();
diff --git a/test/tint/builtins/gen/var/textureStore/c863be.wgsl b/test/tint/builtins/gen/var/textureStore/c863be.wgsl
index e42fa06..ade7b25 100644
--- a/test/tint/builtins/gen/var/textureStore/c863be.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/c863be.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c863be();
diff --git a/test/tint/builtins/gen/var/textureStore/c9d780.wgsl b/test/tint/builtins/gen/var/textureStore/c9d780.wgsl
index 0b35c40..5515ffd 100644
--- a/test/tint/builtins/gen/var/textureStore/c9d780.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/c9d780.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_c9d780();
diff --git a/test/tint/builtins/gen/var/textureStore/cb3b0b.wgsl b/test/tint/builtins/gen/var/textureStore/cb3b0b.wgsl
index d8b0fc5..dfec9af 100644
--- a/test/tint/builtins/gen/var/textureStore/cb3b0b.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/cb3b0b.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_cb3b0b();
diff --git a/test/tint/builtins/gen/var/textureStore/cd6755.wgsl b/test/tint/builtins/gen/var/textureStore/cd6755.wgsl
index a5a0a93..fad1bdb 100644
--- a/test/tint/builtins/gen/var/textureStore/cd6755.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/cd6755.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_cd6755();
diff --git a/test/tint/builtins/gen/var/textureStore/d26166.wgsl b/test/tint/builtins/gen/var/textureStore/d26166.wgsl
index c369da8..6a394f0 100644
--- a/test/tint/builtins/gen/var/textureStore/d26166.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/d26166.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d26166();
diff --git a/test/tint/builtins/gen/var/textureStore/d2b565.wgsl b/test/tint/builtins/gen/var/textureStore/d2b565.wgsl
index d78172c..86affe6 100644
--- a/test/tint/builtins/gen/var/textureStore/d2b565.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/d2b565.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d2b565();
diff --git a/test/tint/builtins/gen/var/textureStore/d4aa95.wgsl b/test/tint/builtins/gen/var/textureStore/d4aa95.wgsl
index 26c39ff..b13e96c 100644
--- a/test/tint/builtins/gen/var/textureStore/d4aa95.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/d4aa95.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d4aa95();
diff --git a/test/tint/builtins/gen/var/textureStore/d55e65.wgsl b/test/tint/builtins/gen/var/textureStore/d55e65.wgsl
index 561690e..78812d0 100644
--- a/test/tint/builtins/gen/var/textureStore/d55e65.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/d55e65.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d55e65();
diff --git a/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl b/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl
index c6dc778..ced3a00 100644
--- a/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d73b5c();
diff --git a/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl b/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl
index 6841e09..165f250 100644
--- a/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_d82b0a();
diff --git a/test/tint/builtins/gen/var/textureStore/db92a2.wgsl b/test/tint/builtins/gen/var/textureStore/db92a2.wgsl
index a5df6eb..6313151 100644
--- a/test/tint/builtins/gen/var/textureStore/db92a2.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/db92a2.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_db92a2();
diff --git a/test/tint/builtins/gen/var/textureStore/dd7d81.wgsl b/test/tint/builtins/gen/var/textureStore/dd7d81.wgsl
index 79fbb32..864dce9 100644
--- a/test/tint/builtins/gen/var/textureStore/dd7d81.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/dd7d81.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_dd7d81();
diff --git a/test/tint/builtins/gen/var/textureStore/dde364.wgsl b/test/tint/builtins/gen/var/textureStore/dde364.wgsl
index 5796c71..51b0b60 100644
--- a/test/tint/builtins/gen/var/textureStore/dde364.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/dde364.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_dde364();
diff --git a/test/tint/builtins/gen/var/textureStore/de4b94.wgsl b/test/tint/builtins/gen/var/textureStore/de4b94.wgsl
index 3bd65d2..086caa2 100644
--- a/test/tint/builtins/gen/var/textureStore/de4b94.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/de4b94.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_de4b94();
diff --git a/test/tint/builtins/gen/var/textureStore/df2ca4.wgsl b/test/tint/builtins/gen/var/textureStore/df2ca4.wgsl
index b03549c..8b44c68 100644
--- a/test/tint/builtins/gen/var/textureStore/df2ca4.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/df2ca4.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_df2ca4();
diff --git a/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl b/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl
index 8371fa3..2145e4a 100644
--- a/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_dfa9a1();
diff --git a/test/tint/builtins/gen/var/textureStore/dffb13.wgsl b/test/tint/builtins/gen/var/textureStore/dffb13.wgsl
index 175a7f5..532da02 100644
--- a/test/tint/builtins/gen/var/textureStore/dffb13.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/dffb13.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_dffb13();
diff --git a/test/tint/builtins/gen/var/textureStore/e0b666.wgsl b/test/tint/builtins/gen/var/textureStore/e0b666.wgsl
index cd26359..a3c62a5 100644
--- a/test/tint/builtins/gen/var/textureStore/e0b666.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/e0b666.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e0b666();
diff --git a/test/tint/builtins/gen/var/textureStore/e38281.wgsl b/test/tint/builtins/gen/var/textureStore/e38281.wgsl
index 936b2dc..4c947de 100644
--- a/test/tint/builtins/gen/var/textureStore/e38281.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/e38281.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e38281();
diff --git a/test/tint/builtins/gen/var/textureStore/e7c6d8.wgsl b/test/tint/builtins/gen/var/textureStore/e7c6d8.wgsl
index c8fbc82..f3c2756 100644
--- a/test/tint/builtins/gen/var/textureStore/e7c6d8.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/e7c6d8.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e7c6d8();
diff --git a/test/tint/builtins/gen/var/textureStore/e885e8.wgsl b/test/tint/builtins/gen/var/textureStore/e885e8.wgsl
index 34b40f5..3769989 100644
--- a/test/tint/builtins/gen/var/textureStore/e885e8.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/e885e8.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e885e8();
diff --git a/test/tint/builtins/gen/var/textureStore/e8cbf7.wgsl b/test/tint/builtins/gen/var/textureStore/e8cbf7.wgsl
index cf4ab0c..fa36bbc 100644
--- a/test/tint/builtins/gen/var/textureStore/e8cbf7.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/e8cbf7.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_e8cbf7();
diff --git a/test/tint/builtins/gen/var/textureStore/eb702f.wgsl b/test/tint/builtins/gen/var/textureStore/eb702f.wgsl
index 36372e1..ec96c29 100644
--- a/test/tint/builtins/gen/var/textureStore/eb702f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/eb702f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_eb702f();
diff --git a/test/tint/builtins/gen/var/textureStore/eb78b9.wgsl b/test/tint/builtins/gen/var/textureStore/eb78b9.wgsl
index bf2ec48..498ebe8 100644
--- a/test/tint/builtins/gen/var/textureStore/eb78b9.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/eb78b9.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_eb78b9();
diff --git a/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl b/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl
index 6b99bfa..941b2e2 100644
--- a/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_ee6acc();
diff --git a/test/tint/builtins/gen/var/textureStore/ef9f2f.wgsl b/test/tint/builtins/gen/var/textureStore/ef9f2f.wgsl
index 9154768..a05b773 100644
--- a/test/tint/builtins/gen/var/textureStore/ef9f2f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/ef9f2f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_ef9f2f();
diff --git a/test/tint/builtins/gen/var/textureStore/f1e6d3.wgsl b/test/tint/builtins/gen/var/textureStore/f1e6d3.wgsl
index f2caa3c..172924d 100644
--- a/test/tint/builtins/gen/var/textureStore/f1e6d3.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/f1e6d3.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_f1e6d3();
diff --git a/test/tint/builtins/gen/var/textureStore/f8dead.wgsl b/test/tint/builtins/gen/var/textureStore/f8dead.wgsl
index 8068cf5..731cc86 100644
--- a/test/tint/builtins/gen/var/textureStore/f8dead.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/f8dead.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_f8dead();
diff --git a/test/tint/builtins/gen/var/textureStore/f9be83.wgsl b/test/tint/builtins/gen/var/textureStore/f9be83.wgsl
index 101ef88..277b008 100644
--- a/test/tint/builtins/gen/var/textureStore/f9be83.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/f9be83.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_f9be83();
diff --git a/test/tint/builtins/gen/var/textureStore/fb9a8f.wgsl b/test/tint/builtins/gen/var/textureStore/fb9a8f.wgsl
index 2b020b6..b4d1618 100644
--- a/test/tint/builtins/gen/var/textureStore/fb9a8f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/fb9a8f.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_fb9a8f();
diff --git a/test/tint/builtins/gen/var/textureStore/fbf53f.wgsl b/test/tint/builtins/gen/var/textureStore/fbf53f.wgsl
index 6ef2bed..8e2ca01 100644
--- a/test/tint/builtins/gen/var/textureStore/fbf53f.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/fbf53f.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<i32>(1i);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_fbf53f();
diff --git a/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl b/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl
index 775b39a..1c957c3 100644
--- a/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl
@@ -28,7 +28,6 @@
   var arg_2 = vec4<f32>(1.f);
   textureStore(arg_0, arg_1, arg_2);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_fcbe66();
diff --git a/test/tint/builtins/gen/var/textureStore/fd350c.wgsl b/test/tint/builtins/gen/var/textureStore/fd350c.wgsl
index 8c61c4e..8ee86f9 100644
--- a/test/tint/builtins/gen/var/textureStore/fd350c.wgsl
+++ b/test/tint/builtins/gen/var/textureStore/fd350c.wgsl
@@ -29,7 +29,6 @@
   var arg_3 = vec4<u32>(1u);
   textureStore(arg_0, arg_1, arg_2, arg_3);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   textureStore_fd350c();
diff --git a/test/tint/builtins/gen/var/transpose/06794e.wgsl b/test/tint/builtins/gen/var/transpose/06794e.wgsl
index 534407f..0feedad 100644
--- a/test/tint/builtins/gen/var/transpose/06794e.wgsl
+++ b/test/tint/builtins/gen/var/transpose/06794e.wgsl
@@ -27,7 +27,9 @@
 fn transpose_06794e() {
   var arg_0 = mat3x3<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: mat3x3<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.dxc.hlsl
index c87027e..2e46982 100644
--- a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 16u), value[2u]);
+}
+
 void transpose_06794e() {
   matrix<float16_t, 3, 3> arg_0 = matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
   matrix<float16_t, 3, 3> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.fxc.hlsl
index 9b49ef4..2f4fdde 100644
--- a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.fxc.hlsl
@@ -1,8 +1,17 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 16u), value[2u]);
+}
+
 void transpose_06794e() {
   matrix<float16_t, 3, 3> arg_0 = matrix<float16_t, 3, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
   matrix<float16_t, 3, 3> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.glsl
index 550afe1..af98f85 100644
--- a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.glsl
@@ -1,9 +1,20 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_06794e() {
   f16mat3 arg_0 = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -23,9 +34,20 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_06794e() {
   f16mat3 arg_0 = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -39,9 +61,20 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_06794e() {
   f16mat3 arg_0 = f16mat3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.msl
index 35ebcd4..add5b3a 100644
--- a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.msl
@@ -1,34 +1,59 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_06794e() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f16_array_element {
+  /* 0x0000 */ packed_half3 elements;
+  /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 3>* const dest, half3x3 value) {
+  (*(dest))[0u].elements = packed_half3(value[0u]);
+  (*(dest))[1u].elements = packed_half3(value[1u]);
+  (*(dest))[2u].elements = packed_half3(value[2u]);
+}
+
+void transpose_06794e(device tint_array<tint_packed_vec3_f16_array_element, 3>* const tint_symbol_1) {
   half3x3 arg_0 = half3x3(half3(1.0h), half3(1.0h), half3(1.0h));
   half3x3 res = transpose(arg_0);
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_06794e();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f16_array_element, 3>* const tint_symbol_2) {
+  transpose_06794e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f16_array_element, 3>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_06794e();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f16_array_element, 3>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_06794e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_06794e();
+kernel void compute_main(device tint_array<tint_packed_vec3_f16_array_element, 3>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_06794e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.spvasm
index f93f895..3ae7287 100644
--- a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -9,13 +9,18 @@
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_06794e "transpose_06794e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -23,57 +28,93 @@
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
  %mat3v3half = OpTypeMatrix %v3half 3
+%prevent_dce_block = OpTypeStruct %mat3v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void %mat3v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+      %int_2 = OpConstant %int 2
+     %uint_2 = OpConstant %uint 2
+         %36 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat3v3half %17 %17 %17
+         %40 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %41 = OpConstantComposite %mat3v3half %40 %40 %40
 %_ptr_Function_mat3v3half = OpTypePointer Function %mat3v3half
-         %21 = OpConstantNull %mat3v3half
-         %25 = OpTypeFunction %v4float
+         %44 = OpConstantNull %mat3v3half
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_06794e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat3v3half Function %21
-        %res = OpVariable %_ptr_Function_mat3v3half Function %21
-               OpStore %arg_0 %18
-         %23 = OpLoad %mat3v3half %arg_0
-         %22 = OpTranspose %mat3v3half %23
-               OpStore %res %22
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %15
+      %value = OpFunctionParameter %mat3v3half
+         %19 = OpLabel
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %23
+         %27 = OpCompositeExtract %v3half %value 0
+               OpStore %25 %27
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_1
+         %31 = OpCompositeExtract %v3half %value 1
+               OpStore %29 %31
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_2
+         %35 = OpCompositeExtract %v3half %value 2
+               OpStore %33 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_06794e
+%transpose_06794e = OpFunction %void None %36
+         %38 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat3v3half Function %44
+        %res = OpVariable %_ptr_Function_mat3v3half Function %44
+               OpStore %arg_0 %41
+         %46 = OpLoad %mat3v3half %arg_0
+         %45 = OpTranspose %mat3v3half %46
+               OpStore %res %45
+         %49 = OpLoad %mat3v3half %res
+         %48 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %49
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %transpose_06794e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %36
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_06794e
+%fragment_main = OpFunction %void None %36
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %transpose_06794e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_06794e
+%compute_main = OpFunction %void None %36
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %transpose_06794e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.wgsl
index e5b99ca..4ee7514 100644
--- a/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/06794e.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_06794e() {
   var arg_0 = mat3x3<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat3x3<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_06794e();
diff --git a/test/tint/builtins/gen/var/transpose/2585cd.wgsl b/test/tint/builtins/gen/var/transpose/2585cd.wgsl
index ac28d29..55176aa 100644
--- a/test/tint/builtins/gen/var/transpose/2585cd.wgsl
+++ b/test/tint/builtins/gen/var/transpose/2585cd.wgsl
@@ -25,7 +25,9 @@
 fn transpose_2585cd() {
   var arg_0 = mat4x3<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: mat3x4<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.dxc.hlsl
index 5050a32..7e4b305 100644
--- a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.dxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store4((offset + 32u), asuint(value[2u]));
+}
+
 void transpose_2585cd() {
   float4x3 arg_0 = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
   float3x4 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.fxc.hlsl
index 5050a32..7e4b305 100644
--- a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.fxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store4((offset + 32u), asuint(value[2u]));
+}
+
 void transpose_2585cd() {
   float4x3 arg_0 = float4x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
   float3x4 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.glsl
index 336d930..c939c65 100644
--- a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x4 inner;
+} prevent_dce;
+
 void transpose_2585cd() {
   mat4x3 arg_0 = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
   mat3x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x4 inner;
+} prevent_dce;
+
 void transpose_2585cd() {
   mat4x3 arg_0 = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
   mat3x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x4 inner;
+} prevent_dce;
+
 void transpose_2585cd() {
   mat4x3 arg_0 = mat4x3(vec3(1.0f), vec3(1.0f), vec3(1.0f), vec3(1.0f));
   mat3x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.msl
index f0cf813..1366466 100644
--- a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_2585cd() {
+void transpose_2585cd(device float3x4* const tint_symbol_1) {
   float4x3 arg_0 = float4x3(float3(1.0f), float3(1.0f), float3(1.0f), float3(1.0f));
   float3x4 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_2585cd();
+float4 vertex_main_inner(device float3x4* const tint_symbol_2) {
+  transpose_2585cd(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float3x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_2585cd();
+fragment void fragment_main(device float3x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_2585cd(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_2585cd();
+kernel void compute_main(device float3x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_2585cd(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.spvasm
index f75aad3..9358c8f 100644
--- a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_2585cd "transpose_2585cd"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%mat3v4float = OpTypeMatrix %v4float 3
+%prevent_dce_block = OpTypeStruct %mat3v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat4v3float = OpTypeMatrix %v3float 4
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %17 = OpConstantComposite %mat4v3float %16 %16 %16 %16
+         %20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %21 = OpConstantComposite %mat4v3float %20 %20 %20 %20
 %_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
-         %20 = OpConstantNull %mat4v3float
-%mat3v4float = OpTypeMatrix %v4float 3
+         %24 = OpConstantNull %mat4v3float
 %_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
-         %26 = OpConstantNull %mat3v4float
-         %27 = OpTypeFunction %v4float
-%transpose_2585cd = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat4v3float Function %20
-        %res = OpVariable %_ptr_Function_mat3v4float Function %26
-               OpStore %arg_0 %17
-         %23 = OpLoad %mat4v3float %arg_0
-         %21 = OpTranspose %mat3v4float %23
-               OpStore %res %21
+         %29 = OpConstantNull %mat3v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat3v4float = OpTypePointer StorageBuffer %mat3v4float
+         %35 = OpTypeFunction %v4float
+%transpose_2585cd = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat4v3float Function %24
+        %res = OpVariable %_ptr_Function_mat3v4float Function %29
+               OpStore %arg_0 %21
+         %26 = OpLoad %mat4v3float %arg_0
+         %25 = OpTranspose %mat3v4float %26
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_mat3v4float %prevent_dce %uint_0
+         %34 = OpLoad %mat3v4float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_2585cd
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %transpose_2585cd
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_2585cd
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %transpose_2585cd
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_2585cd
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %transpose_2585cd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.wgsl
index 7390cfe..da4ccff 100644
--- a/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/2585cd.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_2585cd() {
   var arg_0 = mat4x3<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat3x4<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_2585cd();
diff --git a/test/tint/builtins/gen/var/transpose/31d679.wgsl b/test/tint/builtins/gen/var/transpose/31d679.wgsl
index 9f1e0ef..c5c93f0 100644
--- a/test/tint/builtins/gen/var/transpose/31d679.wgsl
+++ b/test/tint/builtins/gen/var/transpose/31d679.wgsl
@@ -25,7 +25,9 @@
 fn transpose_31d679() {
   var arg_0 = mat2x2<f32>(1.f, 1.f, 1.f, 1.f);
   var res: mat2x2<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.dxc.hlsl
index cd4d593..5eb471d 100644
--- a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.dxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+}
+
 void transpose_31d679() {
   float2x2 arg_0 = float2x2((1.0f).xx, (1.0f).xx);
   float2x2 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.fxc.hlsl
index cd4d593..5eb471d 100644
--- a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.fxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+}
+
 void transpose_31d679() {
   float2x2 arg_0 = float2x2((1.0f).xx, (1.0f).xx);
   float2x2 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.glsl
index 4db7e7f..4f48f04 100644
--- a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2 inner;
+} prevent_dce;
+
 void transpose_31d679() {
   mat2 arg_0 = mat2(vec2(1.0f), vec2(1.0f));
   mat2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2 inner;
+} prevent_dce;
+
 void transpose_31d679() {
   mat2 arg_0 = mat2(vec2(1.0f), vec2(1.0f));
   mat2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2 inner;
+} prevent_dce;
+
 void transpose_31d679() {
   mat2 arg_0 = mat2(vec2(1.0f), vec2(1.0f));
   mat2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.msl
index 5029a96..cf632a4 100644
--- a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_31d679() {
+void transpose_31d679(device float2x2* const tint_symbol_1) {
   float2x2 arg_0 = float2x2(float2(1.0f), float2(1.0f));
   float2x2 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_31d679();
+float4 vertex_main_inner(device float2x2* const tint_symbol_2) {
+  transpose_31d679(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_31d679();
+fragment void fragment_main(device float2x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_31d679(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_31d679();
+kernel void compute_main(device float2x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_31d679(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.spvasm
index 836104a..7225231 100644
--- a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_31d679 "transpose_31d679"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,45 +38,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat2v2float = OpTypeMatrix %v2float 2
+%prevent_dce_block = OpTypeStruct %mat2v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
-         %17 = OpConstantComposite %mat2v2float %16 %16
+         %19 = OpConstantComposite %v2float %float_1 %float_1
+         %20 = OpConstantComposite %mat2v2float %19 %19
 %_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
-         %20 = OpConstantNull %mat2v2float
-         %24 = OpTypeFunction %v4float
-%transpose_31d679 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat2v2float Function %20
-        %res = OpVariable %_ptr_Function_mat2v2float Function %20
-               OpStore %arg_0 %17
-         %22 = OpLoad %mat2v2float %arg_0
-         %21 = OpTranspose %mat2v2float %22
-               OpStore %res %21
+         %23 = OpConstantNull %mat2v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat2v2float = OpTypePointer StorageBuffer %mat2v2float
+         %32 = OpTypeFunction %v4float
+%transpose_31d679 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat2v2float Function %23
+        %res = OpVariable %_ptr_Function_mat2v2float Function %23
+               OpStore %arg_0 %20
+         %25 = OpLoad %mat2v2float %arg_0
+         %24 = OpTranspose %mat2v2float %25
+               OpStore %res %24
+         %30 = OpAccessChain %_ptr_StorageBuffer_mat2v2float %prevent_dce %uint_0
+         %31 = OpLoad %mat2v2float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %transpose_31d679
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %transpose_31d679
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_31d679
+%fragment_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %transpose_31d679
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_31d679
+%compute_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %transpose_31d679
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.wgsl
index b647749..a278873 100644
--- a/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/31d679.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_31d679() {
   var arg_0 = mat2x2<f32>(1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat2x2<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_31d679();
diff --git a/test/tint/builtins/gen/var/transpose/31e37e.wgsl b/test/tint/builtins/gen/var/transpose/31e37e.wgsl
index bd023b9..a951e00 100644
--- a/test/tint/builtins/gen/var/transpose/31e37e.wgsl
+++ b/test/tint/builtins/gen/var/transpose/31e37e.wgsl
@@ -25,7 +25,9 @@
 fn transpose_31e37e() {
   var arg_0 = mat4x2<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: mat2x4<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.dxc.hlsl
index 85970ed..17e74c8 100644
--- a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.dxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+}
+
 void transpose_31e37e() {
   float4x2 arg_0 = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
   float2x4 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.fxc.hlsl
index 85970ed..17e74c8 100644
--- a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.fxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+}
+
 void transpose_31e37e() {
   float4x2 arg_0 = float4x2((1.0f).xx, (1.0f).xx, (1.0f).xx, (1.0f).xx);
   float2x4 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.glsl
index bf4eb4a..48d5c07 100644
--- a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x4 inner;
+} prevent_dce;
+
 void transpose_31e37e() {
   mat4x2 arg_0 = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
   mat2x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x4 inner;
+} prevent_dce;
+
 void transpose_31e37e() {
   mat4x2 arg_0 = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
   mat2x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x4 inner;
+} prevent_dce;
+
 void transpose_31e37e() {
   mat4x2 arg_0 = mat4x2(vec2(1.0f), vec2(1.0f), vec2(1.0f), vec2(1.0f));
   mat2x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.msl
index 87dadd9..26cb6d0 100644
--- a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_31e37e() {
+void transpose_31e37e(device float2x4* const tint_symbol_1) {
   float4x2 arg_0 = float4x2(float2(1.0f), float2(1.0f), float2(1.0f), float2(1.0f));
   float2x4 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_31e37e();
+float4 vertex_main_inner(device float2x4* const tint_symbol_2) {
+  transpose_31e37e(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_31e37e();
+fragment void fragment_main(device float2x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_31e37e(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_31e37e();
+kernel void compute_main(device float2x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_31e37e(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.spvasm
index 6a80ab5..e5383e6 100644
--- a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_31e37e "transpose_31e37e"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%mat2v4float = OpTypeMatrix %v4float 2
+%prevent_dce_block = OpTypeStruct %mat2v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat4v2float = OpTypeMatrix %v2float 4
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
-         %17 = OpConstantComposite %mat4v2float %16 %16 %16 %16
+         %20 = OpConstantComposite %v2float %float_1 %float_1
+         %21 = OpConstantComposite %mat4v2float %20 %20 %20 %20
 %_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
-         %20 = OpConstantNull %mat4v2float
-%mat2v4float = OpTypeMatrix %v4float 2
+         %24 = OpConstantNull %mat4v2float
 %_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
-         %26 = OpConstantNull %mat2v4float
-         %27 = OpTypeFunction %v4float
-%transpose_31e37e = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat4v2float Function %20
-        %res = OpVariable %_ptr_Function_mat2v4float Function %26
-               OpStore %arg_0 %17
-         %23 = OpLoad %mat4v2float %arg_0
-         %21 = OpTranspose %mat2v4float %23
-               OpStore %res %21
+         %29 = OpConstantNull %mat2v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat2v4float = OpTypePointer StorageBuffer %mat2v4float
+         %35 = OpTypeFunction %v4float
+%transpose_31e37e = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat4v2float Function %24
+        %res = OpVariable %_ptr_Function_mat2v4float Function %29
+               OpStore %arg_0 %21
+         %26 = OpLoad %mat4v2float %arg_0
+         %25 = OpTranspose %mat2v4float %26
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_mat2v4float %prevent_dce %uint_0
+         %34 = OpLoad %mat2v4float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_31e37e
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %transpose_31e37e
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_31e37e
+%fragment_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %transpose_31e37e
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_31e37e
+%compute_main = OpFunction %void None %13
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %transpose_31e37e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.wgsl
index a19b38a..509467f 100644
--- a/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/31e37e.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_31e37e() {
   var arg_0 = mat4x2<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat2x4<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_31e37e();
diff --git a/test/tint/builtins/gen/var/transpose/32dd64.wgsl b/test/tint/builtins/gen/var/transpose/32dd64.wgsl
index 29621e6..ab8c02e 100644
--- a/test/tint/builtins/gen/var/transpose/32dd64.wgsl
+++ b/test/tint/builtins/gen/var/transpose/32dd64.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat3x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_32dd64();
diff --git a/test/tint/builtins/gen/var/transpose/4ce359.wgsl b/test/tint/builtins/gen/var/transpose/4ce359.wgsl
index ddd59ce..9bc36e8 100644
--- a/test/tint/builtins/gen/var/transpose/4ce359.wgsl
+++ b/test/tint/builtins/gen/var/transpose/4ce359.wgsl
@@ -25,7 +25,9 @@
 fn transpose_4ce359() {
   var arg_0 = mat2x4<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: mat4x2<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.dxc.hlsl
index 3ae0139..49376e2 100644
--- a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.dxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+  prevent_dce.Store2((offset + 16u), asuint(value[2u]));
+  prevent_dce.Store2((offset + 24u), asuint(value[3u]));
+}
+
 void transpose_4ce359() {
   float2x4 arg_0 = float2x4((1.0f).xxxx, (1.0f).xxxx);
   float4x2 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.fxc.hlsl
index 3ae0139..49376e2 100644
--- a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.fxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+  prevent_dce.Store2((offset + 16u), asuint(value[2u]));
+  prevent_dce.Store2((offset + 24u), asuint(value[3u]));
+}
+
 void transpose_4ce359() {
   float2x4 arg_0 = float2x4((1.0f).xxxx, (1.0f).xxxx);
   float4x2 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.glsl
index 1c639d6..bcf9d47 100644
--- a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x2 inner;
+} prevent_dce;
+
 void transpose_4ce359() {
   mat2x4 arg_0 = mat2x4(vec4(1.0f), vec4(1.0f));
   mat4x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x2 inner;
+} prevent_dce;
+
 void transpose_4ce359() {
   mat2x4 arg_0 = mat2x4(vec4(1.0f), vec4(1.0f));
   mat4x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x2 inner;
+} prevent_dce;
+
 void transpose_4ce359() {
   mat2x4 arg_0 = mat2x4(vec4(1.0f), vec4(1.0f));
   mat4x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.msl
index e6fb42d..c1ee75c 100644
--- a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_4ce359() {
+void transpose_4ce359(device float4x2* const tint_symbol_1) {
   float2x4 arg_0 = float2x4(float4(1.0f), float4(1.0f));
   float4x2 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_4ce359();
+float4 vertex_main_inner(device float4x2* const tint_symbol_2) {
+  transpose_4ce359(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_4ce359();
+fragment void fragment_main(device float4x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_4ce359(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_4ce359();
+kernel void compute_main(device float4x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_4ce359(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.spvasm
index cc2dcb5..1bb1577 100644
--- a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_4ce359 "transpose_4ce359"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,48 +38,57 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
-%mat2v4float = OpTypeMatrix %v4float 2
-    %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %16 = OpConstantComposite %mat2v4float %15 %15
-%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
-         %19 = OpConstantNull %mat2v4float
     %v2float = OpTypeVector %float 2
 %mat4v2float = OpTypeMatrix %v2float 4
+%prevent_dce_block = OpTypeStruct %mat4v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
+%mat2v4float = OpTypeMatrix %v4float 2
+    %float_1 = OpConstant %float 1
+         %20 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %21 = OpConstantComposite %mat2v4float %20 %20
+%_ptr_Function_mat2v4float = OpTypePointer Function %mat2v4float
+         %24 = OpConstantNull %mat2v4float
 %_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
-         %26 = OpConstantNull %mat4v2float
-         %27 = OpTypeFunction %v4float
-%transpose_4ce359 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat2v4float Function %19
-        %res = OpVariable %_ptr_Function_mat4v2float Function %26
-               OpStore %arg_0 %16
-         %23 = OpLoad %mat2v4float %arg_0
-         %20 = OpTranspose %mat4v2float %23
-               OpStore %res %20
+         %29 = OpConstantNull %mat4v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat4v2float = OpTypePointer StorageBuffer %mat4v2float
+         %35 = OpTypeFunction %v4float
+%transpose_4ce359 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat2v4float Function %24
+        %res = OpVariable %_ptr_Function_mat4v2float Function %29
+               OpStore %arg_0 %21
+         %26 = OpLoad %mat2v4float %arg_0
+         %25 = OpTranspose %mat4v2float %26
+               OpStore %res %25
+         %33 = OpAccessChain %_ptr_StorageBuffer_mat4v2float %prevent_dce %uint_0
+         %34 = OpLoad %mat4v2float %res
+               OpStore %33 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_4ce359
+%vertex_main_inner = OpFunction %v4float None %35
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %transpose_4ce359
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %14
+         %40 = OpLabel
+         %41 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %41
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_4ce359
+%fragment_main = OpFunction %void None %14
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %transpose_4ce359
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_4ce359
+%compute_main = OpFunction %void None %14
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %transpose_4ce359
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.wgsl
index 41d870d..ca21df7 100644
--- a/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/4ce359.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_4ce359() {
   var arg_0 = mat2x4<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat4x2<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_4ce359();
diff --git a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl
index 8b75992..4198656 100644
--- a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl
+++ b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl
@@ -25,7 +25,9 @@
 fn transpose_4dc9a1() {
   var arg_0 = mat2x3<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: mat3x2<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.dxc.hlsl
index 140fa1c..24bed3e 100644
--- a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.dxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+  prevent_dce.Store2((offset + 16u), asuint(value[2u]));
+}
+
 void transpose_4dc9a1() {
   float2x3 arg_0 = float2x3((1.0f).xxx, (1.0f).xxx);
   float3x2 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.fxc.hlsl
index 140fa1c..24bed3e 100644
--- a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.fxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x2 value) {
+  prevent_dce.Store2((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store2((offset + 8u), asuint(value[1u]));
+  prevent_dce.Store2((offset + 16u), asuint(value[2u]));
+}
+
 void transpose_4dc9a1() {
   float2x3 arg_0 = float2x3((1.0f).xxx, (1.0f).xxx);
   float3x2 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.glsl
index 37428d1..1de089d 100644
--- a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x2 inner;
+} prevent_dce;
+
 void transpose_4dc9a1() {
   mat2x3 arg_0 = mat2x3(vec3(1.0f), vec3(1.0f));
   mat3x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x2 inner;
+} prevent_dce;
+
 void transpose_4dc9a1() {
   mat2x3 arg_0 = mat2x3(vec3(1.0f), vec3(1.0f));
   mat3x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3x2 inner;
+} prevent_dce;
+
 void transpose_4dc9a1() {
   mat2x3 arg_0 = mat2x3(vec3(1.0f), vec3(1.0f));
   mat3x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.msl
index df256e4..36f033f 100644
--- a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_4dc9a1() {
+void transpose_4dc9a1(device float3x2* const tint_symbol_1) {
   float2x3 arg_0 = float2x3(float3(1.0f), float3(1.0f));
   float3x2 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_4dc9a1();
+float4 vertex_main_inner(device float3x2* const tint_symbol_2) {
+  transpose_4dc9a1(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float3x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_4dc9a1();
+fragment void fragment_main(device float3x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_4dc9a1(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_4dc9a1();
+kernel void compute_main(device float3x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_4dc9a1(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.spvasm
index 2be80fe..c63b340 100644
--- a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_4dc9a1 "transpose_4dc9a1"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,49 +38,58 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+    %v2float = OpTypeVector %float 2
+%mat3v2float = OpTypeMatrix %v2float 3
+%prevent_dce_block = OpTypeStruct %mat3v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %14 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat2v3float = OpTypeMatrix %v3float 2
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %17 = OpConstantComposite %mat2v3float %16 %16
+         %21 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %22 = OpConstantComposite %mat2v3float %21 %21
 %_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
-         %20 = OpConstantNull %mat2v3float
-    %v2float = OpTypeVector %float 2
-%mat3v2float = OpTypeMatrix %v2float 3
+         %25 = OpConstantNull %mat2v3float
 %_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
-         %27 = OpConstantNull %mat3v2float
-         %28 = OpTypeFunction %v4float
-%transpose_4dc9a1 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat2v3float Function %20
-        %res = OpVariable %_ptr_Function_mat3v2float Function %27
-               OpStore %arg_0 %17
-         %24 = OpLoad %mat2v3float %arg_0
-         %21 = OpTranspose %mat3v2float %24
-               OpStore %res %21
+         %30 = OpConstantNull %mat3v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat3v2float = OpTypePointer StorageBuffer %mat3v2float
+         %36 = OpTypeFunction %v4float
+%transpose_4dc9a1 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat2v3float Function %25
+        %res = OpVariable %_ptr_Function_mat3v2float Function %30
+               OpStore %arg_0 %22
+         %27 = OpLoad %mat2v3float %arg_0
+         %26 = OpTranspose %mat3v2float %27
+               OpStore %res %26
+         %34 = OpAccessChain %_ptr_StorageBuffer_mat3v2float %prevent_dce %uint_0
+         %35 = OpLoad %mat3v2float %res
+               OpStore %34 %35
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %transpose_4dc9a1
+%vertex_main_inner = OpFunction %v4float None %36
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %transpose_4dc9a1
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %42
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %transpose_4dc9a1
+%fragment_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %transpose_4dc9a1
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %transpose_4dc9a1
+%compute_main = OpFunction %void None %14
+         %47 = OpLabel
+         %48 = OpFunctionCall %void %transpose_4dc9a1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.wgsl
index 666dc84..852437e 100644
--- a/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/4dc9a1.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_4dc9a1() {
   var arg_0 = mat2x3<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat3x2<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_4dc9a1();
diff --git a/test/tint/builtins/gen/var/transpose/553e90.wgsl b/test/tint/builtins/gen/var/transpose/553e90.wgsl
index dae39d4..bc0261e 100644
--- a/test/tint/builtins/gen/var/transpose/553e90.wgsl
+++ b/test/tint/builtins/gen/var/transpose/553e90.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat4x2(1., 1., 1., 1., 1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_553e90();
diff --git a/test/tint/builtins/gen/var/transpose/5c133c.wgsl b/test/tint/builtins/gen/var/transpose/5c133c.wgsl
index b41c917..553a2b3 100644
--- a/test/tint/builtins/gen/var/transpose/5c133c.wgsl
+++ b/test/tint/builtins/gen/var/transpose/5c133c.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat4x3(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_5c133c();
diff --git a/test/tint/builtins/gen/var/transpose/5edd96.wgsl b/test/tint/builtins/gen/var/transpose/5edd96.wgsl
index 1a6abd5..da26804 100644
--- a/test/tint/builtins/gen/var/transpose/5edd96.wgsl
+++ b/test/tint/builtins/gen/var/transpose/5edd96.wgsl
@@ -27,7 +27,9 @@
 fn transpose_5edd96() {
   var arg_0 = mat4x2<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: mat2x4<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.dxc.hlsl
index e4bc919..76a218e 100644
--- a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.dxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+}
+
 void transpose_5edd96() {
   matrix<float16_t, 4, 2> arg_0 = matrix<float16_t, 4, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
   matrix<float16_t, 2, 4> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.fxc.hlsl
index f7be249..0b9b8b8 100644
--- a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.fxc.hlsl
@@ -1,8 +1,16 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+}
+
 void transpose_5edd96() {
   matrix<float16_t, 4, 2> arg_0 = matrix<float16_t, 4, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
   matrix<float16_t, 2, 4> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.glsl
index e05bcef..648931b 100644
--- a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x4 inner;
+} prevent_dce;
+
 void transpose_5edd96() {
   f16mat4x2 arg_0 = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x4 inner;
+} prevent_dce;
+
 void transpose_5edd96() {
   f16mat4x2 arg_0 = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x4 inner;
+} prevent_dce;
+
 void transpose_5edd96() {
   f16mat4x2 arg_0 = f16mat4x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.msl
index b6a8ba5..4c5dbb6 100644
--- a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_5edd96() {
+void transpose_5edd96(device half2x4* const tint_symbol_1) {
   half4x2 arg_0 = half4x2(half2(1.0h), half2(1.0h), half2(1.0h), half2(1.0h));
   half2x4 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_5edd96();
+float4 vertex_main_inner(device half2x4* const tint_symbol_2) {
+  transpose_5edd96(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_5edd96();
+fragment void fragment_main(device half2x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_5edd96(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_5edd96();
+kernel void compute_main(device half2x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_5edd96(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.spvasm
index b059f58..9d0a292 100644
--- a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_5edd96 "transpose_5edd96"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -25,6 +28,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,51 +42,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+     %v4half = OpTypeVector %half 4
+ %mat2v4half = OpTypeMatrix %v4half 2
+%prevent_dce_block = OpTypeStruct %mat2v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
      %v2half = OpTypeVector %half 2
  %mat4v2half = OpTypeMatrix %v2half 4
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat4v2half %17 %17 %17 %17
+         %22 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %23 = OpConstantComposite %mat4v2half %22 %22 %22 %22
 %_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-         %21 = OpConstantNull %mat4v2half
-     %v4half = OpTypeVector %half 4
- %mat2v4half = OpTypeMatrix %v4half 2
+         %26 = OpConstantNull %mat4v2half
 %_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
-         %28 = OpConstantNull %mat2v4half
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %mat2v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat2v4half = OpTypePointer StorageBuffer %mat2v4half
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_5edd96 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat4v2half Function %21
-        %res = OpVariable %_ptr_Function_mat2v4half Function %28
-               OpStore %arg_0 %18
-         %25 = OpLoad %mat4v2half %arg_0
-         %22 = OpTranspose %mat2v4half %25
-               OpStore %res %22
+%transpose_5edd96 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat4v2half Function %26
+        %res = OpVariable %_ptr_Function_mat2v4half Function %31
+               OpStore %arg_0 %23
+         %28 = OpLoad %mat4v2half %arg_0
+         %27 = OpTranspose %mat2v4half %28
+               OpStore %res %27
+         %35 = OpAccessChain %_ptr_StorageBuffer_mat2v4half %prevent_dce %uint_0
+         %36 = OpLoad %mat2v4half %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_5edd96
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_5edd96
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_5edd96
+%fragment_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %transpose_5edd96
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %transpose_5edd96
+%compute_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %transpose_5edd96
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.wgsl
index 6301bbb..72ab4bb 100644
--- a/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/5edd96.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_5edd96() {
   var arg_0 = mat4x2<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat2x4<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_5edd96();
diff --git a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl
index 537fb1b..35f74ff 100644
--- a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl
+++ b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl
@@ -27,7 +27,9 @@
 fn transpose_5f36bf() {
   var arg_0 = mat4x3<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: mat3x4<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.dxc.hlsl
index d9848bb..62a897b 100644
--- a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.dxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 16u), value[2u]);
+}
+
 void transpose_5f36bf() {
   matrix<float16_t, 4, 3> arg_0 = matrix<float16_t, 4, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
   matrix<float16_t, 3, 4> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.fxc.hlsl
index 1cccc40..49f0186 100644
--- a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.fxc.hlsl
@@ -1,8 +1,17 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 16u), value[2u]);
+}
+
 void transpose_5f36bf() {
   matrix<float16_t, 4, 3> arg_0 = matrix<float16_t, 4, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
   matrix<float16_t, 3, 4> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.glsl
index eb65382..de46377 100644
--- a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x4 inner;
+} prevent_dce;
+
 void transpose_5f36bf() {
   f16mat4x3 arg_0 = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x4 inner;
+} prevent_dce;
+
 void transpose_5f36bf() {
   f16mat4x3 arg_0 = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x4 inner;
+} prevent_dce;
+
 void transpose_5f36bf() {
   f16mat4x3 arg_0 = f16mat4x3(f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3x4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.msl
index ccf7f2b..84fdd60 100644
--- a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_5f36bf() {
+void transpose_5f36bf(device half3x4* const tint_symbol_1) {
   half4x3 arg_0 = half4x3(half3(1.0h), half3(1.0h), half3(1.0h), half3(1.0h));
   half3x4 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_5f36bf();
+float4 vertex_main_inner(device half3x4* const tint_symbol_2) {
+  transpose_5f36bf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half3x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_5f36bf();
+fragment void fragment_main(device half3x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_5f36bf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_5f36bf();
+kernel void compute_main(device half3x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_5f36bf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.spvasm
index 11a1ed3..adf0a85 100644
--- a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_5f36bf "transpose_5f36bf"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -25,6 +28,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,51 +42,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+     %v4half = OpTypeVector %half 4
+ %mat3v4half = OpTypeMatrix %v4half 3
+%prevent_dce_block = OpTypeStruct %mat3v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
      %v3half = OpTypeVector %half 3
  %mat4v3half = OpTypeMatrix %v3half 4
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat4v3half %17 %17 %17 %17
+         %22 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %23 = OpConstantComposite %mat4v3half %22 %22 %22 %22
 %_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
-         %21 = OpConstantNull %mat4v3half
-     %v4half = OpTypeVector %half 4
- %mat3v4half = OpTypeMatrix %v4half 3
+         %26 = OpConstantNull %mat4v3half
 %_ptr_Function_mat3v4half = OpTypePointer Function %mat3v4half
-         %28 = OpConstantNull %mat3v4half
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %mat3v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat3v4half = OpTypePointer StorageBuffer %mat3v4half
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_5f36bf = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat4v3half Function %21
-        %res = OpVariable %_ptr_Function_mat3v4half Function %28
-               OpStore %arg_0 %18
-         %25 = OpLoad %mat4v3half %arg_0
-         %22 = OpTranspose %mat3v4half %25
-               OpStore %res %22
+%transpose_5f36bf = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat4v3half Function %26
+        %res = OpVariable %_ptr_Function_mat3v4half Function %31
+               OpStore %arg_0 %23
+         %28 = OpLoad %mat4v3half %arg_0
+         %27 = OpTranspose %mat3v4half %28
+               OpStore %res %27
+         %35 = OpAccessChain %_ptr_StorageBuffer_mat3v4half %prevent_dce %uint_0
+         %36 = OpLoad %mat3v4half %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_5f36bf
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_5f36bf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_5f36bf
+%fragment_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %transpose_5f36bf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %transpose_5f36bf
+%compute_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %transpose_5f36bf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.wgsl
index 7633281..7c9a10e0 100644
--- a/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/5f36bf.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_5f36bf() {
   var arg_0 = mat4x3<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat3x4<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_5f36bf();
diff --git a/test/tint/builtins/gen/var/transpose/66fce8.wgsl b/test/tint/builtins/gen/var/transpose/66fce8.wgsl
index d5c553e..884b4c0 100644
--- a/test/tint/builtins/gen/var/transpose/66fce8.wgsl
+++ b/test/tint/builtins/gen/var/transpose/66fce8.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat3x3(1., 1., 1., 1., 1., 1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_66fce8();
diff --git a/test/tint/builtins/gen/var/transpose/70ca11.wgsl b/test/tint/builtins/gen/var/transpose/70ca11.wgsl
index 00419e9..e28d14d 100644
--- a/test/tint/builtins/gen/var/transpose/70ca11.wgsl
+++ b/test/tint/builtins/gen/var/transpose/70ca11.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat2x3(1., 1., 1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_70ca11();
diff --git a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl
index 6a9b894..902b702 100644
--- a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl
+++ b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl
@@ -27,7 +27,9 @@
 fn transpose_7be8b2() {
   var arg_0 = mat2x2<f16>(1.h, 1.h, 1.h, 1.h);
   var res: mat2x2<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.dxc.hlsl
index 5f701d3..8e96da1 100644
--- a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.dxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+}
+
 void transpose_7be8b2() {
   matrix<float16_t, 2, 2> arg_0 = matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
   matrix<float16_t, 2, 2> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.fxc.hlsl
index fb00d88..4dcea8f 100644
--- a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.fxc.hlsl
@@ -1,8 +1,16 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+}
+
 void transpose_7be8b2() {
   matrix<float16_t, 2, 2> arg_0 = matrix<float16_t, 2, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
   matrix<float16_t, 2, 2> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.glsl
index ce42da7..96300d8 100644
--- a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2 inner;
+} prevent_dce;
+
 void transpose_7be8b2() {
   f16mat2 arg_0 = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2 inner;
+} prevent_dce;
+
 void transpose_7be8b2() {
   f16mat2 arg_0 = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2 inner;
+} prevent_dce;
+
 void transpose_7be8b2() {
   f16mat2 arg_0 = f16mat2(f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.msl
index a352ada..fea4f71 100644
--- a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_7be8b2() {
+void transpose_7be8b2(device half2x2* const tint_symbol_1) {
   half2x2 arg_0 = half2x2(half2(1.0h), half2(1.0h));
   half2x2 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_7be8b2();
+float4 vertex_main_inner(device half2x2* const tint_symbol_2) {
+  transpose_7be8b2(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_7be8b2();
+fragment void fragment_main(device half2x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_7be8b2(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_7be8b2();
+kernel void compute_main(device half2x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_7be8b2(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.spvasm
index ce66a9b..80407c3 100644
--- a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_7be8b2 "transpose_7be8b2"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -25,6 +28,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 4
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,47 +42,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
  %mat2v2half = OpTypeMatrix %v2half 2
+%prevent_dce_block = OpTypeStruct %mat2v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat2v2half %17 %17
+         %20 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat2v2half %20 %20
 %_ptr_Function_mat2v2half = OpTypePointer Function %mat2v2half
-         %21 = OpConstantNull %mat2v2half
-         %25 = OpTypeFunction %v4float
+         %24 = OpConstantNull %mat2v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat2v2half = OpTypePointer StorageBuffer %mat2v2half
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_7be8b2 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat2v2half Function %21
-        %res = OpVariable %_ptr_Function_mat2v2half Function %21
-               OpStore %arg_0 %18
-         %23 = OpLoad %mat2v2half %arg_0
-         %22 = OpTranspose %mat2v2half %23
-               OpStore %res %22
+%transpose_7be8b2 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat2v2half Function %24
+        %res = OpVariable %_ptr_Function_mat2v2half Function %24
+               OpStore %arg_0 %21
+         %26 = OpLoad %mat2v2half %arg_0
+         %25 = OpTranspose %mat2v2half %26
+               OpStore %res %25
+         %31 = OpAccessChain %_ptr_StorageBuffer_mat2v2half %prevent_dce %uint_0
+         %32 = OpLoad %mat2v2half %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_7be8b2
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %transpose_7be8b2
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_7be8b2
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_7be8b2
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_7be8b2
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %transpose_7be8b2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.wgsl
index 0899191..8821f29 100644
--- a/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/7be8b2.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_7be8b2() {
   var arg_0 = mat2x2<f16>(1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat2x2<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_7be8b2();
diff --git a/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl
index fbeee47..ee2cf89 100644
--- a/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl
+++ b/test/tint/builtins/gen/var/transpose/7eb2c5.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat2x2(1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_7eb2c5();
diff --git a/test/tint/builtins/gen/var/transpose/844869.wgsl b/test/tint/builtins/gen/var/transpose/844869.wgsl
index df41e76..5518356 100644
--- a/test/tint/builtins/gen/var/transpose/844869.wgsl
+++ b/test/tint/builtins/gen/var/transpose/844869.wgsl
@@ -27,7 +27,9 @@
 fn transpose_844869() {
   var arg_0 = mat4x4<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: mat4x4<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.dxc.hlsl
index 67ade18..bd86fb2 100644
--- a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.dxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 16u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 24u), value[3u]);
+}
+
 void transpose_844869() {
   matrix<float16_t, 4, 4> arg_0 = matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
   matrix<float16_t, 4, 4> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.fxc.hlsl
index 50704bf..c5a3b3b 100644
--- a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.fxc.hlsl
@@ -1,8 +1,18 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 4> value) {
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 16u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 4> >((offset + 24u), value[3u]);
+}
+
 void transpose_844869() {
   matrix<float16_t, 4, 4> arg_0 = matrix<float16_t, 4, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
   matrix<float16_t, 4, 4> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.glsl
index cb77521..1dbfb0d 100644
--- a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4 inner;
+} prevent_dce;
+
 void transpose_844869() {
   f16mat4 arg_0 = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4 inner;
+} prevent_dce;
+
 void transpose_844869() {
   f16mat4 arg_0 = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4 inner;
+} prevent_dce;
+
 void transpose_844869() {
   f16mat4 arg_0 = f16mat4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.msl
index 7b17966..e272041 100644
--- a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_844869() {
+void transpose_844869(device half4x4* const tint_symbol_1) {
   half4x4 arg_0 = half4x4(half4(1.0h), half4(1.0h), half4(1.0h), half4(1.0h));
   half4x4 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_844869();
+float4 vertex_main_inner(device half4x4* const tint_symbol_2) {
+  transpose_844869(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_844869();
+fragment void fragment_main(device half4x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_844869(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_844869();
+kernel void compute_main(device half4x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_844869(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.spvasm
index 6e24aa1..bd502bd 100644
--- a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_844869 "transpose_844869"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -25,6 +28,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,47 +42,56 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
  %mat4v4half = OpTypeMatrix %v4half 4
+%prevent_dce_block = OpTypeStruct %mat4v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat4v4half %17 %17 %17 %17
+         %20 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %21 = OpConstantComposite %mat4v4half %20 %20 %20 %20
 %_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
-         %21 = OpConstantNull %mat4v4half
-         %25 = OpTypeFunction %v4float
+         %24 = OpConstantNull %mat4v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat4v4half = OpTypePointer StorageBuffer %mat4v4half
+         %33 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_844869 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat4v4half Function %21
-        %res = OpVariable %_ptr_Function_mat4v4half Function %21
-               OpStore %arg_0 %18
-         %23 = OpLoad %mat4v4half %arg_0
-         %22 = OpTranspose %mat4v4half %23
-               OpStore %res %22
+%transpose_844869 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat4v4half Function %24
+        %res = OpVariable %_ptr_Function_mat4v4half Function %24
+               OpStore %arg_0 %21
+         %26 = OpLoad %mat4v4half %arg_0
+         %25 = OpTranspose %mat4v4half %26
+               OpStore %res %25
+         %31 = OpAccessChain %_ptr_StorageBuffer_mat4v4half %prevent_dce %uint_0
+         %32 = OpLoad %mat4v4half %res
+               OpStore %31 %32
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %transpose_844869
+%vertex_main_inner = OpFunction %v4float None %33
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %transpose_844869
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %15
+         %38 = OpLabel
+         %39 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %39
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_844869
+%fragment_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_844869
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %transpose_844869
+%compute_main = OpFunction %void None %15
+         %45 = OpLabel
+         %46 = OpFunctionCall %void %transpose_844869
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.wgsl
index 43882f0..3ae73ab 100644
--- a/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/844869.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_844869() {
   var arg_0 = mat4x4<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat4x4<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_844869();
diff --git a/test/tint/builtins/gen/var/transpose/84a763.wgsl b/test/tint/builtins/gen/var/transpose/84a763.wgsl
index 7e6263e..542a541 100644
--- a/test/tint/builtins/gen/var/transpose/84a763.wgsl
+++ b/test/tint/builtins/gen/var/transpose/84a763.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat2x4(1., 1., 1., 1., 1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_84a763();
diff --git a/test/tint/builtins/gen/var/transpose/854336.wgsl b/test/tint/builtins/gen/var/transpose/854336.wgsl
index b763f69..d594b0d 100644
--- a/test/tint/builtins/gen/var/transpose/854336.wgsl
+++ b/test/tint/builtins/gen/var/transpose/854336.wgsl
@@ -25,7 +25,9 @@
 fn transpose_854336() {
   var arg_0 = mat3x3<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: mat3x3<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.dxc.hlsl
index 838bc51..049155b 100644
--- a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.dxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store3((offset + 32u), asuint(value[2u]));
+}
+
 void transpose_854336() {
   float3x3 arg_0 = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
   float3x3 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.fxc.hlsl
index 838bc51..049155b 100644
--- a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.fxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float3x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store3((offset + 32u), asuint(value[2u]));
+}
+
 void transpose_854336() {
   float3x3 arg_0 = float3x3((1.0f).xxx, (1.0f).xxx, (1.0f).xxx);
   float3x3 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.glsl
index 8a50d43..0a31c39 100644
--- a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.glsl
@@ -1,8 +1,19 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_854336() {
   mat3 arg_0 = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
   mat3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -21,9 +32,20 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_854336() {
   mat3 arg_0 = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
   mat3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -36,9 +58,20 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+}
+
 void transpose_854336() {
   mat3 arg_0 = mat3(vec3(1.0f), vec3(1.0f), vec3(1.0f));
   mat3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.msl
index 5837ea6..522bac8 100644
--- a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.msl
@@ -1,34 +1,59 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_854336() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f32_array_element {
+  /* 0x0000 */ packed_float3 elements;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 3>* const dest, float3x3 value) {
+  (*(dest))[0u].elements = packed_float3(value[0u]);
+  (*(dest))[1u].elements = packed_float3(value[1u]);
+  (*(dest))[2u].elements = packed_float3(value[2u]);
+}
+
+void transpose_854336(device tint_array<tint_packed_vec3_f32_array_element, 3>* const tint_symbol_1) {
   float3x3 arg_0 = float3x3(float3(1.0f), float3(1.0f), float3(1.0f));
   float3x3 res = transpose(arg_0);
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_854336();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f32_array_element, 3>* const tint_symbol_2) {
+  transpose_854336(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_854336();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_854336(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_854336();
+kernel void compute_main(device tint_array<tint_packed_vec3_f32_array_element, 3>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_854336(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.spvasm
index 406209b..da97f44 100644
--- a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.spvasm
@@ -1,17 +1,22 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_854336 "transpose_854336"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -19,55 +24,91 @@
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
 %mat3v3float = OpTypeMatrix %v3float 3
+%prevent_dce_block = OpTypeStruct %mat3v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void %mat3v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %22 = OpConstantNull %int
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+      %int_2 = OpConstant %int 2
+     %uint_2 = OpConstant %uint 2
+         %35 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-         %17 = OpConstantComposite %mat3v3float %16 %16 %16
+         %39 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %40 = OpConstantComposite %mat3v3float %39 %39 %39
 %_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
-         %20 = OpConstantNull %mat3v3float
-         %24 = OpTypeFunction %v4float
-%transpose_854336 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat3v3float Function %20
-        %res = OpVariable %_ptr_Function_mat3v3float Function %20
-               OpStore %arg_0 %17
-         %22 = OpLoad %mat3v3float %arg_0
-         %21 = OpTranspose %mat3v3float %22
-               OpStore %res %21
+         %43 = OpConstantNull %mat3v3float
+         %49 = OpTypeFunction %v4float
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %14
+      %value = OpFunctionParameter %mat3v3float
+         %18 = OpLabel
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %22
+         %26 = OpCompositeExtract %v3float %value 0
+               OpStore %24 %26
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_1
+         %30 = OpCompositeExtract %v3float %value 1
+               OpStore %28 %30
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_2
+         %34 = OpCompositeExtract %v3float %value 2
+               OpStore %32 %34
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %transpose_854336
+%transpose_854336 = OpFunction %void None %35
+         %37 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat3v3float Function %43
+        %res = OpVariable %_ptr_Function_mat3v3float Function %43
+               OpStore %arg_0 %40
+         %45 = OpLoad %mat3v3float %arg_0
+         %44 = OpTranspose %mat3v3float %45
+               OpStore %res %44
+         %48 = OpLoad %mat3v3float %res
+         %47 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %48
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %transpose_854336
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %35
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %transpose_854336
+%fragment_main = OpFunction %void None %35
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %transpose_854336
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_854336
+%compute_main = OpFunction %void None %35
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %transpose_854336
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.wgsl
index e20f97e..d6db347 100644
--- a/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/854336.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_854336() {
   var arg_0 = mat3x3<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat3x3<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_854336();
diff --git a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl
index 2c8b1e3..c8d895e 100644
--- a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl
+++ b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl
@@ -27,7 +27,9 @@
 fn transpose_8c06ce() {
   var arg_0 = mat3x4<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: mat4x3<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.dxc.hlsl
index f83c870..75417b1 100644
--- a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.dxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 16u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 24u), value[3u]);
+}
+
 void transpose_8c06ce() {
   matrix<float16_t, 3, 4> arg_0 = matrix<float16_t, 3, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
   matrix<float16_t, 4, 3> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.fxc.hlsl
index bd80678..a3ac992 100644
--- a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.fxc.hlsl
@@ -1,8 +1,18 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 16u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 24u), value[3u]);
+}
+
 void transpose_8c06ce() {
   matrix<float16_t, 3, 4> arg_0 = matrix<float16_t, 3, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
   matrix<float16_t, 4, 3> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.glsl
index 375e8a83..d6eb143 100644
--- a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.glsl
@@ -1,9 +1,21 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_8c06ce() {
   f16mat3x4 arg_0 = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -23,9 +35,21 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_8c06ce() {
   f16mat3x4 arg_0 = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -39,9 +63,21 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_8c06ce() {
   f16mat3x4 arg_0 = f16mat3x4(f16vec4(1.0hf), f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.msl
index 7484fc0..bae5299 100644
--- a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.msl
@@ -1,34 +1,60 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_8c06ce() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f16_array_element {
+  /* 0x0000 */ packed_half3 elements;
+  /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 4>* const dest, half4x3 value) {
+  (*(dest))[0u].elements = packed_half3(value[0u]);
+  (*(dest))[1u].elements = packed_half3(value[1u]);
+  (*(dest))[2u].elements = packed_half3(value[2u]);
+  (*(dest))[3u].elements = packed_half3(value[3u]);
+}
+
+void transpose_8c06ce(device tint_array<tint_packed_vec3_f16_array_element, 4>* const tint_symbol_1) {
   half3x4 arg_0 = half3x4(half4(1.0h), half4(1.0h), half4(1.0h));
   half4x3 res = transpose(arg_0);
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_8c06ce();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f16_array_element, 4>* const tint_symbol_2) {
+  transpose_8c06ce(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f16_array_element, 4>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_8c06ce();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f16_array_element, 4>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_8c06ce(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_8c06ce();
+kernel void compute_main(device tint_array<tint_packed_vec3_f16_array_element, 4>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_8c06ce(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.spvasm
index 5cc52f3..8f6a931 100644
--- a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 72
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -9,13 +9,18 @@
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_8c06ce "transpose_8c06ce"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -23,61 +28,102 @@
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+     %v3half = OpTypeVector %half 3
+ %mat4v3half = OpTypeMatrix %v3half 4
+%prevent_dce_block = OpTypeStruct %mat4v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void %mat4v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+      %int_2 = OpConstant %int 2
+     %uint_2 = OpConstant %uint 2
+      %int_3 = OpConstant %int 3
+     %uint_3 = OpConstant %uint 3
+         %40 = OpTypeFunction %void
      %v4half = OpTypeVector %half 4
  %mat3v4half = OpTypeMatrix %v4half 3
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat3v4half %17 %17 %17
+         %46 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %47 = OpConstantComposite %mat3v4half %46 %46 %46
 %_ptr_Function_mat3v4half = OpTypePointer Function %mat3v4half
-         %21 = OpConstantNull %mat3v4half
-     %v3half = OpTypeVector %half 3
- %mat4v3half = OpTypeMatrix %v3half 4
+         %50 = OpConstantNull %mat3v4half
 %_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
-         %28 = OpConstantNull %mat4v3half
-         %29 = OpTypeFunction %v4float
+         %55 = OpConstantNull %mat4v3half
+         %58 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_8c06ce = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat3v4half Function %21
-        %res = OpVariable %_ptr_Function_mat4v3half Function %28
-               OpStore %arg_0 %18
-         %25 = OpLoad %mat3v4half %arg_0
-         %22 = OpTranspose %mat4v3half %25
-               OpStore %res %22
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %15
+      %value = OpFunctionParameter %mat4v3half
+         %19 = OpLabel
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %23
+         %27 = OpCompositeExtract %v3half %value 0
+               OpStore %25 %27
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_1
+         %31 = OpCompositeExtract %v3half %value 1
+               OpStore %29 %31
+         %33 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_2
+         %35 = OpCompositeExtract %v3half %value 2
+               OpStore %33 %35
+         %37 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_3
+         %39 = OpCompositeExtract %v3half %value 3
+               OpStore %37 %39
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_8c06ce
+%transpose_8c06ce = OpFunction %void None %40
+         %42 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat3v4half Function %50
+        %res = OpVariable %_ptr_Function_mat4v3half Function %55
+               OpStore %arg_0 %47
+         %52 = OpLoad %mat3v4half %arg_0
+         %51 = OpTranspose %mat4v3half %52
+               OpStore %res %51
+         %57 = OpLoad %mat4v3half %res
+         %56 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %57
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %58
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %transpose_8c06ce
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %40
+         %63 = OpLabel
+         %64 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %64
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_8c06ce
+%fragment_main = OpFunction %void None %40
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %transpose_8c06ce
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %transpose_8c06ce
+%compute_main = OpFunction %void None %40
+         %70 = OpLabel
+         %71 = OpFunctionCall %void %transpose_8c06ce
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.wgsl
index 1aa96e4..bd65911 100644
--- a/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/8c06ce.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_8c06ce() {
   var arg_0 = mat3x4<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat4x3<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_8c06ce();
diff --git a/test/tint/builtins/gen/var/transpose/ace596.wgsl b/test/tint/builtins/gen/var/transpose/ace596.wgsl
index f3e7c35..c40a714 100644
--- a/test/tint/builtins/gen/var/transpose/ace596.wgsl
+++ b/test/tint/builtins/gen/var/transpose/ace596.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat3x2(1., 1., 1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_ace596();
diff --git a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl
index ca4d50c..0ed9504 100644
--- a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl
+++ b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl
@@ -27,7 +27,9 @@
 fn transpose_b9ad1f() {
   var arg_0 = mat3x2<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: mat2x3<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.dxc.hlsl
index aa75d02..d2ba4b6 100644
--- a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.dxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+}
+
 void transpose_b9ad1f() {
   matrix<float16_t, 3, 2> arg_0 = matrix<float16_t, 3, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
   matrix<float16_t, 2, 3> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.fxc.hlsl
index f9fea08..7eb271f 100644
--- a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.fxc.hlsl
@@ -1,8 +1,16 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 2, 3> value) {
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 3> >((offset + 8u), value[1u]);
+}
+
 void transpose_b9ad1f() {
   matrix<float16_t, 3, 2> arg_0 = matrix<float16_t, 3, 2>((float16_t(1.0h)).xx, (float16_t(1.0h)).xx, (float16_t(1.0h)).xx);
   matrix<float16_t, 2, 3> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.glsl
index b6e288b..bbf4eb7 100644
--- a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.glsl
@@ -1,9 +1,19 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_b9ad1f() {
   f16mat3x2 arg_0 = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -23,9 +33,19 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_b9ad1f() {
   f16mat3x2 arg_0 = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -39,9 +59,19 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(f16mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_b9ad1f() {
   f16mat3x2 arg_0 = f16mat3x2(f16vec2(1.0hf), f16vec2(1.0hf), f16vec2(1.0hf));
   f16mat2x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.msl
index 13d5499..0573b21 100644
--- a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.msl
@@ -1,34 +1,58 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_b9ad1f() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f16_array_element {
+  /* 0x0000 */ packed_half3 elements;
+  /* 0x0006 */ tint_array<int8_t, 2> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f16_array_element, 2>* const dest, half2x3 value) {
+  (*(dest))[0u].elements = packed_half3(value[0u]);
+  (*(dest))[1u].elements = packed_half3(value[1u]);
+}
+
+void transpose_b9ad1f(device tint_array<tint_packed_vec3_f16_array_element, 2>* const tint_symbol_1) {
   half3x2 arg_0 = half3x2(half2(1.0h), half2(1.0h), half2(1.0h));
   half2x3 res = transpose(arg_0);
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_b9ad1f();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f16_array_element, 2>* const tint_symbol_2) {
+  transpose_b9ad1f(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f16_array_element, 2>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_b9ad1f();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f16_array_element, 2>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_b9ad1f(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_b9ad1f();
+kernel void compute_main(device tint_array<tint_packed_vec3_f16_array_element, 2>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_b9ad1f(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.spvasm
index 5af2d0d..429710b 100644
--- a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 64
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -9,13 +9,18 @@
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_b9ad1f "transpose_b9ad1f"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -23,61 +28,92 @@
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 8
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+     %v3half = OpTypeVector %half 3
+ %mat2v3half = OpTypeMatrix %v3half 2
+%prevent_dce_block = OpTypeStruct %mat2v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void %mat2v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %23 = OpConstantNull %int
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %26 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+         %32 = OpTypeFunction %void
      %v2half = OpTypeVector %half 2
  %mat3v2half = OpTypeMatrix %v2half 3
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat3v2half %17 %17 %17
+         %38 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %39 = OpConstantComposite %mat3v2half %38 %38 %38
 %_ptr_Function_mat3v2half = OpTypePointer Function %mat3v2half
-         %21 = OpConstantNull %mat3v2half
-     %v3half = OpTypeVector %half 3
- %mat2v3half = OpTypeMatrix %v3half 2
+         %42 = OpConstantNull %mat3v2half
 %_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
-         %28 = OpConstantNull %mat2v3half
-         %29 = OpTypeFunction %v4float
+         %47 = OpConstantNull %mat2v3half
+         %50 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_b9ad1f = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat3v2half Function %21
-        %res = OpVariable %_ptr_Function_mat2v3half Function %28
-               OpStore %arg_0 %18
-         %25 = OpLoad %mat3v2half %arg_0
-         %22 = OpTranspose %mat2v3half %25
-               OpStore %res %22
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %15
+      %value = OpFunctionParameter %mat2v3half
+         %19 = OpLabel
+         %25 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %23
+         %27 = OpCompositeExtract %v3half %value 0
+               OpStore %25 %27
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0 %int_1
+         %31 = OpCompositeExtract %v3half %value 1
+               OpStore %29 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_b9ad1f
+%transpose_b9ad1f = OpFunction %void None %32
+         %34 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat3v2half Function %42
+        %res = OpVariable %_ptr_Function_mat2v3half Function %47
+               OpStore %arg_0 %39
+         %44 = OpLoad %mat3v2half %arg_0
+         %43 = OpTranspose %mat2v3half %44
+               OpStore %res %43
+         %49 = OpLoad %mat2v3half %res
+         %48 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %49
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %50
+         %52 = OpLabel
+         %53 = OpFunctionCall %void %transpose_b9ad1f
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %32
+         %55 = OpLabel
+         %56 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %56
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_b9ad1f
+%fragment_main = OpFunction %void None %32
+         %59 = OpLabel
+         %60 = OpFunctionCall %void %transpose_b9ad1f
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %transpose_b9ad1f
+%compute_main = OpFunction %void None %32
+         %62 = OpLabel
+         %63 = OpFunctionCall %void %transpose_b9ad1f
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.wgsl
index b03542a..d5ae5bf 100644
--- a/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/b9ad1f.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_b9ad1f() {
   var arg_0 = mat3x2<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat2x3<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_b9ad1f();
diff --git a/test/tint/builtins/gen/var/transpose/c1b600.wgsl b/test/tint/builtins/gen/var/transpose/c1b600.wgsl
index 5840776..ba7c128 100644
--- a/test/tint/builtins/gen/var/transpose/c1b600.wgsl
+++ b/test/tint/builtins/gen/var/transpose/c1b600.wgsl
@@ -25,7 +25,9 @@
 fn transpose_c1b600() {
   var arg_0 = mat4x4<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: mat4x4<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.dxc.hlsl
index 464f750..8cd97fc 100644
--- a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.dxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store4((offset + 32u), asuint(value[2u]));
+  prevent_dce.Store4((offset + 48u), asuint(value[3u]));
+}
+
 void transpose_c1b600() {
   float4x4 arg_0 = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
   float4x4 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.fxc.hlsl
index 464f750..8cd97fc 100644
--- a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.fxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x4 value) {
+  prevent_dce.Store4((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store4((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store4((offset + 32u), asuint(value[2u]));
+  prevent_dce.Store4((offset + 48u), asuint(value[3u]));
+}
+
 void transpose_c1b600() {
   float4x4 arg_0 = float4x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
   float4x4 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.glsl
index b4705c8..37cb1f3 100644
--- a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4 inner;
+} prevent_dce;
+
 void transpose_c1b600() {
   mat4 arg_0 = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
   mat4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4 inner;
+} prevent_dce;
+
 void transpose_c1b600() {
   mat4 arg_0 = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
   mat4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4 inner;
+} prevent_dce;
+
 void transpose_c1b600() {
   mat4 arg_0 = mat4(vec4(1.0f), vec4(1.0f), vec4(1.0f), vec4(1.0f));
   mat4 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.msl
index 862013a..dd7a6ab 100644
--- a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_c1b600() {
+void transpose_c1b600(device float4x4* const tint_symbol_1) {
   float4x4 arg_0 = float4x4(float4(1.0f), float4(1.0f), float4(1.0f), float4(1.0f));
   float4x4 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_c1b600();
+float4 vertex_main_inner(device float4x4* const tint_symbol_2) {
+  transpose_c1b600(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4x4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_c1b600();
+fragment void fragment_main(device float4x4* tint_symbol_4 [[buffer(0)]]) {
+  transpose_c1b600(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_c1b600();
+kernel void compute_main(device float4x4* tint_symbol_5 [[buffer(0)]]) {
+  transpose_c1b600(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.spvasm
index 27235ee..c13edb1 100644
--- a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -12,6 +12,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_c1b600 "transpose_c1b600"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -21,6 +24,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -29,44 +38,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
 %mat4v4float = OpTypeMatrix %v4float 4
+%prevent_dce_block = OpTypeStruct %mat4v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %16 = OpConstantComposite %mat4v4float %15 %15 %15 %15
+         %18 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %19 = OpConstantComposite %mat4v4float %18 %18 %18 %18
 %_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
-         %19 = OpConstantNull %mat4v4float
-         %23 = OpTypeFunction %v4float
-%transpose_c1b600 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat4v4float Function %19
-        %res = OpVariable %_ptr_Function_mat4v4float Function %19
-               OpStore %arg_0 %16
-         %21 = OpLoad %mat4v4float %arg_0
-         %20 = OpTranspose %mat4v4float %21
-               OpStore %res %20
+         %22 = OpConstantNull %mat4v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat4v4float = OpTypePointer StorageBuffer %mat4v4float
+         %31 = OpTypeFunction %v4float
+%transpose_c1b600 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat4v4float Function %22
+        %res = OpVariable %_ptr_Function_mat4v4float Function %22
+               OpStore %arg_0 %19
+         %24 = OpLoad %mat4v4float %arg_0
+         %23 = OpTranspose %mat4v4float %24
+               OpStore %res %23
+         %29 = OpAccessChain %_ptr_StorageBuffer_mat4v4float %prevent_dce %uint_0
+         %30 = OpLoad %mat4v4float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %transpose_c1b600
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %transpose_c1b600
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_c1b600
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_c1b600
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %transpose_c1b600
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %transpose_c1b600
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.wgsl
index 435849a..9935d01 100644
--- a/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/c1b600.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_c1b600() {
   var arg_0 = mat4x4<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat4x4<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_c1b600();
diff --git a/test/tint/builtins/gen/var/transpose/d6faec.wgsl b/test/tint/builtins/gen/var/transpose/d6faec.wgsl
index 69281e0..2b9f927 100644
--- a/test/tint/builtins/gen/var/transpose/d6faec.wgsl
+++ b/test/tint/builtins/gen/var/transpose/d6faec.wgsl
@@ -27,7 +27,9 @@
 fn transpose_d6faec() {
   var arg_0 = mat2x3<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: mat3x2<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.dxc.hlsl
index 61e3055..3678f77 100644
--- a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.dxc.hlsl
@@ -1,6 +1,15 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 8u), value[2u]);
+}
+
 void transpose_d6faec() {
   matrix<float16_t, 2, 3> arg_0 = matrix<float16_t, 2, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
   matrix<float16_t, 3, 2> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.fxc.hlsl
index 9ab4756..d60cde2 100644
--- a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.fxc.hlsl
@@ -1,8 +1,17 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 3, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 8u), value[2u]);
+}
+
 void transpose_d6faec() {
   matrix<float16_t, 2, 3> arg_0 = matrix<float16_t, 2, 3>((float16_t(1.0h)).xxx, (float16_t(1.0h)).xxx);
   matrix<float16_t, 3, 2> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.glsl
index 83dbe18..398ca87 100644
--- a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x2 inner;
+} prevent_dce;
+
 void transpose_d6faec() {
   f16mat2x3 arg_0 = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x2 inner;
+} prevent_dce;
+
 void transpose_d6faec() {
   f16mat2x3 arg_0 = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat3x2 inner;
+} prevent_dce;
+
 void transpose_d6faec() {
   f16mat2x3 arg_0 = f16mat2x3(f16vec3(1.0hf), f16vec3(1.0hf));
   f16mat3x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.msl
index 0e8d5a0..af4dcc8 100644
--- a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_d6faec() {
+void transpose_d6faec(device half3x2* const tint_symbol_1) {
   half2x3 arg_0 = half2x3(half3(1.0h), half3(1.0h));
   half3x2 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_d6faec();
+float4 vertex_main_inner(device half3x2* const tint_symbol_2) {
+  transpose_d6faec(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half3x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_d6faec();
+fragment void fragment_main(device half3x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_d6faec(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_d6faec();
+kernel void compute_main(device half3x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_d6faec(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.spvasm
index 3b781a5..3d7391f 100644
--- a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_d6faec "transpose_d6faec"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -25,6 +28,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 4
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,51 +42,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+     %v2half = OpTypeVector %half 2
+ %mat3v2half = OpTypeMatrix %v2half 3
+%prevent_dce_block = OpTypeStruct %mat3v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
      %v3half = OpTypeVector %half 3
  %mat2v3half = OpTypeMatrix %v3half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat2v3half %17 %17
+         %22 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %23 = OpConstantComposite %mat2v3half %22 %22
 %_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
-         %21 = OpConstantNull %mat2v3half
-     %v2half = OpTypeVector %half 2
- %mat3v2half = OpTypeMatrix %v2half 3
+         %26 = OpConstantNull %mat2v3half
 %_ptr_Function_mat3v2half = OpTypePointer Function %mat3v2half
-         %28 = OpConstantNull %mat3v2half
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %mat3v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat3v2half = OpTypePointer StorageBuffer %mat3v2half
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_d6faec = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat2v3half Function %21
-        %res = OpVariable %_ptr_Function_mat3v2half Function %28
-               OpStore %arg_0 %18
-         %25 = OpLoad %mat2v3half %arg_0
-         %22 = OpTranspose %mat3v2half %25
-               OpStore %res %22
+%transpose_d6faec = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat2v3half Function %26
+        %res = OpVariable %_ptr_Function_mat3v2half Function %31
+               OpStore %arg_0 %23
+         %28 = OpLoad %mat2v3half %arg_0
+         %27 = OpTranspose %mat3v2half %28
+               OpStore %res %27
+         %35 = OpAccessChain %_ptr_StorageBuffer_mat3v2half %prevent_dce %uint_0
+         %36 = OpLoad %mat3v2half %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_d6faec
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_d6faec
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_d6faec
+%fragment_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %transpose_d6faec
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %transpose_d6faec
+%compute_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %transpose_d6faec
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.wgsl
index f439b66..5dc64dd 100644
--- a/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/d6faec.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_d6faec() {
   var arg_0 = mat2x3<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat3x2<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat3x2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_d6faec();
diff --git a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl
index 9f61b7c..feab040 100644
--- a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl
+++ b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl
@@ -25,7 +25,9 @@
 fn transpose_d8f8ba() {
   var arg_0 = mat3x4<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: mat4x3<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.dxc.hlsl
index 2cd9d6b..fb2ee0a 100644
--- a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.dxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store3((offset + 32u), asuint(value[2u]));
+  prevent_dce.Store3((offset + 48u), asuint(value[3u]));
+}
+
 void transpose_d8f8ba() {
   float3x4 arg_0 = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
   float4x3 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.fxc.hlsl
index 2cd9d6b..fb2ee0a 100644
--- a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.fxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float4x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+  prevent_dce.Store3((offset + 32u), asuint(value[2u]));
+  prevent_dce.Store3((offset + 48u), asuint(value[3u]));
+}
+
 void transpose_d8f8ba() {
   float3x4 arg_0 = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx);
   float4x3 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.glsl
index fd91e2e..1b7fe19 100644
--- a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.glsl
@@ -1,8 +1,20 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_d8f8ba() {
   mat3x4 arg_0 = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
   mat4x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -21,9 +33,21 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_d8f8ba() {
   mat3x4 arg_0 = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
   mat4x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -36,9 +60,21 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat4x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat4x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+  prevent_dce.inner[2] = value[2u];
+  prevent_dce.inner[3] = value[3u];
+}
+
 void transpose_d8f8ba() {
   mat3x4 arg_0 = mat3x4(vec4(1.0f), vec4(1.0f), vec4(1.0f));
   mat4x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.msl
index 29a2dad..7c98ff3 100644
--- a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.msl
@@ -1,34 +1,60 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_d8f8ba() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f32_array_element {
+  /* 0x0000 */ packed_float3 elements;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 4>* const dest, float4x3 value) {
+  (*(dest))[0u].elements = packed_float3(value[0u]);
+  (*(dest))[1u].elements = packed_float3(value[1u]);
+  (*(dest))[2u].elements = packed_float3(value[2u]);
+  (*(dest))[3u].elements = packed_float3(value[3u]);
+}
+
+void transpose_d8f8ba(device tint_array<tint_packed_vec3_f32_array_element, 4>* const tint_symbol_1) {
   float3x4 arg_0 = float3x4(float4(1.0f), float4(1.0f), float4(1.0f));
   float4x3 res = transpose(arg_0);
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_d8f8ba();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f32_array_element, 4>* const tint_symbol_2) {
+  transpose_d8f8ba(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f32_array_element, 4>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_d8f8ba();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f32_array_element, 4>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_d8f8ba(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_d8f8ba();
+kernel void compute_main(device tint_array<tint_packed_vec3_f32_array_element, 4>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_d8f8ba(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.spvasm
index b6b20c4..7117de0 100644
--- a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.spvasm
@@ -1,17 +1,22 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 69
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_d8f8ba "transpose_d8f8ba"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -19,58 +24,99 @@
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
-%mat3v4float = OpTypeMatrix %v4float 3
-    %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
-         %16 = OpConstantComposite %mat3v4float %15 %15 %15
-%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
-         %19 = OpConstantNull %mat3v4float
     %v3float = OpTypeVector %float 3
 %mat4v3float = OpTypeMatrix %v3float 4
+%prevent_dce_block = OpTypeStruct %mat4v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void %mat4v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %22 = OpConstantNull %int
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+      %int_2 = OpConstant %int 2
+     %uint_2 = OpConstant %uint 2
+      %int_3 = OpConstant %int 3
+     %uint_3 = OpConstant %uint 3
+         %39 = OpTypeFunction %void
+%mat3v4float = OpTypeMatrix %v4float 3
+    %float_1 = OpConstant %float 1
+         %44 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %45 = OpConstantComposite %mat3v4float %44 %44 %44
+%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
+         %48 = OpConstantNull %mat3v4float
 %_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
-         %26 = OpConstantNull %mat4v3float
-         %27 = OpTypeFunction %v4float
-%transpose_d8f8ba = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat3v4float Function %19
-        %res = OpVariable %_ptr_Function_mat4v3float Function %26
-               OpStore %arg_0 %16
-         %23 = OpLoad %mat3v4float %arg_0
-         %20 = OpTranspose %mat4v3float %23
-               OpStore %res %20
+         %53 = OpConstantNull %mat4v3float
+         %56 = OpTypeFunction %v4float
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %14
+      %value = OpFunctionParameter %mat4v3float
+         %18 = OpLabel
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %22
+         %26 = OpCompositeExtract %v3float %value 0
+               OpStore %24 %26
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_1
+         %30 = OpCompositeExtract %v3float %value 1
+               OpStore %28 %30
+         %32 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_2
+         %34 = OpCompositeExtract %v3float %value 2
+               OpStore %32 %34
+         %36 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_3
+         %38 = OpCompositeExtract %v3float %value 3
+               OpStore %36 %38
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %transpose_d8f8ba
+%transpose_d8f8ba = OpFunction %void None %39
+         %41 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat3v4float Function %48
+        %res = OpVariable %_ptr_Function_mat4v3float Function %53
+               OpStore %arg_0 %45
+         %50 = OpLoad %mat3v4float %arg_0
+         %49 = OpTranspose %mat4v3float %50
+               OpStore %res %49
+         %55 = OpLoad %mat4v3float %res
+         %54 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %55
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %56
+         %58 = OpLabel
+         %59 = OpFunctionCall %void %transpose_d8f8ba
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %33
+%vertex_main = OpFunction %void None %39
+         %61 = OpLabel
+         %62 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %62
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %transpose_d8f8ba
+%fragment_main = OpFunction %void None %39
+         %64 = OpLabel
+         %65 = OpFunctionCall %void %transpose_d8f8ba
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_d8f8ba
+%compute_main = OpFunction %void None %39
+         %67 = OpLabel
+         %68 = OpFunctionCall %void %transpose_d8f8ba
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.wgsl
index c771705..ab9ad1a 100644
--- a/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/d8f8ba.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_d8f8ba() {
   var arg_0 = mat3x4<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat4x3<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_d8f8ba();
diff --git a/test/tint/builtins/gen/var/transpose/dc671a.wgsl b/test/tint/builtins/gen/var/transpose/dc671a.wgsl
index feeed7d..50a8540 100644
--- a/test/tint/builtins/gen/var/transpose/dc671a.wgsl
+++ b/test/tint/builtins/gen/var/transpose/dc671a.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = mat4x4(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.);
   var res = transpose(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_dc671a();
diff --git a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl
index 713d61c..c36dbc4 100644
--- a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl
+++ b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl
@@ -25,7 +25,9 @@
 fn transpose_ed4bdc() {
   var arg_0 = mat3x2<f32>(1.f, 1.f, 1.f, 1.f, 1.f, 1.f);
   var res: mat2x3<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.dxc.hlsl
index 78abe82..50e1306 100644
--- a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.dxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+}
+
 void transpose_ed4bdc() {
   float3x2 arg_0 = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
   float2x3 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.fxc.hlsl
index 78abe82..50e1306 100644
--- a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.fxc.hlsl
@@ -1,6 +1,14 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, float2x3 value) {
+  prevent_dce.Store3((offset + 0u), asuint(value[0u]));
+  prevent_dce.Store3((offset + 16u), asuint(value[1u]));
+}
+
 void transpose_ed4bdc() {
   float3x2 arg_0 = float3x2((1.0f).xx, (1.0f).xx, (1.0f).xx);
   float2x3 res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.glsl
index 00d785f..8778056 100644
--- a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.glsl
@@ -1,8 +1,18 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_ed4bdc() {
   mat3x2 arg_0 = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
   mat2x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 vec4 vertex_main() {
@@ -21,9 +31,19 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_ed4bdc() {
   mat3x2 arg_0 = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
   mat2x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void fragment_main() {
@@ -36,9 +56,19 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  mat2x3 inner;
+} prevent_dce;
+
+void assign_and_preserve_padding_prevent_dce(mat2x3 value) {
+  prevent_dce.inner[0] = value[0u];
+  prevent_dce.inner[1] = value[1u];
+}
+
 void transpose_ed4bdc() {
   mat3x2 arg_0 = mat3x2(vec2(1.0f), vec2(1.0f), vec2(1.0f));
   mat2x3 res = transpose(arg_0);
+  assign_and_preserve_padding_prevent_dce(res);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.msl
index ecb3502..0f49329 100644
--- a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.msl
@@ -1,34 +1,58 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_ed4bdc() {
+
+template<typename T, size_t N>
+struct tint_array {
+    const constant T& operator[](size_t i) const constant { return elements[i]; }
+    device T& operator[](size_t i) device { return elements[i]; }
+    const device T& operator[](size_t i) const device { return elements[i]; }
+    thread T& operator[](size_t i) thread { return elements[i]; }
+    const thread T& operator[](size_t i) const thread { return elements[i]; }
+    threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+    const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+    T elements[N];
+};
+
+struct tint_packed_vec3_f32_array_element {
+  /* 0x0000 */ packed_float3 elements;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+};
+
+void assign_and_preserve_padding(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, float2x3 value) {
+  (*(dest))[0u].elements = packed_float3(value[0u]);
+  (*(dest))[1u].elements = packed_float3(value[1u]);
+}
+
+void transpose_ed4bdc(device tint_array<tint_packed_vec3_f32_array_element, 2>* const tint_symbol_1) {
   float3x2 arg_0 = float3x2(float2(1.0f), float2(1.0f), float2(1.0f));
   float2x3 res = transpose(arg_0);
+  assign_and_preserve_padding(tint_symbol_1, res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_ed4bdc();
+float4 vertex_main_inner(device tint_array<tint_packed_vec3_f32_array_element, 2>* const tint_symbol_2) {
+  transpose_ed4bdc(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device tint_array<tint_packed_vec3_f32_array_element, 2>* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_ed4bdc();
+fragment void fragment_main(device tint_array<tint_packed_vec3_f32_array_element, 2>* tint_symbol_4 [[buffer(0)]]) {
+  transpose_ed4bdc(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_ed4bdc();
+kernel void compute_main(device tint_array<tint_packed_vec3_f32_array_element, 2>* tint_symbol_5 [[buffer(0)]]) {
+  transpose_ed4bdc(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.spvasm
index da5aaeb..7b2e063 100644
--- a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.spvasm
@@ -1,17 +1,22 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 62
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
-               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value_1 %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
                OpEntryPoint GLCompute %compute_main "compute_main"
                OpExecutionMode %fragment_main OriginUpperLeft
                OpExecutionMode %compute_main LocalSize 1 1 1
-               OpName %value "value"
+               OpName %value_1 "value_1"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
+               OpName %assign_and_preserve_padding_prevent_dce "assign_and_preserve_padding_prevent_dce"
+               OpName %value "value"
                OpName %transpose_ed4bdc "transpose_ed4bdc"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -19,59 +24,90 @@
                OpName %vertex_main "vertex_main"
                OpName %fragment_main "fragment_main"
                OpName %compute_main "compute_main"
-               OpDecorate %value BuiltIn Position
+               OpDecorate %value_1 BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 16
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
           %5 = OpConstantNull %v4float
-      %value = OpVariable %_ptr_Output_v4float Output %5
+    %value_1 = OpVariable %_ptr_Output_v4float Output %5
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+    %v3float = OpTypeVector %float 3
+%mat2v3float = OpTypeMatrix %v3float 2
+%prevent_dce_block = OpTypeStruct %mat2v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %14 = OpTypeFunction %void %mat2v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+        %int = OpTypeInt 32 1
+         %22 = OpConstantNull %int
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %25 = OpConstantNull %uint
+      %int_1 = OpConstant %int 1
+     %uint_1 = OpConstant %uint 1
+         %31 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
 %mat3v2float = OpTypeMatrix %v2float 3
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v2float %float_1 %float_1
-         %17 = OpConstantComposite %mat3v2float %16 %16 %16
+         %37 = OpConstantComposite %v2float %float_1 %float_1
+         %38 = OpConstantComposite %mat3v2float %37 %37 %37
 %_ptr_Function_mat3v2float = OpTypePointer Function %mat3v2float
-         %20 = OpConstantNull %mat3v2float
-    %v3float = OpTypeVector %float 3
-%mat2v3float = OpTypeMatrix %v3float 2
+         %41 = OpConstantNull %mat3v2float
 %_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
-         %27 = OpConstantNull %mat2v3float
-         %28 = OpTypeFunction %v4float
-%transpose_ed4bdc = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat3v2float Function %20
-        %res = OpVariable %_ptr_Function_mat2v3float Function %27
-               OpStore %arg_0 %17
-         %24 = OpLoad %mat3v2float %arg_0
-         %21 = OpTranspose %mat2v3float %24
-               OpStore %res %21
+         %46 = OpConstantNull %mat2v3float
+         %49 = OpTypeFunction %v4float
+%assign_and_preserve_padding_prevent_dce = OpFunction %void None %14
+      %value = OpFunctionParameter %mat2v3float
+         %18 = OpLabel
+         %24 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %22
+         %26 = OpCompositeExtract %v3float %value 0
+               OpStore %24 %26
+         %28 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0 %int_1
+         %30 = OpCompositeExtract %v3float %value 1
+               OpStore %28 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %transpose_ed4bdc
+%transpose_ed4bdc = OpFunction %void None %31
+         %33 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat3v2float Function %41
+        %res = OpVariable %_ptr_Function_mat2v3float Function %46
+               OpStore %arg_0 %38
+         %43 = OpLoad %mat3v2float %arg_0
+         %42 = OpTranspose %mat2v3float %43
+               OpStore %res %42
+         %48 = OpLoad %mat2v3float %res
+         %47 = OpFunctionCall %void %assign_and_preserve_padding_prevent_dce %48
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %49
+         %51 = OpLabel
+         %52 = OpFunctionCall %void %transpose_ed4bdc
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %34
+%vertex_main = OpFunction %void None %31
+         %54 = OpLabel
+         %55 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value_1 %55
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %transpose_ed4bdc
+%fragment_main = OpFunction %void None %31
+         %57 = OpLabel
+         %58 = OpFunctionCall %void %transpose_ed4bdc
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %39 = OpLabel
-         %40 = OpFunctionCall %void %transpose_ed4bdc
+%compute_main = OpFunction %void None %31
+         %60 = OpLabel
+         %61 = OpFunctionCall %void %transpose_ed4bdc
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.wgsl
index a024948..8ee5326 100644
--- a/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/ed4bdc.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn transpose_ed4bdc() {
   var arg_0 = mat3x2<f32>(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
   var res : mat2x3<f32> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat2x3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_ed4bdc();
diff --git a/test/tint/builtins/gen/var/transpose/faeb05.wgsl b/test/tint/builtins/gen/var/transpose/faeb05.wgsl
index e891630..da02ab3 100644
--- a/test/tint/builtins/gen/var/transpose/faeb05.wgsl
+++ b/test/tint/builtins/gen/var/transpose/faeb05.wgsl
@@ -27,7 +27,9 @@
 fn transpose_faeb05() {
   var arg_0 = mat2x4<f16>(1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h, 1.h);
   var res: mat4x2<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.dxc.hlsl
index b0ada99..a79f38c 100644
--- a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.dxc.hlsl
@@ -1,6 +1,16 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 8u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 12u), value[3u]);
+}
+
 void transpose_faeb05() {
   matrix<float16_t, 2, 4> arg_0 = matrix<float16_t, 2, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
   matrix<float16_t, 4, 2> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.fxc.hlsl
index afec1bc..bc40fc3 100644
--- a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.fxc.hlsl
@@ -1,8 +1,18 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void prevent_dce_store(uint offset, matrix<float16_t, 4, 2> value) {
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 0u), value[0u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 4u), value[1u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 8u), value[2u]);
+  prevent_dce.Store<vector<float16_t, 2> >((offset + 12u), value[3u]);
+}
+
 void transpose_faeb05() {
   matrix<float16_t, 2, 4> arg_0 = matrix<float16_t, 2, 4>((float16_t(1.0h)).xxxx, (float16_t(1.0h)).xxxx);
   matrix<float16_t, 4, 2> res = transpose(arg_0);
+  prevent_dce_store(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.glsl b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.glsl
index 86c2ac6..3171bc5 100644
--- a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x2 inner;
+} prevent_dce;
+
 void transpose_faeb05() {
   f16mat2x4 arg_0 = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x2 inner;
+} prevent_dce;
+
 void transpose_faeb05() {
   f16mat2x4 arg_0 = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16mat4x2 inner;
+} prevent_dce;
+
 void transpose_faeb05() {
   f16mat2x4 arg_0 = f16mat2x4(f16vec4(1.0hf), f16vec4(1.0hf));
   f16mat4x2 res = transpose(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.msl b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.msl
index 674a561..37b26df 100644
--- a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void transpose_faeb05() {
+void transpose_faeb05(device half4x2* const tint_symbol_1) {
   half2x4 arg_0 = half2x4(half4(1.0h), half4(1.0h));
   half4x2 res = transpose(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  transpose_faeb05();
+float4 vertex_main_inner(device half4x2* const tint_symbol_2) {
+  transpose_faeb05(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4x2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  transpose_faeb05();
+fragment void fragment_main(device half4x2* tint_symbol_4 [[buffer(0)]]) {
+  transpose_faeb05(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  transpose_faeb05();
+kernel void compute_main(device half4x2* tint_symbol_5 [[buffer(0)]]) {
+  transpose_faeb05(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.spvasm b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.spvasm
index 5b43dfb..6a475d6 100644
--- a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -16,6 +16,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %transpose_faeb05 "transpose_faeb05"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -25,6 +28,12 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpMemberDecorate %prevent_dce_block 0 ColMajor
+               OpMemberDecorate %prevent_dce_block 0 MatrixStride 4
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -33,51 +42,60 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+     %v2half = OpTypeVector %half 2
+ %mat4v2half = OpTypeMatrix %v2half 4
+%prevent_dce_block = OpTypeStruct %mat4v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %15 = OpTypeFunction %void
      %v4half = OpTypeVector %half 4
  %mat2v4half = OpTypeMatrix %v4half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %17 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
-         %18 = OpConstantComposite %mat2v4half %17 %17
+         %22 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+         %23 = OpConstantComposite %mat2v4half %22 %22
 %_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
-         %21 = OpConstantNull %mat2v4half
-     %v2half = OpTypeVector %half 2
- %mat4v2half = OpTypeMatrix %v2half 4
+         %26 = OpConstantNull %mat2v4half
 %_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-         %28 = OpConstantNull %mat4v2half
-         %29 = OpTypeFunction %v4float
+         %31 = OpConstantNull %mat4v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_mat4v2half = OpTypePointer StorageBuffer %mat4v2half
+         %37 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%transpose_faeb05 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_mat2v4half Function %21
-        %res = OpVariable %_ptr_Function_mat4v2half Function %28
-               OpStore %arg_0 %18
-         %25 = OpLoad %mat2v4half %arg_0
-         %22 = OpTranspose %mat4v2half %25
-               OpStore %res %22
+%transpose_faeb05 = OpFunction %void None %15
+         %18 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_mat2v4half Function %26
+        %res = OpVariable %_ptr_Function_mat4v2half Function %31
+               OpStore %arg_0 %23
+         %28 = OpLoad %mat2v4half %arg_0
+         %27 = OpTranspose %mat4v2half %28
+               OpStore %res %27
+         %35 = OpAccessChain %_ptr_StorageBuffer_mat4v2half %prevent_dce %uint_0
+         %36 = OpLoad %mat4v2half %res
+               OpStore %35 %36
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %transpose_faeb05
+%vertex_main_inner = OpFunction %v4float None %37
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %transpose_faeb05
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %35
+%vertex_main = OpFunction %void None %15
+         %42 = OpLabel
+         %43 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %43
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %38 = OpLabel
-         %39 = OpFunctionCall %void %transpose_faeb05
+%fragment_main = OpFunction %void None %15
+         %46 = OpLabel
+         %47 = OpFunctionCall %void %transpose_faeb05
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %41 = OpLabel
-         %42 = OpFunctionCall %void %transpose_faeb05
+%compute_main = OpFunction %void None %15
+         %49 = OpLabel
+         %50 = OpFunctionCall %void %transpose_faeb05
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.wgsl b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.wgsl
index 10f8d0a..3325a2f 100644
--- a/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/transpose/faeb05.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn transpose_faeb05() {
   var arg_0 = mat2x4<f16>(1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h, 1.0h);
   var res : mat4x2<f16> = transpose(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : mat4x2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   transpose_faeb05();
diff --git a/test/tint/builtins/gen/var/trunc/103ab8.wgsl b/test/tint/builtins/gen/var/trunc/103ab8.wgsl
index b1c2ecb..d174c9c 100644
--- a/test/tint/builtins/gen/var/trunc/103ab8.wgsl
+++ b/test/tint/builtins/gen/var/trunc/103ab8.wgsl
@@ -27,7 +27,9 @@
 fn trunc_103ab8() {
   var arg_0 = vec3<f16>(1.5h);
   var res: vec3<f16> = trunc(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.dxc.hlsl
index 8eb5c91..7325653 100644
--- a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_103ab8() {
   vector<float16_t, 3> arg_0 = (float16_t(1.5h)).xxx;
   vector<float16_t, 3> res = trunc(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.fxc.hlsl
index a29214b..a27423e 100644
--- a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_103ab8() {
   vector<float16_t, 3> arg_0 = (float16_t(1.5h)).xxx;
   vector<float16_t, 3> res = trunc(arg_0);
+  prevent_dce.Store<vector<float16_t, 3> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.glsl b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.glsl
index bb2e9a7..64bcaed 100644
--- a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void trunc_103ab8() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void trunc_103ab8() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec3 inner;
+} prevent_dce;
+
 void trunc_103ab8() {
   f16vec3 arg_0 = f16vec3(1.5hf);
   f16vec3 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.msl b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.msl
index 4e3f505..f4a8941 100644
--- a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_103ab8() {
+void trunc_103ab8(device packed_half3* const tint_symbol_1) {
   half3 arg_0 = half3(1.5h);
   half3 res = trunc(arg_0);
+  *(tint_symbol_1) = packed_half3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_103ab8();
+float4 vertex_main_inner(device packed_half3* const tint_symbol_2) {
+  trunc_103ab8(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_half3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_103ab8();
+fragment void fragment_main(device packed_half3* tint_symbol_4 [[buffer(0)]]) {
+  trunc_103ab8(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_103ab8();
+kernel void compute_main(device packed_half3* tint_symbol_5 [[buffer(0)]]) {
+  trunc_103ab8(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.spvasm
index e6b9a38..65fb94d 100644
--- a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_103ab8 "trunc_103ab8"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
+%prevent_dce_block = OpTypeStruct %v3half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v3half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v3half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %19 = OpConstantNull %v3half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v3half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_103ab8 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3half Function %19
-        %res = OpVariable %_ptr_Function_v3half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v3half %arg_0
-         %20 = OpExtInst %v3half %21 Trunc %22
-               OpStore %res %20
+%trunc_103ab8 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3half Function %22
+        %res = OpVariable %_ptr_Function_v3half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v3half %arg_0
+         %23 = OpExtInst %v3half %24 Trunc %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v3half %prevent_dce %uint_0
+         %31 = OpLoad %v3half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %trunc_103ab8
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %trunc_103ab8
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %trunc_103ab8
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %trunc_103ab8
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %trunc_103ab8
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %trunc_103ab8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.wgsl
index 8ccaf01..2ae21c1 100644
--- a/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/trunc/103ab8.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn trunc_103ab8() {
   var arg_0 = vec3<f16>(1.5h);
   var res : vec3<f16> = trunc(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_103ab8();
diff --git a/test/tint/builtins/gen/var/trunc/117396.wgsl b/test/tint/builtins/gen/var/trunc/117396.wgsl
index 811ba78..1493f80 100644
--- a/test/tint/builtins/gen/var/trunc/117396.wgsl
+++ b/test/tint/builtins/gen/var/trunc/117396.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec3(1.5);
   var res = trunc(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_117396();
diff --git a/test/tint/builtins/gen/var/trunc/562d05.wgsl b/test/tint/builtins/gen/var/trunc/562d05.wgsl
index de79b2a..87e3a39 100644
--- a/test/tint/builtins/gen/var/trunc/562d05.wgsl
+++ b/test/tint/builtins/gen/var/trunc/562d05.wgsl
@@ -25,7 +25,9 @@
 fn trunc_562d05() {
   var arg_0 = vec3<f32>(1.5f);
   var res: vec3<f32> = trunc(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.dxc.hlsl
index bee4949..45ad5a7 100644
--- a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_562d05() {
   float3 arg_0 = (1.5f).xxx;
   float3 res = trunc(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.fxc.hlsl
index bee4949..45ad5a7 100644
--- a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_562d05() {
   float3 arg_0 = (1.5f).xxx;
   float3 res = trunc(arg_0);
+  prevent_dce.Store3(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.glsl b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.glsl
index 697c356..2323f85 100644
--- a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void trunc_562d05() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void trunc_562d05() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec3 inner;
+} prevent_dce;
+
 void trunc_562d05() {
   vec3 arg_0 = vec3(1.5f);
   vec3 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.msl b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.msl
index a81ade2..d24eed5 100644
--- a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_562d05() {
+void trunc_562d05(device packed_float3* const tint_symbol_1) {
   float3 arg_0 = float3(1.5f);
   float3 res = trunc(arg_0);
+  *(tint_symbol_1) = packed_float3(res);
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_562d05();
+float4 vertex_main_inner(device packed_float3* const tint_symbol_2) {
+  trunc_562d05(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device packed_float3* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_562d05();
+fragment void fragment_main(device packed_float3* tint_symbol_4 [[buffer(0)]]) {
+  trunc_562d05(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_562d05();
+kernel void compute_main(device packed_float3* tint_symbol_5 [[buffer(0)]]) {
+  trunc_562d05(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.spvasm b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.spvasm
index 4985ca8..2c98176 100644
--- a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_562d05 "trunc_562d05"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
+%prevent_dce_block = OpTypeStruct %v3float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %15 = OpConstantComposite %v3float %float_1_5 %float_1_5 %float_1_5
+         %18 = OpConstantComposite %v3float %float_1_5 %float_1_5 %float_1_5
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %18 = OpConstantNull %v3float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v3float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_562d05 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v3float Function %18
-        %res = OpVariable %_ptr_Function_v3float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v3float %arg_0
-         %19 = OpExtInst %v3float %20 Trunc %21
-               OpStore %res %19
+%trunc_562d05 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v3float Function %21
+        %res = OpVariable %_ptr_Function_v3float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v3float %arg_0
+         %22 = OpExtInst %v3float %23 Trunc %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v3float %prevent_dce %uint_0
+         %30 = OpLoad %v3float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %trunc_562d05
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %trunc_562d05
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %trunc_562d05
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %trunc_562d05
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %trunc_562d05
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %trunc_562d05
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.wgsl b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.wgsl
index fce6311b..29d0760 100644
--- a/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/trunc/562d05.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn trunc_562d05() {
   var arg_0 = vec3<f32>(1.5f);
   var res : vec3<f32> = trunc(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_562d05();
diff --git a/test/tint/builtins/gen/var/trunc/7d6ded.wgsl b/test/tint/builtins/gen/var/trunc/7d6ded.wgsl
index ef22069..e65e886 100644
--- a/test/tint/builtins/gen/var/trunc/7d6ded.wgsl
+++ b/test/tint/builtins/gen/var/trunc/7d6ded.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = 1.5;
   var res = trunc(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_7d6ded();
diff --git a/test/tint/builtins/gen/var/trunc/a56109.wgsl b/test/tint/builtins/gen/var/trunc/a56109.wgsl
index b7604e3..9d5c986 100644
--- a/test/tint/builtins/gen/var/trunc/a56109.wgsl
+++ b/test/tint/builtins/gen/var/trunc/a56109.wgsl
@@ -27,7 +27,9 @@
 fn trunc_a56109() {
   var arg_0 = vec2<f16>(1.5h);
   var res: vec2<f16> = trunc(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.dxc.hlsl
index 64f93d2..82724f5 100644
--- a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_a56109() {
   vector<float16_t, 2> arg_0 = (float16_t(1.5h)).xx;
   vector<float16_t, 2> res = trunc(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.fxc.hlsl
index a14e067..ef6431e 100644
--- a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_a56109() {
   vector<float16_t, 2> arg_0 = (float16_t(1.5h)).xx;
   vector<float16_t, 2> res = trunc(arg_0);
+  prevent_dce.Store<vector<float16_t, 2> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.glsl b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.glsl
index 5e8431c..17fbf03 100644
--- a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void trunc_a56109() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void trunc_a56109() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec2 inner;
+} prevent_dce;
+
 void trunc_a56109() {
   f16vec2 arg_0 = f16vec2(1.5hf);
   f16vec2 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.msl b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.msl
index 0ee977d..5f105be 100644
--- a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_a56109() {
+void trunc_a56109(device half2* const tint_symbol_1) {
   half2 arg_0 = half2(1.5h);
   half2 res = trunc(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_a56109();
+float4 vertex_main_inner(device half2* const tint_symbol_2) {
+  trunc_a56109(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_a56109();
+fragment void fragment_main(device half2* tint_symbol_4 [[buffer(0)]]) {
+  trunc_a56109(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_a56109();
+kernel void compute_main(device half2* tint_symbol_5 [[buffer(0)]]) {
+  trunc_a56109(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.spvasm b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.spvasm
index c9553ad..c0b0263 100644
--- a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_a56109 "trunc_a56109"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
+%prevent_dce_block = OpTypeStruct %v2half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v2half %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v2half %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %19 = OpConstantNull %v2half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v2half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_a56109 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2half Function %19
-        %res = OpVariable %_ptr_Function_v2half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v2half %arg_0
-         %20 = OpExtInst %v2half %21 Trunc %22
-               OpStore %res %20
+%trunc_a56109 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2half Function %22
+        %res = OpVariable %_ptr_Function_v2half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v2half %arg_0
+         %23 = OpExtInst %v2half %24 Trunc %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2half %prevent_dce %uint_0
+         %31 = OpLoad %v2half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %trunc_a56109
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %trunc_a56109
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %trunc_a56109
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %trunc_a56109
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %trunc_a56109
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %trunc_a56109
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.wgsl b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.wgsl
index e22e108..566473a 100644
--- a/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/trunc/a56109.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn trunc_a56109() {
   var arg_0 = vec2<f16>(1.5h);
   var res : vec2<f16> = trunc(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_a56109();
diff --git a/test/tint/builtins/gen/var/trunc/c12555.wgsl b/test/tint/builtins/gen/var/trunc/c12555.wgsl
index 7091415..1d4a72b 100644
--- a/test/tint/builtins/gen/var/trunc/c12555.wgsl
+++ b/test/tint/builtins/gen/var/trunc/c12555.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec2(1.5);
   var res = trunc(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_c12555();
diff --git a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl
index 8af04dd..bd2a699 100644
--- a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl
+++ b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl
@@ -27,7 +27,9 @@
 fn trunc_cc2b0d() {
   var arg_0 = 1.5h;
   var res: f16 = trunc(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.dxc.hlsl
index 6c318d0..9b26482 100644
--- a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_cc2b0d() {
   float16_t arg_0 = float16_t(1.5h);
   float16_t res = trunc(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.fxc.hlsl
index 5f6bcb2..9d3687b 100644
--- a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_cc2b0d() {
   float16_t arg_0 = float16_t(1.5h);
   float16_t res = trunc(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.glsl b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.glsl
index fa17dcb..8f58f67 100644
--- a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void trunc_cc2b0d() {
   float16_t arg_0 = 1.5hf;
   float16_t res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void trunc_cc2b0d() {
   float16_t arg_0 = 1.5hf;
   float16_t res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void trunc_cc2b0d() {
   float16_t arg_0 = 1.5hf;
   float16_t res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.msl b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.msl
index 77638e3..a40af1f 100644
--- a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_cc2b0d() {
+void trunc_cc2b0d(device half* const tint_symbol_1) {
   half arg_0 = 1.5h;
   half res = trunc(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_cc2b0d();
+float4 vertex_main_inner(device half* const tint_symbol_2) {
+  trunc_cc2b0d(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_cc2b0d();
+fragment void fragment_main(device half* tint_symbol_4 [[buffer(0)]]) {
+  trunc_cc2b0d(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_cc2b0d();
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]]) {
+  trunc_cc2b0d(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.spvasm
index 9c8859b..4905c61 100644
--- a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_cc2b0d "trunc_cc2b0d"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,43 +41,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %17 = OpConstantNull %half
-         %22 = OpTypeFunction %v4float
+         %20 = OpConstantNull %half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_cc2b0d = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_half Function %17
-        %res = OpVariable %_ptr_Function_half Function %17
+%trunc_cc2b0d = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_half Function %20
+        %res = OpVariable %_ptr_Function_half Function %20
                OpStore %arg_0 %half_0x1_8p_0
-         %20 = OpLoad %half %arg_0
-         %18 = OpExtInst %half %19 Trunc %20
-               OpStore %res %18
+         %23 = OpLoad %half %arg_0
+         %21 = OpExtInst %half %22 Trunc %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
-         %24 = OpLabel
-         %25 = OpFunctionCall %void %trunc_cc2b0d
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %trunc_cc2b0d
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %27 = OpLabel
-         %28 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %28
+%vertex_main = OpFunction %void None %13
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %trunc_cc2b0d
+%fragment_main = OpFunction %void None %13
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %trunc_cc2b0d
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %trunc_cc2b0d
+%compute_main = OpFunction %void None %13
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %trunc_cc2b0d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.wgsl
index f943aa7..fdb9458 100644
--- a/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/trunc/cc2b0d.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn trunc_cc2b0d() {
   var arg_0 = 1.5h;
   var res : f16 = trunc(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_cc2b0d();
diff --git a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl
index 06955c3..cf470e8 100644
--- a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl
+++ b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl
@@ -27,7 +27,9 @@
 fn trunc_ce7c17() {
   var arg_0 = vec4<f16>(1.5h);
   var res: vec4<f16> = trunc(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.dxc.hlsl
index adfdbc2..9cda36f 100644
--- a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_ce7c17() {
   vector<float16_t, 4> arg_0 = (float16_t(1.5h)).xxxx;
   vector<float16_t, 4> res = trunc(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.fxc.hlsl
index b5a7379..98b431b 100644
--- a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.fxc.hlsl
@@ -1,8 +1,11 @@
 SKIP: FAILED
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_ce7c17() {
   vector<float16_t, 4> arg_0 = (float16_t(1.5h)).xxxx;
   vector<float16_t, 4> res = trunc(arg_0);
+  prevent_dce.Store<vector<float16_t, 4> >(0u, res);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.glsl b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.glsl
index f1fca58..f08e448 100644
--- a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.glsl
@@ -1,9 +1,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void trunc_ce7c17() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -23,9 +28,14 @@
 #extension GL_AMD_gpu_shader_half_float : require
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void trunc_ce7c17() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -39,9 +49,14 @@
 #version 310 es
 #extension GL_AMD_gpu_shader_half_float : require
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  f16vec4 inner;
+} prevent_dce;
+
 void trunc_ce7c17() {
   f16vec4 arg_0 = f16vec4(1.5hf);
   f16vec4 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.msl b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.msl
index b5e9d81..ddaaa1a 100644
--- a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_ce7c17() {
+void trunc_ce7c17(device half4* const tint_symbol_1) {
   half4 arg_0 = half4(1.5h);
   half4 res = trunc(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_ce7c17();
+float4 vertex_main_inner(device half4* const tint_symbol_2) {
+  trunc_ce7c17(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device half4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_ce7c17();
+fragment void fragment_main(device half4* tint_symbol_4 [[buffer(0)]]) {
+  trunc_ce7c17(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_ce7c17();
+kernel void compute_main(device half4* tint_symbol_5 [[buffer(0)]]) {
+  trunc_ce7c17(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.spvasm b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.spvasm
index f8e77e7..7c3399d 100644
--- a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.spvasm
@@ -1,14 +1,14 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 38
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %21 = OpExtInstImport "GLSL.std.450"
+         %24 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -17,6 +17,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_ce7c17 "trunc_ce7c17"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -26,6 +29,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -34,45 +41,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %14 = OpTypeFunction %void
 %half_0x1_8p_0 = OpConstant %half 0x1.8p+0
-         %16 = OpConstantComposite %v4half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
+         %19 = OpConstantComposite %v4half %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0 %half_0x1_8p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %19 = OpConstantNull %v4half
-         %24 = OpTypeFunction %v4float
+         %22 = OpConstantNull %v4half
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_ce7c17 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v4half Function %19
-        %res = OpVariable %_ptr_Function_v4half Function %19
-               OpStore %arg_0 %16
-         %22 = OpLoad %v4half %arg_0
-         %20 = OpExtInst %v4half %21 Trunc %22
-               OpStore %res %20
+%trunc_ce7c17 = OpFunction %void None %14
+         %17 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v4half Function %22
+        %res = OpVariable %_ptr_Function_v4half Function %22
+               OpStore %arg_0 %19
+         %25 = OpLoad %v4half %arg_0
+         %23 = OpExtInst %v4half %24 Trunc %25
+               OpStore %res %23
+         %30 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+         %31 = OpLoad %v4half %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
-         %26 = OpLabel
-         %27 = OpFunctionCall %void %trunc_ce7c17
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %trunc_ce7c17
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %30
+%vertex_main = OpFunction %void None %14
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %trunc_ce7c17
+%fragment_main = OpFunction %void None %14
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %trunc_ce7c17
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %36 = OpLabel
-         %37 = OpFunctionCall %void %trunc_ce7c17
+%compute_main = OpFunction %void None %14
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %trunc_ce7c17
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.wgsl b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.wgsl
index bdf34ff..d660918 100644
--- a/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/trunc/ce7c17.wgsl.expected.wgsl
@@ -3,8 +3,11 @@
 fn trunc_ce7c17() {
   var arg_0 = vec4<f16>(1.5h);
   var res : vec4<f16> = trunc(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f16>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_ce7c17();
diff --git a/test/tint/builtins/gen/var/trunc/e183aa.wgsl b/test/tint/builtins/gen/var/trunc/e183aa.wgsl
index b3cab10..3226bf1 100644
--- a/test/tint/builtins/gen/var/trunc/e183aa.wgsl
+++ b/test/tint/builtins/gen/var/trunc/e183aa.wgsl
@@ -25,7 +25,9 @@
 fn trunc_e183aa() {
   var arg_0 = vec4<f32>(1.5f);
   var res: vec4<f32> = trunc(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.dxc.hlsl
index 86604bd..4049c45 100644
--- a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_e183aa() {
   float4 arg_0 = (1.5f).xxxx;
   float4 res = trunc(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.fxc.hlsl
index 86604bd..4049c45 100644
--- a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_e183aa() {
   float4 arg_0 = (1.5f).xxxx;
   float4 res = trunc(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.glsl b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.glsl
index abed6a6..d757be0 100644
--- a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void trunc_e183aa() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void trunc_e183aa() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void trunc_e183aa() {
   vec4 arg_0 = vec4(1.5f);
   vec4 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.msl b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.msl
index 4e3992b..b8a38ff 100644
--- a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_e183aa() {
+void trunc_e183aa(device float4* const tint_symbol_1) {
   float4 arg_0 = float4(1.5f);
   float4 res = trunc(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_e183aa();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  trunc_e183aa(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_e183aa();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  trunc_e183aa(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_e183aa();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  trunc_e183aa(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.spvasm b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.spvasm
index bfc9dd8..0372759 100644
--- a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 35
+; Bound: 43
 ; Schema: 0
                OpCapability Shader
-         %18 = OpExtInstImport "GLSL.std.450"
+         %21 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_e183aa "trunc_e183aa"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,42 +37,51 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %14 = OpConstantComposite %v4float %float_1_5 %float_1_5 %float_1_5 %float_1_5
+         %17 = OpConstantComposite %v4float %float_1_5 %float_1_5 %float_1_5 %float_1_5
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %21 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %29 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_e183aa = OpFunction %void None %9
-         %12 = OpLabel
+%trunc_e183aa = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
         %res = OpVariable %_ptr_Function_v4float Function %5
-               OpStore %arg_0 %14
-         %19 = OpLoad %v4float %arg_0
-         %17 = OpExtInst %v4float %18 Trunc %19
-               OpStore %res %17
+               OpStore %arg_0 %17
+         %22 = OpLoad %v4float %arg_0
+         %20 = OpExtInst %v4float %21 Trunc %22
+               OpStore %res %20
+         %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %28 = OpLoad %v4float %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
-         %23 = OpLabel
-         %24 = OpFunctionCall %void %trunc_e183aa
+%vertex_main_inner = OpFunction %v4float None %29
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %trunc_e183aa
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %26 = OpLabel
-         %27 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %27
+%vertex_main = OpFunction %void None %12
+         %34 = OpLabel
+         %35 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %35
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %trunc_e183aa
+%fragment_main = OpFunction %void None %12
+         %38 = OpLabel
+         %39 = OpFunctionCall %void %trunc_e183aa
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %33 = OpLabel
-         %34 = OpFunctionCall %void %trunc_e183aa
+%compute_main = OpFunction %void None %12
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %trunc_e183aa
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.wgsl b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.wgsl
index 3aba18f..b504993 100644
--- a/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/trunc/e183aa.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn trunc_e183aa() {
   var arg_0 = vec4<f32>(1.5f);
   var res : vec4<f32> = trunc(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_e183aa();
diff --git a/test/tint/builtins/gen/var/trunc/eb83df.wgsl b/test/tint/builtins/gen/var/trunc/eb83df.wgsl
index 5ea7bcd..4697b65 100644
--- a/test/tint/builtins/gen/var/trunc/eb83df.wgsl
+++ b/test/tint/builtins/gen/var/trunc/eb83df.wgsl
@@ -25,7 +25,9 @@
 fn trunc_eb83df() {
   var arg_0 = 1.5f;
   var res: f32 = trunc(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.dxc.hlsl
index 1056d4f..39e592a 100644
--- a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_eb83df() {
   float arg_0 = 1.5f;
   float res = trunc(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.fxc.hlsl
index 1056d4f..39e592a 100644
--- a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_eb83df() {
   float arg_0 = 1.5f;
   float res = trunc(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.glsl b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.glsl
index 2baaf2d..90f8f4f 100644
--- a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void trunc_eb83df() {
   float arg_0 = 1.5f;
   float res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void trunc_eb83df() {
   float arg_0 = 1.5f;
   float res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void trunc_eb83df() {
   float arg_0 = 1.5f;
   float res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.msl b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.msl
index 1f4dab6..962a4c9 100644
--- a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_eb83df() {
+void trunc_eb83df(device float* const tint_symbol_1) {
   float arg_0 = 1.5f;
   float res = trunc(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_eb83df();
+float4 vertex_main_inner(device float* const tint_symbol_2) {
+  trunc_eb83df(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_eb83df();
+fragment void fragment_main(device float* tint_symbol_4 [[buffer(0)]]) {
+  trunc_eb83df(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_eb83df();
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]]) {
+  trunc_eb83df(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.spvasm b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.spvasm
index 15a7d6d..a36f7d8 100644
--- a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
 ; Schema: 0
                OpCapability Shader
-         %17 = OpExtInstImport "GLSL.std.450"
+         %20 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_eb83df "trunc_eb83df"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,41 +37,50 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
 %_ptr_Function_float = OpTypePointer Function %float
-         %20 = OpTypeFunction %v4float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %28 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_eb83df = OpFunction %void None %9
-         %12 = OpLabel
+%trunc_eb83df = OpFunction %void None %12
+         %15 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
                OpStore %arg_0 %float_1_5
-         %18 = OpLoad %float %arg_0
-         %16 = OpExtInst %float %17 Trunc %18
-               OpStore %res %16
+         %21 = OpLoad %float %arg_0
+         %19 = OpExtInst %float %20 Trunc %21
+               OpStore %res %19
+         %26 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %27 = OpLoad %float %res
+               OpStore %26 %27
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %trunc_eb83df
+%vertex_main_inner = OpFunction %v4float None %28
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %trunc_eb83df
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %25 = OpLabel
-         %26 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %26
+%vertex_main = OpFunction %void None %12
+         %33 = OpLabel
+         %34 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %34
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %trunc_eb83df
+%fragment_main = OpFunction %void None %12
+         %37 = OpLabel
+         %38 = OpFunctionCall %void %trunc_eb83df
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %trunc_eb83df
+%compute_main = OpFunction %void None %12
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %trunc_eb83df
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.wgsl b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.wgsl
index 6cb3f54..0fe8d6e 100644
--- a/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/trunc/eb83df.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn trunc_eb83df() {
   var arg_0 = 1.5f;
   var res : f32 = trunc(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_eb83df();
diff --git a/test/tint/builtins/gen/var/trunc/f0f1a1.wgsl b/test/tint/builtins/gen/var/trunc/f0f1a1.wgsl
index 720789c..35d0eae 100644
--- a/test/tint/builtins/gen/var/trunc/f0f1a1.wgsl
+++ b/test/tint/builtins/gen/var/trunc/f0f1a1.wgsl
@@ -26,7 +26,6 @@
   const arg_0 = vec4(1.5);
   var res = trunc(arg_0);
 }
-
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_f0f1a1();
diff --git a/test/tint/builtins/gen/var/trunc/f370d3.wgsl b/test/tint/builtins/gen/var/trunc/f370d3.wgsl
index 843d598..b1e9c43 100644
--- a/test/tint/builtins/gen/var/trunc/f370d3.wgsl
+++ b/test/tint/builtins/gen/var/trunc/f370d3.wgsl
@@ -25,7 +25,9 @@
 fn trunc_f370d3() {
   var arg_0 = vec2<f32>(1.5f);
   var res: vec2<f32> = trunc(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.dxc.hlsl
index 4763fd8..6077e4d 100644
--- a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.dxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_f370d3() {
   float2 arg_0 = (1.5f).xx;
   float2 res = trunc(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.fxc.hlsl
index 4763fd8..6077e4d 100644
--- a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.fxc.hlsl
@@ -1,6 +1,9 @@
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void trunc_f370d3() {
   float2 arg_0 = (1.5f).xx;
   float2 res = trunc(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.glsl b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.glsl
index 9ab35b5..aeb534a 100644
--- a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void trunc_f370d3() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void trunc_f370d3() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void trunc_f370d3() {
   vec2 arg_0 = vec2(1.5f);
   vec2 res = trunc(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.msl b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.msl
index 074922c..12b8bd5 100644
--- a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void trunc_f370d3() {
+void trunc_f370d3(device float2* const tint_symbol_1) {
   float2 arg_0 = float2(1.5f);
   float2 res = trunc(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  trunc_f370d3();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  trunc_f370d3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  trunc_f370d3();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  trunc_f370d3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  trunc_f370d3();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  trunc_f370d3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.spvasm
index 917f79e..7674740 100644
--- a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 45
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %trunc_f370d3 "trunc_f370d3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,53 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
-       %void = OpTypeVoid
-          %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+       %void = OpTypeVoid
+         %13 = OpTypeFunction %void
   %float_1_5 = OpConstant %float 1.5
-         %15 = OpConstantComposite %v2float %float_1_5 %float_1_5
+         %18 = OpConstantComposite %v2float %float_1_5 %float_1_5
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %18 = OpConstantNull %v2float
-         %23 = OpTypeFunction %v4float
+         %21 = OpConstantNull %v2float
+       %uint = OpTypeInt 32 0
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %31 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%trunc_f370d3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_v2float Function %18
-        %res = OpVariable %_ptr_Function_v2float Function %18
-               OpStore %arg_0 %15
-         %21 = OpLoad %v2float %arg_0
-         %19 = OpExtInst %v2float %20 Trunc %21
-               OpStore %res %19
+%trunc_f370d3 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_v2float Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %21
+               OpStore %arg_0 %18
+         %24 = OpLoad %v2float %arg_0
+         %22 = OpExtInst %v2float %23 Trunc %24
+               OpStore %res %22
+         %29 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %30 = OpLoad %v2float %res
+               OpStore %29 %30
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %trunc_f370d3
+%vertex_main_inner = OpFunction %v4float None %31
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %trunc_f370d3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %13
+         %36 = OpLabel
+         %37 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %37
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %trunc_f370d3
+%fragment_main = OpFunction %void None %13
+         %40 = OpLabel
+         %41 = OpFunctionCall %void %trunc_f370d3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %trunc_f370d3
+%compute_main = OpFunction %void None %13
+         %43 = OpLabel
+         %44 = OpFunctionCall %void %trunc_f370d3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.wgsl
index 5fe9aac..fe77993 100644
--- a/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/trunc/f370d3.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn trunc_f370d3() {
   var arg_0 = vec2<f32>(1.5f);
   var res : vec2<f32> = trunc(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   trunc_f370d3();
diff --git a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl
index da1e21b..a9f7c67 100644
--- a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl
+++ b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl
@@ -25,7 +25,9 @@
 fn unpack2x16float_32a5cf() {
   var arg_0 = 1u;
   var res: vec2<f32> = unpack2x16float(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.dxc.hlsl
index 1497db8..7c73c66 100644
--- a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.dxc.hlsl
@@ -3,9 +3,12 @@
   return f16tof32(uint2(i & 0xffff, i >> 16));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16float_32a5cf() {
   uint arg_0 = 1u;
   float2 res = tint_unpack2x16float(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.fxc.hlsl
index 1497db8..7c73c66 100644
--- a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.fxc.hlsl
@@ -3,9 +3,12 @@
   return f16tof32(uint2(i & 0xffff, i >> 16));
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16float_32a5cf() {
   uint arg_0 = 1u;
   float2 res = tint_unpack2x16float(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.glsl
index e88f3bc..5c91ce1 100644
--- a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16float_32a5cf() {
   uint arg_0 = 1u;
   vec2 res = unpackHalf2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16float_32a5cf() {
   uint arg_0 = 1u;
   vec2 res = unpackHalf2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16float_32a5cf() {
   uint arg_0 = 1u;
   vec2 res = unpackHalf2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.msl b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.msl
index 9bd1c57..adef61a 100644
--- a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack2x16float_32a5cf() {
+void unpack2x16float_32a5cf(device float2* const tint_symbol_1) {
   uint arg_0 = 1u;
   float2 res = float2(as_type<half2>(arg_0));
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack2x16float_32a5cf();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  unpack2x16float_32a5cf(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack2x16float_32a5cf();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  unpack2x16float_32a5cf(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack2x16float_32a5cf();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  unpack2x16float_32a5cf(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.spvasm
index 1abc4ab..0ddd87b 100644
--- a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack2x16float_32a5cf "unpack2x16float_32a5cf"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,46 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+    %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-    %v2float = OpTypeVector %float 2
+         %21 = OpConstantNull %uint
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack2x16float_32a5cf = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_v2float Function %24
+%unpack2x16float_32a5cf = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %27
                OpStore %arg_0 %uint_1
-         %21 = OpLoad %uint %arg_0
-         %18 = OpExtInst %v2float %20 UnpackHalf2x16 %21
-               OpStore %res %18
+         %24 = OpLoad %uint %arg_0
+         %22 = OpExtInst %v2float %23 UnpackHalf2x16 %24
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %31 = OpLoad %v2float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %unpack2x16float_32a5cf
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %unpack2x16float_32a5cf
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %unpack2x16float_32a5cf
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %unpack2x16float_32a5cf
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %unpack2x16float_32a5cf
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %unpack2x16float_32a5cf
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.wgsl
index 98598a4..e083d98 100644
--- a/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/unpack2x16float/32a5cf.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn unpack2x16float_32a5cf() {
   var arg_0 = 1u;
   var res : vec2<f32> = unpack2x16float(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack2x16float_32a5cf();
diff --git a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl
index d25b7d7..b92dffc 100644
--- a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl
+++ b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl
@@ -25,7 +25,9 @@
 fn unpack2x16snorm_b4aea6() {
   var arg_0 = 1u;
   var res: vec2<f32> = unpack2x16snorm(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.dxc.hlsl
index ab650e8..0a5aaa4 100644
--- a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.dxc.hlsl
@@ -4,9 +4,12 @@
   return clamp(float2(i) / 32767.0, -1.0, 1.0);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16snorm_b4aea6() {
   uint arg_0 = 1u;
   float2 res = tint_unpack2x16snorm(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.fxc.hlsl
index ab650e8..0a5aaa4 100644
--- a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return clamp(float2(i) / 32767.0, -1.0, 1.0);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16snorm_b4aea6() {
   uint arg_0 = 1u;
   float2 res = tint_unpack2x16snorm(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.glsl b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.glsl
index bb3b180..70df608 100644
--- a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16snorm_b4aea6() {
   uint arg_0 = 1u;
   vec2 res = unpackSnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16snorm_b4aea6() {
   uint arg_0 = 1u;
   vec2 res = unpackSnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16snorm_b4aea6() {
   uint arg_0 = 1u;
   vec2 res = unpackSnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.msl b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.msl
index f3290ba..c95fcf2 100644
--- a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack2x16snorm_b4aea6() {
+void unpack2x16snorm_b4aea6(device float2* const tint_symbol_1) {
   uint arg_0 = 1u;
   float2 res = unpack_snorm2x16_to_float(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack2x16snorm_b4aea6();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  unpack2x16snorm_b4aea6(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack2x16snorm_b4aea6();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  unpack2x16snorm_b4aea6(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack2x16snorm_b4aea6();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  unpack2x16snorm_b4aea6(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
index 9f93655..a4d151a 100644
--- a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack2x16snorm_b4aea6 "unpack2x16snorm_b4aea6"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,46 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+    %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-    %v2float = OpTypeVector %float 2
+         %21 = OpConstantNull %uint
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack2x16snorm_b4aea6 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_v2float Function %24
+%unpack2x16snorm_b4aea6 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %27
                OpStore %arg_0 %uint_1
-         %21 = OpLoad %uint %arg_0
-         %18 = OpExtInst %v2float %20 UnpackSnorm2x16 %21
-               OpStore %res %18
+         %24 = OpLoad %uint %arg_0
+         %22 = OpExtInst %v2float %23 UnpackSnorm2x16 %24
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %31 = OpLoad %v2float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %unpack2x16snorm_b4aea6
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %unpack2x16snorm_b4aea6
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %unpack2x16snorm_b4aea6
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
index fbff51d..60b9abc 100644
--- a/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn unpack2x16snorm_b4aea6() {
   var arg_0 = 1u;
   var res : vec2<f32> = unpack2x16snorm(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack2x16snorm_b4aea6();
diff --git a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl
index 7ada0e6..2d8b8be 100644
--- a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl
+++ b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl
@@ -25,7 +25,9 @@
 fn unpack2x16unorm_7699c0() {
   var arg_0 = 1u;
   var res: vec2<f32> = unpack2x16unorm(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.dxc.hlsl
index acf38ca..4bbc3f6 100644
--- a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.dxc.hlsl
@@ -4,9 +4,12 @@
   return float2(i) / 65535.0;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16unorm_7699c0() {
   uint arg_0 = 1u;
   float2 res = tint_unpack2x16unorm(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.fxc.hlsl
index acf38ca..4bbc3f6 100644
--- a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return float2(i) / 65535.0;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack2x16unorm_7699c0() {
   uint arg_0 = 1u;
   float2 res = tint_unpack2x16unorm(arg_0);
+  prevent_dce.Store2(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.glsl b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.glsl
index 500c304..c2f5267 100644
--- a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16unorm_7699c0() {
   uint arg_0 = 1u;
   vec2 res = unpackUnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16unorm_7699c0() {
   uint arg_0 = 1u;
   vec2 res = unpackUnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec2 inner;
+} prevent_dce;
+
 void unpack2x16unorm_7699c0() {
   uint arg_0 = 1u;
   vec2 res = unpackUnorm2x16(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.msl b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.msl
index 9c935ce..d7da5d6 100644
--- a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack2x16unorm_7699c0() {
+void unpack2x16unorm_7699c0(device float2* const tint_symbol_1) {
   uint arg_0 = 1u;
   float2 res = unpack_unorm2x16_to_float(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack2x16unorm_7699c0();
+float4 vertex_main_inner(device float2* const tint_symbol_2) {
+  unpack2x16unorm_7699c0(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float2* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack2x16unorm_7699c0();
+fragment void fragment_main(device float2* tint_symbol_4 [[buffer(0)]]) {
+  unpack2x16unorm_7699c0(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack2x16unorm_7699c0();
+kernel void compute_main(device float2* tint_symbol_5 [[buffer(0)]]) {
+  unpack2x16unorm_7699c0(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.spvasm
index d73b447..528fe76 100644
--- a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
 ; Schema: 0
                OpCapability Shader
-         %20 = OpExtInstImport "GLSL.std.450"
+         %23 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack2x16unorm_7699c0 "unpack2x16unorm_7699c0"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,46 +37,54 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+    %v2float = OpTypeVector %float 2
+%prevent_dce_block = OpTypeStruct %v2float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %13 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
-    %v2float = OpTypeVector %float 2
+         %21 = OpConstantNull %uint
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %24 = OpConstantNull %v2float
-         %25 = OpTypeFunction %v4float
+         %27 = OpConstantNull %v2float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+         %32 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack2x16unorm_7699c0 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
-        %res = OpVariable %_ptr_Function_v2float Function %24
+%unpack2x16unorm_7699c0 = OpFunction %void None %13
+         %16 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %21
+        %res = OpVariable %_ptr_Function_v2float Function %27
                OpStore %arg_0 %uint_1
-         %21 = OpLoad %uint %arg_0
-         %18 = OpExtInst %v2float %20 UnpackUnorm2x16 %21
-               OpStore %res %18
+         %24 = OpLoad %uint %arg_0
+         %22 = OpExtInst %v2float %23 UnpackUnorm2x16 %24
+               OpStore %res %22
+         %30 = OpAccessChain %_ptr_StorageBuffer_v2float %prevent_dce %uint_0
+         %31 = OpLoad %v2float %res
+               OpStore %30 %31
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
-         %27 = OpLabel
-         %28 = OpFunctionCall %void %unpack2x16unorm_7699c0
+%vertex_main_inner = OpFunction %v4float None %32
+         %34 = OpLabel
+         %35 = OpFunctionCall %void %unpack2x16unorm_7699c0
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %31
+%vertex_main = OpFunction %void None %13
+         %37 = OpLabel
+         %38 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %38
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %unpack2x16unorm_7699c0
+%fragment_main = OpFunction %void None %13
+         %41 = OpLabel
+         %42 = OpFunctionCall %void %unpack2x16unorm_7699c0
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %37 = OpLabel
-         %38 = OpFunctionCall %void %unpack2x16unorm_7699c0
+%compute_main = OpFunction %void None %13
+         %44 = OpLabel
+         %45 = OpFunctionCall %void %unpack2x16unorm_7699c0
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.wgsl
index 893e4db..1a8d52f 100644
--- a/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/unpack2x16unorm/7699c0.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn unpack2x16unorm_7699c0() {
   var arg_0 = 1u;
   var res : vec2<f32> = unpack2x16unorm(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack2x16unorm_7699c0();
diff --git a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl
index 4375d6b..27399d8 100644
--- a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl
+++ b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl
@@ -25,7 +25,9 @@
 fn unpack4x8snorm_523fb3() {
   var arg_0 = 1u;
   var res: vec4<f32> = unpack4x8snorm(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.dxc.hlsl
index b7cc730..5606bc4 100644
--- a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.dxc.hlsl
@@ -4,9 +4,12 @@
   return clamp(float4(i) / 127.0, -1.0, 1.0);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack4x8snorm_523fb3() {
   uint arg_0 = 1u;
   float4 res = tint_unpack4x8snorm(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.fxc.hlsl
index b7cc730..5606bc4 100644
--- a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return clamp(float4(i) / 127.0, -1.0, 1.0);
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack4x8snorm_523fb3() {
   uint arg_0 = 1u;
   float4 res = tint_unpack4x8snorm(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.glsl b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.glsl
index 2f7c01b..2aa00e3 100644
--- a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8snorm_523fb3() {
   uint arg_0 = 1u;
   vec4 res = unpackSnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8snorm_523fb3() {
   uint arg_0 = 1u;
   vec4 res = unpackSnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8snorm_523fb3() {
   uint arg_0 = 1u;
   vec4 res = unpackSnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.msl b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.msl
index 364d8ea..88ecad2 100644
--- a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack4x8snorm_523fb3() {
+void unpack4x8snorm_523fb3(device float4* const tint_symbol_1) {
   uint arg_0 = 1u;
   float4 res = unpack_snorm4x8_to_float(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack4x8snorm_523fb3();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  unpack4x8snorm_523fb3(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack4x8snorm_523fb3();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  unpack4x8snorm_523fb3(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack4x8snorm_523fb3();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  unpack4x8snorm_523fb3(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.spvasm
index 3ce5456..13f3636 100644
--- a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack4x8snorm_523fb3 "unpack4x8snorm_523fb3"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
+         %20 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack4x8snorm_523fb3 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
+%unpack4x8snorm_523fb3 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %arg_0 %uint_1
-         %20 = OpLoad %uint %arg_0
-         %18 = OpExtInst %v4float %19 UnpackSnorm4x8 %20
-               OpStore %res %18
+         %23 = OpLoad %uint %arg_0
+         %21 = OpExtInst %v4float %22 UnpackSnorm4x8 %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %29 = OpLoad %v4float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %unpack4x8snorm_523fb3
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %unpack4x8snorm_523fb3
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %unpack4x8snorm_523fb3
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %unpack4x8snorm_523fb3
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %unpack4x8snorm_523fb3
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %unpack4x8snorm_523fb3
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.wgsl
index 14ff067..c4f8a2a 100644
--- a/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/unpack4x8snorm/523fb3.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn unpack4x8snorm_523fb3() {
   var arg_0 = 1u;
   var res : vec4<f32> = unpack4x8snorm(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack4x8snorm_523fb3();
diff --git a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl
index bd30aa0..3cb8297 100644
--- a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl
+++ b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl
@@ -25,7 +25,9 @@
 fn unpack4x8unorm_750c74() {
   var arg_0 = 1u;
   var res: vec4<f32> = unpack4x8unorm(arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
 
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
diff --git a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.dxc.hlsl
index 8cbb853..ecdea37 100644
--- a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.dxc.hlsl
@@ -4,9 +4,12 @@
   return float4(i) / 255.0;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack4x8unorm_750c74() {
   uint arg_0 = 1u;
   float4 res = tint_unpack4x8unorm(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.fxc.hlsl
index 8cbb853..ecdea37 100644
--- a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.fxc.hlsl
@@ -4,9 +4,12 @@
   return float4(i) / 255.0;
 }
 
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void unpack4x8unorm_750c74() {
   uint arg_0 = 1u;
   float4 res = tint_unpack4x8unorm(arg_0);
+  prevent_dce.Store4(0u, asuint(res));
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.glsl b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.glsl
index b7d4334..fb10edd 100644
--- a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.glsl
@@ -1,8 +1,13 @@
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8unorm_750c74() {
   uint arg_0 = 1u;
   vec4 res = unpackUnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 vec4 vertex_main() {
@@ -21,9 +26,14 @@
 #version 310 es
 precision mediump float;
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8unorm_750c74() {
   uint arg_0 = 1u;
   vec4 res = unpackUnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 void fragment_main() {
@@ -36,9 +46,14 @@
 }
 #version 310 es
 
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  vec4 inner;
+} prevent_dce;
+
 void unpack4x8unorm_750c74() {
   uint arg_0 = 1u;
   vec4 res = unpackUnorm4x8(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.msl b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.msl
index a1bf4ae..5ea5e7c 100644
--- a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.msl
@@ -1,34 +1,35 @@
 #include <metal_stdlib>
 
 using namespace metal;
-void unpack4x8unorm_750c74() {
+void unpack4x8unorm_750c74(device float4* const tint_symbol_1) {
   uint arg_0 = 1u;
   float4 res = unpack_unorm4x8_to_float(arg_0);
+  *(tint_symbol_1) = res;
 }
 
 struct tint_symbol {
   float4 value [[position]];
 };
 
-float4 vertex_main_inner() {
-  unpack4x8unorm_750c74();
+float4 vertex_main_inner(device float4* const tint_symbol_2) {
+  unpack4x8unorm_750c74(tint_symbol_2);
   return float4(0.0f);
 }
 
-vertex tint_symbol vertex_main() {
-  float4 const inner_result = vertex_main_inner();
+vertex tint_symbol vertex_main(device float4* tint_symbol_3 [[buffer(0)]]) {
+  float4 const inner_result = vertex_main_inner(tint_symbol_3);
   tint_symbol wrapper_result = {};
   wrapper_result.value = inner_result;
   return wrapper_result;
 }
 
-fragment void fragment_main() {
-  unpack4x8unorm_750c74();
+fragment void fragment_main(device float4* tint_symbol_4 [[buffer(0)]]) {
+  unpack4x8unorm_750c74(tint_symbol_4);
   return;
 }
 
-kernel void compute_main() {
-  unpack4x8unorm_750c74();
+kernel void compute_main(device float4* tint_symbol_5 [[buffer(0)]]) {
+  unpack4x8unorm_750c74(tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.spvasm
index 962a06f..1384e94 100644
--- a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.spvasm
@@ -1,10 +1,10 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
 ; Schema: 0
                OpCapability Shader
-         %19 = OpExtInstImport "GLSL.std.450"
+         %22 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %value "value"
                OpName %vertex_point_size "vertex_point_size"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %unpack4x8unorm_750c74 "unpack4x8unorm_750c74"
                OpName %arg_0 "arg_0"
                OpName %res "res"
@@ -22,6 +25,10 @@
                OpName %compute_main "compute_main"
                OpDecorate %value BuiltIn Position
                OpDecorate %vertex_point_size BuiltIn PointSize
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
       %float = OpTypeFloat 32
     %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -30,44 +37,52 @@
 %_ptr_Output_float = OpTypePointer Output %float
           %8 = OpConstantNull %float
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
        %void = OpTypeVoid
-          %9 = OpTypeFunction %void
+         %12 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
      %uint_1 = OpConstant %uint 1
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %17 = OpConstantNull %uint
+         %20 = OpConstantNull %uint
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %23 = OpTypeFunction %v4float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+         %30 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
-%unpack4x8unorm_750c74 = OpFunction %void None %9
-         %12 = OpLabel
-      %arg_0 = OpVariable %_ptr_Function_uint Function %17
+%unpack4x8unorm_750c74 = OpFunction %void None %12
+         %15 = OpLabel
+      %arg_0 = OpVariable %_ptr_Function_uint Function %20
         %res = OpVariable %_ptr_Function_v4float Function %5
                OpStore %arg_0 %uint_1
-         %20 = OpLoad %uint %arg_0
-         %18 = OpExtInst %v4float %19 UnpackUnorm4x8 %20
-               OpStore %res %18
+         %23 = OpLoad %uint %arg_0
+         %21 = OpExtInst %v4float %22 UnpackUnorm4x8 %23
+               OpStore %res %21
+         %28 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+         %29 = OpLoad %v4float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
-         %25 = OpLabel
-         %26 = OpFunctionCall %void %unpack4x8unorm_750c74
+%vertex_main_inner = OpFunction %v4float None %30
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %unpack4x8unorm_750c74
                OpReturnValue %5
                OpFunctionEnd
-%vertex_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %v4float %vertex_main_inner
-               OpStore %value %29
+%vertex_main = OpFunction %void None %12
+         %35 = OpLabel
+         %36 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %36
                OpStore %vertex_point_size %float_1
                OpReturn
                OpFunctionEnd
-%fragment_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %unpack4x8unorm_750c74
+%fragment_main = OpFunction %void None %12
+         %39 = OpLabel
+         %40 = OpFunctionCall %void %unpack4x8unorm_750c74
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %9
-         %35 = OpLabel
-         %36 = OpFunctionCall %void %unpack4x8unorm_750c74
+%compute_main = OpFunction %void None %12
+         %42 = OpLabel
+         %43 = OpFunctionCall %void %unpack4x8unorm_750c74
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.wgsl
index 70c7980..eeb0ce5 100644
--- a/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/unpack4x8unorm/750c74.wgsl.expected.wgsl
@@ -1,8 +1,11 @@
 fn unpack4x8unorm_750c74() {
   var arg_0 = 1u;
   var res : vec4<f32> = unpack4x8unorm(arg_0);
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
 @vertex
 fn vertex_main() -> @builtin(position) vec4<f32> {
   unpack4x8unorm_750c74();
diff --git a/test/tint/builtins/gen/var/workgroupBarrier/a17f7f.wgsl b/test/tint/builtins/gen/var/workgroupBarrier/a17f7f.wgsl
index e493337..8dca1bd 100644
--- a/test/tint/builtins/gen/var/workgroupBarrier/a17f7f.wgsl
+++ b/test/tint/builtins/gen/var/workgroupBarrier/a17f7f.wgsl
@@ -25,7 +25,6 @@
 fn workgroupBarrier_a17f7f() {
   workgroupBarrier();
 }
-
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupBarrier_a17f7f();
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl
index ff17877..2700b1f 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl
@@ -25,7 +25,9 @@
 // fn workgroupUniformLoad(ptr<workgroup, u32, read_write>) -> u32
 fn workgroupUniformLoad_37307c() {
   var res: u32 = workgroupUniformLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
index 9324574..7db1f5c 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.dxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_37307c() {
   uint res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
index 9324574..7db1f5c 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.fxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared uint arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_37307c() {
   uint res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.glsl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.glsl
index 061ebab..08650d7 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.glsl
@@ -8,8 +8,13 @@
 }
 
 shared uint arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  uint inner;
+} prevent_dce;
+
 void workgroupUniformLoad_37307c() {
   uint res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.msl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.msl
index 3553390..8f560f8 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.msl
@@ -8,21 +8,22 @@
   return result;
 }
 
-void workgroupUniformLoad_37307c(threadgroup uint* const tint_symbol) {
+void workgroupUniformLoad_37307c(threadgroup uint* const tint_symbol, device uint* const tint_symbol_1) {
   uint res = tint_workgroupUniformLoad(tint_symbol);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup uint* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup uint* const tint_symbol_2, device uint* const tint_symbol_3) {
   {
-    *(tint_symbol_1) = 0u;
+    *(tint_symbol_2) = 0u;
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  workgroupUniformLoad_37307c(tint_symbol_1);
+  workgroupUniformLoad_37307c(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup uint tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device uint* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup uint tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.spvasm
index b3755dc..c898890 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_workgroupUniformLoad_arg_0 "tint_workgroupUniformLoad_arg_0"
                OpName %workgroupUniformLoad_37307c "workgroupUniformLoad_37307c"
                OpName %res "res"
@@ -16,44 +19,56 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
       %arg_0 = OpVariable %_ptr_Workgroup_uint Workgroup
-          %6 = OpTypeFunction %uint
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+          %9 = OpTypeFunction %uint
        %void = OpTypeVoid
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
-         %15 = OpTypeFunction %void
+         %18 = OpTypeFunction %void
 %_ptr_Function_uint = OpTypePointer Function %uint
-         %21 = OpConstantNull %uint
-         %22 = OpTypeFunction %void %uint
-%tint_workgroupUniformLoad_arg_0 = OpFunction %uint None %6
-          %8 = OpLabel
+         %24 = OpConstantNull %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+         %29 = OpTypeFunction %void %uint
+%tint_workgroupUniformLoad_arg_0 = OpFunction %uint None %9
+         %11 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %13 = OpLoad %uint %arg_0
+         %16 = OpLoad %uint %arg_0
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpReturnValue %13
+               OpReturnValue %16
                OpFunctionEnd
-%workgroupUniformLoad_37307c = OpFunction %void None %15
-         %17 = OpLabel
-        %res = OpVariable %_ptr_Function_uint Function %21
-         %18 = OpFunctionCall %uint %tint_workgroupUniformLoad_arg_0
-               OpStore %res %18
+%workgroupUniformLoad_37307c = OpFunction %void None %18
+         %20 = OpLabel
+        %res = OpVariable %_ptr_Function_uint Function %24
+         %21 = OpFunctionCall %uint %tint_workgroupUniformLoad_arg_0
+               OpStore %res %21
+         %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+         %28 = OpLoad %uint %res
+               OpStore %27 %28
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %22
+%compute_main_inner = OpFunction %void None %29
 %local_invocation_index = OpFunctionParameter %uint
-         %25 = OpLabel
-               OpStore %arg_0 %21
+         %32 = OpLabel
+               OpStore %arg_0 %24
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %27 = OpFunctionCall %void %workgroupUniformLoad_37307c
+         %34 = OpFunctionCall %void %workgroupUniformLoad_37307c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %15
-         %29 = OpLabel
-         %31 = OpLoad %uint %local_invocation_index_1
-         %30 = OpFunctionCall %void %compute_main_inner %31
+%compute_main = OpFunction %void None %18
+         %36 = OpLabel
+         %38 = OpLoad %uint %local_invocation_index_1
+         %37 = OpFunctionCall %void %compute_main_inner %38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.wgsl
index f4d48fa..ce426be 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn workgroupUniformLoad_37307c() {
   var res : u32 = workgroupUniformLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupUniformLoad_37307c();
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl
index c5cf95e..f571cec 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl
@@ -25,7 +25,9 @@
 // fn workgroupUniformLoad(ptr<workgroup, f32, read_write>) -> f32
 fn workgroupUniformLoad_7a857c() {
   var res: f32 = workgroupUniformLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
index 0bd3512..31bcd63 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.dxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared float arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_7a857c() {
   float res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
index 0bd3512..31bcd63 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.fxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared float arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_7a857c() {
   float res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.glsl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.glsl
index dcde824..b0d7db3 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.glsl
@@ -8,8 +8,13 @@
 }
 
 shared float arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float inner;
+} prevent_dce;
+
 void workgroupUniformLoad_7a857c() {
   float res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.msl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.msl
index 7637172..d207300 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.msl
@@ -8,21 +8,22 @@
   return result;
 }
 
-void workgroupUniformLoad_7a857c(threadgroup float* const tint_symbol) {
+void workgroupUniformLoad_7a857c(threadgroup float* const tint_symbol, device float* const tint_symbol_1) {
   float res = tint_workgroupUniformLoad(tint_symbol);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup float* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup float* const tint_symbol_2, device float* const tint_symbol_3) {
   {
-    *(tint_symbol_1) = 0.0f;
+    *(tint_symbol_2) = 0.0f;
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  workgroupUniformLoad_7a857c(tint_symbol_1);
+  workgroupUniformLoad_7a857c(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup float tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device float* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup float tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
index abd0f6a..27b66d3 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_workgroupUniformLoad_arg_0 "tint_workgroupUniformLoad_arg_0"
                OpName %workgroupUniformLoad_7a857c "workgroupUniformLoad_7a857c"
                OpName %res "res"
@@ -16,45 +19,57 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
       %float = OpTypeFloat 32
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
       %arg_0 = OpVariable %_ptr_Workgroup_float Workgroup
-          %7 = OpTypeFunction %float
+%prevent_dce_block = OpTypeStruct %float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %10 = OpTypeFunction %float
        %void = OpTypeVoid
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
-         %16 = OpTypeFunction %void
+         %19 = OpTypeFunction %void
 %_ptr_Function_float = OpTypePointer Function %float
-         %22 = OpConstantNull %float
-         %23 = OpTypeFunction %void %uint
-%tint_workgroupUniformLoad_arg_0 = OpFunction %float None %7
-          %9 = OpLabel
+         %25 = OpConstantNull %float
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+         %30 = OpTypeFunction %void %uint
+%tint_workgroupUniformLoad_arg_0 = OpFunction %float None %10
+         %12 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %14 = OpLoad %float %arg_0
+         %17 = OpLoad %float %arg_0
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpReturnValue %14
+               OpReturnValue %17
                OpFunctionEnd
-%workgroupUniformLoad_7a857c = OpFunction %void None %16
-         %18 = OpLabel
-        %res = OpVariable %_ptr_Function_float Function %22
-         %19 = OpFunctionCall %float %tint_workgroupUniformLoad_arg_0
-               OpStore %res %19
+%workgroupUniformLoad_7a857c = OpFunction %void None %19
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %25
+         %22 = OpFunctionCall %float %tint_workgroupUniformLoad_arg_0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %prevent_dce %uint_0
+         %29 = OpLoad %float %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %23
+%compute_main_inner = OpFunction %void None %30
 %local_invocation_index = OpFunctionParameter %uint
-         %26 = OpLabel
-               OpStore %arg_0 %22
+         %33 = OpLabel
+               OpStore %arg_0 %25
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %workgroupUniformLoad_7a857c
+         %35 = OpFunctionCall %void %workgroupUniformLoad_7a857c
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %19
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.wgsl
index 2fd46aa..6df5674 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn workgroupUniformLoad_7a857c() {
   var res : f32 = workgroupUniformLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupUniformLoad_7a857c();
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl
index 6ebb067..852d72d 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl
@@ -25,7 +25,9 @@
 // fn workgroupUniformLoad(ptr<workgroup, i32, read_write>) -> i32
 fn workgroupUniformLoad_9d33de() {
   var res: i32 = workgroupUniformLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
index 5bce24b..c495ebc 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.dxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_9d33de() {
   int res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
index 5bce24b..c495ebc 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.fxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared int arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_9d33de() {
   int res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store(0u, asuint(res));
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.glsl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.glsl
index 10874b5..8d3a9e6 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.glsl
@@ -8,8 +8,13 @@
 }
 
 shared int arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  int inner;
+} prevent_dce;
+
 void workgroupUniformLoad_9d33de() {
   int res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.msl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.msl
index 4ef9721..9916a7c 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.msl
@@ -8,21 +8,22 @@
   return result;
 }
 
-void workgroupUniformLoad_9d33de(threadgroup int* const tint_symbol) {
+void workgroupUniformLoad_9d33de(threadgroup int* const tint_symbol, device int* const tint_symbol_1) {
   int res = tint_workgroupUniformLoad(tint_symbol);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup int* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup int* const tint_symbol_2, device int* const tint_symbol_3) {
   {
-    *(tint_symbol_1) = 0;
+    *(tint_symbol_2) = 0;
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  workgroupUniformLoad_9d33de(tint_symbol_1);
+  workgroupUniformLoad_9d33de(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup int tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device int* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup int tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
index 50b0e3f..2a3afbb 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpMemoryModel Logical GLSL450
@@ -9,6 +9,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_workgroupUniformLoad_arg_0 "tint_workgroupUniformLoad_arg_0"
                OpName %workgroupUniformLoad_9d33de "workgroupUniformLoad_9d33de"
                OpName %res "res"
@@ -16,45 +19,57 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
         %int = OpTypeInt 32 1
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %arg_0 = OpVariable %_ptr_Workgroup_int Workgroup
-          %7 = OpTypeFunction %int
+%prevent_dce_block = OpTypeStruct %int
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %10 = OpTypeFunction %int
        %void = OpTypeVoid
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
-         %16 = OpTypeFunction %void
+         %19 = OpTypeFunction %void
 %_ptr_Function_int = OpTypePointer Function %int
-         %22 = OpConstantNull %int
-         %23 = OpTypeFunction %void %uint
-%tint_workgroupUniformLoad_arg_0 = OpFunction %int None %7
-          %9 = OpLabel
+         %25 = OpConstantNull %int
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %30 = OpTypeFunction %void %uint
+%tint_workgroupUniformLoad_arg_0 = OpFunction %int None %10
+         %12 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %14 = OpLoad %int %arg_0
+         %17 = OpLoad %int %arg_0
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpReturnValue %14
+               OpReturnValue %17
                OpFunctionEnd
-%workgroupUniformLoad_9d33de = OpFunction %void None %16
-         %18 = OpLabel
-        %res = OpVariable %_ptr_Function_int Function %22
-         %19 = OpFunctionCall %int %tint_workgroupUniformLoad_arg_0
-               OpStore %res %19
+%workgroupUniformLoad_9d33de = OpFunction %void None %19
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_int Function %25
+         %22 = OpFunctionCall %int %tint_workgroupUniformLoad_arg_0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_int %prevent_dce %uint_0
+         %29 = OpLoad %int %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %23
+%compute_main_inner = OpFunction %void None %30
 %local_invocation_index = OpFunctionParameter %uint
-         %26 = OpLabel
-               OpStore %arg_0 %22
+         %33 = OpLabel
+               OpStore %arg_0 %25
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %workgroupUniformLoad_9d33de
+         %35 = OpFunctionCall %void %workgroupUniformLoad_9d33de
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %19
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.wgsl
index 5228ac7..26a2cef 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.wgsl
@@ -2,8 +2,11 @@
 
 fn workgroupUniformLoad_9d33de() {
   var res : i32 = workgroupUniformLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : i32;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupUniformLoad_9d33de();
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl
index a0820bb..767f48a 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl
@@ -27,7 +27,9 @@
 // fn workgroupUniformLoad(ptr<workgroup, f16, read_write>) -> f16
 fn workgroupUniformLoad_e07d08() {
   var res: f16 = workgroupUniformLoad(&arg_0);
+  prevent_dce = res;
 }
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
 
 @compute @workgroup_size(1)
 fn compute_main() {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
index 96fb735..ed848f2 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.dxc.hlsl
@@ -6,9 +6,11 @@
 }
 
 groupshared float16_t arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
 
 void workgroupUniformLoad_e07d08() {
   float16_t res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.fxc.hlsl
index 3f0f269..9fe9c3e 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.fxc.hlsl
@@ -1,16 +1,18 @@
 SKIP: FAILED
 
-groupshared float16_t arg_0;
-
-float16_t tint_workgroupUniformLoad_arg_0() {
+float16_t tint_workgroupUniformLoad(inout float16_t p) {
   GroupMemoryBarrierWithGroupSync();
-  const float16_t result = arg_0;
+  const float16_t result = p;
   GroupMemoryBarrierWithGroupSync();
   return result;
 }
 
+groupshared float16_t arg_0;
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
 void workgroupUniformLoad_e07d08() {
-  float16_t res = tint_workgroupUniformLoad_arg_0();
+  float16_t res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.Store<float16_t>(0u, res);
 }
 
 struct tint_symbol_1 {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.glsl b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.glsl
index 33a9a40..9d804d4 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.glsl
@@ -9,8 +9,13 @@
 }
 
 shared float16_t arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+  float16_t inner;
+} prevent_dce;
+
 void workgroupUniformLoad_e07d08() {
   float16_t res = tint_workgroupUniformLoad(arg_0);
+  prevent_dce.inner = res;
 }
 
 void compute_main(uint local_invocation_index) {
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.msl b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.msl
index c4c40c9..cec8325 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.msl
@@ -8,21 +8,22 @@
   return result;
 }
 
-void workgroupUniformLoad_e07d08(threadgroup half* const tint_symbol) {
+void workgroupUniformLoad_e07d08(threadgroup half* const tint_symbol, device half* const tint_symbol_1) {
   half res = tint_workgroupUniformLoad(tint_symbol);
+  *(tint_symbol_1) = res;
 }
 
-void compute_main_inner(uint local_invocation_index, threadgroup half* const tint_symbol_1) {
+void compute_main_inner(uint local_invocation_index, threadgroup half* const tint_symbol_2, device half* const tint_symbol_3) {
   {
-    *(tint_symbol_1) = 0.0h;
+    *(tint_symbol_2) = 0.0h;
   }
   threadgroup_barrier(mem_flags::mem_threadgroup);
-  workgroupUniformLoad_e07d08(tint_symbol_1);
+  workgroupUniformLoad_e07d08(tint_symbol_2, tint_symbol_3);
 }
 
-kernel void compute_main(uint local_invocation_index [[thread_index_in_threadgroup]]) {
-  threadgroup half tint_symbol_2;
-  compute_main_inner(local_invocation_index, &(tint_symbol_2));
+kernel void compute_main(device half* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
+  threadgroup half tint_symbol_4;
+  compute_main_inner(local_invocation_index, &(tint_symbol_4), tint_symbol_5);
   return;
 }
 
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.spvasm b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
index 9c5cf13..40fe77d 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
@@ -13,6 +13,9 @@
                OpExecutionMode %compute_main LocalSize 1 1 1
                OpName %local_invocation_index_1 "local_invocation_index_1"
                OpName %arg_0 "arg_0"
+               OpName %prevent_dce_block "prevent_dce_block"
+               OpMemberName %prevent_dce_block 0 "inner"
+               OpName %prevent_dce "prevent_dce"
                OpName %tint_workgroupUniformLoad_arg_0 "tint_workgroupUniformLoad_arg_0"
                OpName %workgroupUniformLoad_e07d08 "workgroupUniformLoad_e07d08"
                OpName %res "res"
@@ -20,45 +23,57 @@
                OpName %local_invocation_index "local_invocation_index"
                OpName %compute_main "compute_main"
                OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
+               OpDecorate %prevent_dce_block Block
+               OpMemberDecorate %prevent_dce_block 0 Offset 0
+               OpDecorate %prevent_dce DescriptorSet 2
+               OpDecorate %prevent_dce Binding 0
        %uint = OpTypeInt 32 0
 %_ptr_Input_uint = OpTypePointer Input %uint
 %local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
        %half = OpTypeFloat 16
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
       %arg_0 = OpVariable %_ptr_Workgroup_half Workgroup
-          %7 = OpTypeFunction %half
+%prevent_dce_block = OpTypeStruct %half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+         %10 = OpTypeFunction %half
        %void = OpTypeVoid
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
-         %16 = OpTypeFunction %void
+         %19 = OpTypeFunction %void
 %_ptr_Function_half = OpTypePointer Function %half
-         %22 = OpConstantNull %half
-         %23 = OpTypeFunction %void %uint
-%tint_workgroupUniformLoad_arg_0 = OpFunction %half None %7
-          %9 = OpLabel
+         %25 = OpConstantNull %half
+     %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+         %30 = OpTypeFunction %void %uint
+%tint_workgroupUniformLoad_arg_0 = OpFunction %half None %10
+         %12 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %14 = OpLoad %half %arg_0
+         %17 = OpLoad %half %arg_0
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpReturnValue %14
+               OpReturnValue %17
                OpFunctionEnd
-%workgroupUniformLoad_e07d08 = OpFunction %void None %16
-         %18 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %22
-         %19 = OpFunctionCall %half %tint_workgroupUniformLoad_arg_0
-               OpStore %res %19
+%workgroupUniformLoad_e07d08 = OpFunction %void None %19
+         %21 = OpLabel
+        %res = OpVariable %_ptr_Function_half Function %25
+         %22 = OpFunctionCall %half %tint_workgroupUniformLoad_arg_0
+               OpStore %res %22
+         %28 = OpAccessChain %_ptr_StorageBuffer_half %prevent_dce %uint_0
+         %29 = OpLoad %half %res
+               OpStore %28 %29
                OpReturn
                OpFunctionEnd
-%compute_main_inner = OpFunction %void None %23
+%compute_main_inner = OpFunction %void None %30
 %local_invocation_index = OpFunctionParameter %uint
-         %26 = OpLabel
-               OpStore %arg_0 %22
+         %33 = OpLabel
+               OpStore %arg_0 %25
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %workgroupUniformLoad_e07d08
+         %35 = OpFunctionCall %void %workgroupUniformLoad_e07d08
                OpReturn
                OpFunctionEnd
-%compute_main = OpFunction %void None %16
-         %30 = OpLabel
-         %32 = OpLoad %uint %local_invocation_index_1
-         %31 = OpFunctionCall %void %compute_main_inner %32
+%compute_main = OpFunction %void None %19
+         %37 = OpLabel
+         %39 = OpLoad %uint %local_invocation_index_1
+         %38 = OpFunctionCall %void %compute_main_inner %39
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.wgsl b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.wgsl
index 79b6a47..ce938f9 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.wgsl
@@ -4,8 +4,11 @@
 
 fn workgroupUniformLoad_e07d08() {
   var res : f16 = workgroupUniformLoad(&(arg_0));
+  prevent_dce = res;
 }
 
+@group(2) @binding(0) var<storage, read_write> prevent_dce : f16;
+
 @compute @workgroup_size(1)
 fn compute_main() {
   workgroupUniformLoad_e07d08();